57% user-referral-free

Code Review | User Referral ( Free ) - Points, Rewards, Loyalty, Leader Board & Referrals Plugin

WordPress plugin User Referral ( Free ) - Points, Rewards, Loyalty, Leader Board & Referrals Plugin scored57%from 54 tests.

About plugin

  • Plugin page: user-referral-free
  • Plugin version: 3.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 16, 2023
  • Latest release: Nov 22, 2023
  • Number of updates: 14
  • Update frequency: every 11.4 days
  • Top authors: softclever (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /464 total downloads

Benchmarks

Plugin footprint 48% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.92MB] [CPU: ▼56.60ms] Passed 4 tests

An overview of server-side resources used by User Referral ( Free ) - Points, Rewards, Loyalty, Leader Board & Referrals Plugin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.85 ▼47.25
Dashboard /wp-admin2.11 ▼1.246.15 ▼55.76
Posts /wp-admin/edit.php2.11 ▼1.259.87 ▼38.55
Add New Post /wp-admin/post-new.php2.11 ▼3.786.42 ▼84.83
Media Library /wp-admin/upload.php2.11 ▼1.136.07 ▼29.93
Security /wp-admin/admin.php?page=user-referral-free-security2.116.83
Help /wp-admin/admin.php?page=user-referral-free-help2.115.87
Adjust /wp-admin/admin.php?page=user-referral-free-adjust2.116.64
Docs /wp-admin/admin.php?page=user-referral-free-docs2.115.56
Referral /wp-admin/admin.php?page=user-referral-free-settings2.115.83
History /wp-admin/admin.php?page=user-referral-free-history2.116.20
Backup /wp-admin/admin.php?page=user-referral-free-backup2.117.70

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 60 new files
Database: 1 new table, 43 new options
New tables
wp_referral_history
New WordPress options
top_users_count
translate_approved_comment
translate_points_give
fixed_points_for_woocommerce_order_completed
custom_post_types
translate_daily_login
minimum_woocommerce_order_amount_required
custom_post_types_point
translate_woocommerce_order
visitor_referral_points
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for User Referral ( Free ) - Points, Rewards, Loyalty, Leader Board & Referrals Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲14014.48 ▲0.141.67 ▼0.0142.41 ▼6.02
Dashboard /wp-admin2,295 ▲1156.19 ▲0.55139.24 ▲50.8339.77 ▼2.51
Posts /wp-admin/edit.php2,146 ▲492.01 ▲0.0139.27 ▲2.5434.63 ▼0.19
Add New Post /wp-admin/post-new.php1,565 ▲3923.30 ▼0.18637.35 ▼28.3254.21 ▼5.25
Media Library /wp-admin/upload.php1,452 ▲494.28 ▲0.0496.34 ▼4.0341.41 ▼2.53
Security /wp-admin/admin.php?page=user-referral-free-security9522.1324.0338.01
Help /wp-admin/admin.php?page=user-referral-free-help8312.0024.0326.27
Adjust /wp-admin/admin.php?page=user-referral-free-adjust1,0332.0426.4129.80
Docs /wp-admin/admin.php?page=user-referral-free-docs1,1761.9922.4536.69
Referral /wp-admin/admin.php?page=user-referral-free-settings3,3691.6728.0037.56
History /wp-admin/admin.php?page=user-referral-free-history8762.0123.6227.36
Backup /wp-admin/admin.php?page=user-referral-free-backup8752.0125.1027.02

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
    • > 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 scurf-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie tables detected upon uninstall: 1 table
    • wp_referral_history
  • This plugin does not fully uninstall, leaving 43 options in the database
    • custom_post_types
    • points_for_comment_approved
    • translate_points_transferred
    • points_limit_for_daily_post
    • theysaidso_admin_options
    • translate_refer_signup
    • points_for_commission
    • translate_points_removed
    • translate_approved_comment
    • scurf_timezone
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=user-referral-free-backup
    • > 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 scurf-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/admin.php?page=user-referral-free-adjust
    • > Notice in wp-content/plugins/user-referral-free/inc/referral-adjust.php+39
    Undefined variable: get_user_id
    • > GET request to /wp-admin/admin.php?page=user-referral-free-adjust
    • > Notice in wp-content/plugins/user-referral-free/inc/referral-adjust.php+46
    Undefined variable: readonly
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=user-referral-free-adjust
    • > Notice in wp-content/plugins/user-referral-free/inc/referral-adjust.php+99
    Undefined variable: get_points
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=user-referral-free-adjust
    • > Notice in wp-content/plugins/user-referral-free/inc/referral-adjust.php+115
    Undefined variable: get_reason
    • > GET request to /wp-admin/admin.php?page=user-referral-free-settings
    • > Notice in wp-content/plugins/user-referral-free/inc/referral-settings.php+84
    Undefined variable: message
    • > GET request to /wp-admin/admin.php?page=user-referral-free-settings
    • > Notice in wp-content/plugins/user-referral-free/inc/referral-settings.php+702
    Undefined variable: scurf_timezone
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=user-referral-free-history
    • > Notice in wp-content/plugins/user-referral-free/inc/referral-history.php+101
    Undefined variable: search_term

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
Please fix the following items
  • 36× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-referral-free/inc/referral-field.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-referral-free/inc/referral-security.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-referral-free/inc/referral-help.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-referral-free/user-timezone.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/user-referral-free/inc/referral-translator.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/user-referral-free/core/referral-premium.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-referral-free/inc/referral-visitor.php:59
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-referral-free/inc/referral-history.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/user-referral-free/inc/referral-generate.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/user-referral-free/user-referral-free.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Contributors: Plugin contributors not specified
You can take inspiration from this readme.txt

user-referral-free/user-referral-free.php 85% from 13 tests

"User Referral ( Free ) - Points, Rewards, Loyalty, Leader Board & Referrals Plugin" version 3.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Plugin Name: Keep the plugin name shorter than 70 characters (currently 82 characters long)
  • Description: Please don't use more than 140 characters for the plugin description (currently 148 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin2,731 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP374663912,702
JavaScript221828
CSS1011

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions76
▷ Named functions76100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
12 PNG files occupy 1.26MB with 0.72MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/screenshot-07.png18.57KB7.43KB▼ 59.99%
img/icon-128x128.png1.80KB0.84KB▼ 53.35%
img/screenshot-01.png193.38KB58.42KB▼ 69.79%
img/screenshot-05.png13.83KB6.94KB▼ 49.79%
img/icon-256x256.png3.61KB1.70KB▼ 53.01%