83% nutsforpress-maintenance-mode

Code Review | NutsForPress Maintenance Mode

WordPress plugin NutsForPress Maintenance Mode scored83%from 54 tests.

About plugin

  • Plugin page: nutsforpress-main...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.3-6.3
  • WordPress version: 6.3.1
  • First release: Jul 13, 2022
  • Latest release: Aug 4, 2023
  • Number of updates: 14
  • Update frequency: every 27.7 days
  • Top authors: Christian Gatti (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /864 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▲1.77ms] Passed 4 tests

Analyzing server-side resources used by NutsForPress Maintenance Mode
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1635.50 ▼4.80
Dashboard /wp-admin3.46 ▲0.1547.36 ▼0.10
Posts /wp-admin/edit.php3.57 ▲0.2147.52 ▲3.50
Add New Post /wp-admin/post-new.php6.06 ▲0.1795.00 ▲12.74
Media Library /wp-admin/upload.php3.38 ▲0.1539.96 ▲8.48
NutsForPress /wp-admin/admin.php?page=nfproot-settings3.3433.46
Maintenance Mode /wp-admin/admin.php?page=nfpmnm-settings3.4037.10

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 23 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by NutsForPress Maintenance Mode
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲10413.33 ▼1.061.57 ▼0.1042.12 ▲0.41
Dashboard /wp-admin2,245 ▲604.96 ▼0.88113.69 ▲15.1441.19 ▼0.22
Posts /wp-admin/edit.php2,128 ▲392.07 ▲0.0835.86 ▲0.0534.05 ▼0.03
Add New Post /wp-admin/post-new.php1,548 ▲2923.20 ▲0.11673.53 ▲79.7555.58 ▲10.62
Media Library /wp-admin/upload.php1,421 ▲304.33 ▲0.1496.86 ▼0.9939.70 ▼3.06
NutsForPress /wp-admin/admin.php?page=nfproot-settings8122.1024.3525.93
Maintenance Mode /wp-admin/admin.php?page=nfpmnm-settings9302.2127.0628.55

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

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
The following issues need your attention
  • 19× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/nutsforpress-maintenance-mode/admin/includes/nfpmnm-add-user-fields.php
    • > /wp-content/plugins/nutsforpress-maintenance-mode/root/nfproot-styles-and-scripts.php
    • > /wp-content/plugins/nutsforpress-maintenance-mode/admin/includes/nfpmnm-force-logout.php
    • > /wp-content/plugins/nutsforpress-maintenance-mode/includes/nfpmnm-plugin-uninstall.php
    • > /wp-content/plugins/nutsforpress-maintenance-mode/includes/nfpmnm-plugin-activate.php
    • > /wp-content/plugins/nutsforpress-maintenance-mode/public/includes/nfpmnm-restrict-rest.php
    • > /wp-content/plugins/nutsforpress-maintenance-mode/admin/includes/nfpmnm-save-user-fields.php
    • > /wp-content/plugins/nutsforpress-maintenance-mode/root/nfproot-saved-settings.php
    • > /wp-content/plugins/nutsforpress-maintenance-mode/public/includes/nfpmnm-redirect.php
    • > /wp-content/plugins/nutsforpress-maintenance-mode/admin/includes/nfpmnm-check-after-login.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Requires php: Version format is invalid
Please take inspiration from this readme.txt

nutsforpress-maintenance-mode/nuts-for-press-maintenance-mode.php 85% from 13 tests

The main PHP file in "NutsForPress Maintenance Mode" ver. 1.4 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 156 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("nutsforpress-maintenance-mode.php" instead of "nuts-for-press-maintenance-mode.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin1,593 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP199922131,345
JavaScript29750136
CSS1291112

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.59
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%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected