78% smart-maintenance-mode

Code Review | Smart Maintenance Mode

WordPress plugin Smart Maintenance Mode scored78%from 54 tests.

About plugin

  • Plugin page: smart-maintenance...
  • Plugin version: 1.4.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 21, 2014
  • Latest release: Apr 22, 2023
  • Number of updates: 57
  • Update frequency: every 57.7 days
  • Top authors: brijeshk89 (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

2,000+ active /49,584 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.03MB] [CPU: ▼8.42ms] Passed 4 tests

This is a short check of server-side resources used by Smart Maintenance Mode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.95 ▼0.5120.40 ▼17.57
Dashboard /wp-admin3.43 ▲0.1346.94 ▼0.71
Posts /wp-admin/edit.php3.48 ▲0.1348.62 ▲1.37
Add New Post /wp-admin/post-new.php6.01 ▲0.1382.50 ▼16.75
Media Library /wp-admin/upload.php3.35 ▲0.1337.80 ▲6.87
Maintenance Mode /wp-admin/options-general.php?page=smart-maintenance-mode3.3033.25

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 40 new files
Database: 1 new table, 9 new options
New tables
wp_smart_maintenance_mode
New WordPress options
can_compress_scripts
widget_theysaidso_widget
smm_donate_popup
theysaidso_admin_options
db_upgraded
smm_version
widget_recent-posts
disable_smm
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Smart Maintenance Mode
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,444 ▼30213.26 ▼1.420.51 ▼1.3410.59 ▼36.96
Dashboard /wp-admin2,210 ▲195.85 ▲0.99110.64 ▲1.7139.41 ▼2.70
Posts /wp-admin/edit.php2,093 ▲42.05 ▼0.0040.00 ▼0.2836.72 ▲2.16
Add New Post /wp-admin/post-new.php1,545 ▲1718.13 ▼0.08621.80 ▲11.8870.96 ▲21.81
Media Library /wp-admin/upload.php1,392 ▲44.29 ▲0.0598.43 ▼1.6445.37 ▲2.22
Maintenance Mode /wp-admin/options-general.php?page=smart-maintenance-mode1,9082.0526.0032.97

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=smart-maintenance-mode
    • > Notice in wp-content/plugins/smart-maintenance-mode/smart-maintenance-mode.php+679
    Undefined index: disable_smm
  • 198 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=smart-maintenance-mode
    • > Notice in wp-content/plugins/smart-maintenance-mode/smart-maintenance-mode.php+769
    Trying to access array offset on value of type bool
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=smart-maintenance-mode
    • > Notice in wp-content/plugins/smart-maintenance-mode/smart-maintenance-mode.php+724
    Undefined index: smm_countdown_year
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=smart-maintenance-mode
    • > Notice in wp-content/plugins/smart-maintenance-mode/smart-maintenance-mode.php+733
    Undefined index: smm_countdown_month
  • 31 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=smart-maintenance-mode
    • > Notice in wp-content/plugins/smart-maintenance-mode/smart-maintenance-mode.php+742
    Undefined index: smm_countdown_day
  • 24 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=smart-maintenance-mode
    • > Notice in wp-content/plugins/smart-maintenance-mode/smart-maintenance-mode.php+751
    Undefined index: smm_countdown_hour
  • 59 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=smart-maintenance-mode
    • > Notice in wp-content/plugins/smart-maintenance-mode/smart-maintenance-mode.php+760
    Undefined index: smm_countdown_minute
  • 59 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=smart-maintenance-mode
    • > Notice in wp-content/plugins/smart-maintenance-mode/smart-maintenance-mode.php+769
    Undefined index: smm_countdown_second

SRP 50% from 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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/smart-maintenance-mode/smart-maintenance-mode.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: maintenance mode, customize, mode, smart maintenance mode, maintenance...

smart-maintenance-mode/smart-maintenance-mode.php 92% from 13 tests

The principal PHP file in "Smart Maintenance Mode" v. 1.4.4 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 296 characters long)

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
Good job! No executable or dangerous file extensions detected727 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP216648710
JavaScript1114917

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
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%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
33 compressed PNG files occupy 0.19MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/flipper80.png1.32KB1.51KB0.00%
images/flipper12.png0.98KB1.61KB0.00%
screenshot-2.png107.90KB54.78KB▼ 49.24%
images/flipper20.png1.13KB1.51KB0.00%
images/flipper11.png1.36KB1.71KB0.00%