84% maintenance-notice

Code Review | Maintenance Notice

WordPress plugin Maintenance Notice scored84%from 54 tests.

About plugin

  • Plugin page: maintenance-notice
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Mar 19, 2021
  • Latest release: Jul 23, 2023
  • Number of updates: 8
  • Update frequency: every 107.4 days
  • Top authors: codevibrant (100%)

Code review

54 tests

User reviews

1 review

Install metrics

600+ active /5,812 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Server-side resources used by Maintenance Notice
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.59 ▲0.1339.46 ▼2.49
Dashboard /wp-admin3.45 ▲0.1546.32 ▼1.41
Posts /wp-admin/edit.php3.56 ▲0.2147.57 ▼1.46
Add New Post /wp-admin/post-new.php6.03 ▲0.1590.54 ▼6.47
Media Library /wp-admin/upload.php3.37 ▲0.1436.02 ▲2.18
Background Settings /wp-admin/admin.php?page=maintenance-notice-background-settings3.4234.72
Countdown Settings /wp-admin/admin.php?page=maintenance-notice-countdown-settings3.4139.01
Typography Settings /wp-admin/admin.php?page=maintenance-notice-typography-settings3.6739.47
Dashboard /wp-admin/admin.php?page=maintenance-notice3.3836.54
Additional Settings /wp-admin/admin.php?page=maintenance-notice-additional-settings3.4237.83
Content Settings /wp-admin/admin.php?page=maintenance-notice-content-settings3.4138.20

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 84 new files
Database: no new tables, 8 new options
New WordPress options
maintenance_notice_activated_time
theysaidso_admin_options
widget_recent-comments
maintenance_notice_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Maintenance Notice
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲10413.36 ▼1.311.72 ▼0.0144.09 ▼1.90
Dashboard /wp-admin2,245 ▲575.89 ▲0.86109.11 ▼0.8445.92 ▲1.35
Posts /wp-admin/edit.php2,131 ▲422.04 ▲0.0541.39 ▲0.5636.61 ▲0.91
Add New Post /wp-admin/post-new.php1,564 ▲4523.40 ▲0.25583.33 ▼20.5353.76 ▼5.79
Media Library /wp-admin/upload.php1,424 ▲364.20 ▼0.0795.17 ▼0.7842.30 ▼2.08
Background Settings /wp-admin/admin.php?page=maintenance-notice-background-settings1,3013.8260.5677.49
Countdown Settings /wp-admin/admin.php?page=maintenance-notice-countdown-settings1,5936.64123.5885.92
Typography Settings /wp-admin/admin.php?page=maintenance-notice-typography-settings3,0874.9695.8363.22
Dashboard /wp-admin/admin.php?page=maintenance-notice1,2043.2741.9980.75
Additional Settings /wp-admin/admin.php?page=maintenance-notice-additional-settings1,3373.6055.2773.48
Content Settings /wp-admin/admin.php?page=maintenance-notice-content-settings1,5626.77109.3982.50

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

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 13× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/maintenance-notice/admin/partials/content-help.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/maintenance-notice/admin/class-maintenance-notice-admin.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/maintenance-notice/admin/partials/countdown-settings.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/maintenance-notice/admin/partials/content-dashboard.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/maintenance-notice/admin/partials/typography-settings.php:52
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/maintenance-notice/includes/layouts/style-one.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/maintenance-notice/admin/partials/content-review.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/maintenance-notice/includes/dynamic-styles.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/maintenance-notice/includes/hooks/section-hooks.php:37
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/maintenance-notice/includes/index.php:9

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% 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: unavailable, coming soon, maintenance mode, under construction, administration...

maintenance-notice/maintenance-notice.php 92% from 13 tests

"Maintenance Notice" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 219 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin19,373 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
SVG51128,933
JavaScript71,4549634,397
CSS91,665434,083
PHP172305171,959
JSON1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity18.60
▷ Minimum class complexity1.00
▷ Maximum class complexity43.00
Average method complexity4.03
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods29
▷ Static methods310.34%
▷ Public methods29100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.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
16 PNG files occupy 0.14MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/assets/images/wpallresources-img.png20.16KB7.29KB▼ 63.82%
admin/assets/images/background-overlay-four.png4.06KB2.74KB▼ 32.66%
admin/assets/images/background-overlay-one.png0.16KB0.08KB▼ 45.63%
admin/assets/images/default.png0.99KB0.10KB▼ 90.02%
includes/assets/library/jquery.mb.YTPlayer/images/raster@2x.png2.66KB0.10KB▼ 96.07%