78% gp-notification-bar

Code Review | Notification Bar, Sticky Notification Bar, Sticky Welcome Bar for any theme

WordPress plugin Notification Bar, Sticky Notification Bar, Sticky Welcome Bar for any theme scored78%from 54 tests.

About plugin

  • Plugin page: gp-notification-bar
  • Plugin version: 1.0.4
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-6.3
  • WordPress version: 6.3.1
  • First release: Apr 25, 2020
  • Latest release: Sep 12, 2023
  • Number of updates: 11
  • Update frequency: every 113.3 days
  • Top authors: gingerplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,545 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.20MB] [CPU: ▼8.81ms] Passed 4 tests

This is a short check of server-side resources used by Notification Bar, Sticky Notification Bar, Sticky Welcome Bar for any theme
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.10 ▼2.02
Dashboard /wp-admin3.55 ▲0.2146.74 ▼18.11
Posts /wp-admin/edit.php3.67 ▲0.3151.25 ▲8.32
Add New Post /wp-admin/post-new.php6.13 ▲0.2584.98 ▼20.10
Media Library /wp-admin/upload.php3.48 ▲0.2538.96 ▲5.00
Need help? /wp-admin/admin.php?page=gp-notification-bar-need-help3.4535.07
Upgrade to Pro /wp-admin/admin.php?page=gp-notification-bar-upgrade-to-pro3.5132.72
Settings /wp-admin/admin.php?page=gp-notification-bar3.5433.30

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 47 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
is_gnb_database_migrated
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Notification Bar, Sticky Notification Bar, Sticky Welcome Bar for any theme
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,942 ▲19613.74 ▼0.948.55 ▲6.8443.86 ▲0.84
Dashboard /wp-admin2,231 ▲465.79 ▲0.9695.19 ▼9.7236.82 ▲0.93
Posts /wp-admin/edit.php2,120 ▲312.00 ▲0.0139.64 ▼0.7135.19 ▼1.21
Add New Post /wp-admin/post-new.php1,544 ▲1623.19 ▲5.12668.93 ▲47.1155.44 ▲5.11
Media Library /wp-admin/upload.php1,422 ▲314.19 ▲0.05104.16 ▲8.7547.10 ▲5.96
Need help? /wp-admin/admin.php?page=gp-notification-bar-need-help8732.0829.1047.59
Upgrade to Pro /wp-admin/admin.php?page=gp-notification-bar-upgrade-to-pro1,1702.0726.4167.85
Settings /wp-admin/admin.php?page=gp-notification-bar1,2713.7956.6349.37

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • is_gnb_database_migrated
    • widget_recent-posts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 take a closer look at the following
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/gp-notification-bar/admin/templates/widget-preview.php
    • > /wp-content/plugins/gp-notification-bar/includes/front-end.php
    • > /wp-content/plugins/gp-notification-bar/index.php
    • > /wp-content/plugins/gp-notification-bar/admin/admin.php
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/gp-notification-bar/templates/template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/gp-notification-bar/admin/templates/upgrade-to-pro.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/gp-notification-bar/admin/templates/display-settings.php:9
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/gp-notification-bar/admin/templates/plugin-deactivate.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/gp-notification-bar/admin/templates/admin-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gp-notification-bar/admin/admin-common.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/gp-notification-bar/admin/templates/widget-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/gp-notification-bar/admin/templates/admin-help.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/gp-notification-bar/admin/templates/button-settings.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/gp-notification-bar/admin/templates/close-button-settings.php:8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
These attributes need your attention:
  • Tags: Too many tags (20 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can look at the official readme.txt

gp-notification-bar/index.php 92% from 13 tests

The main PHP script in "Notification Bar, Sticky Notification Bar, Sticky Welcome Bar for any theme" version 1.0.4 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("gp-notification-bar.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin8,249 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
CSS12180544,158
PHP16246692,223
JavaScript102292011,829
SVG20030
HTML1109

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity47.50
▷ Minimum class complexity1.00
▷ Maximum class complexity90.00
Average method complexity6.64
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods33
▷ Static methods927.27%
▷ Public methods3090.91%
▷ Protected methods00.00%
▷ Private methods39.09%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
3 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/images/payment-card-icons.png11.56KB4.49KB▼ 61.19%
assets/admin/images/calendar.png2.05KB1.51KB▼ 26.49%
assets/admin/css/jquery.minicolors.png67.02KB34.31KB▼ 48.80%