73% 360-product-rotation

Code Review | 360 Product Rotation

WordPress plugin 360 Product Rotation scored 73% from 54 tests.

About plugin

  • Plugin page: 360-product-rotation
  • Plugin version: 1.5.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.0-5.6.0
  • WordPress version: 5.8.1
  • First release: Jan 25, 2014
  • Latest release: Dec 15, 2020
  • Number of updates: 119
  • Update frequency: every 21.1 days
  • Top authors: YoFLA (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

1,000+ active / 35,542 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.21MB] [CPU: ▼187.39ms] Passed 4 tests

An overview of server-side resources used by 360 Product Rotation
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.00 ▲0.1630.55 ▲2.52
Dashboard /wp-admin3.34 ▲0.2740.72 ▼2.91
Posts /wp-admin/edit.php3.39 ▲0.2736.54 ▼0.01
Add New Post /wp-admin/post-new.php5.64 ▲0.1973.25 ▼749.17
Media Library /wp-admin/upload.php3.22 ▲0.2129.78 ▲5.05
360° Views /wp-admin/upload.php?page=yofla-360-media3.1723.01
360° Product Rotation /wp-admin/options-general.php?page=yofla-360-admin3.1925.75

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 91 new files
Database: no new tables, 1 new option
New WordPress options
yofla_360_version

Browser metrics Passed 4 tests

This is an overview of browser requirements for 360 Product Rotation
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,683 ▲8215.80 ▲0.245.09 ▼0.3976.54 ▼1.70
Dashboard /wp-admin2,941 ▲456.16 ▼0.02119.40 ▼13.89167.16 ▼9.11
Posts /wp-admin/edit.php2,753 ▲103.24 ▼0.0064.14 ▲1.70138.93 ▼5.16
Add New Post /wp-admin/post-new.php3,821 ▲11519.22 ▲0.22446.43 ▼4.42159.52 ▼9.39
Media Library /wp-admin/upload.php1,763 ▲115.55 ▼0.01150.65 ▲8.40188.22 ▲4.74
360° Views /wp-admin/upload.php?page=yofla-360-media1,0482.6355.8299.61
360° Product Rotation /wp-admin/options-general.php?page=yofla-360-admin1,1942.4155.13111.07

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 1 option
    • yofla_360_version

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/upload.php?page=yofla-360-media
    • > Notice in wp-content/plugins/360-product-rotation/includes/class-yofla360-addmedia.php+93
    Trying to access array offset on value of type bool

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/360-product-rotation/includes/yofla_3drt/lib/yofla/get_config_file.php
    • > /wp-content/plugins/360-product-rotation/includes/yofla_3drt/lib/yofla/get_page_for_iframe.php
    • > /wp-content/plugins/360-product-rotation/includes/iframe.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/upload.php?page=yofla-360-media
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1 1:31592 "jQuery.Deferred exception: selfHostedProjectsListData is not defined" "ReferenceError: selfHostedProjectsListData is not defined\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/360-product-rotation//js/add-media.js?ver=1.0.0:75:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1:2:30038)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1:2:30340)" undefined
    • > GET request to /wp-admin/upload.php?page=yofla-360-media
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=5.8.1 1:31702 Uncaught ReferenceError: selfHostedProjectsListData is not defined

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: 3d product viewer, 360 product view, 360, 360 product viewer, 360 view software...

360-product-rotation/360-product-rotation.php Passed 13 tests

The primary PHP file in "360 Product Rotation" version 1.5.7 is used by WordPress to initiate all plugin functionality
74 characters long description:
360 Product Rotation :: creates a 360 product view from a series of photos

Code Analysis Passed 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 plugin3,892 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP168171,2682,870
CSS715071593
JavaScript589117408
INI1143721

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity35.00
▷ Minimum class complexity2.00
▷ Maximum class complexity116.00
Average method complexity3.27
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods180
▷ Static methods5631.11%
▷ Public methods12368.33%
▷ Protected methods00.00%
▷ Private methods5731.67%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants20
▷ Global constants1470.00%
▷ Class constants630.00%
▷ Public constants6100.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
52 PNG files occupy 0.15MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/yofla_3drt/themes/default/zoomslider-handle.png2.77KB0.12KB▼ 95.67%
includes/yofla_3drt/themes/default-black/zoomslider-handle.png2.77KB0.12KB▼ 95.67%
includes/yofla_3drt/themes/default-black/button-down.png2.80KB0.14KB▼ 94.83%
includes/yofla_3drt/themes/default-black/button-left.png2.80KB0.15KB▼ 94.77%
includes/yofla_3drt/themes/default/button-start.png3.52KB1.12KB▼ 68.15%