68% affiliates-manager

Code Review | Affiliates Manager

WordPress plugin Affiliates Manager scored68%from 54 tests.

About plugin

  • Plugin page: affiliates-manager
  • Plugin version: 2.9.33
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.4
  • WordPress version: 6.3.1
  • First release: Jun 5, 2014
  • Latest release: Nov 6, 2023
  • Number of updates: 256
  • Update frequency: every 13.5 days
  • Top authors: affmngr (92.58%)mra13 (7.81%)

Code review

54 tests

User reviews

61 reviews

Install metrics

10,000+ active /868,307 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.21MB] [CPU: ▼2.56ms] Passed 4 tests

Server-side resources used by Affiliates Manager
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2139.02 ▼2.53
Dashboard /wp-admin3.51 ▲0.2155.04 ▲5.48
Posts /wp-admin/edit.php3.56 ▲0.2148.30 ▲2.39
Add New Post /wp-admin/post-new.php6.09 ▲0.2184.84 ▼12.70
Media Library /wp-admin/upload.php3.43 ▲0.2133.67 ▲2.61
Settings /wp-admin/admin.php?page=wpam-settings3.5241.32
PayPal Mass Pay /wp-admin/admin.php?page=wpam-payments3.4532.92
Admin Functions /wp-admin/admin.php?page=wpam-admin-functions3.4031.11
Commissions /wp-admin/admin.php?page=wpam-commission3.4834.89
Manage Payouts /wp-admin/admin.php?page=wpam-manage-payouts3.4032.35
New Affiliate /wp-admin/admin.php?page=wpam-newaffiliate3.5534.59
My Affiliates /wp-admin/admin.php?page=wpam-affiliates3.5734.94
My Creatives /wp-admin/admin.php?page=wpam-creatives3.5136.67
Click Tracking /wp-admin/admin.php?page=wpam-clicktracking3.4633.49
Add-ons /wp-admin/admin.php?page=wpam-addons3.4234.66

Server storage [IO: ▲4.22MB] [DB: ▲0.12MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 278 new files
Database: 11 new tables, 33 new options
New tables
wp_wpam_affiliates_fields
wp_wpam_tracking_tokens_purchase_logs
wp_wpam_affiliates
wp_wpam_paypal_logs
wp_wpam_tracking_tokens
wp_wpam_actions
wp_wpam_impressions
wp_wpam_events
wp_wpam_messages
wp_wpam_transactions
...
New WordPress options
widget_theysaidso_widget
wpam_affcurrency_symbol
wpam_bank_transfer_instructions
wpam_default_creative_id
wpam_auto_delete_wp_user_account
wpam_aff_home_page
theysaidso_admin_options
widget_recent-posts
wpam_admin_reg_notification_email
wpam_send_admin_reg_notification
...

Browser metrics Passed 4 tests

An overview of browser requirements for Affiliates Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲6014.26 ▼0.152.02 ▼0.1744.14 ▲1.61
Dashboard /wp-admin2,250 ▲705.60 ▼0.0384.17 ▼16.2339.34 ▼3.44
Posts /wp-admin/edit.php2,163 ▲662.02 ▲0.0837.96 ▲1.5735.49 ▼0.06
Add New Post /wp-admin/post-new.php1,571 ▲3722.78 ▼0.08598.87 ▼85.6853.96 ▼4.53
Media Library /wp-admin/upload.php1,460 ▲574.17 ▼0.0497.45 ▼1.8141.95 ▼3.22
Settings /wp-admin/admin.php?page=wpam-settings1,3792.7852.3128.31
PayPal Mass Pay /wp-admin/admin.php?page=wpam-payments8902.1330.6925.70
Admin Functions /wp-admin/admin.php?page=wpam-admin-functions9202.1729.6026.38
Commissions /wp-admin/admin.php?page=wpam-commission1,0842.1229.1332.10
Manage Payouts /wp-admin/admin.php?page=wpam-manage-payouts1,0402.1931.1027.28
New Affiliate /wp-admin/admin.php?page=wpam-newaffiliate2,3352.2929.5828.58
My Affiliates /wp-admin/admin.php?page=wpam-affiliates1,1632.1128.5228.07
My Creatives /wp-admin/admin.php?page=wpam-creatives1,2753.7172.4723.05
Click Tracking /wp-admin/admin.php?page=wpam-clicktracking1,0832.1330.0225.09
Add-ons /wp-admin/admin.php?page=wpam-addons1,1782.1126.1877.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall successfully, leaving 11 tables in the database
    • wp_wpam_impressions
    • wp_wpam_affiliates_fields
    • wp_wpam_paypal_logs
    • wp_wpam_tracking_tokens_purchase_logs
    • wp_wpam_affiliates
    • wp_wpam_messages
    • wp_wpam_actions
    • wp_wpam_creatives
    • wp_wpam_transactions
    • wp_wpam_events
    • ...
  • The uninstall procedure has failed, leaving 33 options in the database
    • wpam_min_payout
    • wpam_send_admin_reg_notification
    • wpam_email_type
    • wpam_default_creative_id
    • wpam_aff_home_msg
    • wpam_aff_home_msg_not_registered
    • wpam_paypal_api_endpoint
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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
  • 10× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/affiliates-manager/html/widget_form_errors_panel.php
    • > /wp-content/plugins/affiliates-manager/html/frontend_my_creatives.php
    • > /wp-content/plugins/affiliates-manager/tests/testRefKey.php
    • > /wp-content/plugins/affiliates-manager/html/affiliate_cp_impressions.php
    • > /wp-content/plugins/affiliates-manager/html/admin/settings/settings_registration.php
    • > /wp-content/plugins/affiliates-manager/tnc.php
    • > /wp-content/plugins/affiliates-manager/html/affiliate_cp_transactions.php
    • > /wp-content/plugins/affiliates-manager/html/affiliate_cp_contactinfo.php
    • > /wp-content/plugins/affiliates-manager/tests/genId.php
    • > /wp-content/plugins/affiliates-manager/imp.php
  • 170× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'WPAM_BASE_DIRECTORY/source/Data/DataAccess.php' (include_path='.:/usr/share/php') in wp-content/plugins/affiliates-manager/source/MessageHelper.php on line 9
    • > PHP Warning
      Use of undefined constant WPAM_BASE_DIRECTORY - assumed 'WPAM_BASE_DIRECTORY' (this will throw an Error in a future version of PHP) in wp-content/plugins/affiliates-manager/source/Data/CreativeRepository.php on line 9
    • > PHP Warning
      require_once(WPAM_BASE_DIRECTORY/source/Validation/StateCodes.php): failed to open stream: No such file or directory in wp-content/plugins/affiliates-manager/source/Validation/StateCodeValidator.php on line 9
    • > PHP Warning
      Use of undefined constant WPAM_URL - assumed 'WPAM_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/affiliates-manager/html/admin/settings/settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WPAM_Pages_PublicPage' not found in wp-content/plugins/affiliates-manager/source/Pages/AffiliatesAppStatus.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WPAM_MessageHelper' not found in wp-content/plugins/affiliates-manager/html/affiliate_application_submitted.php:1
    • > PHP Fatal error
      Uncaught Error: Interface 'WPAM_Validation_IValidator' not found in wp-content/plugins/affiliates-manager/source/Validation/StringValidator.php:9
    • > PHP Warning
      Use of undefined constant WPAM_URL - assumed 'WPAM_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/affiliates-manager/html/admin/settings/settings.php on line 3
    • > PHP Warning
      include(): Failed opening 'WPAM_BASE_DIRECTORY/html/affiliate_cp_nav.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/affiliates-manager/html/affiliate_cp_transactions.php on line 3
    • > PHP Warning
      include(WPAM_BASE_DIRECTORY/html/affiliate_cp_nav.php): failed to open stream: No such file or directory in wp-content/plugins/affiliates-manager/html/affiliate_cp_home.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 19 tag instead of maximum 10
Please take inspiration from this readme.txt

affiliates-manager/boot-strap.php 92% from 13 tests

The principal PHP file in "Affiliates Manager" v. 2.9.33 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("affiliates-manager.php" instead of "boot-strap.php")

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
Everything looks great! No dangerous files found in this plugin59,845 lines of code in 194 files:
LanguageFilesBlank linesComment linesLines of code
PO File2118,16322,30843,280
PHP1611,9831,09813,696
CSS62101842,532
JavaScript537138327
HTML10010

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity11.48
▷ Minimum class complexity1.00
▷ Maximum class complexity123.00
Average method complexity2.89
▷ Minimum method complexity1.00
▷ Maximum method complexity53.00
Code structure
Namespaces0
Interfaces2
Traits0
Classes89
▷ Abstract classes22.25%
▷ Concrete classes8797.75%
▷ Final classes00.00%
Methods513
▷ Static methods377.21%
▷ Public methods45288.11%
▷ Protected methods336.43%
▷ Private methods285.46%
Functions36
▷ Named functions36100.00%
▷ Anonymous functions00.00%
Constants51
▷ Global constants2549.02%
▷ Class constants2650.98%
▷ Public constants26100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
46 PNG files occupy 0.12MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/addons/woo-revenue-share.png3.04KB2.05KB▼ 32.46%
images/addons/mailchimp-integration.png3.16KB2.24KB▼ 29.32%
images/addons/getresponse-integration-addon.png2.27KB1.29KB▼ 43.13%
images/addons/sdd-plugin-integraton.png2.60KB1.56KB▼ 40.03%
images/icon_cash.png0.56KB0.51KB▼ 8.58%