78% beapi-maintenance-mode

Code Review | BEAPI - Maintenance Mode

WordPress plugin BEAPI - Maintenance Mode scored78%from 54 tests.

About plugin

  • Plugin page: beapi-maintenance...
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 5, 2018
  • Latest release: Apr 2, 2019
  • Number of updates: 10
  • Update frequency: every 14.8 days
  • Top authors: MaximeCulea (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /2,865 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
The plugin installed gracefully, with no errors

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

A check of server-side resources used by BEAPI - Maintenance Mode
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0534.81 ▼3.70
Dashboard /wp-admin3.34 ▼0.0043.34 ▼14.31
Posts /wp-admin/edit.php3.47 ▲0.1142.60 ▼10.04
Add New Post /wp-admin/post-new.php5.93 ▲0.0479.84 ▼13.30
Media Library /wp-admin/upload.php3.27 ▲0.0431.20 ▼1.05

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for BEAPI - Maintenance Mode
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.27 ▼0.081.58 ▼0.7940.94 ▼2.41
Dashboard /wp-admin2,195 ▲185.55 ▼0.0382.31 ▼6.4739.90 ▲5.35
Posts /wp-admin/edit.php2,100 ▲31.95 ▼0.0233.02 ▼0.3137.10 ▲0.65
Add New Post /wp-admin/post-new.php1,526 ▼223.12 ▼0.23616.04 ▼76.5952.54 ▼11.19
Media Library /wp-admin/upload.php1,400 ▼04.18 ▲0.0194.92 ▼4.2442.13 ▼4.53

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not 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
The following issues need your attention
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/beapi-maintenance-mode/beapi-maintenance-mode.php
    • > /wp-content/plugins/beapi-maintenance-mode/classes/main.php
    • > /wp-content/plugins/beapi-maintenance-mode/templates/maintenance.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      Use of undefined constant BEAPI_MAINTENANCE_MODE_DIR - assumed 'BEAPI_MAINTENANCE_MODE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/beapi-maintenance-mode/autoload.php on line 196

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
8 plugin tags: offline, admin, seo, multisite, development...

beapi-maintenance-mode/beapi-maintenance-mode.php 77% from 13 tests

The main PHP file in "BEAPI - Maintenance Mode" ver. 1.0.5 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected242 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP774296242

PHP code Passed 2 tests

Analyzing 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.33
Average class complexity6.00
▷ Minimum class complexity2.00
▷ Maximum class complexity11.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces1
Interfaces0
Traits1
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods21
▷ Static methods733.33%
▷ Public methods1361.90%
▷ Protected methods419.05%
▷ Private methods419.05%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin