66% splendid-product-viewer

Code Review | Splendid Product Viewer

WordPress plugin Splendid Product Viewer scored66%from 54 tests.

About plugin

  • Plugin page: splendid-product-...
  • Plugin version: 3.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.6
  • WordPress version: 6.3.1
  • First release: Jan 27, 2014
  • Latest release: Aug 2, 2016
  • Number of updates: 55
  • Update frequency: every 16.7 days
  • Top authors: albertodangelo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,854 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 gracefully, with no errors

Server metrics [RAM: ▼0.49MB] [CPU: ▼14.12ms] Passed 4 tests

A check of server-side resources used by Splendid Product Viewer
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1743.93 ▲1.65
Dashboard /wp-admin3.47 ▲0.1748.66 ▼5.52
Posts /wp-admin/edit.php3.58 ▲0.2345.84 ▼2.59
Add New Post /wp-admin/post-new.php3.60 ▼2.2946.62 ▼43.77
Media Library /wp-admin/upload.php3.21 ▼0.0230.71 ▼4.59
Add New Product /wp-admin/post-new.php?post_type=pv3.4141.54
Product Viewer /wp-admin/edit.php?post_type=pv3.4338.49
Product Viewer /wp-admin/edit-tags.php?taxonomy=pv_type&post_type=pv3.3833.52

Server storage [IO: ▲0.25MB] [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: 47 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Splendid Product Viewer: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲18413.86 ▼0.5116.78 ▲14.4848.08 ▲4.32
Dashboard /wp-admin2,232 ▲415.85 ▼0.22108.79 ▲3.7981.24 ▲36.64
Posts /wp-admin/edit.php2,133 ▲472.05 ▲0.0835.01 ▲0.0335.40 ▲0.79
Add New Post /wp-admin/post-new.php1,551 ▲2223.07 ▲4.92789.97 ▲103.6337.68 ▼36.91
Media Library /wp-admin/upload.php1,426 ▲354.08 ▼0.12130.64 ▲26.6551.09 ▲5.23
Add New Product /wp-admin/post-new.php?post_type=pv2,4987.71173.69146.82
Product Viewer /wp-admin/edit.php?post_type=pv1,1081.9431.9730.95
Product Viewer /wp-admin/edit-tags.php?taxonomy=pv_type&post_type=pv1,3032.1825.6830.45

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: 6 options
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=pv
    • > Warning in wp-content/plugins/splendid-product-viewer/class_pv_backend.php+105
    Illegal string offset 'jpg|jpeg|jpe'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=pv
    • > Warning in wp-content/plugins/splendid-product-viewer/class_pv_backend.php+106
    Illegal string offset 'gif'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=pv
    • > Warning in wp-content/plugins/splendid-product-viewer/class_pv_backend.php+107
    Illegal string offset 'png'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=pv
    • > Warning in wp-content/plugins/splendid-product-viewer/class_pv_backend.php+108
    Illegal string offset 'bmp'
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=pv
    • > Warning in wp-content/plugins/splendid-product-viewer/class_pv_backend.php+109
    Illegal string offset 'tif|tiff'
  • 11 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=pv
    • > Warning in wp-includes/media.php+4142
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/post-new.php?post_type=pv
    • > Warning in wp-includes/media.php+4140
    array_keys() expects parameter 1 to be array, string given
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=pv
    • > Notice in wp-content/plugins/splendid-product-viewer/class_pv_backend.php+324
    Undefined variable: upload_path

SRP 0% 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 perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/splendid-product-viewer/pv_details_page.php
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/splendid-product-viewer/product_viewer.php:19

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
    • > GET request to /wp-admin/post-new.php?post_type=pv
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLInputElement.\u003Canonymous> (/wp-content/plugins/splendid-product-viewer/js/jquery.simple-color-picker.js?ver=6.3.1:60:18)\n at Function.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:3129)\n at e.\u003Ccomputed>.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:1594)\n at jQuery.fn.simpleColorPicker (/wp-content/plugins/splendid-product-viewer/js/jquery.simple-color-picker.js?ver=6.3.1:20:14)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/splendid-product-viewer/js/pv-backend-scripts.js?ver=6.3.1:4:27)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=pv
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 14 tag instead of maximum 10
Please take inspiration from this readme.txt

splendid-product-viewer/product_viewer.php 92% from 13 tests

The entry point to "Splendid Product Viewer" version 3.1.4 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("splendid-product-viewer.php" instead of "product_viewer.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
No dangerous file extensions were detected3,438 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PO File124394631,301
JavaScript53593781,061
PHP4271106637
CSS42222439

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity29.50
▷ Minimum class complexity23.00
▷ Maximum class complexity36.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods2291.67%
▷ Protected methods00.00%
▷ Private methods28.33%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/150_glasses.png1.44KB0.59KB▼ 58.79%
img/refresh.png2.05KB0.92KB▼ 55.24%
img/bg_text_box.png0.94KB0.09KB▼ 89.87%
img/150_glasses_32x32.png2.15KB1.21KB▼ 43.42%