84% tp-woocommerce-product-gallery

Code Review | TP Woocommerce Product Gallery

WordPress plugin TP Woocommerce Product Gallery scored84%from 54 tests.

About plugin

  • Plugin page: tp-woocommerce-pr...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3.2
  • WordPress version: 6.3.1
  • First release: Apr 14, 2020
  • Latest release: Nov 1, 2023
  • Number of updates: 31
  • Update frequency: every 41.8 days
  • Top authors: tplugins (100%)

Code review

54 tests

User reviews

24 reviews

Install metrics

2,000+ active /34,788 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.17MB] [CPU: ▼6.11ms] Passed 4 tests

This is a short check of server-side resources used by TP Woocommerce Product Gallery
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1844.76 ▲3.46
Dashboard /wp-admin3.47 ▲0.1746.98 ▼5.09
Posts /wp-admin/edit.php3.59 ▲0.2247.79 ▼3.71
Add New Post /wp-admin/post-new.php6.07 ▲0.1887.50 ▼17.67
Media Library /wp-admin/upload.php3.40 ▲0.1635.47 ▲2.04

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 55 new files
Database: no new tables, 34 new options
New WordPress options
tpwpg_centerPadding
tpwpg_lightbox_hideBarsDelay
tpwpg_thumbnail
tpwpg_dots
db_upgraded
widget_theysaidso_widget
widget_recent-posts
tpwpg_arrow_background
tpwpg_lightbox_mode
tpwpg_icons_color
...

Browser metrics Passed 4 tests

A check of browser resources used by TP Woocommerce Product Gallery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,947 ▲18613.54 ▼1.0712.14 ▲10.4241.78 ▼1.27
Dashboard /wp-admin2,218 ▲415.63 ▲0.0094.00 ▼9.6039.51 ▼5.76
Posts /wp-admin/edit.php2,123 ▲232.07 ▲0.0437.45 ▼1.2630.56 ▼7.27
Add New Post /wp-admin/post-new.php1,547 ▲2123.92 ▲0.77650.42 ▼23.8454.49 ▲3.16
Media Library /wp-admin/upload.php1,420 ▲174.22 ▲0.01103.15 ▲1.2145.02 ▲4.85

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 34 options
    • tpwpg_infinite
    • tpwpg_lightbox_speed
    • tpwpg_centerPadding
    • tpwpg_speed
    • tpwpg_vertical
    • tpwpg_icons_background
    • tpwpg_dots
    • tpwpg_arrows
    • theysaidso_admin_options
    • tpwpg_focusOnSelect
    • ...

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)
The smoke test was a success, however most plugin functionality was not tested

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
Please take a closer look at the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/tp-woocommerce-product-gallery/public/partials/woocommerce-product-gallery-public-display.php
    • > /wp-content/plugins/tp-woocommerce-product-gallery/admin/partials/woocommerce-product-gallery-admin-display.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: product gallery slider, woocommerce product image slider, woocommerce product gallery carousel, woocommerce product gallery slider

tp-woocommerce-product-gallery/tp-woocommerce-product-gallery.php 92% from 13 tests

This is the main PHP file of "TP Woocommerce Product Gallery" version 1.1.3, 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:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.5" instead of "3.0")

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
There were no executable files found in this plugin4,599 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript88561262,136
CSS898561,274
PHP134036271,092
SVG41097

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity10.00
▷ Minimum class complexity1.00
▷ Maximum class complexity41.00
Average method complexity2.64
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods44
▷ Static methods1227.27%
▷ Public methods3988.64%
▷ Protected methods00.00%
▷ Private methods511.36%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
6 PNG files occupy 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/youtube-play.png5.06KB2.37KB▼ 53.04%
admin/images/tp.png1.24KB0.26KB▼ 79.08%
public/images/icon.png0.56KB0.30KB▼ 45.98%
public/images/vimeo-play.png5.30KB1.56KB▼ 70.65%
admin/images/jquery.minicolors.png67.02KB34.31KB▼ 48.80%