88% wc-product-3d-viewer

Code Review | 3D Product Viewer & WebAR for WooCommerce

WordPress plugin 3D Product Viewer & WebAR for WooCommerce scored88%from 54 tests.

About plugin

  • Plugin page: wc-product-3d-viewer
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.3-6.3.0
  • WordPress version: 6.3.1
  • First release: Nov 15, 2022
  • Latest release: Jul 25, 2023
  • Number of updates: 11
  • Update frequency: every 23.9 days
  • Top authors: virakle (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,574 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼10.78ms] Passed 4 tests

Server-side resources used by 3D Product Viewer & WebAR for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0436.72 ▼4.33
Dashboard /wp-admin3.38 ▲0.0844.47 ▼5.66
Posts /wp-admin/edit.php3.41 ▲0.0643.83 ▼3.61
Add New Post /wp-admin/post-new.php6.05 ▲0.1770.79 ▼25.73
Media Library /wp-admin/upload.php3.32 ▲0.0929.18 ▼7.40

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 26 new options
New WordPress options
nickx_adaptive_height
nickx_thumbnails_to_show
widget_recent-posts
nickx_show_zoom
nickx_arrowdisable
nickx_arrow_thumb
theysaidso_admin_options
nickx_vid_autoplay
nickx_arrowbgcolor
can_compress_scripts
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for 3D Product Viewer & WebAR for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲7413.17 ▼1.211.56 ▼0.1540.98 ▼14.47
Dashboard /wp-admin2,209 ▲245.82 ▼0.0799.51 ▼17.1843.31 ▼4.43
Posts /wp-admin/edit.php2,100 ▲112.05 ▼0.0039.62 ▲1.4835.30 ▼0.21
Add New Post /wp-admin/post-new.php1,538 ▲2423.61 ▲6.15667.10 ▲7.9253.17 ▼2.95
Media Library /wp-admin/upload.php1,400 ▲154.25 ▲0.08100.72 ▲1.8344.85 ▼0.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 26 options in the database
    • nickx_show_only_video
    • theysaidso_admin_options
    • nickx_show_zoom
    • nickx_hide_thumbnails
    • nickx_sliderautoplay
    • nickx_vid_autoplay
    • nickx_rtl
    • nickx_template
    • nickx_thumbnails_to_show
    • nickx_adaptive_height
    • ...

Smoke tests Passed 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 Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 76% from 29 tests

readme.txt 81% 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 your attention:
  • Donate link: Invalid url: ""
  • Screenshots: These screenshots have no corresponding images in /assets: #2 (WebAR), #3 (Portal management)
  • Tags: Please delete some tags, you are using 27 tag instead of maximum 10
Please take inspiration from this readme.txt

wc-product-3d-viewer/3D-product-viewer-and-webAR-for-woocommerce.php 69% from 13 tests

Analyzing the main PHP file in "3D Product Viewer & WebAR for WooCommerce" version 1.0.5
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Requires at least: The required version number must match the one declared in readme.txt ("5.6" instead of "2.3")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-product-3d-viewer.php" instead of "3D-product-viewer-and-webAR-for-woocommerce.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin5,308 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41,1806514,355
PHP23129526
CSS301426
SVG1001

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.39
Average class complexity15.00
▷ Minimum class complexity11.00
▷ Maximum class complexity19.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods1392.86%
▷ Protected methods00.00%
▷ Private methods17.14%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
4 PNG files occupy 0.22MB with 0.12MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon.png1.82KB1.46KB▼ 19.75%
images/viraview.png166.49KB54.95KB▼ 66.99%
images/icon-256x256.png43.45KB15.63KB▼ 64.03%
images/logo-virakle.png12.63KB4.78KB▼ 62.20%