10% easy-affiliate-cloaker

Code Review | Easy Affiliate Cloaker

WordPress plugin Easy Affiliate Cloaker scored10%from 54 tests.

About plugin

  • Plugin page: easy-affiliate-cl...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7
  • WordPress version: 6.3.1
  • First release: Feb 23, 2017
  • Latest release: Mar 13, 2017
  • Number of updates: 15
  • Update frequency: every 1.1 days
  • Top authors: angelocala94 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,323 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • Install procedure had errors
    • > Compile error in wp-content/plugins/easy-affiliate-cloaker/vendor/vierbergenlars/php-semver/src/vierbergenlars/SemVer/internal.php+7
    Cannot use vierbergenlars\LibJs\Object as Object because 'Object' is a special class name

Server metrics [RAM: ▲0.00MB] [CPU: ▼10.09ms] Passed 4 tests

Analyzing server-side resources used by Easy Affiliate Cloaker
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0041.64 ▼0.96
Dashboard /wp-admin3.31 ▲0.0044.48 ▼4.27
Posts /wp-admin/edit.php3.36 ▲0.0043.06 ▼7.51
Add New Post /wp-admin/post-new.php5.89 ▲0.0086.84 ▼18.59
Media Library /wp-admin/upload.php3.23 ▲0.0032.87 ▼9.97

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 2,487 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Easy Affiliate Cloaker
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.58 ▼0.864.69 ▲2.9443.77 ▲4.53
Dashboard /wp-admin2,206 ▲184.84 ▼1.05105.61 ▼6.1640.67 ▼1.94
Posts /wp-admin/edit.php2,071 ▼182.03 ▲0.0634.22 ▼7.2332.30 ▼5.33
Add New Post /wp-admin/post-new.php1,533 ▲1122.96 ▼0.29603.45 ▼66.1763.00 ▲14.42
Media Library /wp-admin/upload.php1,388 ▲34.18 ▲0.0297.29 ▼17.9544.66 ▼3.34

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% 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 0% 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
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/easy-affiliate-cloaker/vendor/doctrine/dbal/bin/doctrine-dbal.php
    • > /wp-content/plugins/easy-affiliate-cloaker/vendor/mobiledetect/mobiledetectlib/export/exportToJSON.php
  • 1249× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\HttpFoundation\\Response' not found in wp-content/plugins/easy-affiliate-cloaker/vendor/symfony/http-foundation/RedirectResponse.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Finder\\Iterator\\FilterIterator' not found in wp-content/plugins/easy-affiliate-cloaker/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/easy-affiliate-cloaker/vendor/symfony/translation/Tests/IdentityTranslatorTest.php:17
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/easy-affiliate-cloaker/vendor/getherbert/framework/bootstrap/autoload.php on line 20
    • > PHP Fatal error
      Uncaught Error: Interface 'Herbert\\Framework\\Plugin' not found in wp-content/plugins/easy-affiliate-cloaker/vendor/getherbert/framework/Herbert/Framework/Base/Plugin.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\DBAL\\Types\\StringType' not found in wp-content/plugins/easy-affiliate-cloaker/vendor/doctrine/dbal/lib/Doctrine/DBAL/Types/GuidType.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_TokenParser_Include' not found in wp-content/plugins/easy-affiliate-cloaker/vendor/twig/twig/lib/Twig/TokenParser/Embed.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'vierbergenlars\\LibJs\\Object' not found in wp-content/plugins/easy-affiliate-cloaker/vendor/vierbergenlars/php-semver/src/vierbergenlars/LibJs/JString.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'Twig_TokenParserInterface' not found in wp-content/plugins/easy-affiliate-cloaker/vendor/twig/twig/lib/Twig/TokenParser.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Twig_Node_Expression_Call' not found in wp-content/plugins/easy-affiliate-cloaker/vendor/twig/twig/lib/Twig/Node/Expression/Test.php:11

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

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 19 tag instead of maximum 10
  • Contributors: Plugin contributors field is missing
You can look at the official readme.txt

easy-affiliate-cloaker/plugin.php 85% from 13 tests

The principal PHP file in "Easy Affiliate Cloaker" v. 1.0.4 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("easy-affiliate-cloaker.php" instead of "plugin.php")
  • Git Repository: Please remove the Git repository from this plugin

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin161,319 lines of code in 2,071 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,79032,98884,654141,565
Markdown511,99605,935
reStructuredText973,1843,0884,414
JSON41003,374
XSD392482,803
C22241921,082
XML308378682
Twig12160459
make4475202
YAML13463194
PO File76256186
JavaScript11860163
Ant113097
C/C++ Header2192155
m42131246
Python1182228
HTML110017
Qt Linguist10010
INI2107

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity7.87
▷ Minimum class complexity1.00
▷ Maximum class complexity200.00
Average method complexity1.98
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces267
Interfaces217
Traits11
Classes1,545
▷ Abstract classes895.76%
▷ Concrete classes1,45694.24%
▷ Final classes281.92%
Methods13,130
▷ Static methods7996.09%
▷ Public methods11,02283.95%
▷ Protected methods1,57812.02%
▷ Private methods5304.04%
Functions1,082
▷ Named functions27425.32%
▷ Anonymous functions80874.68%
Constants571
▷ Global constants579.98%
▷ Class constants51490.02%
▷ Public constants514100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.24MB with 0.08MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/guzzlehttp/guzzle/docs/_static/guzzle-icon.png0.78KB0.94KB0.00%
vendor/guzzlehttp/guzzle/docs/_static/logo.png241.87KB69.68KB▼ 71.19%