10% affiliates-for-woocommerce

Code Review | Affiliates for WooCommerce - Boost your Earnings with Affiliate Marketing Program

WordPress plugin Affiliates for WooCommerce - Boost your Earnings with Affiliate Marketing Program scored10%from 54 tests.

About plugin

  • Plugin page: affiliates-for-wo...
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Apr 28, 2023
  • Latest release: Nov 13, 2023
  • Number of updates: 8
  • Update frequency: every 24.9 days
  • Top authors: devdiggers (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /498 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin did not install without errors
    • > Error in wp-content/plugins/affiliates-for-woocommerce/includes/install.php+119
    Uncaught Error: Call to undefined function WC() in wp-content/plugins/affiliates-for-woocommerce/includes/install.php:119
    Stack trace:
    #0 wp-content/plugins/affiliates-for-woocommerce/includes/install.php(92): DDWCAF_Install::ddwcaf_add_pages()
    #1 wp-includes/class-wp-hook.php(310): DDWCAF_Install::ddwcaf_on_plugin_activation()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/includes/plugin.php(693): do_action()

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.79ms] Passed 4 tests

An overview of server-side resources used by Affiliates for WooCommerce - Boost your Earnings with Affiliate Marketing Program
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.15 ▼1.70
Dashboard /wp-admin3.31 ▲0.0044.41 ▼3.07
Posts /wp-admin/edit.php3.36 ▲0.0047.19 ▼3.62
Add New Post /wp-admin/post-new.php5.89 ▲0.0081.48 ▼14.75
Media Library /wp-admin/upload.php3.24 ▲0.0033.86 ▲1.70

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 87 new files
Database: 4 new tables, 6 new options
New tables
wp_ddwcaf_payouts
wp_ddwcaf_visits
wp_ddwcaf_commissionsmeta
wp_ddwcaf_commissions
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Affiliates for WooCommerce - Boost your Earnings with Affiliate Marketing Program
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,790 ▲2814.34 ▼0.031.62 ▼0.0841.75 ▼0.73
Dashboard /wp-admin2,198 ▲205.63 ▼0.0296.36 ▼15.7138.76 ▼5.18
Posts /wp-admin/edit.php2,100 ▼31.95 ▼0.0139.87 ▼3.8936.04 ▲1.12
Add New Post /wp-admin/post-new.php1,526 ▼523.33 ▲0.19716.18 ▲118.1673.20 ▲20.12
Media Library /wp-admin/upload.php1,400 ▲34.22 ▲0.0096.40 ▼3.3841.10 ▲0.51

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • The uninstall procedure failed, leaving 4 tables in the database
    • wp_ddwcaf_commissions
    • wp_ddwcaf_visits
    • wp_ddwcaf_commissionsmeta
    • wp_ddwcaf_payouts
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 28× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/affiliates-for-woocommerce/autoload/index.php
    • > /wp-content/plugins/affiliates-for-woocommerce/assets/css/index.php
    • > /wp-content/plugins/affiliates-for-woocommerce/templates/admin/configuration/index.php
    • > /wp-content/plugins/affiliates-for-woocommerce/helper/payout/index.php
    • > /wp-content/plugins/affiliates-for-woocommerce/templates/admin/visits/index.php
    • > /wp-content/plugins/affiliates-for-woocommerce/templates/shortcodes/index.php
    • > /wp-content/plugins/affiliates-for-woocommerce/includes/front/index.php
    • > /wp-content/plugins/affiliates-for-woocommerce/helper/visit/index.php
    • > /wp-content/plugins/affiliates-for-woocommerce/helper/error/index.php
    • > /wp-content/plugins/affiliates-for-woocommerce/templates/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
You can look at the official readme.txt

affiliates-for-woocommerce/functions.php 77% from 13 tests

The primary PHP file in "Affiliates for WooCommerce - Boost your Earnings with Affiliate Marketing Program" version 1.0.1 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 302 characters long)
  • Requires at least: Required version must be the same as the one declared in readme.txt ("5.8" instead of "5.0.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("affiliates-for-woocommerce.php" instead of "functions.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected6,404 lines of code in 53 files:
LanguageFilesBlank linesComment linesLines of code
PHP461,1701,9486,192
Markdown1320120
CSS40090
JavaScript2002

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity18.78
▷ Minimum class complexity1.00
▷ Maximum class complexity87.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces17
Interfaces0
Traits1
Classes31
▷ Abstract classes00.00%
▷ Concrete classes31100.00%
▷ Final classes13.23%
Methods227
▷ Static methods31.32%
▷ Public methods22599.12%
▷ Protected methods20.88%
▷ Private methods00.00%
Functions9
▷ Named functions333.33%
▷ Anonymous functions666.67%
Constants3
▷ Global constants3100.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 are no PNG files in this plugin