10% easy-amazon-product-information

Code Review | Easy Amazon Product Information

WordPress plugin Easy Amazon Product Information scored10%from 54 tests.

About plugin

  • Plugin page: easy-amazon-produ...
  • Plugin version: 4.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2.3
  • WordPress version: 6.3.1
  • First release: Dec 28, 2015
  • Latest release: Oct 16, 2019
  • Number of updates: 61
  • Update frequency: every 22.8 days
  • Top authors: jensmueller (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

500+ active /18,811 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Warning in wp-content/plugins/easy-amazon-product-information/eapi_amazon.php+205
    file_get_contents(https://webservices.amazon.de/paapi5/searchitems): failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request

Server metrics [RAM: ▲0.40MB] [CPU: ▼4.53ms] Passed 4 tests

This is a short check of server-side resources used by Easy Amazon Product Information
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.4043.48 ▲3.31
Dashboard /wp-admin3.70 ▲0.4051.09 ▼6.10
Posts /wp-admin/edit.php3.82 ▲0.4649.96 ▼0.35
Add New Post /wp-admin/post-new.php6.30 ▲0.4293.01 ▼13.13
Media Library /wp-admin/upload.php3.63 ▲0.4039.05 ▲1.47
Easy Amazon Product Information /wp-admin/options-general.php?page=easy_amazon_product_information3.6138.90

Server storage [IO: ▲0.34MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 28 new files
Database: 1 new table, 20 new options
New tables
wp_easy_amazon_product_information_data
New WordPress options
eapi_personal_error
eapi_picture
widget_recent-comments
eapi_button
widget_recent-posts
eapi_sidebar
eapi_version
db_upgraded
eapi_negative
eapi_inter_vall_time_in_hours
...

Browser metrics Passed 4 tests

Checking browser requirements for Easy Amazon Product Information
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲8113.72 ▼0.651.82 ▼0.4644.42 ▼0.34
Dashboard /wp-admin2,231 ▲435.10 ▼0.76105.53 ▼13.1639.35 ▼5.69
Posts /wp-admin/edit.php2,113 ▲212.31 ▲0.2636.98 ▼6.5132.36 ▼5.21
Add New Post /wp-admin/post-new.php1,533 ▲517.77 ▼0.53681.06 ▲42.5537.28 ▼14.32
Media Library /wp-admin/upload.php1,413 ▲314.57 ▲0.36109.56 ▲7.5941.67 ▼1.08
Easy Amazon Product Information /wp-admin/options-general.php?page=easy_amazon_product_information4,9973.81143.4938.11

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/easy-amazon-product-information/easy_amazon_product_information.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === easy-amazon-product-information === )
You can take inspiration from this readme.txt

easy-amazon-product-information/easy_amazon_product_information.php 85% from 13 tests

The primary PHP file in "Easy Amazon Product Information" version 4.0.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("easy-amazon-product-information.php" instead of "easy_amazon_product_information.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 201 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected2,351 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP61423441,986
PO File2167210337
CSS20018
JavaScript12010

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.12
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods850.00%
▷ Protected methods00.00%
▷ Private methods850.00%
Functions47
▷ Named functions47100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.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
13 PNG files occupy 0.21MB with 0.12MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/shipping_amazon.png4.50KB1.69KB▼ 62.53%
images/logo_top.png73.88KB25.17KB▼ 65.93%
images/eapi_false.png1.73KB1.16KB▼ 32.86%
images/default.png3.68KB2.16KB▼ 41.30%
images/logo_top_300_125.png8.95KB2.72KB▼ 69.64%