84% easyazon

Code Review | EasyAzon - Amazon Associates Affiliate Plugin

WordPress plugin EasyAzon - Amazon Associates Affiliate Plugin scored84%from 54 tests.

About plugin

  • Plugin page: easyazon
  • Plugin version: 5.1.0
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.9.0
  • WordPress version: 6.3.1
  • First release: Feb 2, 2014
  • Latest release: Feb 16, 2022
  • Number of updates: 48
  • Update frequency: every 61.2 days
  • Top authors: boostwpcom (87.5%)flowdee (14.58%)

Code review

54 tests

User reviews

62 reviews

Install metrics

6,000+ active /243,775 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.37MB] [CPU: ▲3.33ms] Passed 4 tests

Server-side resources used by EasyAzon - Amazon Associates Affiliate Plugin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.79 ▲1.3346.10 ▲2.82
Dashboard /wp-admin4.69 ▲1.3859.46 ▲4.37
Posts /wp-admin/edit.php4.80 ▲1.4457.70 ▲12.10
Add New Post /wp-admin/post-new.php7.29 ▲1.4090.97 ▲0.09
Media Library /wp-admin/upload.php4.61 ▲1.3844.65 ▲6.04
Settings /wp-admin/admin.php?page=easyazon-settings4.8365.48
Localization /wp-admin/admin.php?page=easyazon-localization4.6560.76

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 571 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
easyazon-version
can_compress_scripts
widget_recent-posts

Browser metrics 75% from 4 tests

EasyAzon - Amazon Associates Affiliate Plugin: an overview of browser usage
Please improve the following
  • Nodes: Try to keep the DOM nodes under 25,000 (currently 36,191 on /wp-admin/admin.php?page=easyazon-settings)
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,967 ▲18113.52 ▼0.839.35 ▲7.3637.89 ▼6.15
Dashboard /wp-admin2,255 ▲755.60 ▼0.0184.11 ▼13.5236.40 ▼7.67
Posts /wp-admin/edit.php2,155 ▲552.04 ▲0.0635.90 ▲2.1234.52 ▼3.08
Add New Post /wp-admin/post-new.php6,254 ▲4,72825.97 ▲3.05898.91 ▲239.7360.07 ▼5.97
Media Library /wp-admin/upload.php1,455 ▲554.27 ▲0.0996.49 ▼2.1242.10 ▼3.63
Settings /wp-admin/admin.php?page=easyazon-settings36,1912.1480.03346.56
Localization /wp-admin/admin.php?page=easyazon-localization1,2313.1941.0928.80

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • easyazon-version
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means 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
  • 230× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function easyazon_collapse_attributes() in wp-content/plugins/easyazon/addition/components/popovers/views/popover.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/easyazon/components/settings-sections/links/views/section.php:1
    • > PHP Fatal error
      Uncaught Error: Interface 'MaxMind\\WebService\\Http\\Request' not found in wp-content/plugins/easyazon/addition/components/localization/lib/geoip/vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/easyazon/vendor/thewirecutter/paapi5-php-sdk/src/com/amazon/paapi5/v1/ImageType.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/easyazon/vendor/thewirecutter/paapi5-php-sdk/src/com/amazon/paapi5/v1/ExternalIds.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/easyazon/vendor/thewirecutter/paapi5-php-sdk/src/com/amazon/paapi5/v1/VariationSummary.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/easyazon/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/easyazon/vendor/thewirecutter/paapi5-php-sdk/src/com/amazon/paapi5/v1/OfferListing.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/easyazon/addition/components/popup-states/call-to-action/views/state.php:2
    • > PHP Notice
      Undefined variable: item in wp-content/plugins/easyazon/addition/components/popovers/views/popover.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: amazon, amazon associate, amazon affiliate

easyazon/easyazon.php Passed 13 tests

"EasyAzon - Amazon Associates Affiliate Plugin" version 5.1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
74 characters long description:
Quickly and easily insert Amazon affiliate links into your site's content.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin41,397 lines of code in 433 files:
LanguageFilesBlank linesComment linesLines of code
PHP3708,41722,84831,395
JSON23005,386
Markdown674103,400
JavaScript2021023941
CSS10370226
XML11020
Dockerfile18010
YAML10010
make1409

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity10.30
▷ Minimum class complexity1.00
▷ Maximum class complexity120.00
Average method complexity1.95
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces25
Interfaces38
Traits4
Classes326
▷ Abstract classes30.92%
▷ Concrete classes32399.08%
▷ Final classes175.26%
Methods3,490
▷ Static methods87325.01%
▷ Public methods3,07888.19%
▷ Protected methods160.46%
▷ Private methods39611.35%
Functions391
▷ Named functions18246.55%
▷ Anonymous functions20953.45%
Constants412
▷ Global constants368.74%
▷ Class constants37691.26%
▷ Public constants37599.73%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin