87% maintenance-mode-with-site-build-status

Code Review | Maintenance Mode with Site Build Status

WordPress plugin Maintenance Mode with Site Build Status scored 87% from 54 tests.

About plugin

  • Plugin page: maintenance-mode-...
  • Plugin version: 1.0.9
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: May 25, 2019
  • Latest release: Mar 9, 2021
  • Number of updates: 14
  • Update frequency: every 46.8 days
  • Top authors: redearthdesign (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 407 total downloads

Benchmarks

Plugin footprint Passed 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.19MB] [CPU: ▼139.84ms] Passed 4 tests

Analyzing server-side resources used by Maintenance Mode with Site Build Status
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.97 ▲0.2539.64 ▲14.95
Dashboard /wp-admin3.29 ▲0.2461.61 ▲11.29
Posts /wp-admin/edit.php3.35 ▲0.2455.01 ▲7.46
Add New Post /wp-admin/post-new.php5.58 ▲0.1599.87 ▼574.00
Media Library /wp-admin/upload.php3.16 ▲0.1534.39 ▼4.11

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 71 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Maintenance Mode with Site Build Status
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,899 ▲30317.68 ▲1.937.71 ▼1.8650.18 ▼0.44
Dashboard /wp-admin3,191 ▲2607.97 ▲2.01174.53 ▲27.53117.32 ▲5.72
Posts /wp-admin/edit.php2,989 ▲2504.35 ▲1.6690.43 ▲18.32105.61 ▲13.60
Add New Post /wp-admin/post-new.php1,638 ▼4521.15 ▲2.45263.29 ▼111.54141.06 ▲30.88
Media Library /wp-admin/upload.php1,835 ▲254.81 ▼0.19120.98 ▼49.90126.47 ▼9.84

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/maintenance-mode-with-site-build-status/public/partials/template-parts/footer.php
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/maintenance-mode-with-site-build-status/public/partials/template-parts/header.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/maintenance-mode-with-site-build-status/public/partials/templates/mm-basic.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/maintenance-mode-with-site-build-status/public/partials/template-parts/header.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'MM_Site_Build_Status_Clear_Cache' not found in wp-content/plugins/maintenance-mode-with-site-build-status/admin/partials/mm-site-build-status-admin-display.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 81% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that need to be fixed: You can look at the official readme.txt

maintenance-mode-with-site-build-status/mm-site-build-status.php 85% from 13 tests

The main PHP script in "Maintenance Mode with Site Build Status" version 1.0.9 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("maintenance-mode-with-site-build-status.php" instead of "mm-site-build-status.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected2,012 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
Sass2413964787
PHP23295696702
CSS2037255
JavaScript335116136
PO File1263077
Markdown142055

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity4.70
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity1.62
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods60
▷ Static methods35.00%
▷ Public methods5591.67%
▷ Protected methods00.00%
▷ Private methods58.33%
Functions12
▷ Named functions12100.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
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/default-client-logo.png7.08KB7.07KB0.22%