93% woo-images-product-tab

Code Review | WooCommerce Images Product Tab

WordPress plugin WooCommerce Images Product Tab scored 93% from 54 tests.

About plugin

  • Plugin page: woo-images-produc...
  • Plugin version: 3.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.6
  • WordPress version: 5.8.1
  • First release: May 10, 2018
  • Latest release: Feb 23, 2021
  • Number of updates: 18
  • Update frequency: every 56.7 days
  • Top authors: rafasashi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 1,090 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼144.19ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Images Product Tab
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0142.06 ▼1.37
Dashboard /wp-admin3.07 ▲0.0152.09 ▲1.88
Posts /wp-admin/edit.php3.12 ▲0.0149.95 ▲0.05
Add New Post /wp-admin/post-new.php5.42 ▼0.0193.28 ▼577.31
Media Library /wp-admin/upload.php3.01 ▲0.0138.02 ▲2.90

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 49 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Images Product Tab
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲13115.98 ▲0.0010.40 ▲0.4348.62 ▲1.47
Dashboard /wp-admin2,970 ▲395.87 ▼0.12177.51 ▲18.87108.19 ▼3.31
Posts /wp-admin/edit.php2,736 ▼32.72 ▲0.0067.61 ▼11.2691.53 ▲1.61
Add New Post /wp-admin/post-new.php1,683 ▲6818.63 ▼2.88402.86 ▲91.91119.50 ▲6.20
Media Library /wp-admin/upload.php1,807 ▼05.04 ▲0.00168.02 ▲8.27113.89 ▼6.70

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
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
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woo-images-product-tab/views/premium.php:112

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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 to be fixed:
  • Screenshots: Screenshot #1 (Add a new tab to the product page to display all the product images.) image missing
The official readme.txt might help

woo-images-product-tab/woocommerce-images-product-tab.php 85% from 13 tests

The main PHP script in "WooCommerce Images Product Tab" version 3.0.5 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-images-product-tab.php" instead of "woocommerce-images-product-tab.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin1,657 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP105075401,443
PO File34698150
Markdown133040
CSS22813
JavaScript38011

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity28.57
▷ Minimum class complexity5.00
▷ Maximum class complexity61.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods67
▷ Static methods45.97%
▷ Public methods6292.54%
▷ Protected methods00.00%
▷ Private methods57.46%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants0
▷ Global constants00.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
19 PNG files occupy 0.40MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/upgrade.png2.72KB1.86KB▼ 31.68%
assets/images/screenshot-1.png71.00KB26.38KB▼ 62.85%
assets/images/05-icon.png1.66KB0.89KB▼ 46.18%
assets/images/05-bg.png5.63KB2.74KB▼ 51.28%
assets/images/04-bg.png6.93KB3.78KB▼ 45.46%