67% wc-spin-to-win-wheel

Code Review | WooCommerce Spin Popup

WordPress plugin WooCommerce Spin Popup scored67%from 54 tests.

About plugin

  • Plugin page: wc-spin-to-win-wheel
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.2
  • WordPress version: 6.3.1
  • First release: Apr 29, 2021
  • Latest release: May 18, 2023
  • Number of updates: 14
  • Update frequency: every 53.6 days
  • Top authors: xfinitysoft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,283 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

An overview of server-side resources used by WooCommerce Spin Popup
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0637.22 ▼5.55
Dashboard /wp-admin3.39 ▲0.0949.15 ▲2.66
Posts /wp-admin/edit.php3.51 ▲0.1552.96 ▲5.30
Add New Post /wp-admin/post-new.php5.97 ▲0.0894.89 ▼3.69
Media Library /wp-admin/upload.php3.29 ▲0.0641.26 ▲7.89
Spinio Wheel /wp-admin/admin.php?page=spinio-display3.3639.03
Help /wp-admin/admin.php?page=spinio-help3.3136.19
Support /wp-admin/admin.php?page=spinio-support3.3530.78
Subscribers /wp-admin/admin.php?page=spinio-subscribers3.3333.48
Style /wp-admin/admin.php?page=spinio-style3.4135.48
Settings /wp-admin/admin.php?page=spinio-settings3.3332.24

Server storage [IO: ▲1.54MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 79 new files
Database: 1 new table, 17 new options
New tables
wp_spinio_emails
New WordPress options
widget_recent-posts
spinio_style_04757
theysaidso_admin_options
spinio_form_right
spinio_style_94031
spinio_style_90014
spinio_style_id
db_upgraded
spinio-slice
widget_recent-comments
...

Browser metrics Passed 4 tests

WooCommerce Spin Popup: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,016 ▲25915.20 ▲0.821.54 ▼0.4625.09 ▼20.77
Dashboard /wp-admin2,425 ▲2376.86 ▲0.97142.77 ▲37.6951.92 ▲9.28
Posts /wp-admin/edit.php2,334 ▲2453.80 ▲1.7660.67 ▲23.2342.32 ▲6.50
Add New Post /wp-admin/post-new.php1,748 ▲21425.26 ▲1.86568.97 ▼131.4838.23 ▼14.22
Media Library /wp-admin/upload.php1,470 ▲794.64 ▲0.5086.81 ▼84.4049.71 ▼10.55
Spinio Wheel /wp-admin/admin.php?page=spinio-display2,0783.5545.3366.03
Help /wp-admin/admin.php?page=spinio-help1,0843.4346.3775.07
Support /wp-admin/admin.php?page=spinio-support1,1313.4442.4732.20
Subscribers /wp-admin/admin.php?page=spinio-subscribers1,0443.4548.3528.72
Style /wp-admin/admin.php?page=spinio-style1,1703.5746.3629.97
Settings /wp-admin/admin.php?page=spinio-settings1,1533.6845.6427.51

Uninstaller [IO: ▲0.00MB] [DB: ▲0.01MB] 50% 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 1 table in the database
    • wp_spinio_emails
  • This plugin did not uninstall successfully, leaving 17 options in the database
    • theysaidso_admin_options
    • spinio_form_right
    • spinio_style_90014
    • spinio_style_79439
    • can_compress_scripts
    • spinio_display
    • spinio_style_94031
    • db_upgraded
    • widget_recent-comments
    • spinio_style_04757
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wc-spin-to-win-wheel/admin/partials/spinio-display.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wc-spin-to-win-wheel/admin/partials/spinio-support.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_all_page_ids() in wp-content/plugins/wc-spin-to-win-wheel/admin/partials/spinio-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wc-spin-to-win-wheel/admin/partials/spinio-style.php:20
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/wc-spin-to-win-wheel/admin/partials/spinio-subscribers.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/wc-spin-to-win-wheel/admin/partials/spinio-help.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=spinio-display
    • > Network (severe)
    https://spinio.bixab.com/bixab.png - Failed to load resource: net::ERR_CERT_COMMON_NAME_INVALID

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4 in wc-spin-to-win-wheel/assets to your readme.txt
  • Tags: Please reduce the number of tags, currently 15 tag instead of maximum 10
Please take inspiration from this readme.txt

wc-spin-to-win-wheel/spinio.php 77% from 13 tests

The main PHP file in "WooCommerce Spin Popup" ver. 1.0.5 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "4.0.0")
  • Requires PHP: The required version number must match the one declared in readme.txt ("7.0" instead of "5.6")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wc-spin-to-win-wheel.php" instead of "spinio.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin4,616 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
PHP162645932,012
JavaScript142832201,445
CSS493110852
SVG800307

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity11.14
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods50
▷ Static methods24.00%
▷ Public methods4590.00%
▷ Protected methods00.00%
▷ Private methods510.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
25 PNG files occupy 0.51MB with 0.26MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/s1.png2.70KB0.90KB▼ 66.51%
public/img/bg-circles02-invert.png9.03KB6.29KB▼ 30.40%
public/img/bg-pat-green.png5.98KB1.00KB▼ 83.29%
admin/img/step4.png14.78KB7.56KB▼ 48.83%
public/img/bg-summer01.png8.46KB6.01KB▼ 28.93%