94% add-banner-extension

Code Review | Add Banner Extension

WordPress plugin Add Banner Extension scored 94% from 54 tests.

About plugin

  • Plugin page: add-banner-extension
  • Plugin version: 2.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.2-5.2.1
  • WordPress version: 5.9.2
  • First release: Mar 14, 2017
  • Latest release: Jun 1, 2019
  • Number of updates: 31
  • Update frequency: every 26.0 days
  • Top authors: Sararilfy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,130 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼306.17ms] Passed 4 tests

An overview of server-side resources used by Add Banner Extension
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1258.37 ▲3.81
Dashboard /wp-admin3.49 ▲0.0836.58 ▼3.62
Posts /wp-admin/edit.php3.71 ▲0.0740.63 ▲1.26
Add New Post /wp-admin/post-new.php6.95 ▼0.0295.84 ▼1,224.02
Media Library /wp-admin/upload.php3.36 ▲0.0628.11 ▲1.69
Add New /wp-admin/admin.php?page=add-banner-extension/includes/add-banner-admin-post.php3.4637.36
All Banner List /wp-admin/admin.php?page=add-banner-extension/add-banner-extension.php3.3826.34

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 16 new files
Database: 1 new table, 1 new option
New tables
wp_add_banner_extension
New WordPress options
add-banner-extension

Browser metrics Passed 4 tests

A check of browser resources used by Add Banner Extension
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,829 ▲7516.18 ▲0.516.88 ▲0.472.66 ▼0.38
Dashboard /wp-admin2,922 ▲646.16 ▲0.01117.86 ▼24.65154.37 ▼8.78
Posts /wp-admin/edit.php2,725 ▲343.23 ▼0.0165.34 ▼2.19143.25 ▼0.59
Add New Post /wp-admin/post-new.php1,712 ▲5120.56 ▲4.97441.40 ▲8.00156.02 ▼6.16
Media Library /wp-admin/upload.php1,735 ▲405.54 ▲0.02145.74 ▲1.10187.30 ▼1.05
Add New /wp-admin/admin.php?page=add-banner-extension/includes/add-banner-admin-post.php1,4644.65110.61205.41
All Banner List /wp-admin/admin.php?page=add-banner-extension/add-banner-extension.php1,0232.4054.30101.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/add-banner-extension/includes/add-banner-admin-404.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/add-banner-extension/includes/add-banner-admin-upload.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/add-banner-extension/add-banner-extension.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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:
  • Screenshots: These screenshots do not have images: #1 (The registered banner image list is displayed.), #2 (Banner image registration and edit screen. Items : Image URL (required), Image Alt Text (required), Link URL, Open New Tab, Class Name, Id Name, Display Category (required).)
The official readme.txt might help

add-banner-extension/add-banner-extension.php Passed 13 tests

The main PHP script in "Add Banner Extension" version 2.0.9 is automatically included on every request by WordPress
110 characters long description:
Register an image from the administration screen, and a different banner image is displayed for each category.

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
Everything looks great! No dangerous files found in this plugin840 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP8169301700
PO File14157101
CSS114639

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity12.83
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity3.09
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods2573.53%
▷ Protected methods00.00%
▷ Private methods926.47%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.43MB with 0.21MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/no-image.png4.90KB3.94KB▼ 19.57%
screenshot-1.png136.86KB49.05KB▼ 64.16%
screenshot-2.png295.03KB114.29KB▼ 61.26%