64% link-cloaker-for-affiliates

Code Review | Link Cloaker for Affiliates

WordPress plugin Link Cloaker for Affiliates scored64%from 54 tests.

About plugin

  • Plugin page: link-cloaker-for-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.1-3.8.1
  • WordPress version: 6.3.1
  • First release: Feb 26, 2014
  • Latest release: Feb 26, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: affiliatedefense (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,685 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.94MB] [CPU: ▼37.14ms] Passed 4 tests

This is a short check of server-side resources used by Link Cloaker for Affiliates
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0141.45 ▼8.09
Dashboard /wp-admin3.01 ▼0.3025.79 ▼32.32
Posts /wp-admin/edit.php3.01 ▼0.3525.13 ▼27.40
Add New Post /wp-admin/post-new.php3.01 ▼2.8822.67 ▼80.76
Media Library /wp-admin/upload.php3.01 ▼0.2331.05 ▼6.56

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 4 new files
Database: 1 new table, 7 new options
New tables
wp_affiliate_link_cloaker
New WordPress options
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
alc_db_version

Browser metrics Passed 4 tests

An overview of browser requirements for Link Cloaker for Affiliates
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3314.40 ▲0.161.73 ▼0.3651.36 ▲7.54
Dashboard /wp-admin2,207 ▲275.58 ▼0.0185.87 ▼7.8386.55 ▲50.03
Posts /wp-admin/edit.php2,115 ▲152.00 ▼0.0135.84 ▼2.4936.27 ▲1.65
Add New Post /wp-admin/post-new.php1,556 ▲2823.11 ▼0.03721.86 ▲81.7452.96 ▼15.32
Media Library /wp-admin/upload.php1,415 ▲154.19 ▼0.04114.27 ▼1.7584.82 ▲37.62

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_affiliate_link_cloaker
  • Zombie WordPress options were found after uninstall: 7 options
    • theysaidso_admin_options
    • alc_db_version
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
Almost there! Just fix the following items
  • 4× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/link-cloaker-for-affiliates/linkcloaker_import_admin.php on line 79
    • > PHP Notice
      Undefined index: add_link in wp-content/plugins/link-cloaker-for-affiliates/linkcloaker_import_admin.php on line 46
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/link-cloaker-for-affiliates/linkcloaker_import_admin.php:80
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/link-cloaker-for-affiliates/link-cloaker-for-affiliates.1.0.php:74

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)
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
9 plugin tags: short, shortener, link, links, cloaker...

link-cloaker-for-affiliates/link-cloaker-for-affiliates.1.0.php 92% from 13 tests

Analyzing the main PHP file in "Link Cloaker for Affiliates" version 1.0
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("link-cloaker-for-affiliates.php" instead of "link-cloaker-for-affiliates.1.0.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
Success! There were no dangerous files found in this plugin184 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP27326184

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.05MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/icon.png47.40KB0.51KB▼ 98.92%