10% ha-banners

Code Review | HA Banners

WordPress plugin HA Banners scored10%from 54 tests.

About plugin

  • Plugin page: ha-banners
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 1.0-4.5
  • WordPress version: 6.3.1
  • First release: Jul 6, 2016
  • Latest release: Aug 4, 2016
  • Number of updates: 8
  • Update frequency: every 3.6 days
  • Top authors: sashamx (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,007 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/ha-banners/widget/stat.php+2
    Undefined index: clickIdBanner

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.02ms] Passed 4 tests

An overview of server-side resources used by HA Banners
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0045.73 ▲2.28
Dashboard /wp-admin3.31 ▲0.0052.76 ▼2.33
Posts /wp-admin/edit.php3.36 ▲0.0049.68 ▼1.80
Add New Post /wp-admin/post-new.php5.89 ▲0.0097.70 ▼1.31
Media Library /wp-admin/upload.php3.23 ▲0.0035.93 ▼2.64

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by HA Banners
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.27 ▼0.101.71 ▼0.0945.83 ▲4.26
Dashboard /wp-admin2,195 ▲155.60 ▼0.0890.21 ▲0.5539.52 ▼6.35
Posts /wp-admin/edit.php2,097 ▼01.97 ▼0.0534.69 ▼1.4430.97 ▼10.39
Add New Post /wp-admin/post-new.php1,545 ▲1923.36 ▲5.94621.63 ▼51.9853.48 ▼1.64
Media Library /wp-admin/upload.php1,403 ▲34.22 ▲0.07101.54 ▲4.0141.82 ▼0.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/ha-banners/widget/habnners-widget.php:2
    • > PHP Notice
      Undefined index: clickIdBanner in wp-content/plugins/ha-banners/widget/stat.php on line 2
    • > PHP Notice
      Undefined variable: click_view in wp-content/plugins/ha-banners/widget/stat.php on line 8

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 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
3 plugin tags: manager banners, banners, widget banners

ha-banners/haa-banners.php 92% from 13 tests

"HA Banners" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ha-banners.php" instead of "haa-banners.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
Good job! No executable or dangerous file extensions detected961 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP49510642
CSS2122177
PO File13839100
JavaScript29042

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity49.00
▷ Minimum class complexity49.00
▷ Maximum class complexity49.00
Average method complexity13.00
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin