68% amazon-product-price

Code Review | Amazon Product Price

WordPress plugin Amazon Product Price scored68%from 54 tests.

About plugin

  • Plugin page: amazon-product-price
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.0.2
  • WordPress version: 6.3.1
  • First release: Aug 11, 2014
  • Latest release: Jan 2, 2019
  • Number of updates: 17
  • Update frequency: every 94.6 days
  • Top authors: aloktiwari (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /3,227 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.76ms] Passed 4 tests

Server-side resources used by Amazon Product Price
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0141.33 ▼1.57
Dashboard /wp-admin3.31 ▲0.0146.78 ▼1.82
Posts /wp-admin/edit.php3.36 ▲0.0153.30 ▲6.23
Add New Post /wp-admin/post-new.php5.89 ▲0.0193.47 ▲1.56
Media Library /wp-admin/upload.php3.23 ▲0.0131.51 ▼5.20
Amazon Settings /wp-admin/options-general.php?page=amazon-setting3.2031.63

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 4 new files
Database: 1 new table, 7 new options
New tables
wp_amazon_setting
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments
am_db_version
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Amazon Product Price
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.20 ▼1.481.75 ▼0.0740.92 ▼4.77
Dashboard /wp-admin2,210 ▲194.87 ▼0.05103.45 ▼11.7539.26 ▼6.39
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0140.29 ▲2.2835.37 ▲1.91
Add New Post /wp-admin/post-new.php1,536 ▲123.20 ▲0.01604.65 ▼53.7449.97 ▼3.98
Media Library /wp-admin/upload.php1,395 ▲74.25 ▲0.0097.31 ▼10.9040.79 ▼3.94
Amazon Settings /wp-admin/options-general.php?page=amazon-setting8672.0225.7327.30

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_amazon_setting
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • am_db_version
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/amazon-product-price/amazon-product-price.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/amazon-product-price/amazon-product-price.php:12

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=amazon-setting
    • > Network (severe)
    wp-content/plugins/amazon-product-price/includes/btn_donate_SM.gif - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed: You can take inspiration from this readme.txt

amazon-product-price/amazon-product-price.php Passed 13 tests

This is the main PHP file of "Amazon Product Price" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
100 characters long description:
Generate the short code to enter on the post and get the amazon product price by amazon "Asin" Code.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected284 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP397142284

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods466.67%
▷ Protected methods00.00%
▷ Private methods233.33%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants666.67%
▷ Class constants333.33%
▷ Public constants3100.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