84% one-click-maintenance-mode

Code Review | One Click Maintenance Mode

WordPress plugin One Click Maintenance Mode scored84%from 54 tests.

About plugin

  • Plugin page: one-click-mainten...
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.3
  • WordPress version: 6.3.1
  • First release: Nov 30, 2020
  • Latest release: May 17, 2022
  • Number of updates: 13
  • Update frequency: every 40.9 days
  • Top authors: heyanirban (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /586 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
Install script ran successfully

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

Analyzing server-side resources used by One Click Maintenance Mode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0135.44 ▼2.91
Dashboard /wp-admin3.31 ▲0.0143.00 ▼5.19
Posts /wp-admin/edit.php3.36 ▲0.0047.36 ▼1.42
Add New Post /wp-admin/post-new.php5.89 ▲0.0093.50 ▼6.14
Media Library /wp-admin/upload.php3.23 ▲0.0035.07 ▼2.11

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

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

Browser metrics Passed 4 tests

Checking browser requirements for One Click Maintenance Mode
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.34 ▲0.061.68 ▲0.0937.75 ▼3.61
Dashboard /wp-admin2,195 ▲185.59 ▼0.0392.21 ▼1.2839.84 ▲0.06
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0539.62 ▲4.5035.75 ▲1.23
Add New Post /wp-admin/post-new.php1,526 ▼023.55 ▲0.50588.51 ▼88.6046.93 ▼12.87
Media Library /wp-admin/upload.php1,400 ▲34.16 ▼0.0795.62 ▼12.2441.79 ▼4.97

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/one-click-maintenance-mode/one-click-maintenance-mode.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed: Please take inspiration from this readme.txt

one-click-maintenance-mode/one-click-maintenance-mode.php Passed 13 tests

This is the main PHP file of "One Click Maintenance Mode" version 1.0.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
25 characters long description:
Turn on maintenance mode.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin26 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP251726

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.40
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
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
PNG images were not found in this plugin