47% amazon-auto-links

Code Review | Auto Amazon Links - Amazon Associates Affiliate Plugin

WordPress plugin Auto Amazon Links - Amazon Associates Affiliate Plugin scored 47% from 54 tests.

About plugin

  • Plugin page: amazon-auto-links
  • Plugin version: 5.3.4
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-6.2.0
  • WordPress version: 6.3.1
  • First release: Sep 10, 2012
  • Latest release: Sep 29, 2023
  • Number of updates: 934
  • Update frequency: every 4.3 days
  • Top authors: miunosoft (100%)

Code review

54 tests

User reviews

77 reviews

Install metrics

10,000+ active / 960,923 total downloads

Benchmarks

Plugin footprint 29% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲11.74MB] [CPU: ▲43.22ms] 50% from 4 tests

An overview of server-side resources used by Auto Amazon Links - Amazon Associates Affiliate Plugin
Please take the time to fix the following items
  • RAM: Total memory usage should be kept under 10MB (currently 16.46MB on /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_add_contextual_unit)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 11.74MB on /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_add_contextual_unit)
PageMemory (MB)CPU Time (ms)
Home /12.08 ▲8.6277.33 ▲37.78
Dashboard /wp-admin16.08 ▲12.7898.50 ▲49.27
Posts /wp-admin/edit.php16.15 ▲12.80106.19 ▲59.88
Add New Post /wp-admin/post-new.php18.74 ▲12.86132.91 ▲29.21
Media Library /wp-admin/upload.php16.01 ▲12.7889.93 ▲56.62
Reports /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_reports21.09113.01
Help /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_help20.68134.69
Add Unit by URL /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_add_url_unit16.4679.25
Add Unit by PA-API /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_add_paapi_unit16.3973.87
Manage Units /wp-admin/edit.php?post_type=amazon_auto_links17.9792.86
Add Unit by Category /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_add_category_unit20.75109.67
Add Unit by Search /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_search_unit16.4676.76
Manage Auto-insert /wp-admin/edit.php?post_type=aal_auto_insert17.9291.40
Manage Buttons /wp-admin/edit.php?post_type=aal_button18.11100.56
Add Contextual Unit /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_add_contextual_unit16.4678.18

Server storage [IO: ▲9.84MB] [DB: ▲0.04MB] Passed 3 tests

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 1,515 new files
Database: 3 new tables, 14 new options
New tables
wp_aal_tasks
wp_aal_products
wp_aal_request_cache
New WordPress options
aal_request_cache_version
widget_amazonautolinks_contextualproductwidget
amazon_auto_links_button_css
aal_products_version
amazon_auto_links_active_auto_inserts
widget_theysaidso_widget
widget_amazonautolinks_widgetbyid
widget_recent-posts
can_compress_scripts
db_upgraded
...

Browser metrics Passed 4 tests

Auto Amazon Links - Amazon Associates Affiliate Plugin: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,020 ▲28513.83 ▼0.577.48 ▲5.7340.80 ▼8.08
Dashboard /wp-admin2,270 ▲825.86 ▲0.92108.45 ▲4.3388.53 ▲47.18
Posts /wp-admin/edit.php2,174 ▲882.03 ▲0.0538.61 ▲2.7635.02 ▲3.26
Add New Post /wp-admin/post-new.php1,714 ▲18123.01 ▼0.15683.65 ▲23.3139.90 ▼23.14
Media Library /wp-admin/upload.php1,461 ▲704.22 ▲0.0194.48 ▼4.7069.23 ▲22.96
Reports /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_reports1,6754.60100.5599.59
Help /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_help3,61712.06284.55154.96
Add Unit by URL /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_add_url_unit7,7753.31111.12158.35
Add Unit by PA-API /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_add_paapi_unit8,1313.33106.5696.97
Manage Units /wp-admin/edit.php?post_type=amazon_auto_links1,2322.3637.8334.78
Add Unit by Category /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_add_category_unit1,7803.1247.5866.61
Add Unit by Search /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_search_unit7,7752.96108.14127.28
Manage Auto-insert /wp-admin/edit.php?post_type=aal_auto_insert1,1652.4235.8828.58
Manage Buttons /wp-admin/edit.php?post_type=aal_button3,4127.7396.2665.39
Add Contextual Unit /wp-admin/edit.php?post_type=amazon_auto_links&page=aal_add_contextual_unit8,1273.2990.71101.57

