68% ultimate-product-gallery-for-woocommerce

Code Review | Ultimate Product Gallery for WooCommerce

WordPress plugin Ultimate Product Gallery for WooCommerce scored68%from 54 tests.

About plugin

  • Plugin page: ultimate-product-...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.10-4.5.2
  • WordPress version: 6.3.1
  • First release: Dec 1, 2018
  • Latest release: May 8, 2019
  • Number of updates: 4
  • Update frequency: every 39.5 days
  • Top authors: barfaraz (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

20+ active /1,601 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.46MB] [CPU: ▼41.48ms] Passed 4 tests

An overview of server-side resources used by Ultimate Product Gallery for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0617.89 ▼20.61
Dashboard /wp-admin3.57 ▲0.2221.46 ▼39.20
Posts /wp-admin/edit.php3.57 ▲0.2121.01 ▼25.30
Add New Post /wp-admin/post-new.php3.57 ▼2.3219.15 ▼80.80
Media Library /wp-admin/upload.php3.57 ▲0.3418.53 ▼15.14

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 245 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
upgfw_option
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Ultimate Product Gallery for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲17013.75 ▼0.5413.03 ▲11.2346.85 ▲1.90
Dashboard /wp-admin2,222 ▲374.90 ▲0.03102.55 ▼1.5440.37 ▲1.74
Posts /wp-admin/edit.php2,105 ▲132.05 ▲0.0443.98 ▲4.5635.01 ▼0.94
Add New Post /wp-admin/post-new.php1,556 ▲3723.31 ▲0.15611.02 ▼57.8754.12 ▼6.72
Media Library /wp-admin/upload.php1,404 ▲134.22 ▼0.0898.02 ▼4.7742.19 ▼2.37

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/ultimate-product-gallery-for-woocommerce/vafpress-framework/includes/wpalchemy/MetaBox.php+61
    Methods with the same name as their class will not be constructors in a future version of PHP; WPAlchemy_MetaBox has a deprecated constructor
  • The uninstall procedure has failed, leaving 7 options in the database
    • upgfw_option
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ultimate-product-gallery-for-woocommerce/ultimate-product-gallery-for-woocommerce.php
  • 115× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: type in wp-content/plugins/ultimate-product-gallery-for-woocommerce/vafpress-framework/views/control/notebox.php on line 4
    • > PHP Notice
      Undefined variable: is_compact in wp-content/plugins/ultimate-product-gallery-for-woocommerce/vafpress-framework/views/control/toggle.php on line 1
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/ultimate-product-gallery-for-woocommerce/vafpress-framework/config/dependencies.php on line 176
    • > PHP Fatal error
      Uncaught Error: Class 'VP_View' not found in wp-content/plugins/ultimate-product-gallery-for-woocommerce/vafpress-framework/views/control/color.php:1
    • > PHP Notice
      Undefined variable: is_compact in wp-content/plugins/ultimate-product-gallery-for-woocommerce/vafpress-framework/views/control/upload.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'VP_View' not found in wp-content/plugins/ultimate-product-gallery-for-woocommerce/vafpress-framework/views/control/checkimage.php:1
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/ultimate-product-gallery-for-woocommerce/vafpress-framework/config/dependencies.php on line 72
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/ultimate-product-gallery-for-woocommerce/vafpress-framework/config/dependencies.php on line 160
    • > PHP Fatal error
      Uncaught Error: Class 'VP_Control_FieldMulti' not found in wp-content/plugins/ultimate-product-gallery-for-woocommerce/vafpress-framework/classes/control/fieldmultiimage.php:6
    • > PHP Warning
      Use of undefined constant VP_PUBLIC_URL - assumed 'VP_PUBLIC_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/ultimate-product-gallery-for-woocommerce/vafpress-framework/config/dependencies.php on line 94

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)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Please add images for these screenshots: #1 (Popup lightbox gallery + default scrollbar theme), #2 (Video sample + minimal scrollbar without arrows), #3 (Lightbox lens zoom + other scrollbar theme), #4 (Fullscreen zooming), #5 (Single product page image zoom)
The official readme.txt might help

ultimate-product-gallery-for-woocommerce/ultimate-product-gallery-for-woocommerce.php Passed 13 tests

The principal PHP file in "Ultimate Product Gallery for WooCommerce" v. 1.0.1 is loaded by WordPress automatically on each request
34 characters long description:
WooCommerce Product Gallery Plugin

Code Analysis 97% from 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 plugin21,132 lines of code in 188 files:
LanguageFilesBlank linesComment linesLines of code
PHP962,1522,3169,906
JavaScript581,2221,2536,759
CSS282532003,888
SVG302489
Markdown231089
JSON1001

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 102)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity21.29
▷ Minimum class complexity1.00
▷ Maximum class complexity271.00
Average method complexity3.33
▷ Minimum method complexity1.00
▷ Maximum method complexity102.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes57
▷ Abstract classes47.02%
▷ Concrete classes5392.98%
▷ Final classes00.00%
Methods518
▷ Static methods8917.18%
▷ Public methods48593.63%
▷ Protected methods193.67%
▷ Private methods142.70%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants39
▷ Global constants3692.31%
▷ Class constants37.69%
▷ Public constants3100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
36 PNG files occupy 2.51MB with 0.78MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vafpress-framework/public/img/bootstrap-colorpicker/alpha.png3.19KB1.68KB▼ 47.45%
assets/images/pan-zoom/zoomIn.png5.37KB2.82KB▼ 47.41%
vafpress-framework/public/img/vp-sprite.png12.79KB4.90KB▼ 61.71%
vafpress-framework/public/img/select2/select2.png0.60KB0.99KB0.00%
vafpress-framework/public/css/vendor/jqueryui/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%