73% 360-product-rotation

Code Review | 360 Product Rotation

WordPress plugin 360 Product Rotation scored73%from 54 tests.

About plugin

  • Plugin page: 360-product-rotation
  • Plugin version: 1.5.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.0-5.9.2
  • WordPress version: 6.3.1
  • First release: Jan 25, 2014
  • Latest release: May 31, 2022
  • Number of updates: 122
  • Update frequency: every 25.0 days
  • Top authors: YoFLA (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

900+ active /38,763 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
Installer ran successfully

Server metrics [RAM: ▲0.20MB] [CPU: ▼5.12ms] Passed 4 tests

An overview of server-side resources used by 360 Product Rotation
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1545.66 ▲3.20
Dashboard /wp-admin3.52 ▲0.2157.66 ▼16.54
Posts /wp-admin/edit.php3.63 ▲0.2751.66 ▼5.03
Add New Post /wp-admin/post-new.php6.12 ▲0.23103.90 ▲3.06
Media Library /wp-admin/upload.php3.44 ▲0.2141.46 ▼1.95
360° Views /wp-admin/upload.php?page=yofla-360-media3.3931.55
360° Product Rotation /wp-admin/options-general.php?page=yofla-360-admin3.4135.27

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 91 new files
Database: no new tables, 7 new options
New WordPress options
yofla_360_version
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by 360 Product Rotation
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲4214.37 ▼0.352.15 ▲0.5742.56 ▼3.31
Dashboard /wp-admin2,205 ▲285.61 ▼0.0581.84 ▼19.8538.11 ▼8.34
Posts /wp-admin/edit.php2,107 ▲72.02 ▲0.0234.55 ▼6.9733.82 ▼3.83
Add New Post /wp-admin/post-new.php1,543 ▲1518.44 ▼4.68613.59 ▼162.2474.74 ▲15.39
Media Library /wp-admin/upload.php1,410 ▲74.11 ▼0.14101.54 ▼25.4845.06 ▼8.60
360° Views /wp-admin/upload.php?page=yofla-360-media8072.1726.9029.89
360° Product Rotation /wp-admin/options-general.php?page=yofla-360-admin9202.0022.6927.75

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • yofla_360_version
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > 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_page_for_iframe.php
    • > /wp-content/plugins/360-product-rotation/includes/iframe.php
    • > /wp-content/plugins/360-product-rotation/includes/yofla_3drt/lib/yofla/get_config_file.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser 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=6.3.1 1:28609 "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=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/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=6.3.1 1:28721 Uncaught ReferenceError: selfHostedProjectsListData is not defined

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
6 plugin tags: 3d product viewer, 360 product viewer, 360 view software, 360, 360 product rotation...

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

The main PHP script in "360 Product Rotation" version 1.5.8 is automatically included on every request by WordPress
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,899 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP168171,2682,877
CSS715071593
JavaScript589117408
INI1143721

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity35.17
▷ Minimum class complexity2.00
▷ Maximum class complexity116.00
Average method complexity3.28
▷ 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

All PNG images should be compressed to minimize bandwidth usage for end users
52 PNG files occupy 0.15MB with 0.13MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/yofla_3drt/themes/default-black/button-rotate.png2.88KB0.23KB▼ 91.86%
includes/yofla_3drt/themes/default/button-fullscreen.png2.82KB0.17KB▼ 93.94%
includes/yofla_3drt/themes/default/button-start.png3.52KB1.12KB▼ 68.15%
includes/yofla_3drt/themes/pure-white/button-zoom-in.png3.14KB0.37KB▼ 88.27%
includes/yofla_3drt/themes/pure-white/button-left.png3.08KB0.44KB▼ 85.81%