10% automatic-affiliate-for-amazon

Code Review | FS-14 Automatic Amazon Affiliate Plugin

WordPress plugin FS-14 Automatic Amazon Affiliate Plugin scored10%from 54 tests.

About plugin

  • Plugin page: automatic-affilia...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.4.2
  • WordPress version: 6.3.1
  • First release: Mar 17, 2016
  • Latest release: Apr 12, 2016
  • Number of updates: 13
  • Update frequency: every 2.0 days
  • Top authors: boernei (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,550 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/automatic-affiliate-for-amazon/includes/AmazonSettings.php+29
    Undefined property: amazonSettings::$data

Server metrics [RAM: ▼1.83MB] [CPU: ▼59.91ms] Passed 4 tests

An overview of server-side resources used by FS-14 Automatic Amazon Affiliate Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.17 ▼1.295.73 ▼33.60
Dashboard /wp-admin2.19 ▼1.167.26 ▼58.37
Posts /wp-admin/edit.php2.19 ▼1.176.79 ▼52.26
Add New Post /wp-admin/post-new.php2.19 ▼3.707.01 ▼95.40
Media Library /wp-admin/upload.php2.19 ▼1.048.35 ▼28.38
FS-14 AAAP /wp-admin/options-general.php?page=listamazon_list_options2.196.57

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

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

Browser metrics Passed 4 tests

A check of browser resources used by FS-14 Automatic Amazon Affiliate Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.23 ▼0.031.77 ▲0.2243.39 ▲4.46
Dashboard /wp-admin2,206 ▲295.73 ▲0.1488.73 ▼2.7538.92 ▼1.48
Posts /wp-admin/edit.php2,108 ▲51.99 ▼0.0236.08 ▼4.4136.45 ▼0.92
Add New Post /wp-admin/post-new.php6,231 ▲4,70225.80 ▲2.56888.83 ▲248.8264.65 ▲0.18
Media Library /wp-admin/upload.php1,411 ▲174.18 ▲0.0194.99 ▼3.2946.73 ▲1.96
FS-14 AAAP /wp-admin/options-general.php?page=listamazon_list_options1,0112.0125.0256.62

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/automatic-affiliate-for-amazon/includes/AmazonSettings.php+29
    Undefined property: amazonSettings::$data
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • can_compress_scripts
    • widget_hd_amazon_sidebar
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • amazonlist
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=listamazon_list_options
    • > Notice in wp-content/plugins/automatic-affiliate-for-amazon/includes/AmazonSettings.php+29
    Undefined property: amazonSettings::$data
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=listamazon_list_options
    • > Warning in wp-content/plugins/automatic-affiliate-for-amazon/includes/AmazonSettings.php+155
    Illegal string offset 'csslayout'
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=listamazon_list_options
    • > Notice in wp-content/plugins/automatic-affiliate-for-amazon/includes/AmazonSettings.php+175
    Uninitialized string offset: 0
    • > GET request to /wp-admin/options-general.php?page=listamazon_list_options
    • > Deprecated in wp-content/plugins/automatic-affiliate-for-amazon/fs-14-aaap.php+43
    Function create_function() is deprecated
    • > GET request to /wp-admin/options-general.php?page=listamazon_list_options
    • > Warning in wp-content/plugins/automatic-affiliate-for-amazon/includes/AmazonSettings.php+120
    Illegal string offset 'country'
    • > GET request to /wp-admin/options-general.php?page=listamazon_list_options
    • > Warning in wp-content/plugins/automatic-affiliate-for-amazon/includes/AmazonSettings.php+135
    Illegal string offset 'AWS_API_KEY'
    • > GET request to /wp-admin/options-general.php?page=listamazon_list_options
    • > Warning in wp-content/plugins/automatic-affiliate-for-amazon/includes/AmazonSettings.php+138
    Illegal string offset 'AWS_API_SECRET_KEY'
    • > GET request to /wp-admin/options-general.php?page=listamazon_list_options
    • > Warning in wp-content/plugins/automatic-affiliate-for-amazon/includes/AmazonSettings.php+161
    Illegal string offset 'BUY_BUTTON'
    • > GET request to /wp-admin/options-general.php?page=listamazon_list_options
    • > Warning in wp-content/plugins/automatic-affiliate-for-amazon/includes/AmazonSettings.php+164
    Illegal string offset 'TARGET_BLANK'
    • > GET request to /wp-admin/options-general.php?page=listamazon_list_options
    • > Warning in wp-content/plugins/automatic-affiliate-for-amazon/includes/AmazonSettings.php+175
    Illegal string offset 'button_color'

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
Please take a closer look at the following
  • 27× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Notice
      Undefined variable: options in wp-content/plugins/automatic-affiliate-for-amazon/includes/views/producttemplate.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/automatic-affiliate-for-amazon/includes/AmazonSidebar.php:5
    • > PHP Notice
      Trying to get property 'LowestNewPrice' of non-object in wp-content/plugins/automatic-affiliate-for-amazon/includes/views/producttemplate.php on line 15
    • > PHP Notice
      Trying to get property 'OfferSummary' of non-object in wp-content/plugins/automatic-affiliate-for-amazon/includes/views/producttemplate.php on line 17
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/automatic-affiliate-for-amazon/includes/views/producttemplate.php on line 24
    • > PHP Notice
      Trying to get property 'DetailPageURL' of non-object in wp-content/plugins/automatic-affiliate-for-amazon/includes/views/producttemplate.php on line 24
    • > PHP Notice
      Trying to get property 'LowestRefurbishedPrice' of non-object in wp-content/plugins/automatic-affiliate-for-amazon/includes/views/producttemplate.php on line 17
    • > PHP Notice
      Undefined variable: itemObject in wp-content/plugins/automatic-affiliate-for-amazon/includes/views/producttemplate.php on line 24
    • > PHP Notice
      Trying to get property 'MediumImage' of non-object in wp-content/plugins/automatic-affiliate-for-amazon/includes/views/producttemplate.php on line 5
    • > PHP Notice
      Trying to get property 'ItemAttributes' of non-object in wp-content/plugins/automatic-affiliate-for-amazon/includes/views/producttemplate.php on line 10

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 fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=listamazon_list_options
    • > Network (severe)
    wp-content/plugins/automatic-affiliate-for-amazon/includes/css/admin.css?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=listamazon_list_options
    • > Network (severe)
    wp-content/plugins/automatic-affiliate-for-amazon/includes/js/admin.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
7 plugin tags: amazon, affiliate plugins, affiliate, amazon partnership, amazon associate...

automatic-affiliate-for-amazon/fs-14-aaap.php 92% from 13 tests

"FS-14 Automatic Amazon Affiliate Plugin" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("automatic-affiliate-for-amazon.php" instead of "fs-14-aaap.php")

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
There were no executable files found in this plugin2,209 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
CSS34321,432
PHP8322333777

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity14.60
▷ Minimum class complexity2.00
▷ Maximum class complexity32.00
Average method complexity2.19
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods57
▷ Static methods00.00%
▷ Public methods4782.46%
▷ Protected methods915.79%
▷ Private methods11.75%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants250.00%
▷ Class constants250.00%
▷ Public constants2100.00%

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