83% sr-product-360o-view

Code Review | SR Product 360° View

WordPress plugin SR Product 360° View scored83%from 54 tests.

About plugin

  • Plugin page: sr-product-360o-view
  • Plugin version: 3.3.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 20, 2018
  • Latest release: Feb 7, 2023
  • Number of updates: 38
  • Update frequency: every 40.5 days
  • Top authors: superrishi (100%)

Code review

54 tests

User reviews

22 reviews

Install metrics

900+ active /16,404 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

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

Server-side resources used by SR Product 360° View
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0034.51 ▼7.46
Dashboard /wp-admin3.31 ▲0.0044.44 ▼3.70
Posts /wp-admin/edit.php3.36 ▲0.0044.18 ▼6.37
Add New Post /wp-admin/post-new.php5.89 ▲0.0079.10 ▼14.71
Media Library /wp-admin/upload.php3.23 ▲0.0036.65 ▲2.51

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 73 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for SR Product 360° View
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.36 ▼0.201.86 ▲0.1243.09 ▼3.68
Dashboard /wp-admin2,195 ▲155.57 ▼0.0583.59 ▼16.1936.49 ▼6.12
Posts /wp-admin/edit.php2,097 ▼02.01 ▲0.0134.45 ▼2.5734.14 ▼2.40
Add New Post /wp-admin/post-new.php1,526 ▼923.02 ▼0.01663.60 ▼20.1946.90 ▼9.48
Media Library /wp-admin/upload.php1,400 ▼04.29 ▲0.0793.44 ▼18.3044.57 ▼1.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/sr-product-360o-view/setting-page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_option() in wp-content/plugins/sr-product-360o-view/set-icons.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% 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
9 plugin tags: product image rotation, woocommerce image rotation, image rotation, 360 degree view, woocommerce product 360 degree view...

sr-product-360o-view/sr.php 77% from 13 tests

This is the main PHP file of "SR Product 360° View" version 3.3.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("sr-product-360o-view.php" instead of "sr.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "3.5.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected5,828 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript118176844,056
CSS108621,002
PHP44222770

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity64.00
▷ Minimum class complexity64.00
▷ Maximum class complexity64.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods22
▷ Static methods2090.91%
▷ Public methods22100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
37 PNG files occupy 0.20MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/colorpicker/images/select.png0.49KB0.33KB▼ 33.40%
assets/img/360-3d-white-43-36.png2.78KB1.30KB▼ 53.16%
assets/img/360-white.png6.10KB3.30KB▼ 45.85%
assets/img/sr.png1.18KB0.26KB▼ 77.83%
assets/img/360.png5.12KB3.30KB▼ 35.45%