93% banner-image

Code Review | Banner Image

WordPress plugin Banner Image scored 93% from 54 tests.

About plugin

  • Plugin page: banner-image
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.9.2
  • First release: Jul 18, 2017
  • Latest release: Jul 18, 2017
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: raftaar1191 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 537 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼301.42ms] Passed 4 tests

This is a short check of server-side resources used by Banner Image
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.1762.17 ▲4.78
Dashboard /wp-admin3.53 ▲0.1239.97 ▼55.67
Posts /wp-admin/edit.php3.75 ▲0.1145.37 ▼2.02
Add New Post /wp-admin/post-new.php7.00 ▲0.03100.41 ▼1,147.89
Media Library /wp-admin/upload.php3.40 ▲0.1129.18 ▼0.08
Banner Image /wp-admin/options-general.php?page=banner-image3.3726.18

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Banner Image
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,786 ▲3215.99 ▲0.196.18 ▲0.422.65 ▼0.02
Dashboard /wp-admin2,882 ▲216.15 ▼0.09125.50 ▼9.44182.54 ▲18.68
Posts /wp-admin/edit.php2,693 ▼13.24 ▲0.0063.42 ▼24.68134.68 ▼15.25
Add New Post /wp-admin/post-new.php1,714 ▲2420.88 ▲0.25443.37 ▼3.50170.67 ▼1.54
Media Library /wp-admin/upload.php1,703 ▲55.53 ▲0.05141.70 ▲1.35224.84 ▲42.05
Banner Image /wp-admin/options-general.php?page=banner-image1,0792.3756.33124.72

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 successfully, without leaving any zombie files or tables

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'BannerImage\\Plugin_Base' not found in wp-content/plugins/banner-image/php/class-frountend.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BannerImage\\content_url() in wp-content/plugins/banner-image/php/class-plugin-base.php:151
    • > PHP Fatal error
      Uncaught Error: Call to undefined function BannerImage\\content_url() in wp-content/plugins/banner-image/php/class-plugin-base.php:151
    • > PHP Fatal error
      Uncaught Error: Class 'BannerImage\\Plugin_Base' not found in wp-content/plugins/banner-image/php/class-admin-setting.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'BannerImage\\Plugin_Base' not found in wp-content/plugins/banner-image/php/class-plugin.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Tested up to: Version not formatted correctly
  • Requires at least: Version not formatted correctly
Please take inspiration from this readme.txt

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

"Banner Image" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin415 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP887299355
CSS25141
JavaScript21019

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity9.80
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods3096.77%
▷ Protected methods13.23%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin