78% wp-simple-maintenance-mode

Code Review | WP Simple Maintenance & Under Construction Mode

WordPress plugin WP Simple Maintenance & Under Construction Mode scored 78% from 54 tests.

About plugin

  • Plugin page: wp-simple-mainten...
  • Plugin version: 1.5.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-5.3.2
  • WordPress version: 5.8.1
  • First release: Jan 15, 2020
  • Latest release: Feb 13, 2020
  • Number of updates: 16
  • Update frequency: every 1.8 days
  • Top authors: h3technologies (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 671 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼152.62ms] Passed 4 tests

A check of server-side resources used by WP Simple Maintenance & Under Construction Mode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.01 ▲0.1730.17 ▲3.75
Dashboard /wp-admin3.25 ▲0.1928.68 ▼14.82
Posts /wp-admin/edit.php3.30 ▲0.1835.27 ▼23.84
Add New Post /wp-admin/post-new.php5.25 ▼0.1981.62 ▼568.01
Media Library /wp-admin/upload.php3.25 ▲0.2530.70 ▼3.79
WP Simple Maintenance Mode /wp-admin/options-general.php?page=wp-simple-maintenance-mode3.2331.72
Activate /wp-admin/admin.php?page=wp-simple-maintenance-mode-optin3.2327.17

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 29 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for WP Simple Maintenance & Under Construction Mode
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,754 ▲11716.32 ▲0.769.22 ▼0.3354.98 ▲5.45
Dashboard /wp-admin3,004 ▲785.91 ▼0.29142.27 ▼24.70113.03 ▼10.77
Posts /wp-admin/edit.php2,770 ▲312.70 ▲0.0168.51 ▲0.6590.48 ▼2.62
Add New Post /wp-admin/post-new.php1,640 ▼2,06621.30 ▲2.05281.56 ▼193.23115.18 ▲5.24
Media Library /wp-admin/upload.php1,779 ▼285.01 ▼0.02168.25 ▲13.96125.86 ▼3.54
WP Simple Maintenance Mode /wp-admin/options-general.php?page=wp-simple-maintenance-mode1,1292.0961.99134.88
Activate /wp-admin/admin.php?page=wp-simple-maintenance-mode-optin1,1142.1161.12114.93

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5663
    wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)

Smoke tests 50% 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
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-simple-maintenance-mode-optin
    • > User notice in wp-includes/functions.php+5663
    WP_Admin_Bar::add_node was called incorrectly. The menu ID should not be empty. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-simple-maintenance-mode
    • > Notice in wp-content/plugins/wp-simple-maintenance-mode/class/class.main_ui.php+65
    Undefined index: tab

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'MYPLUGIN__PLUGIN_URLclass/class.db.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-simple-maintenance-mode/templates/page1.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_current_user() in wp-content/plugins/wp-simple-maintenance-mode/assets/include/create_optin_page.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-simple-maintenance-mode/index.php:13
    • > PHP Warning
      require_once(MYPLUGIN__PLUGIN_URLclass/class.db.php): failed to open stream: No such file or directory in wp-content/plugins/wp-simple-maintenance-mode/templates/page1.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/wp-simple-maintenance-mode/assets/include/deactivate_modal.php:2
    • > PHP Warning
      Use of undefined constant MYPLUGIN__PLUGIN_URL - assumed 'MYPLUGIN__PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/wp-simple-maintenance-mode/templates/page1.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

wp-simple-maintenance-mode/index.php 92% from 13 tests

The main file in "WP Simple Maintenance & Under Construction Mode" v. 1.5.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-simple-maintenance-mode.php" instead of "index.php")

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 plugin2,448 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP8202732,390
JavaScript211056
CSS2062

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity50.00
▷ Minimum class complexity36.00
▷ Maximum class complexity71.00
Average method complexity5.17
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods47
▷ Static methods36.38%
▷ Public methods4697.87%
▷ Protected methods00.00%
▷ Private methods12.13%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
16 PNG files occupy 0.37MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/vk-icon.png28.43KB11.66KB▼ 59.00%
assets/img/linkedin-icon.png15.46KB6.36KB▼ 58.86%
assets/img/twitter-icon.png13.38KB6.14KB▼ 54.11%
assets/img/facebook-icon.png14.66KB5.96KB▼ 59.35%
assets/img/google-plus-icon.png20.60KB8.03KB▼ 61.04%