Uninstaller [IO: ▲9.84MB] [DB: ▲0.04MB] 0% from 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Compile error in wp-content/plugins/amazon-auto-links/amazon-auto-links.php+20
    Cannot declare class AmazonAutoLinks_Registry_Base, because the name is already in use
  • Incomplete uninstall procedure, leaving 1,515 files (9.84MB) in the plugin directory
    • (new file) asset/css/aal_help.css
    • (new file) asset/css/aal_add_search_unit.min.css
    • (new file) amazon-auto-links.php
    • (new file) asset/css/aal_add_category_unit.css
    • (new file) asset/css/aal_define_auto_insert.min.css
    • (new file) asset/css/aal_define_auto_insert.css
    • (new file) asset/css/aal_settings.css
    • (new file) asset/css/aal_add_category_unit.min.css
    • (new file) asset/css/aal_help.min.css
    • (new file) asset/css/aal_add_search_unit.css
    • ...
  • Zombie tables detected upon uninstall: 3 tables
    • wp_aal_tasks
    • wp_aal_products
    • wp_aal_request_cache
  • The uninstall procedure has failed, leaving 15 options in the database
    • widget_amazonautolinks_contextualproductwidget
    • db_upgraded
    • widget_recent-posts
    • aal_tasks_version
    • aal_request_cache_version
    • can_compress_scripts
    • widget_recent-comments
    • aal_products_version
    • amazon_auto_links_active_auto_inserts
    • amazon_auto_links_button_css
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means 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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/amazon-auto-links/template/json/template.php
  • 985× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonAutoLinks_AdminPageFramework_FrameworkUtility' not found in wp-content/plugins/amazon-auto-links/include/library/apf/factory/_common/_abstract/_controller/AdminPageFramework_Resource_Base.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonAutoLinks_Unit_PAAPIItemLookUp_Event_Filter_ProductsFormatter' not found in wp-content/plugins/amazon-auto-links/include/core/component/unit/unit_type/paapi_scratchpad_payload/event/filter/AmazonAutoLinks_Unit_PAAPICustomPayload_Event_Filter_ProductsFormatter.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonAutoLinks_FormFields_SearchUnit_Base' not found in wp-content/plugins/amazon-auto-links/include/core/component/unit/unit_type/paapi_item_lookup/admin/form_field/AmazonAutoLinks_FormFields_ItemLookupUnit_Advanced.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonAutoLinks_FormFields_Base' not found in wp-content/plugins/amazon-auto-links/include/core/component/button/button_type/flat/admin/form_field/AmazonAutoLinks_Button_Flat_FormFields_Text.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonAutoLinks_Locale_EuropeanUnion' not found in wp-content/plugins/amazon-auto-links/include/core/_common/utility/locale/AmazonAutoLinks_Locale_DE.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonAutoLinks_Button_Image_PostMetaBox_Base' not found in wp-content/plugins/amazon-auto-links/include/core/component/button/button_type/image/admin/post_meta_box/AmazonAutoLinks_Button_Image_PostMetaBox_Hover.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonAutoLinks_WPUtility' not found in wp-content/plugins/amazon-auto-links/include/core/component/unit/_common/output/formatter/link_style/AmazonAutoLinks_Output_Format_LinksStyle_Base.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonAutoLinks_Unit_Admin_Page_UnitCreationWizard' not found in wp-content/plugins/amazon-auto-links/include/core/component/unit/unit_type/paapi_product_search/admin/admin_page/AmazonAutoLinks_SearchUnitAdminPage.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonAutoLinks_AdminPageFramework_FrameworkUtility' not found in wp-content/plugins/amazon-auto-links/include/library/apf/factory/_common/_abstract/_view/AdminPageFramework_Factory_View__SettingNotice.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonAutoLinks_ScraperDOM_Base' not found in wp-content/plugins/amazon-auto-links/include/core/component/unit/unit_type/embed/utility/AmazonAutoLinks_ScraperDOM_Product.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: There are too many tags (19 tag instead of maximum 10)
The official readme.txt might help

amazon-auto-links/amazon-auto-links.php 92% from 13 tests

The main file in "Auto Amazon Links - Amazon Associates Affiliate Plugin" v. 5.3.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 176 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin108,051 lines of code in 1,392 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,0539,87833,80461,098
JavaScript1894,9173,15222,533
PO File58,58514,38618,531
CSS1105765374,414
Sass91531391,380
SVG220063
Markdown24020
JSON20012

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity6.37
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1,044
▷ Abstract classes14113.51%
▷ Concrete classes90386.49%
▷ Final classes181.99%
Methods4,728
▷ Static methods56411.93%
▷ Public methods2,53953.70%
▷ Protected methods97520.62%
▷ Private methods1,21425.68%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants43
▷ Global constants49.30%
▷ Class constants3990.70%
▷ Public constants39100.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
27 PNG files occupy 0.22MB with 0.08MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
include/library/apf/custom-field-types/date-time-custom-field-types/css/images/ui-icons_454545_256x240.png6.83KB4.17KB▼ 38.86%
include/core/component/template/asset/lightbox2/images/next.png1.32KB1.58KB0.00%
include/library/apf/custom-field-types/date-time-custom-field-types/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
include/library/apf/custom-field-types/date-time-custom-field-types/css/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
include/core/component/proxy/web_page_dumper/asset/image/instruction/create/manage-app.png47.91KB16.49KB▼ 65.58%