62% better-banners

Code Review | Better Banners

WordPress plugin Better Banners scored62%from 54 tests.

About plugin

  • Plugin page: better-banners
  • Plugin version: 1.1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-5.8
  • WordPress version: 6.3.1
  • First release: Jul 30, 2021
  • Latest release: Nov 8, 2021
  • Number of updates: 15
  • Update frequency: every 7.1 days
  • Top authors: totallyquiche (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /487 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼1.90MB] [CPU: ▼59.18ms] Passed 4 tests

Server-side resources used by Better Banners
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.38 ▼38.15
Dashboard /wp-admin2.10 ▼1.205.48 ▼46.82
Posts /wp-admin/edit.php2.11 ▼1.258.27 ▼41.98
Add New Post /wp-admin/post-new.php2.10 ▼3.786.36 ▼109.78
Media Library /wp-admin/upload.php2.11 ▼1.126.56 ▼25.82
All Banners /wp-admin/edit.php?post_type=tqbb01_banner2.116.59
Options /wp-admin/edit.php?post_type=tqbb01_banner&page=tqbb01_options2.115.70
Add New Banner /wp-admin/post-new.php?post_type=tqbb01_banner2.117.04

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 32 new files
Database: no new tables, 8 new options
New WordPress options
tqbb01_custom_inline_css_all_banners
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
tqbb01_display_banners_using_javascript

Browser metrics Passed 4 tests

Better Banners: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,010 ▲24913.37 ▼0.9110.05 ▲8.1338.27 ▼3.92
Dashboard /wp-admin2,264 ▲875.56 ▼0.1693.12 ▲0.1582.84 ▲42.92
Posts /wp-admin/edit.php2,181 ▲841.97 ▼0.0639.83 ▲4.1037.67 ▲5.56
Add New Post /wp-admin/post-new.php1,593 ▲6723.73 ▲0.70682.57 ▲16.2653.99 ▲0.69
Media Library /wp-admin/upload.php1,463 ▲634.11 ▼0.10103.39 ▼3.7167.60 ▲25.65
All Banners /wp-admin/edit.php?post_type=tqbb01_banner1,1651.9630.7651.31
Options /wp-admin/edit.php?post_type=tqbb01_banner&page=tqbb01_options9611.9933.7248.07
Add New Banner /wp-admin/post-new.php?post_type=tqbb01_banner2,4178.22199.21137.14

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tqbb01_admin_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=tqbb01_banner
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tqbb01_admin_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=tqbb01_banner
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tqbb01_plugin_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=tqbb01_banner&page=tqbb01_options
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tqbb01_table_table_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=tqbb01_banner
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tqbb01_admin_js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/post-new.php?post_type=tqbb01_banner
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/post-new.php?post_type=tqbb01_banner
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tqbb01_post_post_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/post-new.php?post_type=tqbb01_banner
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp-color-picker handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/post-new.php?post_type=tqbb01_banner
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tqbb01_post_post_js handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/post-new.php?post_type=tqbb01_banner
    • > Notice in wp-content/plugins/better-banners/admin/includes/class-post-add-meta-boxes-action-handler.php+45
    Undefined offset: 0

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/better-banners/admin/includes/partials/options-submenu-page.php
    • > /wp-content/plugins/better-banners/admin/includes/partials/logo-banner.php
    • > /wp-content/plugins/better-banners/admin/includes/partials/settings-meta-box.php
  • 36× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: plugin_prefix in wp-content/plugins/better-banners/admin/includes/partials/settings-meta-box.php on line 5
    • > PHP Notice
      Undefined variable: custom_inline_css in wp-content/plugins/better-banners/admin/includes/partials/settings-meta-box.php on line 12
    • > PHP Notice
      Undefined variable: plugin_prefix in wp-content/plugins/better-banners/admin/includes/partials/settings-meta-box.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/better-banners/admin/includes/partials/admin-footer.php:17
    • > PHP Notice
      Undefined variable: plugin_prefix in wp-content/plugins/better-banners/admin/includes/partials/settings-meta-box.php on line 12
    • > PHP Fatal error
      Uncaught Error: Interface 'TotallyQuiche\\BetterBanners\\Hook_Handler' not found in wp-content/plugins/better-banners/admin/includes/class-init-action-handler.php:8
    • > PHP Notice
      Undefined variable: plugin_prefix in wp-content/plugins/better-banners/admin/includes/partials/settings-meta-box.php on line 10
    • > PHP Notice
      Undefined variable: textarea_name in wp-content/plugins/better-banners/admin/includes/partials/options-submenu-page.php on line 23
    • > PHP Fatal error
      Uncaught Error: Interface 'TotallyQuiche\\BetterBanners\\Hook_Handler' not found in wp-content/plugins/better-banners/admin/includes/class-options-init-action-handler.php:8
    • > PHP Notice
      Undefined variable: plugin_prefix in wp-content/plugins/better-banners/admin/includes/partials/options-submenu-page.php on line 23

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: maintenance, banner, warning, header, disclaimer...

better-banners/better-banners.php 92% from 13 tests

The primary PHP file in "Better Banners" version 1.1.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

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
There were no executable files found in this plugin754 lines of code in 30 files:
LanguageFilesBlank linesComment linesLines of code
PHP20145277671
CSS65042
JavaScript36140
SVG1001

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity4.14
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces3
Interfaces1
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes13100.00%
Methods40
▷ Static methods2562.50%
▷ Public methods2562.50%
▷ Protected methods00.00%
▷ Private methods1537.50%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin