84% maintenance-work

Code Review | Maintenance Work

WordPress plugin Maintenance Work scored84%from 54 tests.

About plugin

  • Plugin page: maintenance-work
  • Plugin version: 2.2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 21, 2022
  • Latest release: Sep 8, 2023
  • Number of updates: 79
  • Update frequency: every 4.1 days
  • Top authors: neoslab (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,765 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.37ms] Passed 4 tests

Server-side resources used by Maintenance Work
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0245.76 ▲3.98
Dashboard /wp-admin3.32 ▼0.0343.99 ▼12.86
Posts /wp-admin/edit.php3.37 ▲0.0143.49 ▼1.52
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.48 ▼8.64
Media Library /wp-admin/upload.php3.24 ▲0.0133.31 ▲1.53
Maintenance Mode /wp-admin/options-general.php?page=maintenance-work-admin3.2731.60

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 43 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-posts
_maintenance_work
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Maintenance Work
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.81 ▲0.061.86 ▼0.0344.80 ▼3.06
Dashboard /wp-admin2,210 ▲185.02 ▲0.06104.47 ▼0.0535.50 ▼6.87
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0339.61 ▼1.1034.63 ▼0.12
Add New Post /wp-admin/post-new.php1,517 ▲317.52 ▲0.06639.71 ▼35.1654.05 ▲3.45
Media Library /wp-admin/upload.php1,392 ▲74.30 ▲0.0994.67 ▼16.6541.40 ▼5.21
Maintenance Mode /wp-admin/options-general.php?page=maintenance-work-admin8781.6726.2055.62

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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
Almost there! Just fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined index: pagenow in wp-content/plugins/maintenance-work/public/partials/maintenance-work-public-display.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/maintenance-work/public/partials/maintenance-work-public-display.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/maintenance-work/public/templates/page.php:7
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/maintenance-work/admin/partials/maintenance-work-admin-options.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: Screenshot #1 (A general view of the plugin "options" page.) image not found
You can take inspiration from this readme.txt

maintenance-work/maintenance-work.php Passed 13 tests

The main file in "Maintenance Work" v. 2.2.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
136 characters long description:
Add a maintenance page to your website that lets visitors know your page is down for maintenance and allowing to work on beside of this.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected1,229 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
CSS511853738
PHP1371426460
JavaScript422731

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity5.29
▷ Minimum class complexity1.00
▷ Maximum class complexity22.00
Average method complexity1.97
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods31
▷ Static methods26.45%
▷ Public methods2683.87%
▷ Protected methods00.00%
▷ Private methods516.13%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.07MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png75.55KB23.21KB▼ 69.27%