72% wordpress-notification-bar

Code Review | WordPress Notification Bar

WordPress plugin WordPress Notification Bar scored72%from 54 tests.

About plugin

  • Plugin page: wordpress-notific...
  • Plugin version: 1.3.10
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-5.5
  • WordPress version: 6.3.1
  • First release: May 21, 2012
  • Latest release: Aug 12, 2020
  • Number of updates: 84
  • Update frequency: every 38.0 days
  • Top authors: johnnytee (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

4,000+ active /163,434 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.12MB] [CPU: ▲0.38ms] Passed 4 tests

This is a short check of server-side resources used by WordPress Notification Bar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1141.11 ▼0.50
Dashboard /wp-admin3.44 ▲0.1352.30 ▲3.01
Posts /wp-admin/edit.php3.55 ▲0.1947.70 ▲0.21
Add New Post /wp-admin/post-new.php6.02 ▲0.1396.44 ▼0.97
Media Library /wp-admin/upload.php3.36 ▲0.1338.09 ▲2.76
Notification Bar /wp-admin/options-general.php?page=seed_wnb3.3331.12

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WordPress Notification Bar
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.25 ▲0.011.68 ▼0.1643.18 ▼5.71
Dashboard /wp-admin2,196 ▲195.51 ▼0.2585.29 ▼12.8340.86 ▼7.11
Posts /wp-admin/edit.php2,107 ▲72.03 ▲0.0438.14 ▼0.8432.53 ▼2.25
Add New Post /wp-admin/post-new.php1,528 ▲223.50 ▲0.28613.07 ▼106.9549.46 ▼18.96
Media Library /wp-admin/upload.php1,407 ▲104.21 ▼0.02105.67 ▼0.8543.06 ▼5.93
Notification Bar /wp-admin/options-general.php?page=seed_wnb1,0994.7748.6028.12

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
Please fix the following items
  • The uninstall procedure has failed, leaving 7 options in the database
    • seed_wnb_version
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=seed_wnb
    • > Notice in wp-content/plugins/wordpress-notification-bar/framework/field-types/textbox.php+7
    Undefined index: msg
    • > GET request to /wp-admin/options-general.php?page=seed_wnb
    • > Notice in wp-content/plugins/wordpress-notification-bar/framework/field-types/textbox.php+7
    Undefined index: button_label
    • > GET request to /wp-admin/options-general.php?page=seed_wnb
    • > Notice in wp-content/plugins/wordpress-notification-bar/framework/field-types/textbox.php+7
    Undefined index: button_link

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/wordpress-notification-bar/framework/field-types/textarea.php
    • > /wp-content/plugins/wordpress-notification-bar/framework/field-types/select.php
  • 57× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wordpress-notification-bar/framework/framework.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wordpress-notification-bar/inc/config.php:13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wordpress-notification-bar/framework/validations/color.php on line 11
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/wordpress-notification-bar/framework/field-types/wpeditor.php on line 7
    • > PHP Notice
      Undefined variable: k in wp-content/plugins/wordpress-notification-bar/framework/validations/sanitize_url.php on line 10
    • > PHP Warning
      Use of undefined constant SEED_WNB_PLUGIN_NAME - assumed 'SEED_WNB_PLUGIN_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/wordpress-notification-bar/framework/framework.php on line 641
    • > PHP Notice
      Undefined variable: option_values in wp-content/plugins/wordpress-notification-bar/framework/field-types/select.php on line 8
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/wordpress-notification-bar/framework/field-types/select.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wordpress-notification-bar/framework/field-types/color.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wordpress-notification-bar/framework/field-types/upload.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Plugin Name: Please specify the plugin name on the first line ( === wordpress-notification-bar === )
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Front End), #2 (Back End)
Please take inspiration from this readme.txt

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

The main PHP file in "WordPress Notification Bar" ver. 1.3.10 adds more information about the plugin and also serves as the entry point for this plugin
37 characters long description:
Global Notification Bar for WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin4,264 lines of code in 34 files:
LanguageFilesBlank linesComment linesLines of code
PHP187521,0733,243
PO File10280281928
CSS24148
JavaScript48545

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity115.86
▷ Minimum class complexity1.00
▷ Maximum class complexity379.00
Average method complexity5.08
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods197
▷ Static methods42.03%
▷ Public methods5829.44%
▷ Protected methods13870.05%
▷ Private methods10.51%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.67MB with 0.35MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
framework/settings-page-icon-36x34.png1.03KB0.91KB▼ 11.48%
framework/seedprod-300x250.png41.02KB15.70KB▼ 61.72%
screenshot-1.png453.12KB56.58KB▼ 87.51%
framework/settings-menu-icon-16x16.png0.81KB0.70KB▼ 13.53%
screenshot-2.png186.98KB22.76KB▼ 87.83%