78% js-switch

Code Review | JS-SWITCH

WordPress plugin JS-SWITCH scored 78% from 54 tests.

About plugin

  • Plugin page: js-switch
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-3.9
  • WordPress version: 6.3.1
  • First release: May 10, 2014
  • Latest release: May 29, 2014
  • Number of updates: 34
  • Update frequency: every 0.6 days
  • Top authors: Abhayjain (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,460 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.64MB] [CPU: ▼20.02ms] Passed 4 tests

A check of server-side resources used by JS-SWITCH
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.32 ▼3.24
Dashboard /wp-admin3.36 ▲0.0645.05 ▲0.01
Posts /wp-admin/edit.php3.41 ▲0.0641.68 ▼7.52
Add New Post /wp-admin/post-new.php3.15 ▼2.7440.07 ▼69.33
Media Library /wp-admin/upload.php3.29 ▲0.0635.57 ▲0.17
JS-SWITCH /wp-admin/edit.php?post_type=slidesjs_slider3.3336.75
Add Js-Switch /wp-admin/post-new.php?post_type=slidesjs_slider3.1535.07

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 9 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

JS-SWITCH: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,974 ▲23913.85 ▼0.8112.43 ▲10.6038.20 ▼12.71
Dashboard /wp-admin2,232 ▲415.89 ▲0.9996.46 ▼11.0281.63 ▲41.73
Posts /wp-admin/edit.php2,118 ▲261.97 ▼0.0536.08 ▼4.3831.85 ▼3.10
Add New Post /wp-admin/post-new.php1,546 ▲1823.15 ▲4.94744.99 ▲113.2055.72 ▲6.14
Media Library /wp-admin/upload.php1,408 ▲234.13 ▼0.0995.02 ▼9.1473.20 ▲28.19
JS-SWITCH /wp-admin/edit.php?post_type=slidesjs_slider1,0961.9533.6830.87
Add Js-Switch /wp-admin/post-new.php?post_type=slidesjs_slider2,4067.64167.51124.51

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=slidesjs_slider
    • > Notice in wp-content/plugins/js-switch/js-switch.php+239
    Undefined index: fwds_slider_box_nonce
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slidesjs_slider
    • > Notice in wp-content/plugins/js-switch/js-switch.php+170
    Undefined offset: 0
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slidesjs_slider
    • > Notice in wp-content/plugins/js-switch/js-switch.php+176
    Undefined offset: 1
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slidesjs_slider
    • > Notice in wp-content/plugins/js-switch/js-switch.php+182
    Undefined offset: 2
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slidesjs_slider
    • > Notice in wp-content/plugins/js-switch/js-switch.php+188
    Undefined offset: 3
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slidesjs_slider
    • > Notice in wp-content/plugins/js-switch/js-switch.php+194
    Undefined offset: 4
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slidesjs_slider
    • > Notice in wp-content/plugins/js-switch/js-switch.php+200
    Undefined offset: 5
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slidesjs_slider
    • > Notice in wp-content/plugins/js-switch/js-switch.php+206
    Undefined offset: 6
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slidesjs_slider
    • > Notice in wp-content/plugins/js-switch/js-switch.php+212
    Undefined offset: 7
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slidesjs_slider
    • > Notice in wp-content/plugins/js-switch/js-switch.php+218
    Undefined offset: 8
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=slidesjs_slider
    • > Notice in wp-content/plugins/js-switch/js-switch.php+224
    Undefined offset: 9

SRP 50% 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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/js-switch/js-switch.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Contributors: The plugin contributors field is not present
You can look at the official readme.txt

js-switch/js-switch.php Passed 13 tests

The principal PHP file in "JS-SWITCH" v. 1.1 is loaded by WordPress automatically on each request
42 characters long description:
Scrollbox that scroll images with that box

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin471 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP16021193
JavaScript32118171
CSS100107

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
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%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
3 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/arrow-left.png1.17KB0.26KB▼ 77.58%
images/blue_fire.png1.90KB1.30KB▼ 31.53%
images/arrow-right.png1.17KB0.27KB▼ 77.07%