84% amazing-linker

Code Review | Amazing Linker (Amazon Affiliate Link Placement Plugin)

WordPress plugin Amazing Linker (Amazon Affiliate Link Placement Plugin) scored 84% from 54 tests.

About plugin

  • Plugin page: amazing-linker
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.2.3
  • WordPress version: 6.3.1
  • First release: Jun 3, 2019
  • Latest release: Sep 30, 2019
  • Number of updates: 21
  • Update frequency: every 5.7 days
  • Top authors: shoroar (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active / 966 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: ▲0.11MB] [CPU: ▼5.92ms] Passed 4 tests

Analyzing server-side resources used by Amazing Linker (Amazon Affiliate Link Placement Plugin)
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2542.52 ▲0.57
Dashboard /wp-admin3.55 ▲0.2447.26 ▼2.55
Posts /wp-admin/edit.php3.66 ▲0.3149.83 ▲3.36
Add New Post /wp-admin/post-new.php5.60 ▼0.2977.64 ▼24.81
Media Library /wp-admin/upload.php3.47 ▲0.2437.41 ▲3.12

Server storage [IO: ▲0.85MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
It is recommended to fix the following issues
  • There were 1 file (0.90KB) illegally modified outside of "wp-content/plugins/amazing-linker/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 177 new files
Database: 3 new tables, 8 new options
New tables
wp_amazing_linker_list
wp_amazing_linker_comparison_table
wp_amazing_linker_product
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
amazing-linker-activation-time
widget_recent-comments
widget_amazing_linker_product_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Amazing Linker (Amazon Affiliate Link Placement Plugin)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,957 ▲22216.09 ▲1.806.65 ▲4.7336.42 ▼6.50
Dashboard /wp-admin2,252 ▲616.68 ▲1.79134.84 ▲22.3465.84 ▲22.38
Posts /wp-admin/edit.php2,142 ▲533.63 ▲1.6386.34 ▲47.3833.97 ▼3.98
Add New Post /wp-admin/post-new.php1,551 ▲1719.01 ▼4.14757.22 ▲81.1933.78 ▼14.33
Media Library /wp-admin/upload.php1,434 ▲435.43 ▲1.31130.60 ▲25.8671.05 ▲27.47

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 82× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'ApaiIO\\Configuration\\ConfigurationInterface' not found in wp-content/plugins/amazing-linker/admin/libs/apai-io/exeu/apai-io/src/ApaiIO/Configuration/GenericConfiguration.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UriInterface' not found in wp-content/plugins/amazing-linker/admin/libs/apai-io/guzzlehttp/psr7/src/Uri.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\ClientInterface' not found in wp-content/plugins/amazing-linker/admin/libs/apai-io/guzzlehttp/guzzle/src/Client.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\RequestInterface' not found in wp-content/plugins/amazing-linker/admin/libs/apai-io/psr/http-message/src/ServerRequestInterface.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/amazing-linker/admin/libs/apai-io/guzzlehttp/promises/src/AggregateException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/amazing-linker/admin/libs/apai-io/guzzlehttp/promises/src/Coroutine.php:43
    • > PHP Fatal error
      Uncaught Error: Class 'ApaiIO\\Operations\\AbstractOperation' not found in wp-content/plugins/amazing-linker/admin/libs/apai-io/exeu/apai-io/src/ApaiIO/Operations/BrowseNodeLookup.php:26
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/amazing-linker/admin/libs/apai-io/guzzlehttp/guzzle/src/Exception/SeekException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/amazing-linker/admin/libs/apai-io/guzzlehttp/promises/src/EachPromise.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromisorInterface' not found in wp-content/plugins/amazing-linker/admin/libs/apai-io/guzzlehttp/guzzle/src/Pool.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: affiliate, amazon affiliate link, amazon, amazon associate, amazon affiliate...

amazing-linker/amazing-linker.php 92% from 13 tests

"Amazing Linker (Amazon Affiliate Link Placement Plugin)" version 1.0.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 309 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin14,346 lines of code in 159 files:
LanguageFilesBlank linesComment linesLines of code
PHP1503,4497,27913,935
JSON200362
XML14018
YAML14014
Markdown16013
CSS2002
JavaScript2002

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity16.63
▷ Minimum class complexity1.00
▷ Maximum class complexity246.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces15
Interfaces18
Traits3
Classes105
▷ Abstract classes32.86%
▷ Concrete classes10297.14%
▷ Final classes98.82%
Methods988
▷ Static methods727.29%
▷ Public methods82383.30%
▷ Protected methods484.86%
▷ Private methods11711.84%
Functions148
▷ Named functions6241.89%
▷ Anonymous functions8658.11%
Constants100
▷ Global constants3030.00%
▷ Class constants7070.00%
▷ Public constants70100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 compressed PNG files occupy 0.04MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/search.png0.47KB0.49KB0.00%
public/images/prime-logo.png1.27KB1.31KB0.00%
public/images/unavailable.png0.70KB0.74KB0.00%
admin/images/flags.png6.28KB6.57KB0.00%
public/images/arrow-right.png0.21KB0.21KB0.00%