83% banner-slider-for-advertisement

Code Review | Banner Slider for Advertisement

WordPress plugin Banner Slider for Advertisement scored 83% from 54 tests.

About plugin

  • Plugin page: banner-slider-for...
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-4.9
  • WordPress version: 6.3.1
  • First release: May 10, 2018
  • Latest release: May 20, 2018
  • Number of updates: 15
  • Update frequency: every 0.7 days
  • Top authors: vipuljariwala (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active / 1,538 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
Installer ran successfully

Server metrics [RAM: ▲0.30MB] [CPU: ▼3.46ms] Passed 4 tests

Server-side resources used by Banner Slider for Advertisement
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1940.27 ▼4.43
Dashboard /wp-admin3.65 ▲0.3550.20 ▲2.07
Posts /wp-admin/edit.php3.76 ▲0.4149.98 ▲4.64
Add New Post /wp-admin/post-new.php6.23 ▲0.3499.10 ▼11.65
Media Library /wp-admin/upload.php3.57 ▲0.3436.31 ▲0.19
Plugin Settings /wp-admin/edit.php?post_type=wpwbs&page=wpwbs_settings3.5538.79
Add Banner Slider /wp-admin/post-new.php?post_type=wpwbs3.6046.84
Banner Slider /wp-admin/edit.php?post_type=wpwbs3.6135.78

Server storage [IO: ▲0.81MB] [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: 23 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_wpwbs_banners
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Banner Slider for Advertisement
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲8213.29 ▼1.512.20 ▲0.1938.57 ▼5.86
Dashboard /wp-admin2,236 ▲535.84 ▲0.9196.01 ▼7.5638.45 ▼4.54
Posts /wp-admin/edit.php2,136 ▲442.23 ▲0.2540.17 ▲0.0534.56 ▲0.40
Add New Post /wp-admin/post-new.php1,553 ▲1018.43 ▲0.33591.85 ▼41.8353.04 ▼6.31
Media Library /wp-admin/upload.php1,431 ▲404.24 ▲0.0398.71 ▼10.0742.62 ▼0.49
Plugin Settings /wp-admin/edit.php?post_type=wpwbs&page=wpwbs_settings1,0671.8925.7446.61
Add Banner Slider /wp-admin/post-new.php?post_type=wpwbs1,9892.6552.9840.08
Banner Slider /wp-admin/edit.php?post_type=wpwbs1,0882.1930.5829.10

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_wpwbs_banners

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
The following issues need your attention
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/banner-slider-for-advertisement/admin/banners_posttype.php
    • > /wp-content/plugins/banner-slider-for-advertisement/admin/plugin_settings/admin_general_settings.php
    • > /wp-content/plugins/banner-slider-for-advertisement/includes/functions/banner_slider_functions.php
    • > /wp-content/plugins/banner-slider-for-advertisement/includes/functions/banner_slider_widgets.php
    • > /wp-content/plugins/banner-slider-for-advertisement/admin/banners_cats.php
    • > /wp-content/plugins/banner-slider-for-advertisement/banner_slider.php
    • > /wp-content/plugins/banner-slider-for-advertisement/admin/plugin_settings/admin_settings.php
    • > /wp-content/plugins/banner-slider-for-advertisement/admin/plugin_settings/admin_settings_document.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 19 tag instead of maximum 10
You can look at the official readme.txt

banner-slider-for-advertisement/banner_slider.php 77% from 13 tests

The main file in "Banner Slider for Advertisement" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("banner-slider-for-advertisement.php" instead of "banner_slider.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 185 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin5,947 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript22544053,803
PHP8173861,369
CSS2669524
PO File1114267251

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 175)
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity54.83
▷ Minimum class complexity3.00
▷ Maximum class complexity213.00
Average method complexity8.69
▷ Minimum method complexity1.00
▷ Maximum method complexity175.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods42
▷ Static methods00.00%
▷ Public methods42100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants12100.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
7 PNG files occupy 0.42MB with 0.20MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screens/01_admin_banner_list.png122.30KB36.21KB▼ 70.39%
screens/04_tags_banner_settings.png23.24KB14.09KB▼ 39.37%
screens/03_category_banner_settings.png23.99KB14.58KB▼ 39.20%
admin/plugin_settings/images/header-php-settings.png38.57KB22.52KB▼ 41.61%
screens/05_plugin_banner_settings.png49.01KB24.43KB▼ 50.15%