62% maintenance-alerts

Code Review | Maintenance alerts

WordPress plugin Maintenance alerts scored62%from 54 tests.

About plugin

  • Plugin page: maintenance-alerts
  • Plugin version: 1.3.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.4
  • WordPress version: 6.3.1
  • First release: Jul 21, 2021
  • Latest release: Nov 25, 2023
  • Number of updates: 15
  • Update frequency: every 57.1 days
  • Top authors: himashana (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,546 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.80MB] [CPU: ▼54.64ms] Passed 4 tests

An overview of server-side resources used by Maintenance alerts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.19 ▼1.274.63 ▼34.91
Dashboard /wp-admin2.21 ▼1.135.60 ▼57.26
Posts /wp-admin/edit.php2.21 ▼1.146.43 ▼44.21
Add New Post /wp-admin/post-new.php2.21 ▼3.676.16 ▼82.17
Media Library /wp-admin/upload.php2.21 ▼1.026.44 ▼24.14
Configuration /wp-admin/admin.php?page=Maintenance-Alerts-Configuration2.215.86
About /wp-admin/admin.php?page=Maintenance-Alerts-About2.217.61
Maintenance alerts /wp-admin/admin.php?page=Maintenance-Alerts2.215.52
Compatibility /wp-admin/admin.php?page=Maintenance-Alerts-Compatibility2.2110.83

Server storage [IO: ▲0.05MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Maintenance alerts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲7114.25 ▲0.081.66 ▲0.0538.36 ▼6.89
Dashboard /wp-admin2,224 ▲435.54 ▼0.0688.24 ▼15.6241.24 ▲0.02
Posts /wp-admin/edit.php2,135 ▲351.98 ▲0.0239.77 ▲0.7835.70 ▲3.25
Add New Post /wp-admin/post-new.php1,554 ▲2822.17 ▼1.34688.91 ▲87.2258.88 ▲5.77
Media Library /wp-admin/upload.php1,435 ▲354.18 ▲0.0297.39 ▲2.1841.42 ▼0.01
Configuration /wp-admin/admin.php?page=Maintenance-Alerts-Configuration9242.0124.5526.66
About /wp-admin/admin.php?page=Maintenance-Alerts-About8112.0023.5724.26
Maintenance alerts /wp-admin/admin.php?page=Maintenance-Alerts8721.9628.3332.48
Compatibility /wp-admin/admin.php?page=Maintenance-Alerts-Compatibility8361.9632.1145.50

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the actions handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These server-side errors were triggered
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Maintenance-Alerts-Compatibility
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the actions handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Maintenance-Alerts-Compatibility
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the font-awesome handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 44 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Maintenance-Alerts-Compatibility
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 16× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/maintenance-alerts/Configuration.php:59
    • > PHP Notice
      Undefined variable: my_theme in wp-content/plugins/maintenance-alerts/compatibility_info.php on line 26
    • > PHP Notice
      Undefined variable: my_theme in wp-content/plugins/maintenance-alerts/compatibility_info.php on line 64
    • > PHP Notice
      Undefined variable: my_theme in wp-content/plugins/maintenance-alerts/compatibility_info.php on line 68
    • > PHP Notice
      Undefined variable: my_theme in wp-content/plugins/maintenance-alerts/compatibility_info.php on line 42
    • > PHP Notice
      Undefined variable: my_theme in wp-content/plugins/maintenance-alerts/compatibility_info.php on line 66
    • > PHP Notice
      Undefined variable: my_theme in wp-content/plugins/maintenance-alerts/compatibility_info.php on line 72
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/maintenance-alerts/index.php:39
    • > PHP Notice
      Undefined index: maintenance_alerts_action in wp-content/plugins/maintenance-alerts/Configuration.php on line 45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_theme() in wp-content/plugins/maintenance-alerts/compatibility_check.php:25

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=Maintenance-Alerts-Compatibility
    • > Network (severe)
    wp-content/plugins/maintenance-alerts/https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: text, top bar, maintenance, himashana, top text...

maintenance-alerts/index.php 69% from 13 tests

The main PHP file in "Maintenance alerts" ver. 1.3.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 154 characters long)
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: The principal plugin file should be the same as the plugin slug ("maintenance-alerts.php" instead of "index.php")
  • Domain Path: The domain path folder was not found ("/languages")

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
Good job! No executable or dangerous file extensions detected804 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP7140158768
JavaScript171422
CSS292814

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin