10% attention-grabber-hello-bar-alternative

Code Review | Attention Grabber (Hello Bar Alternative)

WordPress plugin Attention Grabber (Hello Bar Alternative) scored10%from 54 tests.

About plugin

  • Plugin page: attention-grabber...
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.6.1
  • WordPress version: 6.3.1
  • First release: Sep 30, 2013
  • Latest release: Jan 27, 2014
  • Number of updates: 21
  • Update frequency: every 5.7 days
  • Top authors: conversioninsights (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

90+ active /12,138 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
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/attention-grabber-hello-bar-alternative/classes/sunrise.class.php+76
    Only variables should be passed by reference

Server metrics [RAM: ▼1.85MB] [CPU: ▼56.23ms] Passed 4 tests

This is a short check of server-side resources used by Attention Grabber (Hello Bar Alternative)
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.14 ▼1.325.14 ▼42.44
Dashboard /wp-admin2.16 ▼1.146.19 ▼48.04
Posts /wp-admin/edit.php2.16 ▼1.206.29 ▼41.23
Add New Post /wp-admin/post-new.php2.16 ▼3.735.83 ▼93.20
Media Library /wp-admin/upload.php2.16 ▼1.077.84 ▼27.23
Attention Grabber /wp-admin/options-general.php?page=attention-grabber-hello-bar-alternative2.165.76

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 45 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
attention_grabber_hello_bar_alternative_options

Browser metrics Passed 4 tests

An overview of browser requirements for Attention Grabber (Hello Bar Alternative)
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,014 ▲25314.57 ▲0.2914.62 ▲12.9546.03 ▲2.07
Dashboard /wp-admin2,204 ▲275.63 ▼0.0297.59 ▲8.2844.78 ▲4.39
Posts /wp-admin/edit.php2,103 ▲62.01 ▲0.0035.30 ▼7.2935.31 ▲2.93
Add New Post /wp-admin/post-new.php1,533 ▲723.45 ▲0.23613.90 ▼53.7951.89 ▲2.21
Media Library /wp-admin/upload.php1,400 ▲64.11 ▼0.12101.51 ▼2.1441.47 ▼5.47
Attention Grabber /wp-admin/options-general.php?page=attention-grabber-hello-bar-alternative1,7262.4350.1443.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/attention-grabber-hello-bar-alternative/classes/sunrise.class.php+76
    Only variables should be passed by reference
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • attention_grabber_hello_bar_alternative_options
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=attention-grabber-hello-bar-alternative
    • > Notice in wp-content/plugins/attention-grabber-hello-bar-alternative/classes/sunrise.class.php+76
    Only variables should be passed by reference
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=attention-grabber-hello-bar-alternative
    • > Notice in wp-content/plugins/attention-grabber-hello-bar-alternative/classes/sunrise.class.php+89
    Undefined index: attention-grabber-hello-bar-alternative.php
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=attention-grabber-hello-bar-alternative
    • > Notice in wp-content/plugins/attention-grabber-hello-bar-alternative/classes/sunrise.class.php+89
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=attention-grabber-hello-bar-alternative
    • > Notice in wp-content/plugins/attention-grabber-hello-bar-alternative/classes/sunrise.class.php+243
    Undefined index: action
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=attention-grabber-hello-bar-alternative
    • > Notice in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/notifications.php+33
    Undefined index: message
  • 32 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=attention-grabber-hello-bar-alternative
    • > Notice in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/color.php+1
    Undefined index: triggable
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=attention-grabber-hello-bar-alternative
    • > Notice in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/closetab.php+2
    Undefined index: actions
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=attention-grabber-hello-bar-alternative
    • > Notice in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/select.php+2
    Undefined index: trigger

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
Almost there! Just fix the following items
  • 13× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/title.php
    • > /wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/select.php
    • > /wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/radio.php
    • > /wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/size.php
    • > /wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/checkbox-group.php
    • > /wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/textarea.php
    • > /wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/hidden.php
    • > /wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/number.php
    • > /wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/html.php
    • > /wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/text.php
  • 205× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/size.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/size.php on line 4
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/size.php on line 4
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/select.php on line 18
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/color.php on line 3
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/text.php on line 6
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/radio.php on line 6
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/textarea.php on line 5
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/select.php on line 2
    • > PHP Notice
      Undefined variable: option in wp-content/plugins/attention-grabber-hello-bar-alternative/inc/sunrise/views/text.php on line 3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=attention-grabber-hello-bar-alternative
    • > Network (severe)
    wp-content/plugins/attention-grabber-hello-bar-alternative/assets/js/fia-backend.js - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The back-end to the Attention Grabber.), #2 (A sample of what the notification bar looks like in action. (Note that both the color scheme and the text are completely customizable.))
The official readme.txt might help

attention-grabber-hello-bar-alternative/sunrise.php 85% from 13 tests

"Attention Grabber (Hello Bar Alternative)" version 1.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("attention-grabber-hello-bar-alternative.php" instead of "sunrise.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 236 characters long)

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 plugin13,756 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript52,2921,38612,533
PHP2489283856
CSS25521235
PO File25259132

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/conversion-insights-checkmark-blue-32.png1.30KB0.63KB▼ 51.39%
favicon.png1.12KB0.37KB▼ 66.61%
assets/images/success.png0.62KB0.62KB0.00%
assets/images/conversion-insights-checkmark-orange-32.png1.30KB0.63KB▼ 51.43%
assets/images/code.png0.94KB0.10KB▼ 89.75%