84% affiliatewp-checkout-referrals

Code Review | AffiliateWP Checkout Referrals

WordPress plugin AffiliateWP Checkout Referrals scored84%from 54 tests.

About plugin

  • Plugin page: affiliatewp-check...
  • Plugin version: 1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0
  • WordPress version: 6.3.1
  • First release: Jan 5, 2015
  • Latest release: Jun 6, 2022
  • Number of updates: 27
  • Update frequency: every 100.3 days
  • Top authors: sumobi (40.74%)DrewAPicture (37.04%)dbeja (18.52%)mordauk (11.11%)tubiz (7.41%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active /16,615 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.77ms] Passed 4 tests

Server-side resources used by AffiliateWP Checkout Referrals
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0537.84 ▼2.40
Dashboard /wp-admin3.36 ▲0.0643.07 ▼6.94
Posts /wp-admin/edit.php3.47 ▲0.1245.59 ▲2.04
Add New Post /wp-admin/post-new.php5.94 ▲0.0581.02 ▼15.44
Media Library /wp-admin/upload.php3.28 ▲0.0534.19 ▲1.71

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for AffiliateWP Checkout Referrals
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲8213.63 ▼1.171.83 ▲0.0138.07 ▼6.71
Dashboard /wp-admin2,206 ▲205.86 ▲0.92105.43 ▼10.8636.97 ▼8.79
Posts /wp-admin/edit.php2,092 ▲32.01 ▲0.0139.09 ▲0.5336.25 ▲2.37
Add New Post /wp-admin/post-new.php1,517 ▼1617.59 ▼5.56681.19 ▼14.6958.39 ▼7.17
Media Library /wp-admin/upload.php1,394 ▲64.15 ▼0.0597.79 ▼12.4341.29 ▼5.96

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% 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 everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'Affiliate_WP_Checkout_Referrals_Base' not found in wp-content/plugins/affiliatewp-checkout-referrals/integrations/class-woocommerce.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Affiliate_WP_Checkout_Referrals_Base' not found in wp-content/plugins/affiliatewp-checkout-referrals/integrations/class-rcp.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/affiliatewp-checkout-referrals/includes/class-admin.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Affiliate_WP_Checkout_Referrals_Base' not found in wp-content/plugins/affiliatewp-checkout-referrals/integrations/class-edd.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected


Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes: The official readme.txt is a good inspiration

affiliatewp-checkout-referrals/affiliatewp-checkout-referrals.php Passed 13 tests

The main PHP script in "AffiliateWP Checkout Referrals" version 1.2 is automatically included on every request by WordPress
74 characters long description:
Allows a customer to award a referral to a specific affiliate at checkout.

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
Everything looks great! No dangerous files found in this plugin982 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity11.40
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
▷ Abstract classes220.00%
▷ Concrete classes880.00%
▷ Final classes112.50%
▷ Static methods22.11%
▷ Public methods5557.89%
▷ Protected methods2223.16%
▷ Private methods1818.95%
▷ Named functions571.43%
▷ Anonymous functions228.57%
▷ Global constants4100.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
No PNG files were detected