84% js-image-zoom-by-csomor

Code Review | JS Image Zoom by csomorelwood

WordPress plugin JS Image Zoom by csomorelwood scored84%from 54 tests.

About plugin

  • Plugin page: js-image-zoom-by-...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2
  • WordPress version: 6.3.1
  • First release: Aug 5, 2021
  • Latest release: Apr 25, 2023
  • Number of updates: 3
  • Update frequency: every 209.7 days
  • Top authors: csomorelwood (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active /1,479 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▲2.54ms] Passed 4 tests

An overview of server-side resources used by JS Image Zoom by csomorelwood
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.87 ▲0.91
Dashboard /wp-admin3.31 ▲0.0152.18 ▲2.53
Posts /wp-admin/edit.php3.36 ▲0.0150.46 ▲3.53
Add New Post /wp-admin/post-new.php5.89 ▲0.0188.56 ▲4.51
Media Library /wp-admin/upload.php3.24 ▲0.0136.85 ▲3.17
JS Image Zoom by Csömör /wp-admin/options-general.php?page=image_zoom3.2029.80

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

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

Browser metrics Passed 4 tests

JS Image Zoom by csomorelwood: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲8113.30 ▼1.081.81 ▲0.0946.90 ▲3.32
Dashboard /wp-admin2,214 ▲234.86 ▼0.03104.05 ▼15.1240.30 ▼6.21
Posts /wp-admin/edit.php2,097 ▲52.01 ▼0.0540.69 ▲5.8035.40 ▲1.39
Add New Post /wp-admin/post-new.php1,359 ▼17417.08 ▼5.89579.94 ▼92.7957.25 ▼7.83
Media Library /wp-admin/upload.php1,396 ▲84.18 ▼0.0595.87 ▼7.0542.87 ▼2.78
JS Image Zoom by Csömör /wp-admin/options-general.php?page=image_zoom7692.0224.5728.31

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/js-image-zoom-by-csomor/image_zoom_by_csomorelwood.php:16

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: image, hover, image zoom, zoom on hover, zoom...

js-image-zoom-by-csomor/image_zoom_by_csomorelwood.php 92% from 13 tests

"JS Image Zoom by csomorelwood" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("js-image-zoom-by-csomor.php" instead of "image_zoom_by_csomorelwood.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 plugin72 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript141540
PHP181326
CSS1006

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.00
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%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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