74% affiliate-links-woocommerce

Code Review | Affiliate Links Expert

WordPress plugin Affiliate Links Expert scored74%from 54 tests.

About plugin

  • Plugin page: affiliate-links-w...
  • Plugin version: 2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3
  • WordPress version: 6.3.1
  • First release: Jun 17, 2019
  • Latest release: Aug 24, 2023
  • Number of updates: 8
  • Update frequency: every 191.3 days
  • Top authors: markomaksym (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /917 total downloads

Benchmarks

Plugin footprint 65% 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.42MB] [CPU: ▼1.89ms] Passed 4 tests

A check of server-side resources used by Affiliate Links Expert
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4338.83 ▼3.14
Dashboard /wp-admin3.74 ▲0.4447.69 ▼6.74
Posts /wp-admin/edit.php3.79 ▲0.4452.40 ▲5.06
Add New Post /wp-admin/post-new.php6.28 ▲0.3990.17 ▼2.73
Media Library /wp-admin/upload.php3.66 ▲0.4342.04 ▲7.29
Settings /wp-admin/options-general.php?page=mxalfwp-affiliate-setting3.5735.59
Link Name /wp-admin/admin.php?page=mxalfwp-visited-page-details3.5735.55
Affiliate Links /wp-admin/admin.php?page=mxalfwp-affiliate-links3.5738.27
Link Name /wp-admin/admin.php?page=mxalfwp-manage-partner3.5734.83
Link Name /wp-admin/admin.php?page=mxalfwp-affiliate-links-analytics3.5732.66
Settings /wp-admin/admin.php?page=mxalfwp-affiliate-setting3.5733.32

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 59 new files
Database: 3 new tables, 8 new options
New tables
wp_mxalfwp_affiliate_orders
wp_mxalfwp_affiliate_users
wp_mxalfwp_affiliate_links
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
mxalfwp_default_currency_sign
widget_theysaidso_widget
mxalfwp_default_percent
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Affiliate Links Expert
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲16713.96 ▼0.405.03 ▲2.9139.45 ▼5.97
Dashboard /wp-admin2,259 ▲685.23 ▲0.35104.48 ▲0.4639.80 ▼6.20
Posts /wp-admin/edit.php2,145 ▲562.41 ▲0.4042.36 ▲4.9135.34 ▲3.58
Add New Post /wp-admin/post-new.php1,554 ▲2123.75 ▲0.67667.11 ▲35.2436.29 ▼15.42
Media Library /wp-admin/upload.php1,444 ▲564.53 ▲0.3198.41 ▲0.4142.70 ▲0.32
Settings /wp-admin/options-general.php?page=mxalfwp-affiliate-setting9142.6642.8136.60
Link Name /wp-admin/admin.php?page=mxalfwp-visited-page-details1,7382.9232.6236.75
Affiliate Links /wp-admin/admin.php?page=mxalfwp-affiliate-links1,0452.2026.5032.01
Link Name /wp-admin/admin.php?page=mxalfwp-manage-partner1,7382.9629.2936.89
Link Name /wp-admin/admin.php?page=mxalfwp-affiliate-links-analytics1,7382.9431.4037.13
Settings /wp-admin/admin.php?page=mxalfwp-affiliate-setting9112.6539.9535.17

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_mxalfwp_affiliate_links
    • wp_mxalfwp_affiliate_users
    • wp_mxalfwp_affiliate_orders
  • The uninstall procedure has failed, leaving 8 options in the database
    • can_compress_scripts
    • mxalfwp_default_percent
    • widget_recent-comments
    • mxalfwp_default_currency_sign
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/affiliate-links-woocommerce/includes/admin/views/manage-partner.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function maybe_unserialize() in wp-content/plugins/affiliate-links-woocommerce/includes/admin/views/links-analytics.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function admin_url() in wp-content/plugins/affiliate-links-woocommerce/includes/admin/views/visited-page-details.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliate-links-woocommerce/includes/admin/views/affiliate-links.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliate-links-woocommerce/includes/admin/views/create-table-item.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/affiliate-links-woocommerce/includes/admin/views/sub-page.php:7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/affiliate-links-woocommerce/includes/admin/views/manage-partner.php on line 4
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/affiliate-links-woocommerce/includes/admin/views/manage-partner.php on line 4
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/affiliate-links-woocommerce/includes/admin/views/manage-partner.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/affiliate-links-woocommerce/includes/frontend/pages/cabinet.php:1

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)
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
9 plugin tags: affiliate marketing, social media sharing, click tracking, visit tracking, affiliate program management...

affiliate-links-woocommerce/affiliate-links-for-woocommerce-plugin.php 85% from 13 tests

"Affiliate Links Expert" version 2.3'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: Please rename the main PHP file in this plugin to the plugin slug ("affiliate-links-woocommerce.php" instead of "affiliate-links-for-woocommerce-plugin.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 209 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin17,701 lines of code in 51 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript64351,68011,095
PHP381,4296573,125
CSS521192,763
SVG100685
PO File18833

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity8.58
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity2.52
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes13.85%
▷ Concrete classes2596.15%
▷ Final classes14.00%
Methods131
▷ Static methods3929.77%
▷ Public methods12998.47%
▷ Protected methods21.53%
▷ Private methods00.00%
Functions26
▷ Named functions2492.31%
▷ Anonymous functions27.69%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin