79% my-affiliate-link

Code Review | My Affiliate Link

WordPress plugin My Affiliate Link scored 79% from 54 tests.

About plugin

  • Plugin page: my-affiliate-link
  • Plugin version: 1.0.7
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4
  • WordPress version: 6.3.1
  • First release: Aug 13, 2019
  • Latest release: Jul 22, 2020
  • Number of updates: 13
  • Update frequency: every 26.9 days
  • Top authors: ludwigmedia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 902 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼8.02ms] Passed 4 tests

A check of server-side resources used by My Affiliate Link
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1140.68 ▼10.93
Dashboard /wp-admin3.41 ▲0.1045.69 ▼0.68
Posts /wp-admin/edit.php3.52 ▲0.1644.17 ▼12.96
Add New Post /wp-admin/post-new.php5.99 ▲0.1083.32 ▼7.49
Media Library /wp-admin/upload.php3.33 ▲0.1041.19 ▲6.19
My Affiliate Link /wp-admin/options-general.php?page=my-affiliate-link3.3031.84

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 10 new files
Database: no new tables, 15 new options
New WordPress options
my-affiliate-link-onclick
widget_recent-posts
theysaidso_admin_options
my-affiliate-link-amazontrackingid
widget_recent-comments
my-affiliate-link-nofollow
widget_theysaidso_widget
my-affiliate-link-siteurl
can_compress_scripts
my-affiliate-link-childsep
...

Browser metrics Passed 4 tests

A check of browser resources used by My Affiliate Link
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲3314.48 ▲0.291.79 ▼0.4247.77 ▲10.75
Dashboard /wp-admin2,207 ▲195.85 ▲0.84109.56 ▼0.7542.59 ▼5.15
Posts /wp-admin/edit.php2,093 ▲12.04 ▼0.0138.55 ▲2.0131.50 ▼1.11
Add New Post /wp-admin/post-new.php1,538 ▲1823.26 ▲0.10603.81 ▼69.2350.44 ▼8.90
Media Library /wp-admin/upload.php1,386 ▼24.19 ▼0.0198.37 ▼5.7740.92 ▼1.92
My Affiliate Link /wp-admin/options-general.php?page=my-affiliate-link9052.0325.3738.54

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • my-affiliate-link-amazontrackingid
    • widget_recent-comments
    • my-affiliate-link-siteurl
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • my-affiliate-link-cssclass
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/my-affiliate-link/my-affiliate-link.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/my-affiliate-link/includes/shortcodes/mal_affiliate_link.php:95
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/my-affiliate-link/admin/my_affiliate_action_links.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_option() in wp-content/plugins/my-affiliate-link/admin/class-my-affiliate-link-admin.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/my-affiliate-link/includes/shortcodes/mal_affiliate_button.php:100
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/my-affiliate-link/includes/shortcodes/mal_amazon_link.php:65

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
5 plugin tags: affiliate, link cloaking, link cloaker, affiliate link management, clickmeter

my-affiliate-link/my-affiliate-link.php Passed 13 tests

This is the main PHP file of "My Affiliate Link" version 1.0.7, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
89 characters long description:
Generate affiliate links for use with any link cloaking service or plugin via shortcodes.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin371 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP85681371

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG images were found in this plugin