10% affilinker

Code Review | Affiliate Link Plugin from BlashO

WordPress plugin Affiliate Link Plugin from BlashO scored10%from 54 tests.

About plugin

  • Plugin page: affilinker
  • Plugin version: 2.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9.1
  • WordPress version: 6.3.1
  • First release: Aug 11, 2012
  • Latest release: Jan 15, 2018
  • Number of updates: 37
  • Update frequency: every 53.7 days
  • Top authors: ven4online (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active /10,468 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/affilinker/affilinker.php+28
    Methods with the same name as their class will not be constructors in a future version of PHP; AffiLinkerWidget has a deprecated constructor

Server metrics [RAM: ▼1.35MB] [CPU: ▼50.07ms] Passed 4 tests

Server-side resources used by Affiliate Link Plugin from BlashO
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.64 ▼0.835.96 ▼29.66
Dashboard /wp-admin2.66 ▼0.657.53 ▼42.53
Posts /wp-admin/edit.php2.66 ▼0.707.00 ▼42.42
Add New Post /wp-admin/post-new.php2.66 ▼3.236.44 ▼85.66
Media Library /wp-admin/upload.php2.66 ▼0.576.22 ▼26.17
AffiLinker /wp-admin/admin.php?page=affilinker/affilinker.php2.667.52
General Settings /wp-admin/admin.php?page=affilinkergeneralsettings2.667.35
Pro-Features /wp-admin/admin.php?page=affilinkerActivate2.667.70
Track Links /wp-admin/admin.php?page=tracklinkspage2.668.22

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 98 new files
Database: 3 new tables, 33 new options
New tables
wp_affilinker_db
wp_affilinker_db_stat_uniq
wp_affilinker_db_stat
New WordPress options
affl_widget_no_keywords
theysaidso_admin_options
affl_link_term
affl_ignoreposts
affl_widget_interactive_opt
affl_num_of_wordcount
affl_num_count
affl_num_of_keywords_percomment
affl_num_enable
affl_num_samekey_perpost
...

Browser metrics Passed 4 tests

An overview of browser requirements for Affiliate Link Plugin from BlashO
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,845 ▲9913.23 ▼1.161.64 ▼0.0139.01 ▼1.15
Dashboard /wp-admin2,251 ▲594.92 ▼0.07108.47 ▲1.7739.96 ▼4.89
Posts /wp-admin/edit.php2,131 ▲422.09 ▲0.1135.59 ▼5.4134.87 ▼2.47
Add New Post /wp-admin/post-new.php1,547 ▲2823.22 ▼0.29589.66 ▼41.7954.82 ▼0.00
Media Library /wp-admin/upload.php1,430 ▲394.21 ▲0.0198.81 ▲0.9042.19 ▼1.06
AffiLinker /wp-admin/admin.php?page=affilinker/affilinker.php1,5882.0027.7439.98
General Settings /wp-admin/admin.php?page=affilinkergeneralsettings1,0802.0024.5435.89
Pro-Features /wp-admin/admin.php?page=affilinkerActivate9121.7426.8753.13
Track Links /wp-admin/admin.php?page=tracklinkspage8881.8725.2524.08

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/affilinker/affilinker.php+28
    Methods with the same name as their class will not be constructors in a future version of PHP; AffiLinkerWidget has a deprecated constructor
  • Zombie tables detected upon uninstall: 3 tables
    • wp_affilinker_db
    • wp_affilinker_db_stat
    • wp_affilinker_db_stat_uniq
  • Zombie WordPress options detected upon uninstall: 33 options
    • db_upgraded
    • widget_theysaidso_widget
    • affl_widget_no_keywords
    • affl_widget_type
    • affl_link_term
    • affl_num_samekey_oncommsec
    • widget_affilinkerwidget
    • affl_widget_interactive_opt
    • affl_onlyposts
    • affl_keyword_priority
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tracklinkspage
    • > Deprecated in wp-content/plugins/affilinker/affilinker.php+28
    Methods with the same name as their class will not be constructors in a future version of PHP; AffiLinkerWidget has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tracklinkspage
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in AffiLinkerWidget is deprecated since version 4.3.0! Use __construct() instead.
  • 44 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tracklinkspage
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tracklinkspage
    • > Notice in wp-content/plugins/affilinker/affilinker.php+663
    Undefined index: affl_user_rcpt_chkd_vld
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tracklinkspage
    • > Notice in wp-content/plugins/affilinker/affilinker.php+671
    Undefined index: vrr
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tracklinkspage
    • > Notice in wp-content/plugins/affilinker/affilinker.php+678
    Undefined index: aal_sent
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tracklinkspage
    • > Notice in wp-content/plugins/affilinker/affilinker.php+733
    Undefined index: affl_savegs_changes
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tracklinkspage
    • > Notice in wp-content/plugins/affilinker/affilinker.php+919
    Undefined index: SubmitAll
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tracklinkspage
    • > Notice in wp-content/plugins/affilinker/affilinker.php+932
    Undefined index: stats
    • > GET request to /wp-admin/admin.php?page=affilinker/affilinker.php
    • > Notice in wp-content/plugins/affilinker/affilinker.php+1539
    Undefined index: AffiLinker_Do
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tracklinkspage
    • > Notice in wp-content/plugins/affilinker/affilinker.php+1381
    Undefined index: hitcountsort

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
Almost there! Just fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affilinker/trunk/affilinker.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/affilinker/affilinker.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=tracklinkspage
    • > Javascript (severe) in unknown
    /wp-content/plugins/affilinker/js/hidenseek.js?ver=6.3.1 0:0 Uncaught SyntaxError: Unexpected token '
    • > GET request to /wp-admin/admin.php?page=affilinker/affilinker.php
    • > Console-api (warning) in wp-content/plugins/affilinker/jscolor.js?ver=6.3.1+203:18
    Error parsing jscolor options: ReferenceError: link_color is not defined:\n{valueElement:link_color}

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (create affiliate link), #2 (affiliate link interactive options), #3 (affiliate link other options), #4 (affiliate link edit color), #5 (edit affiliate link settings), #6 (affilinker general options), #7 (affilinker more general options), #8 (add new affiliate link)
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
Please take inspiration from this readme.txt

affilinker/affilinker.php 92% from 13 tests

The main PHP script in "Affiliate Link Plugin from BlashO" version 2.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 235 characters long)

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 detected7,753 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript71,1198175,135
PHP15001282,240
CSS210378

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity59.00
▷ Minimum class complexity59.00
▷ Maximum class complexity59.00
Average method complexity15.50
▷ Minimum method complexity1.00
▷ Maximum method complexity49.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
64 PNG files occupy 1.02MB with 0.29MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/colorpicker_rgb_b.png0.95KB0.76KB▼ 19.48%
images/colorpicker_submit.png0.96KB1.04KB0.00%
trunk/images/colorpicker_overlay.png10.11KB8.24KB▼ 18.50%
screenshot-7.png41.75KB24.34KB▼ 41.70%
trunk/screenshot-4.png135.02KB48.62KB▼ 63.99%