73% maintenance-mode-by-ip-address

Code Review | Maintenance Mode by IP Address

WordPress plugin Maintenance Mode by IP Address scored73%from 54 tests.

About plugin

  • Plugin page: maintenance-mode-...
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.2
  • WordPress version: 6.3.1
  • First release: Jul 6, 2015
  • Latest release: May 15, 2019
  • Number of updates: 27
  • Update frequency: every 52.2 days
  • Top authors: rcitconsultign (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

70+ active /5,080 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.14MB] [CPU: ▼45.80ms] Passed 4 tests

Server-side resources used by Maintenance Mode by IP Address
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.84 ▼0.6215.26 ▼24.42
Dashboard /wp-admin2.88 ▼0.4717.45 ▼50.96
Posts /wp-admin/edit.php2.88 ▼0.4817.35 ▼27.67
Add New Post /wp-admin/post-new.php2.88 ▼3.0116.05 ▼80.13
Media Library /wp-admin/upload.php2.88 ▼0.3516.25 ▼19.14

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 29 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
rc_mmip_settings
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Maintenance Mode by IP Address: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲6714.34 ▼0.021.65 ▼0.0544.28 ▼0.49
Dashboard /wp-admin2,216 ▲395.64 ▼0.0385.10 ▼14.4337.14 ▼6.67
Posts /wp-admin/edit.php2,121 ▲181.99 ▲0.0232.81 ▼5.1134.16 ▼1.06
Add New Post /wp-admin/post-new.php1,544 ▲1822.95 ▼0.13680.86 ▼4.1450.45 ▼5.27
Media Library /wp-admin/upload.php1,421 ▲214.20 ▲0.0197.92 ▼2.2439.98 ▼6.18

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/maintenance-mode-by-ip-address/rc_maintenance_mode.php+511
    Undefined index: rc_mmip_disablemodephrase
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

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 items
  • 16× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: proxy1 in wp-content/plugins/maintenance-mode-by-ip-address/admin/admin_page.php on line 49
    • > PHP Notice
      Undefined variable: urlGeneral in wp-content/plugins/maintenance-mode-by-ip-address/admin/admin_page.php on line 76
    • > PHP Notice
      Undefined variable: urlSocial in wp-content/plugins/maintenance-mode-by-ip-address/admin/admin_page.php on line 78
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/maintenance-mode-by-ip-address/admin/settings/design.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/maintenance-mode-by-ip-address/admin/settings/general.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/maintenance-mode-by-ip-address/admin/settings/social.php:2
    • > PHP Notice
      Undefined variable: currentIP in wp-content/plugins/maintenance-mode-by-ip-address/admin/admin_page.php on line 66
    • > PHP Notice
      Undefined variable: urlDesign in wp-content/plugins/maintenance-mode-by-ip-address/admin/admin_page.php on line 77
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/maintenance-mode-by-ip-address/admin/settings/mailchimp.php:3
    • > PHP Notice
      Undefined index: tab in wp-content/plugins/maintenance-mode-by-ip-address/admin/admin_page.php on line 2

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 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt is a good inspiration

maintenance-mode-by-ip-address/rc_maintenance_mode.php 85% from 13 tests

The main PHP script in "Maintenance Mode by IP Address" version 3.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("maintenance-mode-by-ip-address.php" instead of "rc_maintenance_mode.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 203 characters long)

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
There were no executable files found in this plugin5,486 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript84231822,645
PHP7490591,368
CSS4127501,245
SVG100228

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
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%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There were not PNG files found in your plugin