89% 360-product-viewer-for-woocommerce

Code Review | 360 Product Viewer for WooCommerce

WordPress plugin 360 Product Viewer for WooCommerce scored89%from 54 tests.

About plugin

  • Plugin page: 360-product-viewe...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Jun 1, 2023
  • Latest release: Aug 7, 2023
  • Number of updates: 25
  • Update frequency: every 2.7 days
  • Top authors: qewebby (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /520 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by 360 Product Viewer for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.50 ▼19.64
Dashboard /wp-admin3.31 ▲0.0045.77 ▼7.16
Posts /wp-admin/edit.php3.36 ▲0.0045.92 ▼2.20
Add New Post /wp-admin/post-new.php5.89 ▲0.0082.78 ▼17.51
Media Library /wp-admin/upload.php3.23 ▲0.0034.00 ▼0.54

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

Browser metrics Passed 4 tests

An overview of browser requirements for 360 Product Viewer for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.44 ▼0.151.79 ▼0.4144.54 ▲1.66
Dashboard /wp-admin2,206 ▲214.84 ▼1.02101.99 ▲1.3240.46 ▼1.34
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0336.20 ▲0.3532.62 ▼6.56
Add New Post /wp-admin/post-new.php1,533 ▼023.24 ▲0.18666.65 ▼8.2157.78 ▲3.99
Media Library /wp-admin/upload.php1,382 ▼64.24 ▲0.0494.42 ▼17.9343.95 ▼4.68

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
5 plugin tags: 360viewproduct, woocommerce, woocommerceproducts, 360, threesixty

360-product-viewer-for-woocommerce/wp_360view.php 85% from 13 tests

"360 Product Viewer for WooCommerce" version 1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("360-product-viewer-for-woocommerce.php" instead of "wp_360view.php")
  • 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

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected3,054 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
CSS51152271,246
JavaScript62015101,138
PHP16320496669
Markdown1001

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity5.33
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity27.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods35
▷ Static methods617.14%
▷ Public methods3394.29%
▷ Protected methods00.00%
▷ Private methods25.71%
Functions10
▷ Named functions880.00%
▷ Anonymous functions220.00%
Constants8
▷ Global constants450.00%
▷ Class constants450.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
16 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/hand_open.png1.18KB0.74KB▼ 37.10%
images/sprite-left.png1.72KB0.93KB▼ 46.02%
images/sprites.png3.52KB1.26KB▼ 64.06%
images/close.png6.10KB3.08KB▼ 49.54%
images/sprite-play.png1.50KB0.93KB▼ 37.66%