68% scheduled-notification-bar

Code Review | Scheduled Notification Bar

WordPress plugin Scheduled Notification Bar scored 68% from 54 tests.

About plugin

  • Plugin page: scheduled-notific...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.7.2
  • WordPress version: 5.9.2
  • First release: Mar 24, 2021
  • Latest release: Jun 24, 2021
  • Number of updates: 10
  • Update frequency: every 9.2 days
  • Top authors: johnc1979 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 232 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲4.78MB] [CPU: ▼265.84ms] Passed 4 tests

Server-side resources used by Scheduled Notification Bar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /8.64 ▲5.1281.86 ▲30.28
Dashboard /wp-admin8.66 ▲5.25111.94 ▲79.06
Posts /wp-admin/edit.php8.66 ▲5.0261.95 ▲25.21
Add New Post /wp-admin/post-new.php10.72 ▲3.74114.66 ▼1,139.46
Media Library /wp-admin/upload.php8.66 ▲5.3646.73 ▲20.60
All Notification Bar /wp-admin/edit.php?post_type=notification_bar8.6647.91
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius8.6646.62
Add New Notification /wp-admin/post-new.php?post_type=notification_bar8.6669.25
Scheduled Notification Bar /wp-admin/admin.php?page=ScheduledNotificationBar8.6647.42
Addons /wp-admin/edit.php?post_type=notification_bar&page=scheduled_notification_bar8.6643.91

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 202 new files
Database: no new tables, 4 new options
New WordPress options
fs_gdpr
fs_debug_mode
fs_active_plugins
fs_accounts

Browser metrics Passed 4 tests

Checking browser requirements for Scheduled Notification Bar
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,009 ▲28716.01 ▲0.309.72 ▲3.7417.16 ▲14.64
Dashboard /wp-admin2,968 ▲1076.19 ▲0.05119.24 ▼16.88173.43 ▲13.39
Posts /wp-admin/edit.php2,764 ▲703.25 ▲0.0167.68 ▲5.15162.51 ▲17.71
Add New Post /wp-admin/post-new.php1,693 ▼5920.19 ▼1.36427.42 ▼6.00156.78 ▼3.68
Media Library /wp-admin/upload.php1,771 ▲765.64 ▲0.09136.20 ▼15.82200.70 ▲17.19
All Notification Bar /wp-admin/edit.php?post_type=notification_bar1,4363.4963.83124.71
Freemius Debug [v.2.4.2] /wp-admin/admin.php?page=freemius1,4762.5456.01117.23
Add New Notification /wp-admin/post-new.php?post_type=notification_bar3,3564.65132.29169.74
Scheduled Notification Bar /wp-admin/admin.php?page=ScheduledNotificationBar1,3312.6253.10161.76
Addons /wp-admin/edit.php?post_type=notification_bar&page=scheduled_notification_bar1,4263.0456.63192.62

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/scheduled-notification-bar/freemius/includes/class-freemius.php+8552
    Undefined property: stdClass::$plugins
  • This plugin did not uninstall successfully, leaving 4 options in the database
    • fs_active_plugins
    • fs_accounts
    • fs_debug_mode
    • fs_gdpr

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means 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
Please fix the following
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/scheduled-notification-bar/public/partials/scheduled-notification-bar-public-display.php
    • > /wp-content/plugins/scheduled-notification-bar/admin/partials/scheduled-notification-bar-admin-display.php
    • > /wp-content/plugins/scheduled-notification-bar/freemius/templates/ajax-loader.php
  • 21× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scheduled-notification-bar/public/frontend-bar-bottom.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scheduled-notification-bar/admin/meta-boxes.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scheduled-notification-bar/public/frontend-bar-top.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scheduled-notification-bar/admin/class-custom-post-type.php:60
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/scheduled-notification-bar/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scheduled-notification-bar/admin/class-addons.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/scheduled-notification-bar/freemius/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scheduled-notification-bar/public/frontend-bar-bottom.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/scheduled-notification-bar/public/wiz-notify-bar-dashicons.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/scheduled-notification-bar/freemius/templates/partials/network-activation.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === scheduled-notification-bar === )
  • Screenshots: A description for screenshot #3 is missing in scheduled-notification-bar/assets to your readme.txt
The official readme.txt might help

scheduled-notification-bar/scheduled-notification-bar.php Passed 13 tests

The principal PHP file in "Scheduled Notification Bar" v. 1.0.1 is loaded by WordPress automatically on each request
74 characters long description:
Schedule a notification bar to display and hide at a specific time or day.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected31,794 lines of code in 147 files:
LanguageFilesBlank linesComment linesLines of code
PHP1297,50016,70131,534
JavaScript538113200
CSS132860

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
The following items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 2,907)
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity76.19
▷ Minimum class complexity1.00
▷ Maximum class complexity2,907.00
Average method complexity4.51
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes54
▷ Abstract classes23.70%
▷ Concrete classes5296.30%
▷ Final classes00.00%
Methods1,187
▷ Static methods17514.74%
▷ Public methods82369.33%
▷ Protected methods151.26%
▷ Private methods34929.40%
Functions116
▷ Named functions116100.00%
▷ Anonymous functions00.00%
Constants124
▷ Global constants9979.84%
▷ Class constants2520.16%
▷ Public constants25100.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
8 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/mail.png18.38KB7.65KB▼ 58.36%
admin/images/wiz-logo.png8.79KB8.80KB0.00%
admin/images/buyer.png10.19KB3.47KB▼ 65.96%
freemius/assets/img/ScheduledNotificationBar.png9.16KB5.26KB▼ 42.58%
admin/images/timer.png6.95KB5.92KB▼ 14.88%