84% maintenance-mode-based-on-user-roles

Code Review | Conditionnal Maintenance Mode for WordPress

WordPress plugin Conditionnal Maintenance Mode for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: maintenance-mode-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 28, 2023
  • Latest release: Feb 28, 2023
  • Number of updates: 6
  • Update frequency: every 0.3 days
  • Top authors: evolurise (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /294 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

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

This is a short check of server-side resources used by Conditionnal Maintenance Mode for WordPress
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0342.34 ▼1.43
Dashboard /wp-admin3.09 ▼0.2226.97 ▼24.20
Posts /wp-admin/edit.php3.40 ▲0.0452.20 ▲1.68
Add New Post /wp-admin/post-new.php5.93 ▲0.0487.35 ▼9.92
Media Library /wp-admin/upload.php3.27 ▲0.0439.49 ▲4.56
Maintenance Mode /wp-admin/options-general.php?page=maintenance-mode3.2450.03

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Conditionnal Maintenance Mode for WordPress: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲5114.34 ▼0.221.65 ▼0.0744.91 ▲6.23
Dashboard /wp-admin2,213 ▲335.63 ▼0.0394.02 ▲2.6743.64 ▼2.68
Posts /wp-admin/edit.php2,112 ▲122.03 ▲0.0535.78 ▼3.1533.21 ▼0.75
Add New Post /wp-admin/post-new.php1,534 ▲522.91 ▼0.23669.54 ▲9.2255.69 ▲0.75
Media Library /wp-admin/upload.php1,418 ▲214.16 ▼0.05111.23 ▲4.6446.88 ▲0.12
Maintenance Mode /wp-admin/options-general.php?page=maintenance-mode8852.1725.9627.85

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
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-based-on-user-roles/Maintenance_mode.php

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 uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Maintenance Mode settings page), #2 (Maintenance message displayed to users without the necessary roles)
The official readme.txt might help

maintenance-mode-based-on-user-roles/Maintenance_mode.php 92% from 13 tests

The main file in "Conditionnal Maintenance Mode for WordPress" v. 1.0.0 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: It is recommended to name the main PHP file as the plugin slug ("maintenance-mode-based-on-user-roles.php" instead of "Maintenance_mode.php")

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
Everything looks great! No dangerous files found in this plugin163 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP12831133
PO File12222
CSS1008

PHP code Passed 2 tests

An short overview of 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.31
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/evolurise_logo.png10.90KB6.02KB▼ 44.77%