90% affiliatewp-allow-own-referrals

Code Review | AffiliateWP - Allow Own Referrals

WordPress plugin AffiliateWP - Allow Own Referrals scored90%from 54 tests.

About plugin

  • Plugin page: affiliatewp-allow...
  • 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: Apr 16, 2015
  • Latest release: Jun 3, 2022
  • Number of updates: 13
  • Update frequency: every 200.4 days
  • Top authors: dbeja (38.46%)sumobi (38.46%)DrewAPicture (30.77%)tubiz (15.38%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /11,710 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.65ms] Passed 4 tests

A check of server-side resources used by AffiliateWP - Allow Own Referrals
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.75 ▼1.15
Dashboard /wp-admin3.31 ▲0.0149.15 ▼2.85
Posts /wp-admin/edit.php3.37 ▲0.0151.30 ▲4.09
Add New Post /wp-admin/post-new.php5.90 ▲0.0189.84 ▼9.11
Media Library /wp-admin/upload.php3.24 ▲0.0140.21 ▲2.52

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for AffiliateWP - Allow Own Referrals
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲8213.25 ▼1.332.03 ▲0.1543.91 ▼3.76
Dashboard /wp-admin2,212 ▲276.06 ▲1.2095.91 ▼9.2539.06 ▼4.59
Posts /wp-admin/edit.php2,095 ▲92.04 ▲0.0138.52 ▲0.4934.79 ▼0.35
Add New Post /wp-admin/post-new.php1,545 ▲2622.81 ▼0.33621.39 ▼56.1157.96 ▲8.03
Media Library /wp-admin/upload.php1,394 ▲64.23 ▼0.02103.88 ▼1.6946.12 ▼0.86

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can take inspiration from this readme.txt

affiliatewp-allow-own-referrals/affiliatewp-allow-own-referrals.php Passed 13 tests

The main PHP file in "AffiliateWP - Allow Own Referrals" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
61 characters long description:
Allows an affiliate to earn commission on their own referrals

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected626 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP6214947626

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity9.60
▷ Minimum class complexity5.00
▷ Maximum class complexity13.00
Average method complexity1.61
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes240.00%
▷ Concrete classes360.00%
▷ Final classes133.33%
Methods72
▷ Static methods45.56%
▷ Public methods2940.28%
▷ Protected methods2433.33%
▷ Private methods1926.39%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants4
▷ 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 images were found in this plugin