83% woocommerce-zooming-image

Code Review | WooCommerce zooming image

WordPress plugin WooCommerce zooming image scored 83% from 54 tests.

About plugin

  • Plugin page: woocommerce-zoomi...
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Apr 16, 2017
  • Latest release: Oct 26, 2018
  • Number of updates: 6
  • Update frequency: every 93.2 days
  • Top authors: raihancse (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 832 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
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by WooCommerce zooming image
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.21 ▼10.46
Dashboard /wp-admin3.32 ▲0.0150.22 ▲0.94
Posts /wp-admin/edit.php3.37 ▲0.0150.52 ▼1.54
Add New Post /wp-admin/post-new.php5.90 ▲0.0191.70 ▼10.51
Media Library /wp-admin/upload.php3.24 ▲0.0135.39 ▼1.35

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce zooming image
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,883 ▲13714.04 ▼0.708.55 ▲6.7137.04 ▼7.44
Dashboard /wp-admin2,206 ▲184.87 ▼0.02115.13 ▼2.2044.36 ▲2.11
Posts /wp-admin/edit.php2,086 ▼32.18 ▲0.1539.96 ▼1.6734.20 ▼2.44
Add New Post /wp-admin/post-new.php1,533 ▲1423.24 ▼0.19608.94 ▼60.5748.11 ▼13.94
Media Library /wp-admin/upload.php1,388 ▼04.22 ▲0.0499.97 ▼4.5840.96 ▼3.99

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

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

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)
Even though no errors were found, this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-zooming-image/main.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add a description for screenshot #3 in woocommerce-zooming-image/assets to your readme.txt
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === woocommerce-zooming-image === )
  • Screenshots: Screenshot #2 (This is the second screen shot) image required
The official readme.txt is a good inspiration

woocommerce-zooming-image/main.php 92% from 13 tests

This is the main PHP file of "WooCommerce zooming image" version 2.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woocommerce-zooming-image.php" instead of "main.php")

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
Everything looks great! No dangerous files found in this plugin1,351 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript33781611,312
PHP2251739

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.21
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin