58% b-banner-slider

Code Review | B-Banner Slider

WordPress plugin B-Banner Slider scored58%from 54 tests.

About plugin

  • Plugin page: b-banner-slider
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.4
  • WordPress version: 6.3.1
  • First release: Nov 10, 2012
  • Latest release: Nov 10, 2012
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: bikramjoshii (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,182 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.92MB] [CPU: ▼39.30ms] Passed 4 tests

An overview of server-side resources used by B-Banner Slider
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0636.31 ▼6.02
Dashboard /wp-admin3.03 ▼0.3124.80 ▼39.28
Posts /wp-admin/edit.php3.03 ▼0.3222.98 ▼29.55
Add New Post /wp-admin/post-new.php3.03 ▼2.8523.29 ▼75.57
Media Library /wp-admin/upload.php3.03 ▼0.1923.96 ▼12.80
Settings /wp-admin/admin.php?page=b-banner-slider/settings.php3.0325.31
Manage Banners /wp-admin/admin.php?page=b-banner-slider/bbanner_slider.php3.0328.49

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 20 new files
Database: 1 new table, 27 new options
New tables
wp_bbanner_slider_images
New WordPress options
bbsauto_start
bbsdelay
bbsbutton_height
widget_theysaidso_widget
bbstransition_speed
bbsdisplay_dbuttons
bbsdisplay_numbers
widget_recent-posts
bbsbanner_width
widget_recent-comments
...

Browser metrics Passed 4 tests

A check of browser resources used by B-Banner Slider
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,055 ▲28414.20 ▼0.3912.30 ▲10.2737.42 ▼4.21
Dashboard /wp-admin2,232 ▲264.89 ▼0.01114.11 ▲8.7780.28 ▲35.92
Posts /wp-admin/edit.php2,126 ▲232.02 ▼0.0238.68 ▲2.4236.64 ▲0.81
Add New Post /wp-admin/post-new.php1,548 ▲323.18 ▼0.21731.25 ▲55.2557.97 ▼1.27
Media Library /wp-admin/upload.php1,426 ▲264.21 ▼0.0098.16 ▼17.8065.32 ▲15.41
Settings /wp-admin/admin.php?page=b-banner-slider/settings.php1,4602.2428.1828.63
Manage Banners /wp-admin/admin.php?page=b-banner-slider/bbanner_slider.php1,1312.1326.0737.87

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie tables were found after uninstall: 1 table
    • wp_bbanner_slider_images
  • The uninstall procedure has failed, leaving 27 options in the database
    • bbstimer_align
    • bbsauto_start
    • db_upgraded
    • bbsbutton_height
    • bbsbanner_height
    • bbsdisplay_numbers
    • bbsdisplay_playbutton
    • bbstransition
    • bbsdisplay_dbuttons
    • bbsblock_size
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=b-banner-slider/bbanner_slider.php
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/admin.php?page=b-banner-slider/settings.php
    • > Notice in wp-content/plugins/b-banner-slider/settings.php+1
    Undefined index: bbssave_setting
    • > GET request to /wp-admin/admin.php?page=b-banner-slider/bbanner_slider.php
    • > Notice in wp-content/plugins/b-banner-slider/list_banner.php+109
    Undefined index: orderby

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
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/b-banner-slider/bbanner_slider.php:21
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/b-banner-slider/bbanner_slider.php on line 18
    • > 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/b-banner-slider/bbanner_slider.php on line 11
    • > PHP Warning
      Use of undefined constant WP_CONTENT_URL - assumed 'WP_CONTENT_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/b-banner-slider/bbanner_slider.php on line 19
    • > PHP Notice
      Undefined index: bbssave_setting in wp-content/plugins/b-banner-slider/settings.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/b-banner-slider/list_banner.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/b-banner-slider/settings.php:29
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/b-banner-slider/bbanner_slider.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (B-Banner Slider plugin), #2 (The Plugin settings page), #3 (Banner show in the front)
You can look at the official readme.txt

b-banner-slider/bbanner_slider.php 92% from 13 tests

This is the main PHP file of "B-Banner Slider" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("b-banner-slider.php" instead of "bbanner_slider.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin774 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4247496
CSS240265
JavaScript20013

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity15.00
▷ Minimum class complexity15.00
▷ Maximum class complexity15.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants10100.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
8 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/images/pause.png0.15KB0.10KB▼ 32.00%
includes/images/b_32x32.png1.09KB1.13KB0.00%
includes/images/b_22x22.png0.97KB0.98KB0.00%
includes/images/next.png0.24KB0.18KB▼ 26.12%
includes/images/play.png0.23KB0.17KB▼ 25.32%