84% banner-alerts

Code Review | Banner Alerts

WordPress plugin Banner Alerts scored84%from 54 tests.

About plugin

  • Plugin page: banner-alerts
  • Plugin version: 1.4.1
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.4
  • WordPress version: 6.3.1
  • First release: Apr 21, 2020
  • Latest release: Nov 5, 2023
  • Number of updates: 9
  • Update frequency: every 143.8 days
  • Top authors: valicesupport (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,031 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼6.02ms] Passed 4 tests

Analyzing server-side resources used by Banner Alerts
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0738.69 ▼1.77
Dashboard /wp-admin3.41 ▲0.0645.52 ▼13.38
Posts /wp-admin/edit.php3.53 ▲0.1745.86 ▼0.68
Add New Post /wp-admin/post-new.php5.99 ▲0.1090.95 ▼7.14
Media Library /wp-admin/upload.php3.33 ▲0.1030.75 ▼1.80
Add New /wp-admin/post-new.php?post_type=banner_alert3.4548.19
All Alerts /wp-admin/edit.php?post_type=banner_alert3.3842.12
Banner Alerts /wp-admin/options-general.php?page=banner-alerts3.3030.73

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

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

Browser metrics Passed 4 tests

Banner Alerts: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,969 ▲19713.49 ▼0.9213.76 ▲11.8743.78 ▲3.57
Dashboard /wp-admin2,229 ▲525.60 ▼0.0887.75 ▼2.0239.94 ▼1.22
Posts /wp-admin/edit.php2,131 ▲311.95 ▼0.0739.99 ▲3.4036.58 ▼0.19
Add New Post /wp-admin/post-new.php1,557 ▲3123.65 ▲0.45620.10 ▼35.8167.89 ▲18.70
Media Library /wp-admin/upload.php1,431 ▲314.19 ▲0.0298.02 ▼2.3240.94 ▲0.12
Add New /wp-admin/post-new.php?post_type=banner_alert2,2527.61179.9064.29
All Alerts /wp-admin/edit.php?post_type=banner_alert1,1001.9231.5230.44
Banner Alerts /wp-admin/options-general.php?page=banner-alerts9971.6724.6129.24

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% 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
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Plugin\\BannerAlerts\\add_action() in wp-content/plugins/banner-alerts/src/BannerAlerts.php:24

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
8 plugin tags: notice, warning, alert banner, alert, banner alert...

banner-alerts/banner-alerts.php Passed 13 tests

The entry point to "Banner Alerts" version 1.4.1 is a PHP file that has certain tags in its header comment area
97 characters long description:
Provides an easy interface for creating and displaying alerts or notices as a banner on a website

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected541 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP45312349
JavaScript2451192

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity20.50
▷ Minimum class complexity17.00
▷ Maximum class complexity24.00
Average method complexity3.57
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods1386.67%
▷ Protected methods213.33%
▷ Private methods00.00%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin