84% codeshop-amazon-affiliate

Code Review | CodeShop Amazon Affiliate

WordPress plugin CodeShop Amazon Affiliate scored84%from 54 tests.

About plugin

  • Plugin page: codeshop-amazon-a...
  • Plugin version: 3.1.0
  • PHP compatiblity: 5.3.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.0
  • WordPress version: 6.3.1
  • First release: Feb 10, 2017
  • Latest release: Oct 26, 2022
  • Number of updates: 31
  • Update frequency: every 67.2 days
  • Top authors: codeapple (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,712 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.67ms] Passed 4 tests

This is a short check of server-side resources used by CodeShop Amazon Affiliate
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0033.71 ▼6.45
Dashboard /wp-admin3.31 ▲0.0047.70 ▲2.61
Posts /wp-admin/edit.php3.36 ▲0.0049.33 ▲0.55
Add New Post /wp-admin/post-new.php5.89 ▲0.0091.82 ▲3.74
Media Library /wp-admin/upload.php3.23 ▲0.0031.43 ▼3.37

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 260 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for CodeShop Amazon Affiliate
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.28 ▼1.111.62 ▼0.1342.41 ▲1.77
Dashboard /wp-admin2,206 ▲154.84 ▼0.06110.68 ▲3.0642.11 ▼2.98
Posts /wp-admin/edit.php2,089 ▼02.01 ▲0.0140.56 ▲0.1836.63 ▼2.26
Add New Post /wp-admin/post-new.php1,533 ▲12223.66 ▲5.64622.90 ▼21.1156.80 ▲7.01
Media Library /wp-admin/upload.php1,388 ▼04.18 ▲0.0493.96 ▼3.7839.34 ▼3.12

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
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 130× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/codeshop-amazon-affiliate/lib/paapi5/src/com/amazon/paapi5/v1/ContentRating.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/codeshop-amazon-affiliate/lib/paapi5/src/com/amazon/paapi5/v1/ImageSize.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/codeshop-amazon-affiliate/lib/paapi5/vendor/guzzlehttp/psr7/src/InflateStream.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\TaskQueueInterface' not found in wp-content/plugins/codeshop-amazon-affiliate/lib/paapi5/vendor/guzzlehttp/promises/src/TaskQueue.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/codeshop-amazon-affiliate/lib/paapi5/src/com/amazon/paapi5/v1/DurationPrice.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/codeshop-amazon-affiliate/lib/paapi5/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/codeshop-amazon-affiliate/lib/paapi5/src/com/amazon/paapi5/v1/TradeInInfo.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/codeshop-amazon-affiliate/admin/views/add_amazonshop_submenu_settings_callback.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/codeshop-amazon-affiliate/lib/paapi5/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/codeshop-amazon-affiliate/lib/paapi5/src/com/amazon/paapi5/v1/MinReviewsRating.php:28

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

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
9 plugin tags: amazon affiliate, monetize posts, amazon associate, amazon products api, store...

codeshop-amazon-affiliate/codeshop-amazon-affiliate.php 92% from 13 tests

The main PHP script in "CodeShop Amazon Affiliate" version 3.1.0 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 480 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected33,931 lines of code in 245 files:
LanguageFilesBlank linesComment linesLines of code
PHP2206,12720,52127,728
Markdown101,00603,211
JSON7002,332
CSS51413380
JavaScript22832271
make1409

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity12.56
▷ Minimum class complexity1.00
▷ Maximum class complexity143.00
Average method complexity1.84
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces11
Interfaces15
Traits2
Classes168
▷ Abstract classes00.00%
▷ Concrete classes168100.00%
▷ Final classes84.76%
Methods2,447
▷ Static methods55722.76%
▷ Public methods2,30594.20%
▷ Protected methods90.37%
▷ Private methods1335.44%
Functions161
▷ Named functions5936.65%
▷ Anonymous functions10263.35%
Constants323
▷ Global constants41.24%
▷ Class constants31998.76%
▷ Public constants319100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
amazonshop-templates/assets/images/amazon-icon.png1.51KB0.90KB▼ 40.53%