10% useful-banner-manager

Code Review | Useful Banner Manager

WordPress plugin Useful Banner Manager scored 10% from 54 tests.

About plugin

  • Plugin page: useful-banner-man...
  • Plugin version: 1.6.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.3.1
  • WordPress version: 5.9.2
  • First release: Dec 6, 2010
  • Latest release: Oct 12, 2015
  • Number of updates: 32
  • Update frequency: every 55.3 days
  • Top authors: s_ruben (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

4,000+ active / 121,082 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/useful-banner-manager/includes/widgets.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; UBM_Widget has a deprecated constructor

Server metrics [RAM: ▼2.35MB] [CPU: ▼344.99ms] Passed 4 tests

This is a short check of server-side resources used by Useful Banner Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.02 ▼1.495.15 ▼45.66
Dashboard /wp-admin2.04 ▼1.374.51 ▼27.62
Posts /wp-admin/edit.php2.04 ▼1.604.73 ▼31.51
Add New Post /wp-admin/post-new.php2.04 ▼4.934.60 ▼1,275.17
Media Library /wp-admin/upload.php2.04 ▼1.264.63 ▼20.42

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 41 new files
Database: 1 new table, 3 new options
New tables
wp_useful_banner_manager_banners
New WordPress options
widget_ubm-banners-rotation
ubm_version
widget_ubm-banners

Browser metrics Passed 4 tests

This is an overview of browser requirements for Useful Banner Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,923 ▲18116.62 ▲1.059.11 ▲3.232.11 ▼0.00
Dashboard /wp-admin2,912 ▲516.12 ▲0.02116.23 ▼15.07151.88 ▼11.84
Posts /wp-admin/edit.php2,708 ▲173.23 ▲0.0060.91 ▼3.76138.41 ▼3.47
Add New Post /wp-admin/post-new.php1,730 ▲5821.79 ▲0.93422.73 ▼25.74164.56 ▲10.10
Media Library /wp-admin/upload.php1,718 ▲205.52 ▼0.02140.63 ▼5.64186.62 ▼6.08

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/useful-banner-manager/includes/widgets.php+2
    Methods with the same name as their class will not be constructors in a future version of PHP; UBM_Widget has a deprecated constructor
  • Zombie tables were found after uninstall: 1 table
    • wp_useful_banner_manager_banners
  • Zombie WordPress options were found after uninstall: 3 options
    • widget_ubm-banners-rotation
    • ubm_version
    • widget_ubm-banners

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/useful-banner-manager/tinymce/window.php
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/useful-banner-manager/includes/widgets.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/useful-banner-manager/useful-banner-manager.php:27
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/useful-banner-manager/useful-banner-manager.php on line 27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/useful-banner-manager/includes/hooks.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/useful-banner-manager/banners.php:2

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Manage Banners)
You can take inspiration from this readme.txt

useful-banner-manager/useful-banner-manager.php 92% from 13 tests

The main file in "Useful Banner Manager" v. 1.6.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 194 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin3,056 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP7271201,314
CSS648921,195
PO File3185219434
JavaScript4274113

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity20.33
▷ Minimum class complexity10.00
▷ Maximum class complexity34.00
Average method complexity4.62
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions21
▷ Named functions21100.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
16 PNG files occupy 0.07MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-icons_228ef1_256x240.png4.44KB4.17KB▼ 6.02%
css/images/ui-bg_diagonals-thick_18_b81900_40x40.png0.41KB0.15KB▼ 62.44%
screenshot-1.png32.92KB15.49KB▼ 52.95%
css/images/ui-bg_glass_100_fdf5ce_1x400.png0.34KB0.16KB▼ 54.02%
css/images/ui-bg_gloss-wave_35_f6a828_500x100.png5.68KB1.83KB▼ 67.77%