89% wp-maintenance-switch

Code Review | WP Maintenance Switch

WordPress plugin WP Maintenance Switch scored89%from 54 tests.

About plugin

  • Plugin page: wp-maintenance-sw...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9-4.7
  • WordPress version: 6.3.1
  • First release: Feb 19, 2017
  • Latest release: Mar 13, 2017
  • Number of updates: 12
  • Update frequency: every 1.8 days
  • Top authors: lowest (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,647 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 gracefully, with no errors

Server metrics [RAM: ▲0.02MB] [CPU: ▼5.01ms] Passed 4 tests

This is a short check of server-side resources used by WP Maintenance Switch
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0345.90 ▲4.89
Dashboard /wp-admin3.33 ▼0.0246.42 ▼12.68
Posts /wp-admin/edit.php3.38 ▲0.0248.17 ▼0.24
Add New Post /wp-admin/post-new.php5.93 ▲0.0482.64 ▼9.15
Media Library /wp-admin/upload.php3.26 ▲0.0237.06 ▲2.02

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Maintenance Switch
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,931 ▲18513.41 ▼0.988.93 ▲7.3839.98 ▲2.63
Dashboard /wp-admin2,211 ▲365.59 ▲0.0290.86 ▼8.1936.12 ▼9.08
Posts /wp-admin/edit.php2,119 ▲192.00 ▼0.0140.53 ▲6.1236.00 ▼1.94
Add New Post /wp-admin/post-new.php1,538 ▲1223.21 ▼0.68653.97 ▼17.0055.57 ▼6.65
Media Library /wp-admin/upload.php1,413 ▲134.22 ▲0.0294.41 ▼11.1941.49 ▼4.03

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: wp maintenance, maintenance mode, maintenance, switch, maintenance switch

wp-maintenance-switch/wp-maintenance-switch.php 77% from 13 tests

Analyzing the main PHP file in "WP Maintenance Switch" version 1.0.1
You should first fix the following items:
  • Domain Path: Note that the domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: Prefix the domain path with a forward slash character ("/")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin241 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP21729185
CSS11042
JavaScript10014

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin