10% js-banner-rotator

Code Review | jQuery Banner Rotator WordPress Plugin

WordPress plugin jQuery Banner Rotator WordPress Plugin scored 10% from 53 tests.

About plugin

  • Plugin page: js-banner-rotator
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.8
  • WordPress version: 5.8.1
  • First release: Oct 28, 2017
  • Latest release: Oct 28, 2017
  • Number of updates: 25
  • Update frequency: every 0.1 days
  • Top authors: flashblue (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 764 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/js-banner-rotator/includes/framework/functions_wordpress.class.php+83
    Function create_function() is deprecated

Server metrics [RAM: ▼0.62MB] [CPU: ▼312.02ms] Passed 4 tests

Analyzing server-side resources used by jQuery Banner Rotator WordPress Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.01 ▲0.1716.01 ▼16.14
Dashboard /wp-admin3.03 ▼0.0310.75 ▼34.72
Posts /wp-admin/edit.php3.03 ▼0.0811.52 ▼33.51
Add New Post /wp-admin/post-new.php3.03 ▼2.4011.98 ▼1,151.23
Media Library /wp-admin/upload.php3.03 ▲0.0211.22 ▼28.61

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 170 new files
Database: 3 new tables, 1 new option
New tables
wp_bannerrotator_settings
wp_bannerrotator_slides
wp_bannerrotator_sliders
New WordPress options
widget_banner-rotator-widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for jQuery Banner Rotator WordPress Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,706 ▲10116.14 ▲0.537.44 ▼1.5347.99 ▼1.73
Dashboard /wp-admin2,948 ▲985.91 ▲0.02137.41 ▼5.44129.71 ▲28.99
Posts /wp-admin/edit.php2,746 ▲402.67 ▼0.0062.13 ▼2.5093.51 ▲6.08
Add New Post /wp-admin/post-new.php1,671 ▼18018.68 ▲1.14369.18 ▼6.41108.40 ▲4.51
Media Library /wp-admin/upload.php1,738 ▼375.01 ▲0.02126.21 ▼27.73125.50 ▲5.82

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/js-banner-rotator/includes/framework/functions_wordpress.class.php+83
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_banner-rotator-widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/js-banner-rotator/views/templates/dialog_preview_slide.php
    • > /wp-content/plugins/js-banner-rotator/views/templates/dialog_preview_slider.php
  • 42× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/js-banner-rotator/includes/bannerrotator_widget.class.php:2
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/js-banner-rotator/views/slider.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'UniteElementsBaseBanner' not found in wp-content/plugins/js-banner-rotator/includes/bannerrotator_params.class.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/js-banner-rotator/views/templates/slider_new.php:7
    • > PHP Notice
      Undefined variable: sliderID in wp-content/plugins/js-banner-rotator/views/templates/slider_edit.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'UniteBaseFrontClassBanner' not found in wp-content/plugins/js-banner-rotator/bannerrotator_front.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/js-banner-rotator/views/templates/slider_api.php:5
    • > PHP Notice
      Undefined variable: iframeStyle in wp-content/plugins/js-banner-rotator/views/templates/dialog_preview_slide.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'GlobalsBannerRotator' not found in wp-content/plugins/js-banner-rotator/views/master_view.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'UniteElementsBaseBanner' not found in wp-content/plugins/js-banner-rotator/includes/bannerrotator_operations.class.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Plugin in action), #2 (Plugin settings)
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
The official readme.txt is a good inspiration

js-banner-rotator/bannerrotator.php 92% from 13 tests

The main PHP script in "jQuery Banner Rotator WordPress Plugin" version 1.0.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("js-banner-rotator.php" instead of "bannerrotator.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
Good job! No executable or dangerous file extensions detected28,011 lines of code in 104 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript323,4043,08116,024
PHP552,0078307,658
CSS125382193,072
PO File1364390785
SVG300339
XML100133

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity39.38
▷ Minimum class complexity1.00
▷ Maximum class complexity151.00
Average method complexity3.40
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
Methods416
▷ Static methods13231.73%
▷ Public methods27866.83%
▷ Protected methods6615.87%
▷ Private methods7217.31%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants71
▷ Global constants11.41%
▷ Class constants7098.59%
▷ Public constants70100.00%

Plugin size 0% from 1 test

Image compression 0% from 1 test

Often times overlooked, PNG files can occupy unnecessary space in your plugin
46 PNG files occupy 1.64MB with 0.43MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/farbtastic/marker.png0.64KB0.71KB0.00%
images/icon.png0.40KB0.37KB▼ 8.33%
images/icon-unpublished.png0.48KB0.53KB0.00%
images/transparent.png0.19KB0.09KB▼ 49.74%
images/icon-preview.png1.33KB0.35KB▼ 73.93%