83% before-after-image-comparison-slider-for-elementor

Code Review | Before After Image Comparison Slider for Elementor

WordPress plugin Before After Image Comparison Slider for Elementor scored83%from 54 tests.

About plugin

  • Plugin page: before-after-imag...
  • Plugin version: 1.6.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 21, 2018
  • Latest release: Aug 29, 2023
  • Number of updates: 46
  • Update frequency: every 40.6 days
  • Top authors: webbuilder03 (56.52%)plugindevs (45.65%)

Code review

54 tests

User reviews

88 reviews

Install metrics

8,000+ active /74,151 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.15MB] [CPU: ▼1.36ms] Passed 4 tests

This is a short check of server-side resources used by Before After Image Comparison Slider for Elementor
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0737.76 ▼4.57
Dashboard /wp-admin3.50 ▲0.1557.25 ▼6.15
Posts /wp-admin/edit.php3.61 ▲0.2554.17 ▲2.25
Add New Post /wp-admin/post-new.php6.08 ▲0.1999.08 ▲5.66
Media Library /wp-admin/upload.php3.42 ▲0.1939.91 ▲3.05
Custom JS /wp-admin/admin.php?page=wbel-before-after-custom-js3.3936.70
Support /wp-admin/admin.php?page=wb-page-wbebaic-support3.4030.09
Custom CSS /wp-admin/admin.php?page=wbel-before-after-custom-css3.3934.83
AddOns /wp-admin/admin.php?page=wbel-before-after-addons3.4038.20

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 75 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Before After Image Comparison Slider for Elementor: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲11313.25 ▼1.122.08 ▲0.1233.25 ▼8.51
Dashboard /wp-admin2,262 ▲745.86 ▲0.0498.58 ▼4.9243.65 ▲0.75
Posts /wp-admin/edit.php2,147 ▲612.01 ▲0.0240.06 ▲4.3239.35 ▲4.45
Add New Post /wp-admin/post-new.php1,561 ▲4223.10 ▼0.26646.22 ▲42.4755.33 ▼4.57
Media Library /wp-admin/upload.php1,447 ▲594.22 ▲0.05111.85 ▲14.1749.31 ▲5.43
Custom JS /wp-admin/admin.php?page=wbel-before-after-custom-js1,0383.2470.8362.33
Support /wp-admin/admin.php?page=wb-page-wbebaic-support1,6092.0742.44123.50
Custom CSS /wp-admin/admin.php?page=wbel-before-after-custom-css1,0283.1359.5037.72
AddOns /wp-admin/admin.php?page=wbel-before-after-addons9212.1530.6154.49

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/before-after-image-comparison-slider-for-elementor/support-page/class-support-page.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/before-after-image-comparison-slider-for-elementor/admin/admin-pages.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_style() in wp-content/plugins/before-after-image-comparison-slider-for-elementor/admin/addons/admin_ui2.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/before-after-image-comparison-slider-for-elementor/widgets/before-after.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/before-after-image-comparison-slider-for-elementor/before-after-image-comparison-slider-for-elementor.php:15

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 86% 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
Attributes that require attention:
  • Requires at least: Invalid version format
You can take inspiration from this readme.txt

before-after-image-comparison-slider-for-elementor/before-after-image-comparison-slider-for-elementor.php 77% from 13 tests

This is the main PHP file of "Before After Image Comparison Slider for Elementor" version 1.6.2, 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:
  • Domain Path: Prefix the domain path with a forward slash character ("/languages")
  • Description: Keep the plugin description shorter than 140 characters (currently 175 characters long)
  • Domain Path: The domain path follows the same naming rules as the domain name, using only dashes and lowercase characters ("languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin8,204 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
CSS95361213,294
SVG1002,671
PHP83833821,478
JavaScript1318387731
PO File16630

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity13.00
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.14
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods42
▷ Static methods12.38%
▷ Public methods3992.86%
▷ Protected methods37.14%
▷ Private methods00.00%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants457.14%
▷ Class constants342.86%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
20 PNG files occupy 2.21MB with 1.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/addons/images/before-after-carousel-full.png620.47KB286.79KB▼ 53.78%
support-page/images/icon-pack/service-06.png2.38KB1.13KB▼ 52.68%
support-page/images/feature04.png6.35KB2.85KB▼ 55.08%
support-page/images/icon-pack/service-04.png1.67KB0.90KB▼ 46.47%
support-page/images/icon-pack/service-07.png1.67KB0.86KB▼ 48.39%