83% before-after-image-compare

Code Review | Before After Image Comparison - Image comparison for WordPress

WordPress plugin Before After Image Comparison - Image comparison for WordPress scored83%from 54 tests.

About plugin

  • Plugin page: before-after-imag...
  • Plugin version: 1.1.6
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 23, 2021
  • Latest release: Nov 26, 2023
  • Number of updates: 40
  • Update frequency: every 18.4 days
  • Top authors: charlescormier (85%)abuhayat (17.5%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /9,039 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.03MB] [CPU: ▼7.04ms] Passed 4 tests

This is a short check of server-side resources used by Before After Image Comparison - Image comparison for WordPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0533.42 ▼6.21
Dashboard /wp-admin3.34 ▼0.0144.89 ▼13.89
Posts /wp-admin/edit.php3.39 ▲0.0346.66 ▲1.47
Add New Post /wp-admin/post-new.php5.93 ▲0.0481.76 ▼9.53
Media Library /wp-admin/upload.php3.26 ▲0.0333.89 ▲2.55

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Before After Image Comparison - Image comparison for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,884 ▲13713.86 ▼0.8613.84 ▲11.8838.41 ▼6.21
Dashboard /wp-admin2,195 ▲155.62 ▼0.0293.59 ▼5.5943.36 ▲1.75
Posts /wp-admin/edit.php2,100 ▼02.02 ▲0.0141.00 ▼1.9836.26 ▼0.38
Add New Post /wp-admin/post-new.php6,371 ▲4,84528.05 ▲4.52910.81 ▲302.0339.16 ▼11.20
Media Library /wp-admin/upload.php1,394 ▼94.22 ▼0.0199.21 ▲3.1440.26 ▼3.78

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ICB_PLUGIN_VERSION - assumed 'ICB_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/before-after-image-compare/dist/script.asset.php on line 4
    • > PHP Warning
      Use of undefined constant ICB_PLUGIN_VERSION - assumed 'ICB_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/before-after-image-compare/dist/editor.asset.php on line 4

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 87% from 29 tests

readme.txt 88% 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 require attention: The official readme.txt might help

before-after-image-compare/plugin.php 85% from 13 tests

The main PHP script in "Before After Image Comparison - Image comparison for WordPress" version 1.1.6 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("before-after-image-compare.php" instead of "plugin.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
There were no executable files found in this plugin271 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
JSON200147
PO File1315780
PHP4111440
CSS2022
JavaScript2022

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin