78% affiliate-coupons

Code Review | Affiliate Coupons - The #1 WordPress Coupon Plugin for Affiliate Marketers

WordPress plugin Affiliate Coupons - The #1 WordPress Coupon Plugin for Affiliate Marketers scored78%from 54 tests.

About plugin

  • Plugin page: affiliate-coupons
  • Plugin version: 1.6.8
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Jul 30, 2016
  • Latest release: Aug 14, 2023
  • Number of updates: 49
  • Update frequency: every 52.5 days
  • Top authors: flowdee (71.43%)deetronix (26.53%)bentzibentz (6.12%)

Code review

54 tests

User reviews

32 reviews

Install metrics

2,000+ active /78,199 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: ▲1.49MB] [CPU: ▲7.74ms] Passed 4 tests

An overview of server-side resources used by Affiliate Coupons - The #1 WordPress Coupon Plugin for Affiliate Marketers
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.73 ▲1.2752.63 ▲12.29
Dashboard /wp-admin4.87 ▲1.5769.90 ▲16.25
Posts /wp-admin/edit.php4.92 ▲1.5664.21 ▲6.94
Add New Post /wp-admin/post-new.php7.62 ▲1.73103.14 ▼4.51
Media Library /wp-admin/upload.php4.79 ▲1.5658.55 ▲22.37
Categories /wp-admin/edit-tags.php?taxonomy=affcoups_coupon_category&post_type=affcoups_coupon4.7950.80
Settings /wp-admin/edit.php?post_type=affcoups_coupon&page=affcoups_settings4.7653.74
Dashboard /wp-admin/plugins.php?page=meta-box4.8845.70
Types /wp-admin/edit-tags.php?taxonomy=affcoups_coupon_type&post_type=affcoups_coupon4.7952.33
Add Coupon /wp-admin/post-new.php?post_type=affcoups_coupon7.73110.09
All Coupons /wp-admin/edit.php?post_type=affcoups_coupon4.8659.42
Vendors /wp-admin/edit.php?post_type=affcoups_vendor4.8652.84

Server storage [IO: ▲1.95MB] [DB: ▲0.05MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 602 new files
Database: no new tables, 9 new options
New WordPress options
widget_affcoups_single_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
affcoups_version
widget_affcoups_multiple_widget
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Affiliate Coupons - The #1 WordPress Coupon Plugin for Affiliate Marketers
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,968 ▲18213.82 ▼0.9410.62 ▲8.7738.97 ▲0.35
Dashboard /wp-admin2,257 ▲805.74 ▲0.0686.90 ▼3.1979.05 ▲38.73
Posts /wp-admin/edit.php2,145 ▲421.97 ▼0.0135.28 ▼5.9536.67 ▼0.92
Add New Post /wp-admin/post-new.php1,592 ▲6421.02 ▼1.92681.24 ▲45.65147.35 ▲96.55
Media Library /wp-admin/upload.php1,457 ▲574.07 ▼0.14104.36 ▲6.5175.78 ▲33.50
Categories /wp-admin/edit-tags.php?taxonomy=affcoups_coupon_category&post_type=affcoups_coupon1,4182.3140.3046.05
Settings /wp-admin/edit.php?post_type=affcoups_coupon&page=affcoups_settings2,9793.2675.4450.64
Dashboard /wp-admin/plugins.php?page=meta-box1,3222.1728.6446.20
Types /wp-admin/edit-tags.php?taxonomy=affcoups_coupon_type&post_type=affcoups_coupon1,4242.2630.6440.48
Add Coupon /wp-admin/post-new.php?post_type=affcoups_coupon6,56226.70873.54168.16
All Coupons /wp-admin/edit.php?post_type=affcoups_coupon1,2892.4239.4235.46
Vendors /wp-admin/edit.php?post_type=affcoups_vendor1,2232.4036.0838.41

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_recent-posts
    • affcoups_version
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_affcoups_multiple_widget
    • can_compress_scripts
    • widget_affcoups_single_widget
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for 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
Please fix the following items
  • 10× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/affiliate-coupons/includes/vendor/meta-box/inc/templates/upload.php
    • > /wp-content/plugins/affiliate-coupons/includes/vendor/meta-box/inc/templates/image-advanced.php
    • > /wp-content/plugins/affiliate-coupons/vendor/wpmetabox/meta-box/inc/templates/media.php
    • > /wp-content/plugins/affiliate-coupons/includes/vendor/meta-box/inc/templates/media.php
    • > /wp-content/plugins/affiliate-coupons/vendor/wpmetabox/meta-box/inc/templates/image-advanced.php
    • > /wp-content/plugins/affiliate-coupons/vendor/wpmetabox/meta-box/inc/templates/video.php
    • > /wp-content/plugins/affiliate-coupons/includes/vendor/meta-box/inc/templates/audio.php
    • > /wp-content/plugins/affiliate-coupons/includes/vendor/meta-box/inc/templates/video.php
    • > /wp-content/plugins/affiliate-coupons/vendor/wpmetabox/meta-box/inc/templates/audio.php
    • > /wp-content/plugins/affiliate-coupons/vendor/wpmetabox/meta-box/inc/templates/upload.php
  • 134× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/affiliate-coupons/includes/vendor/meta-box/inc/functions.php:333
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Object_Choice_Field' not found in wp-content/plugins/affiliate-coupons/includes/vendor/meta-box/inc/fields/sidebar.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Choice_Field' not found in wp-content/plugins/affiliate-coupons/includes/vendor/meta-box/inc/fields/object-choice.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Choice_Field' not found in wp-content/plugins/affiliate-coupons/vendor/wpmetabox/meta-box/inc/fields/select.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Text_Field' not found in wp-content/plugins/affiliate-coupons/includes/vendor/meta-box/inc/fields/fieldset-text.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Field' not found in wp-content/plugins/affiliate-coupons/vendor/wpmetabox/meta-box/inc/fields/heading.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Datetime_Field' not found in wp-content/plugins/affiliate-coupons/includes/vendor/meta-box/inc/fields/date.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Select_Field' not found in wp-content/plugins/affiliate-coupons/vendor/wpmetabox/meta-box/inc/fields/select-advanced.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'RWMB_Storage_Interface' not found in wp-content/plugins/affiliate-coupons/includes/vendor/meta-box/inc/storages/base.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'RWMB_Input_Field' not found in wp-content/plugins/affiliate-coupons/includes/vendor/meta-box/inc/fields/number.php:11

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 issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Donate link: Invalid URI found ("")
You can take inspiration from this readme.txt

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

The main PHP script in "Affiliate Coupons - The #1 WordPress Coupon Plugin for Affiliate Marketers" version 1.6.8 is automatically included on every request by WordPress
78 characters long description:
The best WordPress coupon plugin which helps you to earn more affiliate money!

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
Success! There were no dangerous files found in this plugin24,982 lines of code in 463 files:
LanguageFilesBlank linesComment linesLines of code
PHP2403,4688,96015,777
JavaScript1229959034,207
CSS672452453,809
LESS173311081,099
JSON20065
SVG150025

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity9.28
▷ Minimum class complexity1.00
▷ Maximum class complexity93.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces4
Interfaces2
Traits0
Classes175
▷ Abstract classes126.86%
▷ Concrete classes16393.14%
▷ Final classes10.61%
Methods982
▷ Static methods59961.00%
▷ Public methods86688.19%
▷ Protected methods626.31%
▷ Private methods545.50%
Functions142
▷ Named functions12990.85%
▷ Anonymous functions139.15%
Constants23
▷ Global constants23100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
35 compressed PNG files occupy 0.09MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/vendor/meta-box/img/jqueryui/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
assets/img/site-logo-reversed.png11.73KB6.06KB▼ 48.31%
includes/vendor/meta-box/inc/about/images/online-generator.png12.95KB13.04KB0.00%
includes/vendor/meta-box/img/jqueryui/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
vendor/wpmetabox/meta-box/img/jqueryui/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%