78% smartarget-lucky-wheel

Code Review | Smartarget Lucky Wheel

WordPress plugin Smartarget Lucky Wheel scored78%from 54 tests.

About plugin

  • Plugin page: smartarget-lucky-...
  • Plugin version: 1.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Mar 18, 2022
  • Latest release: Aug 9, 2023
  • Number of updates: 8
  • Update frequency: every 63.6 days
  • Top authors: erezs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,013 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

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

This is a short check of server-side resources used by Smartarget Lucky Wheel
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0750.05 ▲5.79
Dashboard /wp-admin3.37 ▲0.0754.94 ▲0.68
Posts /wp-admin/edit.php3.48 ▲0.1360.17 ▲0.02
Add New Post /wp-admin/post-new.php5.97 ▲0.0890.43 ▼20.40
Media Library /wp-admin/upload.php3.29 ▲0.0639.78 ▼1.07
Smartarget Lucky Wheel /wp-admin/options-general.php?page=smartarget_lucky_wheel3.2636.65

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Smartarget Lucky Wheel
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,921 ▲13520.98 ▲6.589.37 ▲6.4344.24 ▼7.70
Dashboard /wp-admin2,199 ▲1910.60 ▲4.93171.93 ▲82.9245.13 ▼5.10
Posts /wp-admin/edit.php2,116 ▲137.35 ▲5.39128.22 ▲87.4137.16 ▲1.18
Add New Post /wp-admin/post-new.php1,695 ▲15927.49 ▲9.26735.54 ▲70.1251.68 ▼12.52
Media Library /wp-admin/upload.php1,407 ▲79.49 ▲5.29194.53 ▲83.2344.52 ▼2.55
Smartarget Lucky Wheel /wp-admin/options-general.php?page=smartarget_lucky_wheel2,9728.13254.09148.64

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

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
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/smartarget-lucky-wheel/public/partials/smartarget-lucky-wheel-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_home_url() in wp-content/plugins/smartarget-lucky-wheel/admin/partials/smartarget-lucky-wheel-admin-display.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
6 plugin tags: discount, voucher wheel, lucky wheel, voucher, vouchers...

smartarget-lucky-wheel/smartarget-lucky-wheel.php 92% from 13 tests

The primary PHP file in "Smartarget Lucky Wheel" version 1.2 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin423 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP12130522225
JavaScript351,390198
CSS1040

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG images were found in this plugin