79% affiliate-power

Code Review | Affiliate Power - Sales Tracking for Affiliate Marketers

WordPress plugin Affiliate Power - Sales Tracking for Affiliate Marketers scored79%from 54 tests.

About plugin

  • Plugin page: affiliate-power
  • Plugin version: 2.4.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.2
  • WordPress version: 6.3.1
  • First release: Oct 29, 2012
  • Latest release: Oct 16, 2023
  • Number of updates: 94
  • Update frequency: every 42.6 days
  • Top authors: JonasBreuer (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

200+ active /27,821 total downloads

Benchmarks

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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.34MB] [CPU: ▼4.26ms] Passed 4 tests

Analyzing server-side resources used by Affiliate Power - Sales Tracking for Affiliate Marketers
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3241.27 ▲4.46
Dashboard /wp-admin3.66 ▲0.3153.27 ▼1.57
Posts /wp-admin/edit.php3.77 ▲0.4247.99 ▲1.57
Add New Post /wp-admin/post-new.php6.26 ▲0.3782.11 ▼21.48
Media Library /wp-admin/upload.php3.58 ▲0.3545.76 ▲13.98
Settings /wp-admin/admin.php?page=affiliate-power-settings3.5533.75
Statistics /wp-admin/admin.php?page=affiliate-power-statistics3.5537.49
Leads / Sales /wp-admin/admin.php?page=affiliate-power3.5935.57

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 28 new files
Database: 1 new table, 9 new options
New tables
wp_ap_transaction
New WordPress options
widget_recent-posts
affiliate-power-options
affiliate-power-meta-options
theysaidso_admin_options
affiliate-power-version
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Affiliate Power - Sales Tracking for Affiliate Marketers
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,911 ▲15013.29 ▼1.074.72 ▲3.0543.73 ▲4.56
Dashboard /wp-admin2,317 ▲1405.73 ▲0.1184.88 ▼2.8985.61 ▲46.09
Posts /wp-admin/edit.php2,144 ▲442.19 ▲0.1838.54 ▲3.3332.11 ▼6.55
Add New Post /wp-admin/post-new.php1,719 ▲18422.05 ▲3.73736.15 ▲115.4848.72 ▼13.48
Media Library /wp-admin/upload.php1,438 ▲474.31 ▲0.08119.19 ▲22.0573.98 ▲30.14
Settings /wp-admin/admin.php?page=affiliate-power-settings1,2592.1333.6436.22
Statistics /wp-admin/admin.php?page=affiliate-power-statistics1,0902.1037.0626.51
Leads / Sales /wp-admin/admin.php?page=affiliate-power1,2192.1726.5733.45

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/affiliate-power/csv-download.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined index: affiliate-power-csv in wp-content/plugins/affiliate-power/csv-download.php on line 9

User-side errors Passed 1 test

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

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: affiliate marketing, financeads, sales, awin, tracking

affiliate-power/affiliate-power.php Passed 13 tests

The main file in "Affiliate Power - Sales Tracking for Affiliate Marketers" v. 2.4.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
131 characters long description:
Import all your affiliate sales into your WordPress Backend. Analyze which posts, merchants and campaigns are creating your income.

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
No dangerous file extensions were detected2,463 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP197832432,387
JavaScript3204876

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity21.84
▷ Minimum class complexity1.00
▷ Maximum class complexity54.00
Average method complexity5.25
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods93
▷ Static methods7176.34%
▷ Public methods8490.32%
▷ Protected methods00.00%
▷ Private methods99.68%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants20
▷ Global constants1995.00%
▷ Class constants15.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.09MB with 0.06MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/affiliate-power-ebook.png35.36KB12.18KB▼ 65.54%
img/affiliate-power-36.png4.28KB1.65KB▼ 61.42%
img/affiliate-power-16.png3.34KB0.88KB▼ 73.60%
img/affiliate-power-premium.png46.75KB12.72KB▼ 72.80%