72% wp-roulette-wheel

Code Review | WP Roulette Wheel - Versatile Roulette Game with Pop-Up, Email Collection and Coupon Generation

WordPress plugin WP Roulette Wheel - Versatile Roulette Game with Pop-Up, Email Collection and Coupon Generation scored72%from 54 tests.

About plugin

  • Plugin page: wp-roulette-wheel
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-5.3.2
  • WordPress version: 6.3.1
  • First release: Feb 1, 2020
  • Latest release: Sep 18, 2020
  • Number of updates: 18
  • Update frequency: every 23.1 days
  • Top authors: webwizardsdev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /4,804 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.31MB] [CPU: ▼8.60ms] Passed 4 tests

This is a short check of server-side resources used by WP Roulette Wheel - Versatile Roulette Game with Pop-Up, Email Collection and Coupon Generation
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1241.32 ▼6.87
Dashboard /wp-admin3.71 ▲0.3749.97 ▼11.98
Posts /wp-admin/edit.php3.80 ▲0.4451.16 ▲1.55
Add New Post /wp-admin/post-new.php6.27 ▲0.3893.49 ▼17.10
Media Library /wp-admin/upload.php3.61 ▲0.3843.14 ▲10.00
WP Roulette Wheel /wp-admin/options-general.php?page=wproulettewheel3.6046.54

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 60 new files
Database: 1 new table, 6 new options
New tables
wp_wprw_roulettewheel
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WP Roulette Wheel - Versatile Roulette Game with Pop-Up, Email Collection and Coupon Generation
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.48 ▲0.211.79 ▲0.1643.31 ▲4.25
Dashboard /wp-admin2,228 ▲315.85 ▲0.93105.89 ▲1.3037.90 ▼4.47
Posts /wp-admin/edit.php2,083 ▼172.03 ▲0.0436.65 ▼4.5636.26 ▼3.16
Add New Post /wp-admin/post-new.php1,548 ▲823.24 ▲5.09618.26 ▼31.6157.05 ▼5.91
Media Library /wp-admin/upload.php1,407 ▲74.15 ▼0.11110.86 ▲5.8245.46 ▲1.86
WP Roulette Wheel /wp-admin/options-general.php?page=wproulettewheel4,2104.54154.45178.63

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wproulettewheel
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
    • > GET request to /wp-admin/options-general.php?page=wproulettewheel
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/wp-roulette-wheel/includes/templates/wheel-display-template.php
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-roulette-wheel/includes/templates/input-display-template.php:22
    • > PHP Notice
      Undefined variable: ispopup in wp-content/plugins/wp-roulette-wheel/includes/templates/wheel-display-template.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-roulette-wheel/includes/templates/modal-display-template.php:22
    • > PHP Notice
      Undefined variable: ispopup in wp-content/plugins/wp-roulette-wheel/includes/templates/wheel-display-template.php on line 21
    • > PHP Notice
      Undefined variable: isadmin in wp-content/plugins/wp-roulette-wheel/includes/templates/input-display-template.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-roulette-wheel/includes/templates/popup-display-template.php:8

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 19 tag instead of maximum 10
You can look at the official readme.txt

wp-roulette-wheel/wproulettewheel.php 77% from 13 tests

The principal PHP file in "WP Roulette Wheel - Versatile Roulette Game with Pop-Up, Email Collection and Coupon Generation" v. 1.0.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-roulette-wheel.php" instead of "wproulettewheel.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 176 characters long)
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
There were no executable files found in this plugin13,175 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript81,9791,2807,073
SVG40122,881
PHP133523812,092
CSS671512826
JSON300248
Markdown415055

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity9.86
▷ Minimum class complexity1.00
▷ Maximum class complexity27.00
Average method complexity1.72
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods87
▷ Static methods1416.09%
▷ Public methods87100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 compressed PNG files occupy 0.29MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/wheel-preview.png98.92KB105.70KB0.00%
admin/assets/images/website-example.png48.45KB51.20KB0.00%
includes/assets/lib/semantic/themes/default/assets/images/flags.png27.46KB29.21KB0.00%
includes/assets/images/wheelbackgroundfinal.png126.45KB133.93KB0.00%