84% image-magnify

Code Review | Image Magnify

WordPress plugin Image Magnify scored84%from 54 tests.

About plugin

  • Plugin page: image-magnify
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 12, 2015
  • Latest release: Feb 14, 2023
  • Number of updates: 8
  • Update frequency: every 335.5 days
  • Top authors: sazzadh (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

600+ active /10,613 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: ▲0.01MB] [CPU: ▼2.10ms] Passed 4 tests

Analyzing server-side resources used by Image Magnify
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0133.30 ▼5.90
Dashboard /wp-admin3.31 ▲0.0144.65 ▲0.18
Posts /wp-admin/edit.php3.36 ▲0.0150.75 ▲2.94
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.13 ▼2.78
Media Library /wp-admin/upload.php3.24 ▲0.0135.31 ▲0.12

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Image Magnify
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲13714.01 ▼0.365.22 ▲3.2145.39 ▼0.92
Dashboard /wp-admin2,203 ▲155.81 ▲0.8095.33 ▼19.9438.38 ▼8.32
Posts /wp-admin/edit.php2,086 ▼32.01 ▲0.0137.53 ▼3.3833.58 ▼1.14
Add New Post /wp-admin/post-new.php1,534 ▲2023.37 ▲5.77664.95 ▲48.7656.41 ▼10.81
Media Library /wp-admin/upload.php1,388 ▼04.20 ▲0.0694.43 ▼9.5539.75 ▼5.84

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 does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/image-magnify/image-magnify.php:15

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

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Requires at least: Invalid version format
The official readme.txt is a good inspiration

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

The entry point to "Image Magnify" version 1.1 is a PHP file that has certain tags in its header comment area
114 characters long description:
Image Magnify is a lightweight image magnifier plugin for wordpress. It add zoom effect on the hover of the image.

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
There were no executable files found in this plugin167 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1105190
PHP1131242
CSS10635

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
PNG images were not found in this plugin