78% woo-lucky-wheel

Code Review | Lucky Wheel for WooCommerce - Spin a Sale

WordPress plugin Lucky Wheel for WooCommerce - Spin a Sale scored78%from 54 tests.

About plugin

  • Plugin page: woo-lucky-wheel
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4.0
  • WordPress version: 6.3.1
  • First release: Mar 21, 2018
  • Latest release: Nov 9, 2023
  • Number of updates: 72
  • Update frequency: every 28.7 days
  • Top authors: kimvt1991 (43.06%)dragonlord47 (29.17%)mrt3vn (26.39%)thanhtd (5.56%)

Code review

54 tests

User reviews

18 reviews

Install metrics

1,000+ active /65,119 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.06MB] [CPU: ▼0.17ms] 75% from 4 tests

An overview of server-side resources used by Lucky Wheel for WooCommerce - Spin a Sale
The following require your attention
  • CPU: Try to keep total CPU usage under 500.00ms (currently 540.76ms on /wp-admin/admin.php?page=woo-lucky-wheel-extensions)
PageMemory (MB)CPU Time (ms)
Home /4.48 ▲1.0241.26 ▲0.80
Dashboard /wp-admin4.43 ▲1.0959.79 ▼1.90
Posts /wp-admin/edit.php4.48 ▲1.1350.77 ▼1.20
Add New Post /wp-admin/post-new.php6.95 ▲1.0690.86 ▲1.62
Media Library /wp-admin/upload.php4.29 ▲1.0647.31 ▲14.78
System Status /wp-admin/admin.php?page=wlwl-system-status4.2644.18
Extensions /wp-admin/admin.php?page=woo-lucky-wheel-extensions4.54540.76
Report /wp-admin/admin.php?page=wlwl-report4.2738.75
WC Lucky Wheel /wp-admin/admin.php?page=woo-lucky-wheel4.2742.96
Emails /wp-admin/edit.php?post_type=wlwl_email4.4043.50

Server storage [IO: ▲2.32MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 71 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
recovery_mode_email_last_sent
widget_theysaidso_widget
db_upgraded
woo-lucky-wheel_start_use
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Lucky Wheel for WooCommerce - Spin a Sale
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,527 ▼23514.33 ▲0.180.51 ▼1.2217.97 ▼26.10
Dashboard /wp-admin2,271 ▲915.63 ▼0.0096.43 ▲3.0646.41 ▲7.13
Posts /wp-admin/edit.php2,174 ▲742.10 ▲0.1338.92 ▲2.7533.04 ▼5.90
Add New Post /wp-admin/post-new.php1,589 ▲6323.38 ▲0.14650.89 ▼68.3469.19 ▲8.96
Media Library /wp-admin/upload.php1,473 ▲734.20 ▲0.03100.74 ▼6.0848.05 ▲3.39
System Status /wp-admin/admin.php?page=wlwl-system-status8622.0426.7731.39
Extensions /wp-admin/admin.php?page=woo-lucky-wheel-extensions1,7872.0528.2160.89
Report /wp-admin/admin.php?page=wlwl-report9322.0123.9724.23
WC Lucky Wheel /wp-admin/admin.php?page=woo-lucky-wheel1,5542.3149.7245.99
Emails /wp-admin/edit.php?post_type=wlwl_email1,1751.9033.5931.54

Uninstaller [IO: ▲0.00MB] [DB: ▲0.02MB] 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 did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • woo-lucky-wheel_start_use
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=woo-lucky-wheel
    • > Error in wp-content/plugins/woo-lucky-wheel/admin/admin.php+765
    Uncaught Error: Call to undefined function wc_is_valid_url() in wp-content/plugins/woo-lucky-wheel/admin/admin.php:765
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): VI_WOO_LUCKY_WHEEL_Admin_Admin->settings_page()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=woo-lucky-wheel
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).sortable is not a function" "TypeError: $(...).sortable is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/woo-lucky-wheel/js/admin-javascript.js?ver=1.1.2:9:39)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&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,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=woo-lucky-wheel
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).sortable is not a function

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
10 plugin tags: wheelio for woocommerce, woocommerce fortune wheel, lucky wheel, mailchimp, optin popup...

woo-lucky-wheel/woo-lucky-wheel.php Passed 13 tests

This is the main PHP file of "Lucky Wheel for WooCommerce - Spin a Sale" version 1.1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
103 characters long description:
Collect customers emails by letting them play interesting Lucky wheel game to get lucky discount coupon

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin17,862 lines of code in 42 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript111,5044168,827
PHP93917595,809
PO File25366751,313
CSS182011661,262
SVG203651

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity88.50
▷ Minimum class complexity7.00
▷ Maximum class complexity227.00
Average method complexity6.93
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods104
▷ Static methods1110.58%
▷ Public methods9692.31%
▷ Protected methods65.77%
▷ Private methods21.92%
Functions15
▷ Named functions640.00%
▷ Anonymous functions960.00%
Constants18
▷ Global constants950.00%
▷ Class constants950.00%
▷ Public constants9100.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
12 PNG files occupy 0.13MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/falling-snow/snowflakes-lg.png17.91KB6.58KB▼ 63.28%
images/2020.png17.05KB8.88KB▼ 47.93%
images/falling-snow/snowballs-lg.png3.49KB1.92KB▼ 44.86%
images/falling-snow/snowballs-sm.png11.07KB3.76KB▼ 66.06%
images/fs-sprite.png0.22KB0.18KB▼ 15.63%