10% wp-raffle

Code Review | WP Raffle ( System )

WordPress plugin WP Raffle ( System ) scored10%from 54 tests.

About plugin

  • Plugin page: wp-raffle
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Feb 22, 2017
  • Latest release: Feb 22, 2017
  • Number of updates: 19
  • Update frequency: every 0.2 days
  • Top authors: charly23 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,783 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/wp-raffle/register.php+8
    Only variables should be passed by reference

Server metrics [RAM: ▼1.93MB] [CPU: ▼54.53ms] Passed 4 tests

An overview of server-side resources used by WP Raffle ( System )
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.404.75 ▼39.85
Dashboard /wp-admin2.08 ▼1.235.53 ▼54.35
Posts /wp-admin/edit.php2.08 ▼1.286.19 ▼39.52
Add New Post /wp-admin/post-new.php2.08 ▼3.817.27 ▼84.39
Media Library /wp-admin/upload.php2.08 ▼1.155.76 ▼30.17
Add Prizes /wp-admin/admin.php?page=add_prizes_wp_raffle2.085.58
Add Tickets /wp-admin/admin.php?page=add_tickets_wp_raffle2.086.69
Help? /wp-admin/admin.php?page=help_wp_raffle2.085.75
Settings /wp-admin/admin.php?page=settings_wp_raffle2.086.28
Time Schedule /wp-admin/admin.php?page=time_schedule_wp_raffle2.085.45
WP Raffle /wp-admin/admin.php?page=wp_raffle2.086.55
Add Events /wp-admin/admin.php?page=add_events_wp_raffle2.086.27

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 93 new files
Database: 3 new tables, 7 new options
New tables
wp_raffle_prizes
wp_raffle_tickets
wp_raffle_events
New WordPress options
db_upgraded
can_compress_scripts
widget_add_widget
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Raffle ( System )
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,215 ▲45816.15 ▲1.779.09 ▲6.9439.75 ▼5.80
Dashboard /wp-admin2,430 ▲2396.75 ▲0.85140.16 ▲30.3642.95 ▼5.57
Posts /wp-admin/edit.php2,384 ▲2955.79 ▲3.8278.26 ▲39.49101.03 ▲68.79
Add New Post /wp-admin/post-new.php1,463 ▼7021.55 ▼1.51527.97 ▼168.0691.94 ▲36.88
Media Library /wp-admin/upload.php1,523 ▲1326.87 ▲2.5599.23 ▼15.6993.69 ▲48.26
Add Prizes /wp-admin/admin.php?page=add_prizes_wp_raffle1,1395.5660.7682.41
Add Tickets /wp-admin/admin.php?page=add_tickets_wp_raffle1,1515.5960.4557.99
Help? /wp-admin/admin.php?page=help_wp_raffle1,1765.44115.9228.92
Settings /wp-admin/admin.php?page=settings_wp_raffle1,1375.5959.5495.42
Time Schedule /wp-admin/admin.php?page=time_schedule_wp_raffle1,1025.5763.4282.98
WP Raffle /wp-admin/admin.php?page=wp_raffle1,0975.6359.4279.58
Add Events /wp-admin/admin.php?page=add_events_wp_raffle1,1255.4761.9395.65

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/wp-raffle/register.php+8
    Only variables should be passed by reference
  • Zombie tables were found after uninstall: 3 tables
    • wp_raffle_prizes
    • wp_raffle_events
    • wp_raffle_tickets
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_add_widget
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 25 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/system/load.php+22
    Only variables should be passed by reference
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Deprecated in wp-content/plugins/wp-raffle/system/html.php+142
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`
  • 21 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Deprecated in wp-content/plugins/wp-raffle/controller/db_action.php+8
    Cannot use "parent" when current class scope has no parent
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp_raffleadmin-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the dashboard handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-ui-sortable handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-ui-draggable handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-ui-droppable handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-ui-core handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-ui-dialog handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery-ui-slider handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp_raffleadmin-script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp_rafflesort-script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wp_raffleajax_handler handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Deprecated in wp-content/plugins/wp-raffle/config/config.php+49
    Non-static method add::localize_script() should not be called statically
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Warning in wp-content/plugins/wp-raffle/model/users.php+15
    Declaration of users::counts() should be compatible with db::counts($tbls = NULL)
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/system/input.php+227
    Undefined property: stdClass::$edit_tickets
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/system/input.php+227
    Undefined property: stdClass::$delete_tickets
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/system/input.php+227
    Undefined property: stdClass::$edit_events
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/system/input.php+227
    Undefined property: stdClass::$delete_events
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/system/input.php+227
    Undefined property: stdClass::$edit_prizes
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/system/input.php+227
    Undefined property: stdClass::$delete_prizes
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/system/input.php+227
    Undefined property: stdClass::$setting
    • > GET request to /wp-admin/admin.php?page=settings_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/model/form.php+730
    Trying to get property 'name_inputs' of non-object
    • > GET request to /wp-admin/admin.php?page=settings_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/model/form.php+731
    Trying to get property 'email_inputs' of non-object
    • > GET request to /wp-admin/admin.php?page=settings_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/model/form.php+732
    Trying to get property 'pid_inputs' of non-object
    • > GET request to /wp-admin/admin.php?page=settings_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/model/form.php+733
    Trying to get property 'phone_inputs' of non-object
    • > GET request to /wp-admin/admin.php?page=settings_wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/model/form.php+734
    Trying to get property 'address_inputs' of non-object
    • > GET request to /wp-admin/admin.php?page=wp_raffle
    • > Notice in wp-content/plugins/wp-raffle/view/manage.php+30
    Trying to get property 'boxies_sort' of non-object
    • > GET request to /wp-admin/admin.php?page=wp_raffle
    • > Warning in wp-content/plugins/wp-raffle/view/manage.php+37
    Invalid argument supplied for foreach()

SRP 0% 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
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-raffle/config/router.php
    • > /wp-content/plugins/wp-raffle/view/template/select-winner-tpl.php
  • 30× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Only variables should be passed by reference in wp-content/plugins/wp-raffle/register.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'db' not found in wp-content/plugins/wp-raffle/model/events.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'db' not found in wp-content/plugins/wp-raffle/model/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'db' not found in wp-content/plugins/wp-raffle/model/tickets.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_userdata() in wp-content/plugins/wp-raffle/view/manage.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'schedule' not found in wp-content/plugins/wp-raffle/view/shortcode/template/randoms.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'config' not found in wp-content/plugins/wp-raffle/config/autoload.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'tickets' not found in wp-content/plugins/wp-raffle/view/template/events-tpl.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'users' not found in wp-content/plugins/wp-raffle/view/template/users-tpl.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-raffle/view/add-prizes.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=add_events_wp_raffle
    • > Javascript (severe) in unknown
    /wp-admin/js/dashboard.min.js?ver=6.3.1 1:8674 Uncaught TypeError: window.wp.deprecateL10nObject is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that require attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wp-raffle === )
You can look at the official readme.txt

wp-raffle/wp-raffle.php Passed 13 tests

The main file in "WP Raffle ( System )" v. 1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
22 characters long description:
Based Plugin Structure

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected6,833 lines of code in 65 files:
LanguageFilesBlank linesComment linesLines of code
PHP581,8484945,288
CSS238321,040
JavaScript47457426
Markdown137079

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity20.45
▷ Minimum class complexity1.00
▷ Maximum class complexity160.00
Average method complexity3.63
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes40
▷ Abstract classes00.00%
▷ Concrete classes40100.00%
▷ Final classes00.00%
Methods296
▷ Static methods23479.05%
▷ Public methods29599.66%
▷ Protected methods00.00%
▷ Private methods10.34%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
25 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/ticket-17.png0.42KB0.40KB▼ 4.22%
assets/images/paypal/paypal-16.png0.41KB0.43KB0.00%
assets/images/More-16.png0.60KB0.56KB▼ 6.68%
assets/images/check-circle-green-16-1.png0.43KB0.44KB0.00%
assets/images/paypal/Paypal-1-16.png0.26KB0.52KB0.00%