79% global-notification-bar

Code Review | Global Notification Bar

WordPress plugin Global Notification Bar scored 79% from 54 tests.

About plugin

  • Plugin page: global-notificati...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8
  • WordPress version: 6.3.1
  • First release: Aug 2, 2021
  • Latest release: Aug 14, 2021
  • Number of updates: 6
  • Update frequency: every 2.5 days
  • Top authors: universetech (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 387 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.83ms] Passed 4 tests

A check of server-side resources used by Global Notification Bar
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.76 ▼4.29
Dashboard /wp-admin3.34 ▲0.0446.22 ▼3.85
Posts /wp-admin/edit.php3.39 ▲0.0447.65 ▼0.08
Add New Post /wp-admin/post-new.php5.92 ▲0.0485.37 ▼10.72
Media Library /wp-admin/upload.php3.27 ▲0.0435.75 ▼0.47
Global Notification /wp-admin/options-general.php?page=global-notification3.2637.09

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 30 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Global Notification Bar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲8413.28 ▼1.091.66 ▼0.1046.56 ▼0.59
Dashboard /wp-admin2,210 ▲314.86 ▼0.11106.46 ▼8.3939.46 ▼10.25
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0536.13 ▲0.9134.95 ▲1.37
Add New Post /wp-admin/post-new.php1,545 ▲3118.25 ▲0.62589.69 ▼125.7056.71 ▼1.82
Media Library /wp-admin/upload.php1,389 ▲14.21 ▲0.0196.04 ▼2.0839.62 ▼4.07
Global Notification /wp-admin/options-general.php?page=global-notification1,9063.8081.2543.50

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/global-notification-bar/global-notification.php+838
    Undefined index: deactivation_delete
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 28 tag instead of maximum 10
  • Screenshots: These screenshots lack descriptions #1, #2 in global-notification-bar/assets to your readme.txt
The official readme.txt is a good inspiration

global-notification-bar/global-notification.php 85% from 13 tests

The primary PHP file in "Global Notification Bar" version 1.0.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: Name the main plugin file the same as the plugin slug ("global-notification-bar.php" instead of "global-notification.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin938 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP1136184694
CSS4120192
JavaScript47552

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity135.00
▷ Minimum class complexity135.00
▷ Maximum class complexity135.00
Average method complexity4.94
▷ Minimum method complexity1.00
▷ Maximum method complexity48.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods34
▷ Static methods12.94%
▷ Public methods3397.06%
▷ Protected methods00.00%
▷ Private methods12.94%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
20 PNG files occupy 0.39MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/halloween.png14.33KB5.75KB▼ 59.90%
img/acrylic.png15.88KB5.82KB▼ 63.38%
img/cart.png12.32KB5.96KB▼ 51.65%
img/party.png25.11KB7.90KB▼ 68.54%
img/candybar.png42.21KB8.59KB▼ 79.64%