10% affiliates-referrals-for-woocommerce

Code Review | Affiliates Referral for WC

WordPress plugin Affiliates Referral for WC scored10%from 54 tests.

About plugin

  • Plugin page: affiliates-referr...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 5, 2016
  • Latest release: Jun 8, 2016
  • Number of updates: 5
  • Update frequency: every 1.0 days
  • Top authors: Sumesh_S (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,603 total downloads


Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/affiliates-referrals-for-woocommerce/index.php+26
    Undefined variable: wpdb

Server metrics [RAM: ▲0.08MB] [CPU: ▼8.39ms] Passed 4 tests

Server-side resources used by Affiliates Referral for WC
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2040.92 ▲2.42
Dashboard /wp-admin3.38 ▲0.0448.56 ▼6.54
Posts /wp-admin/edit.php3.50 ▲0.1443.09 ▼4.50
Add New Post /wp-admin/post-new.php5.96 ▲0.0880.60 ▼15.57
Media Library /wp-admin/upload.php3.30 ▲0.0730.42 ▼6.94
Referral Edits /wp-admin/admin.php?page=aff-wc-referral-edits3.2630.06

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for Affiliates Referral for WC
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲6914.56 ▲0.211.94 ▲0.4041.85 ▲2.37
Dashboard /wp-admin2,211 ▲345.50 ▼0.1283.83 ▼10.3738.72 ▼2.30
Posts /wp-admin/edit.php2,116 ▲162.01 ▲0.0634.05 ▼1.6835.80 ▼0.24
Add New Post /wp-admin/post-new.php1,542 ▲1123.70 ▲0.45659.57 ▼5.9165.77 ▲10.91
Media Library /wp-admin/upload.php1,416 ▲164.31 ▲0.1398.72 ▼18.3341.08 ▼6.25
Referral Edits /wp-admin/admin.php?page=aff-wc-referral-edits7832.0125.4228.09

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/affiliates-referrals-for-woocommerce/includes/index.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/affiliates-referrals-for-woocommerce/includes/index.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/affiliates-referrals-for-woocommerce/includes/index.php on line 4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side


Plugin configuration 86% from 29 tests

readme.txt 81% 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
Please fix the following attributes:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === affiliates-referrals-for-woocommerce === )
  • Tags: Too many tags (22 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Donate link: Invalid URI ("")
You can look at the official readme.txt

affiliates-referrals-for-woocommerce/index.php 92% from 13 tests

"Affiliates Referral for WC" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("affiliates-referrals-for-woocommerce.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected325 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity29.50
▷ Minimum class complexity10.00
▷ Maximum class complexity49.00
Average method complexity4.80
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
▷ Static methods15100.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ Global constants8100.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
3 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/icon.png1.49KB0.89KB▼ 40.21%
screenshots/screenshot-2.png42.55KB19.32KB▼ 54.59%
screenshots/screenshot-1.png38.31KB17.78KB▼ 53.59%