68% hkdev-maintenance-mode

Code Review | Maintenance Mode

WordPress plugin Maintenance Mode scored68%from 54 tests.

About plugin

  • Plugin page: hkdev-maintenance...
  • Plugin version: 2.5.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.1-6.4.1
  • WordPress version: 6.3.1
  • First release: Nov 25, 2020
  • Latest release: Nov 30, 2023
  • Number of updates: 33
  • Update frequency: every 33.3 days
  • Top authors: helderk (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

10,000+ active /52,197 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.23MB] [CPU: ▼0.40ms] Passed 4 tests

A check of server-side resources used by Maintenance Mode
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2438.67 ▼5.90
Dashboard /wp-admin3.54 ▲0.2348.47 ▼0.18
Posts /wp-admin/edit.php3.65 ▲0.2949.83 ▲4.75
Add New Post /wp-admin/post-new.php6.12 ▲0.2395.37 ▼0.29
Media Library /wp-admin/upload.php3.46 ▲0.2336.72 ▲5.49
Maintenance Mode /wp-admin/options-general.php?page=hkdev_Maintenance_Mode3.4941.46

Server storage [IO: ▲0.20MB] [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: 9 new files
Database: 2 new tables, 8 new options
New tables
wp_hkdev_mm_access_keys
wp_hkdev_mm_unrestricted_ips
New WordPress options
widget_recent-posts
can_compress_scripts
hkdev_mm
hkdev_maintenance_mode_version
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Maintenance Mode
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲4914.32 ▼0.031.85 ▼0.0341.55 ▼3.07
Dashboard /wp-admin2,219 ▲425.62 ▲0.0292.10 ▼8.0243.48 ▲1.12
Posts /wp-admin/edit.php2,124 ▲211.95 ▼0.0639.90 ▼2.1333.42 ▼1.35
Add New Post /wp-admin/post-new.php1,542 ▲1623.36 ▲0.41705.14 ▲39.6858.73 ▼1.15
Media Library /wp-admin/upload.php1,421 ▲274.19 ▼0.0897.79 ▲0.8341.56 ▼1.49
Maintenance Mode /wp-admin/options-general.php?page=hkdev_Maintenance_Mode1,9889.05223.8676.61

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie tables were found after uninstall: 2 tables
    • wp_hkdev_mm_access_keys
    • wp_hkdev_mm_unrestricted_ips
  • Zombie WordPress options were found after uninstall: 7 options
    • hkdev_maintenance_mode_version
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/hkdev-maintenance-mode/hkdev_maintenance_mode.php:31

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=hkdev_Maintenance_Mode
    • > Network (severe)
    wp-admin/[[WP_STYLE]] - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed: You can take inspiration from this readme.txt

hkdev-maintenance-mode/hkdev_maintenance_mode.php 92% from 13 tests

The main PHP script in "Maintenance Mode" version 2.5.0 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("hkdev-maintenance-mode.php" instead of "hkdev_maintenance_mode.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected1,604 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP31301771,284
PO File1100113318
CSS1001
JavaScript1011

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity91.00
▷ Minimum class complexity91.00
▷ Maximum class complexity91.00
Average method complexity4.44
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods26100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin