10% sw-slider-responsive

Code Review | SW Slider Responsive

WordPress plugin SW Slider Responsive scored10%from 54 tests.

About plugin

  • Plugin page: sw-slider-responsive
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.5
  • WordPress version: 6.3.1
  • First release: Aug 15, 2013
  • Latest release: Oct 16, 2013
  • Number of updates: 9
  • Update frequency: every 6.9 days
  • Top authors: yatheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,724 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/sw-slider-responsive/sw-slider-widget.php+57
    Methods with the same name as their class will not be constructors in a future version of PHP; sw_slider_Widget has a deprecated constructor

Server metrics [RAM: ▼1.71MB] [CPU: ▼50.42ms] Passed 4 tests

A check of server-side resources used by SW Slider Responsive
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.28 ▼1.187.59 ▼34.47
Dashboard /wp-admin2.29 ▼1.0111.11 ▼42.59
Posts /wp-admin/edit.php2.29 ▼1.0610.08 ▼39.14
Add New Post /wp-admin/post-new.php2.29 ▼3.5911.47 ▼85.46
Media Library /wp-admin/upload.php2.29 ▼0.9410.78 ▼21.69

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_sw-slider-widget

Browser metrics Passed 4 tests

An overview of browser requirements for SW Slider Responsive
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9913.22 ▼1.405.37 ▲3.6448.06 ▲6.86
Dashboard /wp-admin2,206 ▲185.81 ▲0.92101.70 ▼1.5040.18 ▼0.76
Posts /wp-admin/edit.php2,092 ▲32.00 ▼0.0142.10 ▲6.9835.33 ▼1.81
Add New Post /wp-admin/post-new.php1,533 ▲1423.43 ▲0.41650.58 ▲48.4263.70 ▲13.90
Media Library /wp-admin/upload.php1,391 ▲94.25 ▲0.0297.03 ▼9.6549.47 ▲5.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in sw_slider_Widget is deprecated since version 4.3.0! Use __construct() instead.
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_sw-slider-widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/sw-slider-responsive/themes/default.php
    • > /wp-content/plugins/sw-slider-responsive/themes/theme1.php
    • > /wp-content/plugins/sw-slider-responsive/themes/theme2.php
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: list in wp-content/plugins/sw-slider-responsive/themes/default.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sw-slider-responsive/sw-slider-widget.php:13
    • > PHP Notice
      Undefined variable: include in wp-content/plugins/sw-slider-responsive/themes/theme2.php on line 3
    • > PHP Notice
      Undefined variable: include in wp-content/plugins/sw-slider-responsive/themes/theme1.php on line 3
    • > PHP Notice
      Undefined variable: list in wp-content/plugins/sw-slider-responsive/themes/theme1.php on line 5
    • > PHP Notice
      Undefined variable: hover in wp-content/plugins/sw-slider-responsive/themes/theme1.php on line 58
    • > PHP Warning
      count(): Parameter must be an array or an object that implements Countable in wp-content/plugins/sw-slider-responsive/themes/default.php on line 5
    • > PHP Notice
      Undefined variable: interval in wp-content/plugins/sw-slider-responsive/themes/theme1.php on line 57
    • > PHP Notice
      Undefined variable: list in wp-content/plugins/sw-slider-responsive/themes/theme2.php on line 5
    • > PHP Notice
      Undefined variable: interval in wp-content/plugins/sw-slider-responsive/themes/theme2.php on line 64

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

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 require attention:
  • Tags: There are too many tags (33 tag instead of maximum 10)
The official readme.txt is a good inspiration

sw-slider-responsive/sw-slider-widget.php 92% from 13 tests

The principal PHP file in "SW Slider Responsive" v. 1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("sw-slider-responsive.php" instead of "sw-slider-widget.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 detected2,308 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript25513261,417
PHP47446479
CSS32016412

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.50
Average class complexity67.00
▷ Minimum class complexity67.00
▷ Maximum class complexity67.00
Average method complexity10.43
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods685.71%
▷ Protected methods114.29%
▷ 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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
themes/img/bt-left.png1.00KB0.18KB▼ 81.91%
themes/img/bt-right.png0.99KB0.18KB▼ 81.83%