93% image-banner-widget

Code Review | Image/Banner Widget

WordPress plugin Image/Banner Widget scored 93% from 54 tests.

About plugin

  • Plugin page: image-banner-widget
  • Plugin version: 1.4.5
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-5.1.1
  • WordPress version: 5.8.1
  • First release: May 18, 2010
  • Latest release: Mar 31, 2019
  • Number of updates: 35
  • Update frequency: every 92.5 days
  • Top authors: mattsay (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

5,000+ active / 103,379 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼151.70ms] Passed 4 tests

An overview of server-side resources used by Image/Banner Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.89 ▲0.0535.45 ▲10.56
Dashboard /wp-admin3.11 ▲0.0438.33 ▼7.66
Posts /wp-admin/edit.php3.17 ▲0.0537.40 ▲2.34
Add New Post /wp-admin/post-new.php5.47 ▲0.0375.19 ▼598.09
Media Library /wp-admin/upload.php3.06 ▲0.0524.93 ▼3.39

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Image/Banner Widget
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,671 ▲7015.83 ▲0.505.69 ▼0.4180.09 ▲7.05
Dashboard /wp-admin2,935 ▲366.24 ▲0.04117.53 ▼15.24173.64 ▲0.03
Posts /wp-admin/edit.php2,764 ▲583.28 ▲0.0364.72 ▲0.17144.77 ▲2.35
Add New Post /wp-admin/post-new.php2,505 ▼1,20116.77 ▼2.03398.90 ▼64.43161.79 ▲1.60
Media Library /wp-admin/upload.php1,770 ▲215.60 ▲0.04128.57 ▼11.19187.09 ▼9.44

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-banner-widget/image-banner-widget.php:14

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (A snapshot of the widget form) image missing
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

image-banner-widget/image-banner-widget.php 92% from 13 tests

"Image/Banner Widget" version 1.4.5'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:
  • Description: The description should be shorter than 140 characters (currently 145 characters long)

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 detected220 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP16216185
CSS15125
JavaScript14110

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity34.00
▷ Minimum class complexity34.00
▷ Maximum class complexity34.00
Average method complexity7.60
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
transparent.png2.76KB0.09KB▼ 96.57%
screenshot-1.png49.34KB20.05KB▼ 59.36%