10% ab-background-slideshow

Code Review | AB Background Slideshow

WordPress plugin AB Background Slideshow scored 10% from 54 tests.

About plugin

  • Plugin page: ab-background-sli...
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.2.1
  • WordPress version: 5.9.2
  • First release: Sep 22, 2012
  • Latest release: Jan 23, 2018
  • Number of updates: 12
  • Update frequency: every 162.4 days
  • Top authors: abooze (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

50+ active / 6,175 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/ab-background-slideshow/ab-bg-slideshow.php+55
    Undefined variable: wp_cycle_defaults

Server metrics [RAM: ▼2.47MB] [CPU: ▼340.17ms] Passed 4 tests

This is a short check of server-side resources used by AB Background Slideshow
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.89 ▼1.624.99 ▼45.29
Dashboard /wp-admin1.91 ▼1.494.58 ▼28.49
Posts /wp-admin/edit.php1.91 ▼1.725.83 ▼32.40
Add New Post /wp-admin/post-new.php1.91 ▼5.065.17 ▼1,254.49
Media Library /wp-admin/upload.php1.91 ▼1.384.62 ▼21.25
AB BG Slideshow /wp-admin/options-general.php?page=ab-bg-slideshow1.915.62

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 15 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

AB Background Slideshow: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,977 ▲22316.38 ▲0.3817.58 ▲11.833.37 ▲0.44
Dashboard /wp-admin2,898 ▲406.19 ▼0.13123.38 ▼12.77171.64 ▲7.31
Posts /wp-admin/edit.php2,694 ▲63.23 ▲0.0063.35 ▼0.84135.66 ▼2.26
Add New Post /wp-admin/post-new.php1,761 ▲10121.51 ▲4.65440.94 ▼8.27156.22 ▲1.64
Media Library /wp-admin/upload.php1,704 ▲65.52 ▲0.06144.39 ▲0.24189.96 ▲2.72
AB BG Slideshow /wp-admin/options-general.php?page=ab-bg-slideshow1,0202.3751.77120.90

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
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/ab-background-slideshow/ab-bg-slideshow.php+55
    Undefined variable: wp_cycle_defaults

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=ab-bg-slideshow
    • > Notice in wp-content/plugins/ab-background-slideshow/ab-bg-slideshow.php+55
    Undefined variable: wp_cycle_defaults
    • > GET request to /wp-admin/options-general.php?page=ab-bg-slideshow
    • > Notice in wp-content/plugins/ab-background-slideshow/ab-bg-slideshow.php+77
    Undefined index: action
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ab-bg-slideshow
    • > Notice in wp-content/plugins/ab-background-slideshow/ab-bg-slideshow.php+154
    Trying to access array offset on value of type bool

SRP 50% 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 trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/ab-background-slideshow/ab-bg-slideshow.php:21

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Screenshot #1 (AB BG Slideshow admin panel.) image required
You can look at the official readme.txt

ab-background-slideshow/ab-bg-slideshow.php 92% from 13 tests

This is the main PHP file of "AB Background Slideshow" version 1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ab-background-slideshow.php" instead of "ab-bg-slideshow.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin845 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript16827531
PHP11444197
CSS2510117

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions14
▷ Named functions14100.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
4 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bg/page-top.png0.62KB0.32KB▼ 48.18%
images/bg/page-bg.png0.19KB0.09KB▼ 49.74%
screenshot-1.png79.28KB28.68KB▼ 63.82%
images/bg/page-bottom.png0.61KB0.30KB▼ 50.32%