78% remaintenance

Code Review | ReMaintenance

WordPress plugin ReMaintenance scored78%from 54 tests.

About plugin

  • Plugin page: remaintenance
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.0
  • WordPress version: 6.3.1
  • First release: Jan 28, 2019
  • Latest release: Jan 28, 2019
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: redmade (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /686 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.14MB] [CPU: ▼10.15ms] Passed 4 tests

Analyzing server-side resources used by ReMaintenance
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▼0.6219.01 ▼25.00
Dashboard /wp-admin3.32 ▲0.0249.62 ▼5.96
Posts /wp-admin/edit.php3.38 ▲0.0250.29 ▲0.28
Add New Post /wp-admin/post-new.php5.90 ▲0.0290.54 ▼9.90
Media Library /wp-admin/upload.php3.25 ▲0.0237.47 ▲0.38
ReMaintenance options /wp-admin/options-general.php?page=red-setting-admin3.1935.26

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by ReMaintenance
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.32 ▼0.071.83 ▲0.0839.38 ▼6.39
Dashboard /wp-admin2,196 ▲195.61 ▲0.0891.96 ▼10.5240.61 ▼5.21
Posts /wp-admin/edit.php2,104 ▲41.94 ▼0.0541.63 ▲4.3035.90 ▲1.97
Add New Post /wp-admin/post-new.php1,529 ▲122.72 ▼0.55596.79 ▼98.1943.07 ▼23.41
Media Library /wp-admin/upload.php1,407 ▲74.20 ▼0.02103.89 ▼5.5144.47 ▼3.61
ReMaintenance options /wp-admin/options-general.php?page=red-setting-admin8321.9821.1628.37

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=red-setting-admin
    • > Notice in wp-content/plugins/remaintenance/remaintenance.php+266
    Undefined index: re_cookie_name
    • > GET request to /wp-admin/options-general.php?page=red-setting-admin
    • > Notice in wp-content/plugins/remaintenance/remaintenance.php+295
    Trying to access array offset on value of type bool

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
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/remaintenance/theme/default.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/remaintenance/theme/cookie-confirm.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Donate link: Invalid url: "red-made.com/donation"
Please take inspiration from this readme.txt

remaintenance/remaintenance.php Passed 13 tests

Analyzing the main PHP file in "ReMaintenance" version 1.0.0
106 characters long description:
Close the website for maintenance except for logged Admin and for browser that have set a specific cookie.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin279 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP46868223
CSS18054
Markdown1102

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.50
▷ Minimum class complexity6.00
▷ Maximum class complexity9.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants1
▷ Global constants1100.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