90% image-comparison

Code Review | Image Comparison

WordPress plugin Image Comparison scored90%from 54 tests.

About plugin

  • Plugin page: image-comparison
  • Plugin version: 1.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.2
  • WordPress version: 6.3.1
  • First release: Jul 30, 2020
  • Latest release: Apr 3, 2023
  • Number of updates: 13
  • Update frequency: every 75.2 days
  • Top authors: wpdevteam (69.23%)alam789 (23.08%)Asif2BD (23.08%)

Code review

54 tests

User reviews

4 reviews

Install metrics

200+ active /4,122 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 gracefully, with no errors

Server metrics [RAM: ▲0.16MB] [CPU: ▼4.96ms] Passed 4 tests

An overview of server-side resources used by Image Comparison
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1841.82 ▼0.36
Dashboard /wp-admin3.44 ▲0.1447.58 ▼8.54
Posts /wp-admin/edit.php3.56 ▲0.2145.98 ▼1.73
Add New Post /wp-admin/post-new.php6.05 ▲0.1689.79 ▼9.19
Media Library /wp-admin/upload.php3.37 ▲0.1436.45 ▲1.61

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Image Comparison
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.30 ▼0.934.05 ▲2.0541.11 ▼5.10
Dashboard /wp-admin2,209 ▲185.85 ▼0.03101.14 ▼1.7039.93 ▲0.02
Posts /wp-admin/edit.php2,089 ▲32.01 ▲0.0238.39 ▲2.4036.18 ▲3.53
Add New Post /wp-admin/post-new.php1,650 ▲10624.20 ▲6.17661.07 ▲45.5038.55 ▼19.82
Media Library /wp-admin/upload.php1,391 ▲34.23 ▲0.04103.81 ▲7.0244.49 ▲1.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
10 plugin tags: before after, image compare, image, comparison, compare...

image-comparison/image-comparison.php Passed 13 tests

"Image Comparison" version 1.3.5's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
64 characters long description:
Let the visitors compare images & make your website interactive.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin731 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP999155654
JavaScript511466
JSON1009
CSS2162

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity40.25
▷ Minimum class complexity13.00
▷ Maximum class complexity87.00
Average method complexity5.93
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods30
▷ Static methods1240.00%
▷ Public methods2686.67%
▷ Protected methods00.00%
▷ Private methods413.33%
Functions5
▷ Named functions120.00%
▷ Anonymous functions480.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin