72% custom-banners

Code Review | Custom Banners

WordPress plugin Custom Banners scored 72% from 54 tests.

About plugin

  • Plugin page: custom-banners
  • Plugin version: 3.3
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.7.2
  • WordPress version: 5.8.1
  • First release: Feb 5, 2014
  • Latest release: Jun 12, 2021
  • Number of updates: 65
  • Update frequency: every 41.3 days
  • Top authors: richardgabriel (96.92%)ghuger (4.62%)

Code review

54 tests

User reviews

7 reviews

Install metrics

7,000+ active / 162,055 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.89MB] [CPU: ▼135.41ms] Passed 4 tests

Analyzing server-side resources used by Custom Banners
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.9153.98 ▲17.43
Dashboard /wp-admin4.04 ▲0.9867.39 ▲13.86
Posts /wp-admin/edit.php4.10 ▲0.9965.71 ▲13.99
Add New Post /wp-admin/post-new.php6.11 ▲0.6783.79 ▼586.91
Media Library /wp-admin/upload.php3.98 ▲0.9857.37 ▲21.64
Error /wp-admin/admin.php?page=custom_banners_pro_error_page3.9552.04
Settings /wp-admin/edit.php?post_type=banner&page=custom-banners-settings-redirect3.8549.09
Privacy Notice /wp-admin/admin.php?page=custom_banners_pro_privacy_notice3.9555.52
Basic Options /wp-admin/admin.php?page=custom-banners-settings3.9651.29
Theme Options /wp-admin/admin.php?page=custom-banners-themes3.9654.16
Add New Banner /wp-admin/post-new.php?post_type=banner6.0983.48
Upgrade To Pro /wp-admin/admin.php?page=custom-banners-upgrade-to-pro3.9650.25
Help & Instructions /wp-admin/admin.php?page=custom-banners-help3.9652.01
About Plugin /wp-admin/admin.php?page=custom-banners-settings_aloha3.9950.28
Banners /wp-admin/edit.php?post_type=banner4.0251.49

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 135 new files
Database: no new tables, 3 new options
New WordPress options
widget_bannerlistwidget
widget_rotatingbannerwidget
widget_singlebannerwidget

Browser metrics Passed 4 tests

Custom Banners: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,032 ▲46017.02 ▲1.3714.97 ▲3.2446.89 ▼1.27
Dashboard /wp-admin3,176 ▲2457.28 ▲1.17153.14 ▼3.46159.09 ▲13.04
Posts /wp-admin/edit.php2,887 ▲1482.85 ▲0.1384.72 ▲9.8098.72 ▲1.59
Add New Post /wp-admin/post-new.php1,759 ▲7622.45 ▲4.13313.17 ▼90.73105.12 ▼13.69
Media Library /wp-admin/upload.php1,951 ▲1445.58 ▲0.54148.26 ▼9.02125.89 ▲9.75
Error /wp-admin/admin.php?page=custom_banners_pro_error_page1,1562.6756.4789.24
Settings /wp-admin/edit.php?post_type=banner&page=custom-banners-settings-redirect1,5963.0295.89101.74
Privacy Notice /wp-admin/admin.php?page=custom_banners_pro_privacy_notice1,1682.6662.3186.22
Basic Options /wp-admin/admin.php?page=custom-banners-settings1,5963.0296.7794.17
Theme Options /wp-admin/admin.php?page=custom-banners-themes1,9023.67105.65141.07
Add New Banner /wp-admin/post-new.php?post_type=banner6,31720.99597.76199.98
Upgrade To Pro /wp-admin/admin.php?page=custom-banners-upgrade-to-pro1,6342.6773.52128.94
Help & Instructions /wp-admin/admin.php?page=custom-banners-help1,3142.6090.4995.63
About Plugin /wp-admin/admin.php?page=custom-banners-settings_aloha1,8412.7980.38117.32
Banners /wp-admin/edit.php?post_type=banner1,5532.5469.5085.43

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 3 options in the database
    • widget_bannerlistwidget
    • widget_rotatingbannerwidget
    • widget_singlebannerwidget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=banner
    • > User deprecated in wp-includes/functions.php+5586
    block_categories is deprecated since version 5.8.0! Use block_categories_all instead.

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
Almost there! Just fix the following items
  • 13× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/custom-banners/include/tgmpa/tgmpa/class-tgm-plugin-activation.php:2109
    • > PHP Fatal error
      Uncaught Error: Call to undefined function menu_page_url() in wp-content/plugins/custom-banners/include/content/welcome.php:6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/custom-banners/include/Custom_Banners_Update_Notices.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-banners/lib/widgets/banner_list_widget.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-banners/lib/widgets/single_banner_widget.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/custom-banners/custom-banners.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/custom-banners/lib/widgets/rotating_banner_widget.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-banners/blocks/banner-list.php:50
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-banners/blocks/rotating-banner.php:50
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/custom-banners/include/Custom_Banners_Update_Notices.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=custom-banners-upgrade-to-pro
    • > Intervention (severe) in unknown
    /wp-admin/post-new.php?post_type=banner - Blocked attempt to show a 'beforeunload' confirmation panel for a frame that never had a user gesture since its load. https://www.chromestatus.com/feature/5082396709879808

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Screenshots: Screenshot #13 (These are the Pro Themes.) image not found
The official readme.txt is a good inspiration

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

The entry point to "Custom Banners" version 3.3 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 215 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 plugin20,950 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
PHP241,2172,3136,328
PO File171,4491,9934,842
CSS18251693,849
JSON1002,601
JavaScript143022852,270
SVG100685
Markdown2670330
HTML10045

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity39.88
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.09
▷ Minimum method complexity1.00
▷ Maximum method complexity56.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes24
▷ Abstract classes00.00%
▷ Concrete classes24100.00%
▷ Final classes00.00%
Methods302
▷ Static methods51.66%
▷ Public methods27691.39%
▷ Protected methods237.62%
▷ Private methods30.99%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
24 PNG files occupy 0.74MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/standard_pink_left_arrow.png1.69KB0.74KB▼ 56.22%
assets/img/lock.png1.28KB1.25KB▼ 2.52%
assets/img/upgrade/contact-support.png24.79KB14.99KB▼ 39.54%
assets/img/upgrade/banner-style-example.png153.44KB170.20KB0.00%
assets/img/check-mark.png25.95KB14.17KB▼ 45.41%