90% slim-maintenance-mode

Code Review | Slim Maintenance Mode

WordPress plugin Slim Maintenance Mode scored90%from 54 tests.

About plugin

  • Plugin page: slim-maintenance-...
  • Plugin version: 1.4.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Nov 1, 2014
  • Latest release: Jul 19, 2023
  • Number of updates: 67
  • Update frequency: every 47.5 days
  • Top authors: wpdoc.de (100%)

Code review

54 tests

User reviews

42 reviews

Install metrics

6,000+ active /74,561 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.10ms] Passed 4 tests

An overview of server-side resources used by Slim Maintenance Mode
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.15 ▼7.50
Dashboard /wp-admin3.31 ▲0.0044.82 ▼4.40
Posts /wp-admin/edit.php3.36 ▲0.0049.85 ▲2.38
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.89 ▲4.13
Media Library /wp-admin/upload.php3.23 ▲0.0034.92 ▲1.14

Server storage [IO: ▲0.06MB] [DB: ▲0.00MB] Passed 3 tests

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Slim Maintenance Mode
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.48 ▲0.181.79 ▼0.0345.85 ▲0.74
Dashboard /wp-admin2,206 ▲184.86 ▼0.02108.58 ▼5.8544.76 ▲2.40
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0340.27 ▲4.7535.15 ▲3.51
Add New Post /wp-admin/post-new.php1,547 ▲2618.50 ▼4.81601.91 ▼80.9661.84 ▲4.67
Media Library /wp-admin/upload.php1,385 ▼04.23 ▲0.0099.36 ▼51.9841.81 ▼11.30

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Maintenance message for website visitors in English), #2 (Maintenance message for website visitors in German)
The official readme.txt is a good inspiration

slim-maintenance-mode/slim-maintenance-mode.php Passed 13 tests

The main PHP script in "Slim Maintenance Mode" version 1.4.3 is automatically included on every request by WordPress
121 characters long description:
A lightweight solution for scheduled maintenance. Simply activate the plugin and only administrators can see the website.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected89 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1224489

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png22.28KB11.04KB▼ 50.45%
screenshot-1.png14.93KB8.11KB▼ 45.69%