78% js-banner-rotate

Code Review | JS Banner Rotate

WordPress plugin JS Banner Rotate scored78%from 54 tests.

About plugin

  • Plugin page: js-banner-rotate
  • Plugin version: 2.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.5
  • WordPress version: 6.3.1
  • First release: Jul 7, 2009
  • Latest release: Mar 14, 2013
  • Number of updates: 39
  • Update frequency: every 34.5 days
  • Top authors: ericmann (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /36,690 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼2.82ms] Passed 4 tests

This is a short check of server-side resources used by JS Banner Rotate
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0544.20 ▲1.36
Dashboard /wp-admin3.34 ▲0.0452.83 ▲2.89
Posts /wp-admin/edit.php3.45 ▲0.1049.97 ▼2.21
Add New Post /wp-admin/post-new.php5.92 ▲0.0389.43 ▼11.99
Media Library /wp-admin/upload.php3.26 ▲0.0340.66 ▲1.58

Server storage [IO: ▲0.10MB] [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: 11 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
js-banner-rotate-core
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

JS Banner Rotate: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,898 ▲13713.53 ▼0.849.97 ▲8.2442.11 ▼1.27
Dashboard /wp-admin2,224 ▲214.87 ▼0.97106.93 ▲0.4342.30 ▼1.68
Posts /wp-admin/edit.php2,100 ▼32.01 ▲0.0137.95 ▼4.5234.01 ▼5.55
Add New Post /wp-admin/post-new.php1,533 ▲223.27 ▼0.06652.71 ▼58.7352.56 ▼13.80
Media Library /wp-admin/upload.php1,403 ▲64.24 ▼0.0399.48 ▼11.9244.42 ▼9.08

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • js-banner-rotate-core
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/js-banner-rotate/lib/template.jsbrotate_shortcode.php
  • 16× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/js-banner-rotate/lib/template.jsbrotate_shortcode.php on line 21
    • > PHP Notice
      Undefined variable: image in wp-content/plugins/js-banner-rotate/lib/template.jsbrotate_shortcode.php on line 35
    • > PHP Notice
      Undefined variable: height in wp-content/plugins/js-banner-rotate/lib/template.jsbrotate_shortcode.php on line 24
    • > PHP Notice
      Undefined variable: titlevis in wp-content/plugins/js-banner-rotate/lib/template.jsbrotate_shortcode.php on line 25
    • > PHP Notice
      Undefined variable: width in wp-content/plugins/js-banner-rotate/lib/template.jsbrotate_shortcode.php on line 36
    • > PHP Notice
      Undefined variable: width in wp-content/plugins/js-banner-rotate/lib/template.jsbrotate_shortcode.php on line 35
    • > PHP Notice
      Undefined variable: height in wp-content/plugins/js-banner-rotate/lib/template.jsbrotate_shortcode.php on line 23
    • > PHP Notice
      Undefined variable: height in wp-content/plugins/js-banner-rotate/lib/template.jsbrotate_shortcode.php on line 23
    • > PHP Notice
      Undefined variable: height in wp-content/plugins/js-banner-rotate/lib/template.jsbrotate_shortcode.php on line 34
    • > PHP Notice
      Undefined variable: width in wp-content/plugins/js-banner-rotate/lib/template.jsbrotate_shortcode.php on line 24

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 issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots do not have images: #1 (Shortcode entered in the *HTML* view edit post screen.), #2 (The actual output of the banner on your blog.)
You can take inspiration from this readme.txt

js-banner-rotate/jsbrotate.php 92% from 13 tests

The main file in "JS Banner Rotate" v. 2.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("js-banner-rotate.php" instead of "jsbrotate.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin323 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP446231181
CSS116091
JavaScript1131851

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity5.00
▷ Minimum class complexity3.00
▷ Maximum class complexity7.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods466.67%
▷ Public methods583.33%
▷ Protected methods00.00%
▷ Private methods116.67%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/banner-top-links.png0.86KB1.20KB0.00%
images/banner-links.png0.13KB0.09KB▼ 27.07%