94% 2performant-link2

Code Review | 2Performant Link2 - Automatic affiliate links

WordPress plugin 2Performant Link2 - Automatic affiliate links scored 94% from 54 tests.

About plugin

  • Plugin page: 2performant-link2
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.9
  • WordPress version: 5.9.2
  • First release: Apr 5, 2019
  • Latest release: Feb 7, 2022
  • Number of updates: 9
  • Update frequency: every 115.5 days
  • Top authors: 2performant (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 2,073 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼302.63ms] Passed 4 tests

Server-side resources used by 2Performant Link2 - Automatic affiliate links
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.0654.57 ▲5.42
Dashboard /wp-admin3.45 ▲0.0433.79 ▲1.83
Posts /wp-admin/edit.php3.67 ▲0.0338.14 ▼18.71
Add New Post /wp-admin/post-new.php6.91 ▼0.0691.39 ▼1,194.52
Media Library /wp-admin/upload.php3.32 ▲0.0324.11 ▲0.90
2Performant Link2 /wp-admin/options-general.php?page=2performant-link23.3022.66

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for 2Performant Link2 - Automatic affiliate links
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,827 ▲8316.25 ▲0.625.56 ▼0.072.21 ▼0.33
Dashboard /wp-admin2,921 ▲636.15 ▼0.03116.38 ▼17.66154.43 ▼0.04
Posts /wp-admin/edit.php2,718 ▲303.25 ▲0.0168.23 ▲5.26135.22 ▼7.51
Add New Post /wp-admin/post-new.php1,690 ▲2918.43 ▲1.96395.11 ▼3.43151.31 ▼0.28
Media Library /wp-admin/upload.php1,733 ▲385.63 ▲0.11137.69 ▼11.67189.50 ▼8.11
2Performant Link2 /wp-admin/options-general.php?page=2performant-link21,1392.3855.82111.70

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 75% 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 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
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/2performant-link2/views/settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/2performant-link2/link2.php:19
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/2performant-link2/views/dashboard-notices.php:1

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


Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: link2, affiliate, script, affiliate marketing, tool...

2performant-link2/link2.php 92% from 13 tests

This is the main PHP file of "2Performant Link2 - Automatic affiliate links" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("2performant-link2.php" instead of "link2.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected154 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity16.00
▷ Minimum class complexity16.00
▷ Maximum class complexity16.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions00.00%
▷ Anonymous functions00.00%
▷ Global constants1100.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 are no PNG files in this plugin