84% wp-affiliate-link

Code Review | WP affiliate link

WordPress plugin WP affiliate link scored84%from 54 tests.

About plugin

  • Plugin page: wp-affiliate-link
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.0
  • WordPress version: 6.3.1
  • First release: Oct 26, 2014
  • Latest release: Oct 26, 2014
  • Number of updates: 2
  • Update frequency: every 18.0 days
  • Top authors: aijazsiddique (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,401 total downloads

Benchmarks

Plugin footprint 83% 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.07MB] [CPU: ▼2.97ms] Passed 4 tests

A check of server-side resources used by WP affiliate link
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0942.83 ▲5.69
Dashboard /wp-admin3.38 ▲0.0450.18 ▼12.17
Posts /wp-admin/edit.php3.48 ▲0.1356.05 ▲10.09
Add New Post /wp-admin/post-new.php5.97 ▲0.0886.45 ▼6.30
Media Library /wp-admin/upload.php3.31 ▲0.0838.05 ▲0.89
All affiliate link /wp-admin/edit.php?post_type=affiliate3.3340.48
Add New /wp-admin/post-new.php?post_type=affiliate3.3445.89

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by WP affiliate link
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲5414.28 ▼0.351.74 ▲0.2045.82 ▲4.39
Dashboard /wp-admin2,216 ▲365.56 ▼0.0487.41 ▼0.7139.64 ▼1.26
Posts /wp-admin/edit.php2,124 ▲212.02 ▲0.0739.21 ▲2.4339.65 ▲6.89
Add New Post /wp-admin/post-new.php1,549 ▲2123.16 ▼0.12642.19 ▼41.7568.98 ▲12.22
Media Library /wp-admin/upload.php1,427 ▲274.25 ▲0.0594.68 ▼2.3843.38 ▼1.61
All affiliate link /wp-admin/edit.php?post_type=affiliate1,0881.9631.8829.69
Add New /wp-admin/post-new.php?post_type=affiliate1,4852.4948.3260.09

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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 take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-affiliate-link/affiliate_link_cloaker.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-affiliate-link/includes/affi_functions.php:53

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (shortcode generator), #2 (shortcode on text editor), #3 (priview on front end)
You can look at the official readme.txt

wp-affiliate-link/affiliate_link_cloaker.php 92% from 13 tests

"WP affiliate link" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wp-affiliate-link.php" instead of "affiliate_link_cloaker.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected179 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24152136
CSS10043

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin