69% get-affiliate-link

Code Review | Get Affiliate Link

WordPress plugin Get Affiliate Link scored 69% from 54 tests.

About plugin

  • Plugin page: get-affiliate-link
  • Plugin version: 1.5.13
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.1
  • WordPress version: 6.3.1
  • First release: Jan 10, 2018
  • Latest release: Jan 10, 2018
  • Number of updates: 3
  • Update frequency: every 5.7 days
  • Top authors: getaffiliatelink (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 718 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.99MB] [CPU: ▼45.53ms] Passed 4 tests

Analyzing server-side resources used by Get Affiliate Link
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.98 ▼0.4917.69 ▼33.94
Dashboard /wp-admin3.03 ▼0.2817.60 ▼38.48
Posts /wp-admin/edit.php3.03 ▼0.3323.33 ▼25.81
Add New Post /wp-admin/post-new.php3.03 ▼2.8621.39 ▼83.87
Media Library /wp-admin/upload.php3.03 ▼0.2018.93 ▼16.99

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 53 new files
Database: 1 new table, 7 new options
New tables
wp_get_affiliate_link
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
get_affiliate_link_version
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Get Affiliate Link
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲14516.88 ▲2.647.64 ▲5.1138.23 ▼9.75
Dashboard /wp-admin2,264 ▲737.39 ▲2.53125.97 ▲2.8440.38 ▼10.11
Posts /wp-admin/edit.php2,147 ▲584.31 ▲2.2554.40 ▲11.5438.00 ▲4.37
Add New Post /wp-admin/post-new.php1,722 ▲20322.95 ▼0.22614.73 ▼18.1024.91 ▼29.63
Media Library /wp-admin/upload.php1,449 ▲646.19 ▲2.03111.50 ▲8.1840.77 ▼5.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/get-affiliate-link/includes/lib/get-affiliate-link-path-checker.php+22
    Undefined index: page
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_get_affiliate_link
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • get_affiliate_link_version
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Congratulations! This plugin passed the SRP test

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
The official readme.txt is a good inspiration

get-affiliate-link/get-affiliate-link.php 92% from 13 tests

The primary PHP file in "Get Affiliate Link" version 1.5.13 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Requires at least: Required version must be the same as the one declared in readme.txt ("4.7" instead of "4.0")

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
No dangerous file extensions were detected9,096 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript201,31210,3067,180
PHP245851,1531,731
PO File1275171
Markdown125054
CSS2181939
HTML14021

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity15.22
▷ Minimum class complexity4.00
▷ Maximum class complexity63.00
Average method complexity2.38
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods93
▷ Static methods55.38%
▷ Public methods7479.57%
▷ Protected methods99.68%
▷ Private methods1010.75%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin