68% easy-heads-up-bar

Code Review | Easy Heads Up Bar

WordPress plugin Easy Heads Up Bar scored68%from 54 tests.

About plugin

  • Plugin page: easy-heads-up-bar
  • Plugin version: 2.1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.6
  • WordPress version: 6.3.1
  • First release: Jun 26, 2011
  • Latest release: Aug 1, 2016
  • Number of updates: 56
  • Update frequency: every 33.3 days
  • Top authors: Greenweb (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

400+ active /29,499 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.19MB] [CPU: ▼40.41ms] Passed 4 tests

This is a short check of server-side resources used by Easy Heads Up Bar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.78 ▼0.6814.29 ▼27.53
Dashboard /wp-admin2.83 ▼0.4818.22 ▼29.56
Posts /wp-admin/edit.php2.83 ▼0.5317.26 ▼30.65
Add New Post /wp-admin/post-new.php2.83 ▼3.0616.65 ▼73.88
Media Library /wp-admin/upload.php2.83 ▼0.4017.24 ▼18.47
New Heads up Bar /wp-admin/post-new.php?post_type=heads_up_bar2.8320.17
All Heads up Bars /wp-admin/edit.php?post_type=heads_up_bar2.8319.31

Server storage [IO: ▲0.34MB] [DB: ▲0.07MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
ehb_old_db
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Easy Heads Up Bar
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,079 ▲32215.18 ▲0.906.46 ▲4.4439.69 ▼9.35
Dashboard /wp-admin2,374 ▲1866.41 ▲0.53132.81 ▲25.4938.83 ▼5.66
Posts /wp-admin/edit.php2,283 ▲1943.33 ▲1.3360.00 ▲20.8336.80 ▲4.51
Add New Post /wp-admin/post-new.php1,569 ▲5523.02 ▲5.51672.47 ▼28.6838.11 ▼14.53
Media Library /wp-admin/upload.php1,422 ▲344.15 ▼0.0582.96 ▼24.7443.96 ▼4.12
New Heads up Bar /wp-admin/post-new.php?post_type=heads_up_bar2,8727.72206.9579.43
All Heads up Bars /wp-admin/edit.php?post_type=heads_up_bar1,4703.4045.3765.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/easy-heads-up-bar/lib/cmb/init.php+746
    count(): Parameter must be an array or an object that implements Countable
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • ehb_old_db
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=heads_up_bar
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/easy-heads-up-bar/lib/cmb/init.php+746
    count(): Parameter must be an array or an object that implements Countable
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=heads_up_bar
    • > User deprecated in wp-includes/functions.php+5828
    Hook contextual_help is deprecated since version 3.3.0! Use get_current_screen()->add_help_tab(), get_current_screen()->remove_help_tab() instead.

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
Almost there! Just fix the following items
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/easy-heads-up-bar/lib/cmb/init.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-heads-up-bar/lib/ehb-migrate-old-data.php:121
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/easy-heads-up-bar/lib/cmb/example-functions.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/easy-heads-up-bar/lib/ehb-frontend.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/easy-heads-up-bar/lib/ehb-utility-functions.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/easy-heads-up-bar/lib/ehb-metaboxs.php:11

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can look at the official readme.txt

easy-heads-up-bar/easy-heads-up-bar.php Passed 13 tests

Analyzing the main PHP file in "Easy Heads Up Bar" version 2.1.7
98 characters long description:
An Easy to use notification (heads up) bar for your WordPress website with a linked call to action

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected5,497 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP135961,1842,639
JavaScript53163822,262
CSS36524596

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity53.62
▷ Minimum class complexity8.00
▷ Maximum class complexity136.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods144
▷ Static methods3423.61%
▷ Public methods14298.61%
▷ Protected methods21.39%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants375.00%
▷ Class constants125.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
18 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/cmb/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
lib/cmb/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
images/open.png1.42KB0.76KB▼ 46.28%
images/arrow-down.png1.38KB0.53KB▼ 61.61%
lib/cmb/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%