78% affiliate-coupon-codes-for-woocommerce

Code Review | Affiliate Coupons for Woocommerce

WordPress plugin Affiliate Coupons for Woocommerce scored78%from 54 tests.

About plugin

  • Plugin page: affiliate-coupon-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8
  • WordPress version: 6.3.1
  • First release: Jan 4, 2022
  • Latest release: Jan 4, 2022
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: pheromonetreasures (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /288 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼2.89ms] Passed 4 tests

A check of server-side resources used by Affiliate Coupons for Woocommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.74 ▼3.33
Dashboard /wp-admin3.32 ▲0.0147.62 ▲0.50
Posts /wp-admin/edit.php3.37 ▲0.0142.51 ▼6.73
Add New Post /wp-admin/post-new.php5.90 ▲0.0285.21 ▼1.98
Media Library /wp-admin/upload.php3.24 ▲0.0137.26 ▲2.32
Commissions /wp-admin/admin.php?page=affiliate-coupons-commissions3.1831.18
Affiliates /wp-admin/admin.php?page=affiliate-coupons-affiliates3.2132.68
Affiliate Coupons /wp-admin/admin.php?page=affiliate-coupons-admin-menu3.2130.62

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Affiliate Coupons for Woocommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲9213.22 ▼1.591.77 ▲0.0742.78 ▼7.46
Dashboard /wp-admin2,233 ▲425.84 ▼0.21104.31 ▼2.8939.95 ▼6.78
Posts /wp-admin/edit.php2,113 ▲242.06 ▲0.0836.34 ▼5.1533.00 ▼1.94
Add New Post /wp-admin/post-new.php1,559 ▲1723.10 ▲4.75672.90 ▲42.3151.21 ▼1.58
Media Library /wp-admin/upload.php1,415 ▲304.18 ▲0.0296.89 ▼1.4340.86 ▲0.18
Commissions /wp-admin/admin.php?page=affiliate-coupons-commissions7061.146.4921.26
Affiliates /wp-admin/admin.php?page=affiliate-coupons-affiliates9002.0323.3926.18
Affiliate Coupons /wp-admin/admin.php?page=affiliate-coupons-admin-menu8492.1826.5827.47

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=affiliate-coupons-commissions
    • > Error in wp-content/plugins/affiliate-coupon-codes-for-woocommerce/affiliate-coupons-woo-loda.php+405
    Uncaught Error: Call to undefined function wc_get_orders() in wp-content/plugins/affiliate-coupon-codes-for-woocommerce/affiliate-coupons-woo-loda.php:405
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): loda_affiliate_coupons_commissions()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown

SRP 50% 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
Please take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affiliate-coupon-codes-for-woocommerce/affiliate-coupons-woo-loda.php:43

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: affiliate coupons woocommerce, affiliate, affiliate coupons

affiliate-coupon-codes-for-woocommerce/affiliate-coupons-woo-loda.php 92% from 13 tests

"Affiliate Coupons for Woocommerce" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("affiliate-coupon-codes-for-woocommerce.php" instead of "affiliate-coupons-woo-loda.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected374 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP110033374

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG files were detected