62% asin-smart-links

Code Review | ASIN Smart Links

WordPress plugin ASIN Smart Links scored62%from 54 tests.

About plugin

  • Plugin page: asin-smart-links
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: May 12, 2023
  • Latest release: Jun 19, 2023
  • Number of updates: 5
  • Update frequency: every 7.8 days
  • Top authors: joanrodas (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /294 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲2.86MB] [CPU: ▲23.18ms] Passed 4 tests

Analyzing server-side resources used by ASIN Smart Links
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /6.31 ▲2.8568.54 ▲29.91
Dashboard /wp-admin6.18 ▲2.8875.17 ▲26.97
Posts /wp-admin/edit.php6.23 ▲2.8769.41 ▲18.60
Add New Post /wp-admin/post-new.php8.80 ▲2.91113.29 ▲24.80
Media Library /wp-admin/upload.php6.08 ▲2.8558.11 ▲22.36

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 2,171 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-posts
plubo-routes-hash
widget_recent-comments
plubo-endpoints-hash
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for ASIN Smart Links
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,967 ▲20618.63 ▲4.281.79 ▼0.2143.13 ▲0.20
Dashboard /wp-admin2,374 ▲1948.93 ▲3.26204.99 ▲109.6142.45 ▲0.75
Posts /wp-admin/edit.php2,320 ▲2146.14 ▲4.1682.23 ▲40.4534.36 ▼4.29
Add New Post /wp-admin/post-new.php1,602 ▲7620.06 ▼3.64721.72 ▲64.8736.32 ▼9.03
Media Library /wp-admin/upload.php1,451 ▲546.68 ▲2.46111.33 ▲12.3141.57 ▼1.40
ASIN Smart Links /wp-admin/crb_carbon_fields_container_asin_smart_links.php260.420.0814.66

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 8 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • plubo-endpoints-hash
    • plubo-routes-hash
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/asin-smart-links/asin-smart-links.php
    • > /wp-content/plugins/asin-smart-links/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 397× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PluboRoutes\\Endpoint\\Endpoint' not found in wp-content/plugins/asin-smart-links/vendor/joanrodas/plubo-routes/PluboRoutes/Endpoint/PutEndpoint.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerInterface' not found in wp-content/plugins/asin-smart-links/vendor/illuminate/contracts/Container/Container.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Datastore\\Key_Value_Datastore' not found in wp-content/plugins/asin-smart-links/vendor/htmlburger/carbon-fields/core/Datastore/Widget_Datastore.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Field' not found in wp-content/plugins/asin-smart-links/vendor/htmlburger/carbon-fields/core/Field/Html_Field.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\Exceptions\\InvalidArgumentException' not found in wp-content/plugins/asin-smart-links/vendor/nesbot/carbon/src/Carbon/Exceptions/InvalidPeriodParameterException.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'Illuminate\\Contracts\\Support\\Htmlable' not found in wp-content/plugins/asin-smart-links/vendor/illuminate/view/ComponentSlot.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Extractor\\ExtractorInterface' not found in wp-content/plugins/asin-smart-links/vendor/symfony/translation/Extractor/ChainExtractor.php:21
    • > PHP Fatal error
      Uncaught ReflectionException: Class Symfony\\Component\\Translation\\Formatter\\MessageFormatterInterface does not exist in wp-content/plugins/asin-smart-links/vendor/nesbot/carbon/src/Carbon/MessageFormatter/MessageFormatterMapper.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/asin-smart-links/vendor/symfony/translation-contracts/Test/TranslatorTest.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\Translation\\Loader\\FileLoader' not found in wp-content/plugins/asin-smart-links/vendor/symfony/translation/Loader/CsvFileLoader.php:21

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please take a look at the following user-side issues
    • > GET request to /wp-admin/crb_carbon_fields_container_asin_smart_links.php
    • > Network (severe)
    wp-admin/crb_carbon_fields_container_asin_smart_links.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration Passed 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
5 plugin tags: international link, asin, affiliate, isbn, amazon

asin-smart-links/asin-smart-links.php Passed 13 tests

The main PHP script in "ASIN Smart Links" version 1.0.1 is automatically included on every request by WordPress
86 characters long description:
Generate Amazon universal links to redirect users to the Amazon site of their country.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
These items require your attention
  • For security reasons, never distribute binary or executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/asin-smart-links/vendor/nesbot/carbon/bin/carbon.bat
98,804 lines of code in 1,899 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,57415,27052,04569,121
JavaScript1727,05410,87915,947
JSON29002,977
XSD392482,803
PO File288981,1112,411
CSS82401,1572,222
Sass5036631,872
Markdown2952611,307
reStructuredText1747874
Blade13031
TypeScript12122
YAML21113
DOS Batch1004

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
Please fix the following
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity8.70
▷ Minimum class complexity1.00
▷ Maximum class complexity323.00
Average method complexity2.22
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces122
Interfaces155
Traits63
Classes491
▷ Abstract classes377.54%
▷ Concrete classes45492.46%
▷ Final classes5011.01%
Methods5,222
▷ Static methods78915.11%
▷ Public methods4,35083.30%
▷ Protected methods70413.48%
▷ Private methods1683.22%
Functions775
▷ Named functions16220.90%
▷ Anonymous functions61379.10%
Constants251
▷ Global constants176.77%
▷ Class constants23493.23%
▷ Public constants22997.86%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected