67% affiliate-toolkit-starter

Code Review | affiliate-toolkit – WordPress Affiliate Plugin

WordPress plugin affiliate-toolkit – WordPress Affiliate Plugin scored67%from 54 tests.

About plugin

  • Plugin page: affiliate-toolkit...
  • Plugin version: 3.4.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-6.4
  • WordPress version: 6.3.1
  • First release: Sep 25, 2016
  • Latest release: Nov 17, 2023
  • Number of updates: 135
  • Update frequency: every 19.3 days
  • Top authors: cservit (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

2,000+ active /55,379 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.39MB] [CPU: ▲24.57ms] Passed 4 tests

An overview of server-side resources used by affiliate-toolkit – WordPress Affiliate Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.83 ▲0.3759.77 ▲23.35
Dashboard /wp-admin3.73 ▲0.4376.34 ▲27.08
Posts /wp-admin/edit.php3.76 ▲0.4070.35 ▲18.82
Add New Post /wp-admin/post-new.php6.28 ▲0.39127.86 ▲42.23
Media Library /wp-admin/upload.php3.61 ▲0.3862.25 ▲29.04
Product import /wp-admin/admin.php?page=atkp_bulkimport3.5958.32
Templates /wp-admin/admin.php?page=ATKP_viewtemplate3.6159.10
Shortcode Generator /wp-admin/admin.php?page=ATKP_affiliate_toolkit-shortcodegenerator3.5960.89
Tools /wp-admin/admin.php?page=ATKP_affiliate_toolkit-tools3.5957.35
Shops /wp-admin/edit.php?post_type=atkp_shop3.7567.25
Queues /wp-admin/admin.php?page=ATKP_viewqueue3.77105.65
Lists /wp-admin/edit.php?post_type=atkp_list3.6761.47
Settings /wp-admin/admin.php?page=ATKP_affiliate_toolkit-plugin3.6062.83
Products /wp-admin/edit.php?post_type=atkp_product3.7566.60
Product category /wp-admin/edit-tags.php?taxonomy=productcategory3.6258.76

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 1,255 new files
Database: 2 new tables, 9 new options
New tables
wp_atkp_queues_entries
wp_atkp_queues
New WordPress options
db_upgraded
atkp_version_plugin
widget_atkp_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
ATKP_version_posts_queues
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for affiliate-toolkit – WordPress Affiliate Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,509 ▲1,72213.82 ▼0.465.66 ▲3.8541.53 ▼0.92
Dashboard /wp-admin3,810 ▲1,6305.18 ▼0.49108.25 ▲14.0181.63 ▲36.98
Posts /wp-admin/edit.php3,742 ▲1,6392.49 ▲0.5441.44 ▼1.8032.61 ▼3.78
Add New Post /wp-admin/post-new.php7,948 ▲6,42219.01 ▼4.23967.40 ▲277.6575.84 ▲16.35
Media Library /wp-admin/upload.php3,014 ▲1,6144.75 ▲0.57102.57 ▲4.0780.27 ▲39.15
Product import /wp-admin/admin.php?page=atkp_bulkimport2,6622.4348.8730.26
Templates /wp-admin/admin.php?page=ATKP_viewtemplate2,6262.1634.1628.09
Shortcode Generator /wp-admin/admin.php?page=ATKP_affiliate_toolkit-shortcodegenerator5,5232.1946.8133.12
Tools /wp-admin/admin.php?page=ATKP_affiliate_toolkit-tools2,5202.3535.1925.92
Shops /wp-admin/edit.php?post_type=atkp_shop2,8713.3254.4166.59
Queues /wp-admin/admin.php?page=ATKP_viewqueue2,6592.1934.0928.39
Lists /wp-admin/edit.php?post_type=atkp_list2,7352.4139.6930.84
Settings /wp-admin/admin.php?page=ATKP_affiliate_toolkit-plugin2,9192.3937.8531.05
Products /wp-admin/edit.php?post_type=atkp_product2,9303.4352.8783.21
Product category /wp-admin/edit-tags.php?taxonomy=productcategory2,8972.2532.3830.50

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie tables detected upon uninstall: 2 tables
    • wp_atkp_queues_entries
    • wp_atkp_queues
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • atkp_version_plugin
    • can_compress_scripts
    • widget_recent-posts
    • ATKP_version_posts_queues
    • widget_atkp_widget
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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
Almost there! Just fix the following items
  • 43× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/affiliate-toolkit-starter/includes/helper/atkp_url_scraper.php
    • > /wp-content/plugins/affiliate-toolkit-starter/templates/datasheet.blade.php
    • > /wp-content/plugins/affiliate-toolkit-starter/affiliate-toolkit-cron.php
    • > /wp-content/plugins/affiliate-toolkit-starter/templates/blade/detailoffers.blade.php
    • > /wp-content/plugins/affiliate-toolkit-starter/templates/bestseller.blade.php
    • > /wp-content/plugins/affiliate-toolkit-starter/templates/blade/variationboxes.blade.php
    • > /wp-content/plugins/affiliate-toolkit-starter/templates/blade/grid_3_columns.blade.php
    • > /wp-content/plugins/affiliate-toolkit-starter/templates/blade/notavailable.blade.php
    • > /wp-content/plugins/affiliate-toolkit-starter/templates/blade/image_gallery.blade.php
    • > /wp-content/plugins/affiliate-toolkit-starter/templates/blade/grid_2_columns.blade.php
  • 401× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/affiliate-toolkit-starter/lib/vendor/drunomics/paapi5-php-sdk/vendor/guzzlehttp/psr7/src/CachingStream.php:10
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/affiliate-toolkit-starter/includes/pages/atkp_template_table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/affiliate-toolkit-starter/child-plugins/affiliate-toolkit-amazon/lib/vendor/drunomics/paapi5-php-sdk/src/com/amazon/paapi5/v1/ManufactureInfo.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/affiliate-toolkit-starter/lib/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/affiliate-toolkit-starter/child-plugins/affiliate-toolkit-amazon/lib/vendor/drunomics/paapi5-php-sdk/src/com/amazon/paapi5/v1/OfferDeliveryInfo.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/affiliate-toolkit-starter/child-plugins/affiliate-toolkit-amazon/lib/vendor/guzzlehttp/promises/src/Coroutine.php:45
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/affiliate-toolkit-starter/lib/vendor/guzzlehttp/promises/src/EachPromise.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/affiliate-toolkit-starter/child-plugins/affiliate-toolkit-amazon/lib/vendor/guzzlehttp/psr7/src/NoSeekStream.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/affiliate-toolkit-starter/lib/vendor/guzzlehttp/psr7/src/DroppingStream.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/affiliate-toolkit-starter/child-plugins/affiliate-toolkit-amazon/lib/vendor/drunomics/paapi5-php-sdk/src/com/amazon/paapi5/v1/SingleStringValuedAttribute.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add descriptions for these screenshots #3, #4 in affiliate-toolkit-starter/assets to your readme.txt
  • Tags: Please delete some tags, you are using 17 tag instead of maximum 10
You can take inspiration from this readme.txt

affiliate-toolkit-starter/affiliate-toolkit.php 92% from 13 tests

The main PHP script in "affiliate-toolkit – WordPress Affiliate Plugin" version 3.4.3 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("affiliate-toolkit-starter.php" instead of "affiliate-toolkit.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected182,537 lines of code in 1,037 files:
LanguageFilesBlank linesComment linesLines of code
PHP76430,90360,682111,878
JavaScript695,0872,74029,414
CSS292,37422911,072
Markdown302,77008,797
PO File12,1545,3424,214
SVG14483,870
Sass14721343,164
LESS14721443,154
HTML19358573,140
JSON28002,003
Blade3711431,497
YAML11433215
XML42078
make211031
Dockerfile18010

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 118)
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity19.36
▷ Minimum class complexity1.00
▷ Maximum class complexity666.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity118.00
Code structure
Namespaces34
Interfaces60
Traits14
Classes645
▷ Abstract classes111.71%
▷ Concrete classes63498.29%
▷ Final classes497.73%
Methods8,684
▷ Static methods1,34215.45%
▷ Public methods7,89990.96%
▷ Protected methods2342.69%
▷ Private methods5516.35%
Functions835
▷ Named functions24729.58%
▷ Anonymous functions58870.42%
Constants1,081
▷ Global constants29527.29%
▷ Class constants78672.71%
▷ Public constants786100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
38 PNG files occupy 0.17MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/vendor/imelgrat/barcode-validator/docs/images/mstile-150x150.png10.14KB4.14KB▼ 59.14%
lib/vendor/imelgrat/barcode-validator/docs/images/iviewer/iviewer.zoom_fit.png1.22KB0.30KB▼ 75.72%
images/logo_servit-biz.png6.01KB2.66KB▼ 55.73%
lib/vendor/imelgrat/barcode-validator/docs/images/favicon-16x16.png1.46KB0.92KB▼ 37.41%
lib/vendor/imelgrat/barcode-validator/docs/images/apple-touch-icon-114x114.png10.01KB4.01KB▼ 59.90%