84% amazing-search

Code Review | Amazing Search(Amazon Product Searcher)

WordPress plugin Amazing Search(Amazon Product Searcher) scored84%from 54 tests.

About plugin

  • Plugin page: amazing-search
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.2
  • WordPress version: 6.3.1
  • First release: Jun 4, 2019
  • Latest release: Sep 10, 2019
  • Number of updates: 8
  • Update frequency: every 12.3 days
  • Top authors: shoroar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /806 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲1.20MB] [CPU: ▼4.31ms] Passed 4 tests

Server-side resources used by Amazing Search(Amazon Product Searcher)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.81 ▲1.3545.24 ▲1.83
Dashboard /wp-admin4.66 ▲1.3252.52 ▼9.74
Posts /wp-admin/edit.php4.71 ▲1.3657.08 ▲11.71
Add New Post /wp-admin/post-new.php6.65 ▲0.7777.43 ▼20.48
Media Library /wp-admin/upload.php4.59 ▲1.3645.44 ▲11.16

Server storage [IO: ▲0.76MB] [DB: ▲0.00MB] 67% from 3 tests

How much does this plugin use your filesystem and database?
Just a few items left to fix
  • You have illegally modified 1 file (0.90KB) outside of "wp-content/plugins/amazing-search/" and "wp-content/uploads/"
    • (modified) .htaccess
Filesystem: 160 new files
Database: no new tables, 7 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
amazing-search-activation-time
theysaidso_admin_options
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Amazing Search(Amazon Product Searcher)
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,941 ▲17015.85 ▲1.586.13 ▲3.8540.57 ▼3.90
Dashboard /wp-admin2,236 ▲486.18 ▲0.20137.97 ▲23.7539.51 ▼6.23
Posts /wp-admin/edit.php2,121 ▲323.40 ▲1.3882.87 ▲47.5038.89 ▲2.25
Add New Post /wp-admin/post-new.php1,539 ▲1924.39 ▲1.02715.74 ▲81.4264.33 ▲12.67
Media Library /wp-admin/upload.php1,415 ▲245.13 ▲0.95129.77 ▲31.2840.86 ▼3.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 74× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/amazing-search/admin/libs/apai-io/guzzlehttp/psr7/src/BufferStream.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/amazing-search/admin/libs/apai-io/guzzlehttp/psr7/src/CachingStream.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Cookie\\CookieJar' not found in wp-content/plugins/amazing-search/admin/libs/apai-io/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/amazing-search/admin/libs/apai-io/psr/http-message/src/RequestInterface.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\UriInterface' not found in wp-content/plugins/amazing-search/admin/libs/apai-io/guzzlehttp/psr7/src/Uri.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Cookie\\CookieJarInterface' not found in wp-content/plugins/amazing-search/admin/libs/apai-io/guzzlehttp/guzzle/src/Cookie/CookieJar.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\TransferException' not found in wp-content/plugins/amazing-search/admin/libs/apai-io/guzzlehttp/guzzle/src/Exception/RequestException.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'ApaiIO\\Operations\\AbstractOperation' not found in wp-content/plugins/amazing-search/admin/libs/apai-io/exeu/apai-io/src/ApaiIO/Operations/CartCreate.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'GuzzleHttp\\Exception\\RequestException' not found in wp-content/plugins/amazing-search/admin/libs/apai-io/guzzlehttp/guzzle/src/Exception/BadResponseException.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Handler\\CurlFactoryInterface' not found in wp-content/plugins/amazing-search/admin/libs/apai-io/guzzlehttp/guzzle/src/Handler/CurlFactory.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
7 plugin tags: amazon affiliate link, affiliate, amazon associate, amazon affiliate, amazon search...

amazing-search/amazing-search.php 92% from 13 tests

The main file in "Amazing Search(Amazon Product Searcher)" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 247 characters long)

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
Success! There were no dangerous files found in this plugin12,676 lines of code in 145 files:
LanguageFilesBlank linesComment linesLines of code
PHP1402,9216,89012,331
JSON100341
CSS2002
JavaScript2002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity15.88
▷ Minimum class complexity1.00
▷ Maximum class complexity246.00
Average method complexity3.03
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces15
Interfaces18
Traits3
Classes95
▷ Abstract classes11.05%
▷ Concrete classes9498.95%
▷ Final classes99.57%
Methods910
▷ Static methods727.91%
▷ Public methods76984.51%
▷ Protected methods242.64%
▷ Private methods11712.86%
Functions148
▷ Named functions6241.89%
▷ Anonymous functions8658.11%
Constants100
▷ Global constants3030.00%
▷ Class constants7070.00%
▷ Public constants70100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/amazon-logo.png0.69KB0.70KB0.00%
public/images/stars.png0.73KB0.74KB0.00%
public/images/prime-logo.png1.27KB1.31KB0.00%
public/images/unavailable.png0.70KB0.74KB0.00%
admin/images/amazing-search-logo.png10.92KB11.32KB0.00%