78% wp-hamazon

Code Review | Hamazon

WordPress plugin Hamazon scored78%from 54 tests.

About plugin

  • Plugin page: wp-hamazon
  • Plugin version: 5.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Feb 15, 2012
  • Latest release: Jul 3, 2020
  • Number of updates: 39
  • Update frequency: every 78.5 days
  • Top authors: Takahashi_Fumiki (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /5,082 total downloads

Benchmarks

Plugin footprint 83% 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.70MB] [CPU: ▲3.61ms] Passed 4 tests

An overview of server-side resources used by Hamazon
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.16 ▲0.7044.19 ▲4.78
Dashboard /wp-admin4.01 ▲0.7049.62 ▼1.97
Posts /wp-admin/edit.php4.12 ▲0.7657.05 ▲10.01
Add New Post /wp-admin/post-new.php6.59 ▲0.70100.01 ▲2.11
Media Library /wp-admin/upload.php3.93 ▲0.7042.42 ▲9.50
Affiliate Setting /wp-admin/options-general.php?page=wp-hamazon3.9137.68

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 341 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
hamazon_option_updated

Browser metrics Passed 4 tests

A check of browser resources used by Hamazon
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.26 ▼1.491.54 ▼0.2641.86 ▼2.80
Dashboard /wp-admin2,210 ▲224.84 ▼1.0697.91 ▼16.2239.09 ▼8.56
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0340.12 ▼1.9735.00 ▲0.47
Add New Post /wp-admin/post-new.php1,517 ▼017.49 ▼0.07631.53 ▼20.9655.94 ▲8.37
Media Library /wp-admin/upload.php1,392 ▲14.19 ▼0.0593.70 ▼8.6240.21 ▼4.99
Affiliate Setting /wp-admin/options-general.php?page=wp-hamazon1,3716.42164.40100.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • hamazon_option_updated
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 138× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Exception\\GuzzleException' not found in wp-content/plugins/wp-hamazon/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/wp-hamazon/vendor/thewirecutter/paapi5-php-sdk/src/com/amazon/paapi5/v1/OfferAvailability.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/wp-hamazon/vendor/guzzlehttp/promises/src/RejectedPromise.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/wp-hamazon/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/wp-hamazon/vendor/thewirecutter/paapi5-php-sdk/src/com/amazon/paapi5/v1/GetItemsResponse.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/wp-hamazon/vendor/thewirecutter/paapi5-php-sdk/src/com/amazon/paapi5/v1/MinReviewsRating.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/wp-hamazon/vendor/thewirecutter/paapi5-php-sdk/src/com/amazon/paapi5/v1/ItemsResult.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/wp-hamazon/vendor/psr/http-message/src/ResponseInterface.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/wp-hamazon/vendor/thewirecutter/paapi5-php-sdk/src/com/amazon/paapi5/v1/TradeInPrice.php:28
    • > PHP Fatal error
      Uncaught Error: Interface 'Amazon\\ProductAdvertisingAPI\\v1\\com\\amazon\\paapi5\\v1\\ModelInterface' not found in wp-content/plugins/wp-hamazon/vendor/thewirecutter/paapi5-php-sdk/src/com/amazon/paapi5/v1/ManufactureInfo.php:28

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=wp-hamazon
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/options-general.php?page=wp-hamazon
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.

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
4 plugin tags: dmm, amazon, phg, affiliate

wp-hamazon/wp-hamazon.php 92% from 13 tests

The primary PHP file in "Hamazon" version 5.0.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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
Good job! No executable or dangerous file extensions detected50,792 lines of code in 299 files:
LanguageFilesBlank linesComment linesLines of code
PHP2185,75521,22528,411
JSON150016,778
Markdown141,07103,434
JSX1310256848
Sass61021693
PO File1184243367
JavaScript201479171
XML24033
YAML15817
SVG20116
Dockerfile18010
make1409
CSS55135

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity12.28
▷ Minimum class complexity1.00
▷ Maximum class complexity153.00
Average method complexity1.81
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces18
Interfaces16
Traits2
Classes171
▷ Abstract classes31.75%
▷ Concrete classes16898.25%
▷ Final classes137.74%
Methods2,481
▷ Static methods54922.13%
▷ Public methods2,30893.03%
▷ Protected methods311.25%
▷ Private methods1425.72%
Functions290
▷ Named functions13345.86%
▷ Anonymous functions15754.14%
Constants371
▷ Global constants4411.86%
▷ Class constants32788.14%
▷ Public constants327100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/button-icon.png0.74KB0.74KB0.00%
src/img/button-icon.png0.85KB0.85KB0.00%