84% 2performant-link2

Code Review | 2Performant Link2 - Automatic affiliate links

WordPress plugin 2Performant Link2 - Automatic affiliate links scored84%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: 6.3.1
  • 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,713 total downloads

Benchmarks

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

Analyzing server-side resources used by 2Performant Link2 - Automatic affiliate links
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.85 ▼6.68
Dashboard /wp-admin3.34 ▲0.0345.53 ▼2.53
Posts /wp-admin/edit.php3.39 ▲0.0348.10 ▲0.39
Add New Post /wp-admin/post-new.php5.92 ▲0.0386.35 ▼7.30
Media Library /wp-admin/upload.php3.26 ▲0.0336.95 ▲5.86
2Performant Link2 /wp-admin/options-general.php?page=2performant-link23.2330.30

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

2Performant Link2 - Automatic affiliate links: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲8913.38 ▼1.261.56 ▼0.8241.48 ▼13.03
Dashboard /wp-admin2,230 ▲454.88 ▼0.98107.08 ▼11.4839.77 ▼4.01
Posts /wp-admin/edit.php2,112 ▲202.06 ▲0.0137.51 ▼0.2934.11 ▼2.04
Add New Post /wp-admin/post-new.php1,532 ▼617.81 ▼5.39657.91 ▼35.3256.23 ▲3.79
Media Library /wp-admin/upload.php1,415 ▲274.25 ▲0.0696.40 ▼3.9844.58 ▲0.95
2Performant Link2 /wp-admin/options-general.php?page=2performant-link28812.0423.4726.01

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > 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: Using $this when not in object context in wp-content/plugins/2performant-link2/views/dashboard-notices.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/2performant-link2/link2.php:19

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

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: link2, 2performant, tool, affiliate, affiliate marketing...

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

Analyzing the main PHP file in "2Performant Link2 - Automatic affiliate links" version 1.0.1
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be 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 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected154 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3288154

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
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
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There are no PNG files in this plugin