72% comparison-slider

Code Review | Comparison Slider

WordPress plugin Comparison Slider scored72%from 54 tests.

About plugin

  • Plugin page: comparison-slider
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jan 20, 2018
  • Latest release: Apr 27, 2022
  • Number of updates: 8
  • Update frequency: every 194.9 days
  • Top authors: comparisonslider (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /3,991 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲1.66MB] [CPU: ▲7.16ms] Passed 4 tests

Analyzing server-side resources used by Comparison Slider
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /5.01 ▲1.5548.02 ▲3.66
Dashboard /wp-admin5.01 ▲1.7059.00 ▲12.38
Posts /wp-admin/edit.php5.06 ▲1.7062.86 ▼1.23
Add New Post /wp-admin/post-new.php7.60 ▲1.71117.57 ▲23.70
Media Library /wp-admin/upload.php4.93 ▲1.7053.03 ▲13.81
Sliders /wp-admin/admin.php?page=ics-comparison-slider&tab=comparison4.9344.62
Settings /wp-admin/admin.php?page=ics-comparison-slider&tab=settings5.0247.33
Add New Slider /wp-admin/admin.php?page=ics-comparison-slider&tab=comparison_add_new4.9343.17
Comparison Slider /wp-admin/admin.php?page=ics-comparison-slider4.9343.23

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 470 new files
Database: 4 new tables, 10 new options
New tables
wp_ics_modules_type
wp_ics_usage_stat
wp_ics_sliders
wp_ics_modules
New WordPress options
wp_ics_db_version
can_compress_scripts
ics_opts_data
theysaidso_admin_options
ics_plugin_activation_errors
widget_recent-comments
wp_ics_db_installed
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Comparison Slider: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲10513.36 ▼0.901.65 ▼0.2737.84 ▼1.22
Dashboard /wp-admin2,257 ▲695.02 ▼0.09108.61 ▼1.9741.05 ▼6.42
Posts /wp-admin/edit.php2,143 ▲512.29 ▲0.2538.03 ▼9.5034.06 ▼10.06
Add New Post /wp-admin/post-new.php1,558 ▲2523.17 ▲0.04701.07 ▲56.2838.54 ▼19.35
Media Library /wp-admin/upload.php1,439 ▲484.43 ▲0.19106.58 ▲7.3745.15 ▼0.14
Sliders /wp-admin/admin.php?page=ics-comparison-slider&tab=comparison1,6454.7681.2577.68
Settings /wp-admin/admin.php?page=ics-comparison-slider&tab=settings1,5233.6460.5039.86
Add New Slider /wp-admin/admin.php?page=ics-comparison-slider&tab=comparison_add_new4,9745.22117.50105.80
Comparison Slider /wp-admin/admin.php?page=ics-comparison-slider1,6424.7579.5646.07

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
  • The uninstall procedure has failed, leaving 8 options in the database
    • theysaidso_admin_options
    • ics_plugin_activation_errors
    • ics_opts_data
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 9 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ics-comparison-slider
    • > User notice in wp-includes/functions.php+5905
    Function WP_Scripts::localize was called incorrectly. The $l10n parameter must be an array. To pass arbitrary data to scripts, use the wp_add_inline_script() function instead. Please see Debugging in WordPress for more information. (This message was added in version 5.7.0.)
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ics-comparison-slider&tab=comparison_add_new
    • > Notice in wp-content/plugins/comparison-slider/modules/comparison/views/tpl/comparisonEditAdmin.php+678
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=ics-comparison-slider&tab=comparison_add_new
    • > Notice in wp-content/plugins/comparison-slider/modules/comparison/views/tpl/comparisonEditAdmin.php+215
    Undefined variable: circleWithIconClass
    • > GET request to /wp-admin/admin.php?page=ics-comparison-slider&tab=comparison_add_new
    • > Notice in wp-content/plugins/comparison-slider/modules/comparison/views/tpl/comparisonEditAdmin.php+228
    Undefined variable: circleWithoutIconClass
    • > GET request to /wp-admin/admin.php?page=ics-comparison-slider&tab=comparison_add_new
    • > Notice in wp-content/plugins/comparison-slider/modules/comparison/views/tpl/comparisonEditAdmin.php+243
    Undefined variable: rectangleHeightWithIconClass
    • > GET request to /wp-admin/admin.php?page=ics-comparison-slider&tab=comparison_add_new
    • > Notice in wp-content/plugins/comparison-slider/modules/comparison/views/tpl/comparisonEditAdmin.php+256
    Undefined variable: rectangleWidthWithIconClass
    • > GET request to /wp-admin/admin.php?page=ics-comparison-slider&tab=comparison_add_new
    • > Notice in wp-content/plugins/comparison-slider/modules/comparison/views/tpl/comparisonEditAdmin.php+270
    Undefined variable: rectangleHeightWithoutIconClass
    • > GET request to /wp-admin/admin.php?page=ics-comparison-slider&tab=comparison_add_new
    • > Notice in wp-content/plugins/comparison-slider/modules/comparison/views/tpl/comparisonEditAdmin.php+283
    Undefined variable: rectangleWidthWithoutIconClass

