84% affiliatewp-affiliate-info

Code Review | AffiliateWP - Affiliate Info

WordPress plugin AffiliateWP - Affiliate Info scored84%from 54 tests.

About plugin

  • Plugin page: affiliatewp-affil...
  • 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: Oct 28, 2015
  • Latest release: Jun 3, 2022
  • Number of updates: 20
  • Update frequency: every 120.5 days
  • Top authors: sumobi (45%)dbeja (35%)DrewAPicture (20%)tubiz (10%)paninapress (10%)

Code review

54 tests

User reviews

1 review

Install metrics

2,000+ active /15,973 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.98ms] Passed 4 tests

An overview of server-side resources used by AffiliateWP - Affiliate Info
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0546.48 ▲5.61
Dashboard /wp-admin3.36 ▲0.0153.66 ▼16.95
Posts /wp-admin/edit.php3.47 ▲0.1252.42 ▼1.25
Add New Post /wp-admin/post-new.php5.94 ▲0.0594.01 ▼3.33
Media Library /wp-admin/upload.php3.28 ▲0.0550.64 ▲15.46

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

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

Browser metrics Passed 4 tests

AffiliateWP - Affiliate Info: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲3114.35 ▼0.371.66 ▼0.2539.64 ▼5.37
Dashboard /wp-admin2,201 ▲265.58 ▼0.1389.09 ▼46.4838.01 ▼0.92
Posts /wp-admin/edit.php2,103 ▼02.01 ▼0.0239.16 ▼14.0637.78 ▼2.61
Add New Post /wp-admin/post-new.php1,530 ▲223.48 ▲0.55615.23 ▼77.6953.65 ▼1.62
Media Library /wp-admin/upload.php1,406 ▲124.11 ▼0.28109.55 ▲9.9149.09 ▲6.72

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
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/affiliatewp-affiliate-info/includes/class-shortcodes.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/affiliatewp-affiliate-info/includes/class-admin.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Tags: There are too many tags (15 tag instead of maximum 10)
Please take inspiration from this readme.txt

affiliatewp-affiliate-info/affiliatewp-affiliate-info.php Passed 13 tests

The main PHP script in "AffiliateWP - Affiliate Info" version 1.2 is automatically included on every request by WordPress
54 characters long description:
Show information based on the affiliate's referral URL

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin892 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP103531,130861
PO File16631

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity9.00
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity1.74
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes222.22%
▷ Concrete classes777.78%
▷ Final classes114.29%
Methods99
▷ Static methods22.02%
▷ Public methods5959.60%
▷ Protected methods2222.22%
▷ Private methods1818.18%
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

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin