10% dh-notification-bar

Code Review | DH - Notification Bar

WordPress plugin DH - Notification Bar scored10%from 54 tests.

About plugin

  • Plugin page: dh-notification-bar
  • Plugin version: 7...
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.5
  • WordPress version: 6.3.1
  • First release: Nov 5, 2018
  • Latest release: Sep 9, 2020
  • Number of updates: 16
  • Update frequency: every 42.1 days
  • Top authors: k0z3y (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,262 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/dh-notification-bar/index.php+405
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.96MB] [CPU: ▼48.76ms] Passed 4 tests

Analyzing server-side resources used by DH - Notification Bar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.444.95 ▼31.34
Dashboard /wp-admin2.05 ▼1.265.78 ▼41.62
Posts /wp-admin/edit.php2.05 ▼1.316.81 ▼36.81
Add New Post /wp-admin/post-new.php2.05 ▼3.846.55 ▼85.28
Media Library /wp-admin/upload.php2.05 ▼1.185.45 ▼27.66
Submit a Donation /wp-admin/admin.php?page=dh-submit-donation2.056.50
Notification Bar /wp-admin/admin.php?page=dh-notificationbar2.057.34

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for DH - Notification Bar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲16713.83 ▼0.754.95 ▲3.4135.48 ▼5.20
Dashboard /wp-admin2,237 ▲524.98 ▼0.8998.34 ▼3.0871.61 ▲27.91
Posts /wp-admin/edit.php2,123 ▲342.26 ▲0.2336.48 ▲1.2533.74 ▼1.30
Add New Post /wp-admin/post-new.php1,553 ▲3918.32 ▲0.86635.13 ▼12.2140.14 ▼38.14
Media Library /wp-admin/upload.php1,422 ▲344.43 ▲0.2594.16 ▼4.4879.86 ▲37.08
Submit a Donation /wp-admin/admin.php?page=dh-submit-donation9411.7826.5027.16
Notification Bar /wp-admin/admin.php?page=dh-notificationbar2,2676.14138.8281.45

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
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/dh-notification-bar/index.php+405
    Trying to access array offset on value of type bool
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 17 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dh-notificationbar
    • > Notice in wp-content/plugins/dh-notification-bar/admin_menu.php+127
    Trying to access array offset on value of type bool
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=dh-notificationbar
    • > Warning in wp-content/plugins/dh-notification-bar/admin_menu.php+106
    Use of undefined constant dhnbar_linktarget - assumed 'dhnbar_linktarget' (this will throw an Error in a future version of PHP)

SRP 50% 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 fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/dh-notification-bar/index.php:37

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (If "DH - Notification Bar" active then showing notice on top site.), #2 (All settings on WP Dashboard.)
The official readme.txt is a good inspiration

dh-notification-bar/index.php 85% from 13 tests

The main PHP script in "DH - Notification Bar" version 7... is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("dh-notification-bar.php" instead of "index.php")
  • Version: Plugin version number should only contain digits separated by dots (ex. "1.0.3" instead of "7...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin3,388 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript43502111,958
CSS35353947
PHP24523483

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
6 PNG files occupy 1.39MB with 1.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/close.png1.25KB0.34KB▼ 72.51%
assets/img/show.png1.14KB0.36KB▼ 68.69%
screenshot-2.png39.54KB19.61KB▼ 50.41%
assets/img/dh.png19.83KB0.78KB▼ 96.07%
screenshot-1.png1,357.04KB308.36KB▼ 77.28%