SRP 50% 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
Please take a closer look at the following
  • 192× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_TokenParserBrokerInterface' not found in wp-content/plugins/comparison-slider/classes/Twig/TokenParserBroker.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'modelIcs' not found in wp-content/plugins/comparison-slider/modules/supsystic_promo/models/supsystic_promo.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Binary' not found in wp-content/plugins/comparison-slider/classes/Twig/Node/Expression/Binary/Power.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_LoaderInterface' not found in wp-content/plugins/comparison-slider/classes/Twig/Loader/Filesystem.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'controllerIcs' not found in wp-content/plugins/comparison-slider/modules/mail/controller.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/comparison-slider/classes/Twig/Node/If.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/comparison-slider/modules/supsystic_promo/views/tpl/welcomePage.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node' not found in wp-content/plugins/comparison-slider/classes/Twig/Node/SetTemp.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'controllerIcs' not found in wp-content/plugins/comparison-slider/modules/comparison/controller.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'moduleIcs' not found in wp-content/plugins/comparison-slider/modules/pages/mod.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following browser errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ics-comparison-slider
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $ is not a function" "TypeError: $ is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/comparison-slider/modules/comparison/js/admin.comparison.list.js?ver=1.0.4:175:5)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ics-comparison-slider
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $ is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
You can take inspiration from this readme.txt

comparison-slider/ics.php 92% from 13 tests

The main file in "Comparison Slider" v. 1.0.4 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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("comparison-slider.php" instead of "ics.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin37,330 lines of code in 381 files:
LanguageFilesBlank linesComment linesLines of code
PHP2582,8029,29621,710
JavaScript903801,7899,592
CSS322293093,357
SVG1002,671

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity14.19
▷ Minimum class complexity1.00
▷ Maximum class complexity418.00
Average method complexity2.94
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces1
Interfaces19
Traits0
Classes217
▷ Abstract classes198.76%
▷ Concrete classes19891.24%
▷ Final classes00.00%
Methods1,665
▷ Static methods26816.10%
▷ Public methods1,46988.23%
▷ Protected methods17210.33%
▷ Private methods241.44%
Functions79
▷ Named functions79100.00%
▷ Anonymous functions00.00%
Constants129
▷ Global constants6348.84%
▷ Class constants6651.16%
▷ Public constants66100.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
72 PNG files occupy 0.12MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
modules/comparison/img/assets/close_btns/classy_grey.png2.47KB1.96KB▼ 20.51%
img/down.png1.64KB1.50KB▼ 8.63%
modules/comparison/img/assets/bullets/tick_blue.png1.41KB0.60KB▼ 57.48%
css/images/ui-icons_cccccc_256x240.png6.81KB4.17KB▼ 38.71%
js/bx-slider/images/arrows/thick10.png0.14KB0.17KB0.00%