84% wp-referral-code

Code Review | WP Referral Code

WordPress plugin WP Referral Code scored84%from 54 tests.

About plugin

  • Plugin page: wp-referral-code
  • Plugin version: 1.4.10
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-6.2
  • WordPress version: 6.3.1
  • First release: Mar 26, 2020
  • Latest release: Jun 24, 2023
  • Number of updates: 34
  • Update frequency: every 34.9 days
  • Top authors: shalior (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

900+ active /10,722 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
Install script ran successfully

Server metrics [RAM: ▲0.16MB] [CPU: ▼2.73ms] Passed 4 tests

This is a short check of server-side resources used by WP Referral Code
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1541.09 ▲6.42
Dashboard /wp-admin3.47 ▲0.1746.21 ▼0.06
Posts /wp-admin/edit.php3.59 ▲0.2343.22 ▼4.12
Add New Post /wp-admin/post-new.php6.06 ▲0.1680.82 ▼6.88
Media Library /wp-admin/upload.php3.40 ▲0.1635.86 ▲0.15
WP Referral Code /wp-admin/options-general.php?page=wp-referral-code3.3831.61

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

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

Browser metrics Passed 4 tests

WP Referral Code: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.39 ▲0.031.99 ▲0.4738.19 ▼11.33
Dashboard /wp-admin2,202 ▲225.57 ▼0.1181.33 ▼6.7740.17 ▼1.60
Posts /wp-admin/edit.php2,104 ▲42.00 ▼0.0333.63 ▼2.7837.56 ▲0.60
Add New Post /wp-admin/post-new.php1,538 ▲318.76 ▲0.61617.26 ▼41.2966.88 ▼10.47
Media Library /wp-admin/upload.php1,404 ▲104.20 ▼0.0693.32 ▼34.2941.12 ▼7.44
WP Referral Code /wp-admin/options-general.php?page=wp-referral-code9621.6722.9234.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% 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
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/wp-referral-code/admin/partials/options/filed-register-url.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-referral-code/admin/class-wp-referral-code-search-user.php:21
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_referrer_id() on null in wp-content/plugins/wp-referral-code/admin/partials/wp-referral-code-admin-invited-users.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-referral-code/admin/partials/user-select-search.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wp-referral-code/public/partials/copy-ref-link-box.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-referral-code/admin/class-wp-referral-code-options.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/wp-referral-code/admin/class-wp-referral-code-user-edit.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-referral-code/admin/partials/options/wp-referral-code-admin-setting-view.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-referral-code/public/partials/most-referring-list.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/wp-referral-code/admin/partials/wp-referral-code-admin-update-ref-code.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: refer, affiliate, referral marketing, referral, affiliate marketing

wp-referral-code/wp-referral-code.php Passed 13 tests

The entry point to "WP Referral Code" version 1.4.10 is a PHP file that has certain tags in its header comment area
107 characters long description:
This plugin brings referral codes to your WordPress website. many shortcodes are available and its all free

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,663 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP283045501,234
JavaScript84712210
Sass1130110
CSS200109

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.91
▷ Minimum class complexity1.00
▷ Maximum class complexity21.00
Average method complexity2.13
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes327.27%
Methods56
▷ Static methods1017.86%
▷ Public methods5089.29%
▷ Protected methods00.00%
▷ Private methods610.71%
Functions15
▷ Named functions1280.00%
▷ Anonymous functions320.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
public/partials/copy.png0.44KB0.24KB▼ 45.29%