57% wp-maintenance-page

Code Review | WP Maintenance page

WordPress plugin WP Maintenance page scored57%from 54 tests.

About plugin

  • Plugin page: wp-maintenance-page
  • Plugin version: 1.2.18
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.9.4
  • WordPress version: 6.3.1
  • First release: Jan 30, 2018
  • Latest release: Mar 15, 2018
  • Number of updates: 36
  • Update frequency: every 1.3 days
  • Top authors: kosugikun (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /3,068 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.84ms] Passed 4 tests

Analyzing server-side resources used by WP Maintenance page
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0242.34 ▲0.71
Dashboard /wp-admin3.35 ▲0.0552.75 ▲0.11
Posts /wp-admin/edit.php3.46 ▲0.1151.34 ▼4.07
Add New Post /wp-admin/post-new.php5.95 ▲0.0788.42 ▼16.09
Media Library /wp-admin/upload.php3.27 ▲0.0541.13 ▲3.73
WP Maintenance Page /wp-admin/options-general.php?page=wp-maintenance-page3.6141.24

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 81 new files
Database: 1 new table, 8 new options
New tables
wp_wpmp_subscribers
New WordPress options
theysaidso_admin_options
wpmp_version
can_compress_scripts
db_upgraded
widget_recent-comments
wpmp_settings
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by WP Maintenance page
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.43 ▲0.041.70 ▲0.0345.08 ▲1.19
Dashboard /wp-admin2,201 ▲245.62 ▲0.0395.33 ▲9.3743.07 ▲3.34
Posts /wp-admin/edit.php2,106 ▲32.03 ▲0.0135.51 ▼4.2335.18 ▼2.86
Add New Post /wp-admin/post-new.php1,548 ▼723.44 ▲5.05624.27 ▼14.4858.82 ▲6.35
Media Library /wp-admin/upload.php1,403 ▼04.38 ▲0.1498.23 ▲1.1846.25 ▲3.14
WP Maintenance Page /wp-admin/options-general.php?page=wp-maintenance-page3,4647.61194.0548.74

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Zombie tables were found after uninstall: 1 table
    • wp_wpmp_subscribers
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wp-maintenance-page
    • > Deprecated in wp-content/plugins/wp-maintenance-page/includes/functions/helpers.php+11
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=wp-maintenance-page
    • > Warning in wp-content/plugins/wp-maintenance-page/views/settings.php+668
    readfile(): php_network_getaddresses: getaddrinfo failed: Name or service not known
    • > GET request to /wp-admin/options-general.php?page=wp-maintenance-page
    • > Warning in wp-content/plugins/wp-maintenance-page/views/settings.php+668
    readfile(https://xn--0vq403amku.net/plug/WPplugin.php): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

SRP 0% 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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-maintenance-page/views/sidebar.php
  • 10× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_admin_page_title() in wp-content/plugins/wp-maintenance-page/views/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-maintenance-page/views/maintenance.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-maintenance-page/views/promo-strictthemes.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wp-maintenance-page/views/loginform.php:1
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/wp-maintenance-page/views/maintenance.php on line 4
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wp-maintenance-page/views/notice.php on line 2
    • > PHP Notice
      Undefined variable: notices in wp-content/plugins/wp-maintenance-page/views/notice.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/wp-maintenance-page/views/google-analytics.php:7
    • > PHP Warning
      Use of undefined constant WPMP_IMAGES_URL - assumed 'WPMP_IMAGES_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-maintenance-page/views/contact.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-maintenance-page/views/contact.php:34

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=wp-maintenance-page
    • > Network (severe)
    wp-content/plugins/wp-maintenance-page/assets/js/chosen.jquery.min.js?ver=2.1.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=wp-maintenance-page
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).chosen is not a function" "TypeError: $(...).chosen is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/wp-maintenance-page/assets/js/scripts-admin.min.js?ver=2.1.1:1:645)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=wp-maintenance-page
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28721 Uncaught TypeError: $(...).chosen is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
1 plugin tags: maintenance

wp-maintenance-page/wp-maintenance-page.php Passed 13 tests

The main PHP script in "WP Maintenance page" version 1.2.18 is automatically included on every request by WordPress
109 characters long description:
You can easily place your page into maintenance mode. You can customize and create your own maintenance page.

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
Success! There were no dangerous files found in this plugin7,393 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript154699184,149
PHP163248981,702
CSS855581,013
PO File2235254529

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity37.83
▷ Minimum class complexity1.00
▷ Maximum class complexity133.00
Average method complexity5.25
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods52
▷ Static methods1528.85%
▷ Public methods4994.23%
▷ Protected methods00.00%
▷ Private methods35.77%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants1292.31%
▷ Class constants17.69%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
(invalid) assets/images/.R2D2-C3PO-A70B09DA-D3A0-4445-8E24-77CE460FB851icn_sprite.png0.00KB0.00KB0.00%
assets/images/chosen-sprite.png0.53KB0.88KB0.00%
assets/images/icon-48.png3.72KB1.83KB▼ 50.76%