78% insert-amazon-images

Code Review | Insert Amz Images

WordPress plugin Insert Amz Images scored78%from 54 tests.

About plugin

  • Plugin page: insert-amazon-images
  • Plugin version: 0.45.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: May 21, 2019
  • Latest release: Feb 24, 2021
  • Number of updates: 27
  • Update frequency: every 24.1 days
  • Top authors: amzimage (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active /13,468 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.14MB] [CPU: ▼10.17ms] Passed 4 tests

Analyzing server-side resources used by Insert Amz Images
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1539.33 ▼6.63
Dashboard /wp-admin3.46 ▲0.1150.51 ▼13.43
Posts /wp-admin/edit.php3.57 ▲0.2151.59 ▲2.46
Add New Post /wp-admin/post-new.php6.04 ▲0.1587.40 ▼22.28
Media Library /wp-admin/upload.php3.38 ▲0.1538.56 ▲1.65
Insert Amz Images /wp-admin/options-general.php?page=AmazonImages3.3534.30

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 498 new files
Database: no new tables, 22 new options
New WordPress options
db_upgraded
AmazonImages\AmazonImagesTagUs
widget_recent-comments
AmazonImages\AmazonImagesNoFollowLinks
AmazonImages\AmazonImagesAccessKey
AmazonImages\AmazonImagesTagCa
AmazonImages\AmazonImagesSecretKey
theysaidso_admin_options
AmazonImages\AmazonImagesTagFr
widget_recent-posts
...

Browser metrics Passed 4 tests

A check of browser resources used by Insert Amz Images
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.35 ▼0.381.63 ▼0.0440.04 ▼20.85
Dashboard /wp-admin2,203 ▲295.56 ▲0.0284.63 ▼12.5340.01 ▲2.41
Posts /wp-admin/edit.php2,119 ▲192.01 ▲0.0134.25 ▼2.9138.47 ▲0.20
Add New Post /wp-admin/post-new.php1,548 ▲2218.49 ▼4.63619.17 ▲8.8763.89 ▲10.28
Media Library /wp-admin/upload.php1,416 ▲164.27 ▲0.0299.97 ▼5.2444.30 ▼3.00
Insert Amz Images /wp-admin/options-general.php?page=AmazonImages8262.0625.5029.44

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
The following items require your attention
  • This plugin does not fully uninstall, leaving 22 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • AmazonImages\AmazonImagesSecretKey
    • AmazonImages\AmazonImagesNoFollowLinks
    • theysaidso_admin_options
    • can_compress_scripts
    • AmazonImages\AmazonImagesTagAu
    • AmazonImages\AmazonImagesTagFr
    • AmazonImages\AmazonImagesTagUs
    • AmazonImages\AmazonImagesTagEs
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 9× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/insert-amazon-images/vendor/exeu/apai-io/samples/Lookup/SimpleLookup.php
    • > /wp-content/plugins/insert-amazon-images/vendor/exeu/apai-io/samples/Batch/BatchSearch.php
    • > /wp-content/plugins/insert-amazon-images/vendor/exeu/apai-io/samples/Search/SimpleSearch.php
    • > /wp-content/plugins/insert-amazon-images/vendor/exeu/apai-io/samples/SimilarityLookup/SimpleSimilarityLookup.php
    • > /wp-content/plugins/insert-amazon-images/add_amazon_images_form.php
    • > /wp-content/plugins/insert-amazon-images/vendor/exeu/apai-io/samples/BrowseNodeLookup/SimpleBrowseNodeLookup.php
    • > /wp-content/plugins/insert-amazon-images/vendor/exeu/apai-io/tests/bootstrap.php
    • > /wp-content/plugins/insert-amazon-images/vendor/exeu/apai-io/samples/CartModify/SimpleCartFlow.php
    • > /wp-content/plugins/insert-amazon-images/vendor/exeu/apai-io/samples/CartCreate/SimpleCartCreate.php
  • 253× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'AmazonImages\\MaxMind\\WebService\\Http\\Request' not found in wp-content/plugins/insert-amazon-images/vendor/maxmind/web-service-common/src/WebService/Http/CurlRequest.php:12
    • > PHP Notice
      Undefined variable: shortname in wp-content/plugins/insert-amazon-images/add_amazon_images_form.php on line 5
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/insert-amazon-images/vendor/najamhaq/paapi5-php-sdk/vendor/guzzlehttp/psr7/src/LimitStream.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'AmazonImages\\Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/insert-amazon-images/vendor/najamhaq/paapi5-php-sdk/src/com/amazon/paapi5/v1/RentalOfferListing.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonImages\\GuzzleHttp\\Promise\\RejectionException' not found in wp-content/plugins/insert-amazon-images/vendor/guzzlehttp/promises/src/CancellationException.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'AmazonImages\\GeoIp2\\ProviderInterface' not found in wp-content/plugins/insert-amazon-images/vendor/geoip2/geoip2/src/Database/Reader.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonImages\\GeoIp2\\Record\\AbstractPlaceRecord' not found in wp-content/plugins/insert-amazon-images/vendor/geoip2/geoip2/src/Record/Subdivision.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'AmazonImages\\MaxMind\\Exception\\InvalidRequestException' not found in wp-content/plugins/insert-amazon-images/vendor/maxmind/web-service-common/src/Exception/IpAddressNotFoundException.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'AmazonImages\\Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/insert-amazon-images/vendor/najamhaq/paapi5-php-sdk/src/com/amazon/paapi5/v1/GetVariationsResponse.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'AmazonImages\\Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/insert-amazon-images/vendor/guzzlehttp/psr7/src/InflateStream.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues 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:
  • Contributors: Plugin contributors field is missing
Please take inspiration from this readme.txt

insert-amazon-images/AmazonImages.php 92% from 13 tests

The main PHP script in "Insert Amz Images" version 0.45.1 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("insert-amazon-images.php" instead of "AmazonImages.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected43,704 lines of code in 456 files:
LanguageFilesBlank linesComment linesLines of code
PHP3958,26528,61936,376
Markdown221,41204,245
JSON18001,387
JavaScript13213632
C17315476
make2346196
reStructuredText7190249114
Ant113879
YAML38158
Python16043
Bourne Shell120040
XML22036
m415014
C/C++ Header14128

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity10.18
▷ Minimum class complexity1.00
▷ Maximum class complexity172.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces48
Interfaces35
Traits5
Classes310
▷ Abstract classes41.29%
▷ Concrete classes30698.71%
▷ Final classes175.56%
Methods3,499
▷ Static methods54915.69%
▷ Public methods3,13589.60%
▷ Protected methods712.03%
▷ Private methods2938.37%
Functions346
▷ Named functions13238.15%
▷ Anonymous functions21461.85%
Constants405
▷ Global constants40.99%
▷ Class constants40199.01%
▷ Public constants401100.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
No PNG files were detected