10% sw-smooth-slideshow

Code Review | SW Smooth Slideshow

WordPress plugin SW Smooth Slideshow scored 10% from 54 tests.

About plugin

  • Plugin page: sw-smooth-slideshow
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.5
  • WordPress version: 5.8.1
  • First release: Jul 5, 2013
  • Latest release: Aug 15, 2013
  • Number of updates: 14
  • Update frequency: every 3.0 days
  • Top authors: yatheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,334 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
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/sw-smooth-slideshow/sw-slideshow-widget.php+52
    Methods with the same name as their class will not be constructors in a future version of PHP; sw_slideshow_Widget has a deprecated constructor

Server metrics [RAM: ▼1.73MB] [CPU: ▼191.88ms] Passed 4 tests

A check of server-side resources used by SW Smooth Slideshow
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.90 ▼0.825.15 ▼14.99
Dashboard /wp-admin1.92 ▼1.146.54 ▼36.45
Posts /wp-admin/edit.php1.92 ▼1.196.58 ▼42.00
Add New Post /wp-admin/post-new.php1.92 ▼3.515.76 ▼663.64
Media Library /wp-admin/upload.php1.92 ▼1.086.60 ▼25.41

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 1 new option
New WordPress options
widget_sw-slideshow-widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for SW Smooth Slideshow
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲10716.08 ▲0.0510.06 ▲0.4446.05 ▼3.48
Dashboard /wp-admin2,992 ▲556.08 ▲0.14136.32 ▼2.95126.13 ▲17.04
Posts /wp-admin/edit.php2,739 ▼02.71 ▼0.0161.05 ▼4.2988.00 ▼8.48
Add New Post /wp-admin/post-new.php1,683 ▼018.67 ▲0.15376.03 ▲17.32106.04 ▼10.01
Media Library /wp-admin/upload.php1,810 ▲35.02 ▲0.02143.29 ▲0.64123.90 ▲2.23

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
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/sw-smooth-slideshow/sw-slideshow-widget.php+52
    Methods with the same name as their class will not be constructors in a future version of PHP; sw_slideshow_Widget has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 1 option
    • widget_sw-slideshow-widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/sw-smooth-slideshow/themes/default.php
    • > /wp-content/plugins/sw-smooth-slideshow/themes/theme2.php
  • 37× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/sw-smooth-slideshow/themes/theme2.php on line 47
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/sw-smooth-slideshow/themes/theme2.php on line 11
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sw-smooth-slideshow/themes/theme2.php on line 44
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/sw-smooth-slideshow/themes/default.php on line 40
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/sw-smooth-slideshow/themes/theme2.php on line 45
    • > PHP Notice
      Undefined variable: list in wp-content/plugins/sw-smooth-slideshow/themes/theme2.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sw-smooth-slideshow/themes/default.php on line 41
    • > PHP Notice
      Undefined variable: widget_id in wp-content/plugins/sw-smooth-slideshow/themes/default.php on line 2
    • > PHP Notice
      Undefined variable: instance in wp-content/plugins/sw-smooth-slideshow/themes/default.php on line 44
    • > PHP Notice
      Undefined variable: list in wp-content/plugins/sw-smooth-slideshow/themes/theme2.php on line 11

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: There are too many tags (31 tag instead of maximum 10)
The official readme.txt might help

sw-smooth-slideshow/sw-slideshow-widget.php 92% from 13 tests

The primary PHP file in "SW Smooth Slideshow" version 1.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("sw-smooth-slideshow.php" instead of "sw-slideshow-widget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,617 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript4340354811
PHP38362450
CSS240356

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity72.00
▷ Minimum class complexity72.00
▷ Maximum class complexity72.00
Average method complexity12.83
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods583.33%
▷ Protected methods116.67%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected