78% review-widgets-for-amazon

Code Review | Widgets for Amazon Reviews

WordPress plugin Widgets for Amazon Reviews scored78%from 54 tests.

About plugin

  • Plugin page: review-widgets-fo...
  • Plugin version: 11.1
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: May 2, 2020
  • Latest release: Nov 24, 2023
  • Number of updates: 159
  • Update frequency: every 8.2 days
  • Top authors: trustindex (100%)

Code review

54 tests

User reviews

23 reviews

Install metrics

1,000+ active /61,084 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲1.13MB] [CPU: ▲4.08ms] Passed 4 tests

A check of server-side resources used by Widgets for Amazon Reviews
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.59 ▲1.1247.52 ▲5.80
Dashboard /wp-admin4.46 ▲1.1554.88 ▲3.95
Posts /wp-admin/edit.php4.49 ▲1.1360.42 ▲10.43
Add New Post /wp-admin/post-new.php7.10 ▲1.2192.03 ▼3.86
Media Library /wp-admin/upload.php4.33 ▲1.1046.24 ▲13.25

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 131 new files
Database: 1 new table, 8 new options
New tables
wp_trustindex_amazon_reviews
New WordPress options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded
trustindex-amazon-version
theysaidso_admin_options
trustindex-amazon-active

Browser metrics Passed 4 tests

This is an overview of browser requirements for Widgets for Amazon Reviews
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,834 ▲7214.22 ▼0.491.74 ▲0.0940.19 ▼3.00
Dashboard /wp-admin2,199 ▲225.60 ▼0.0594.70 ▲4.7580.87 ▲40.43
Posts /wp-admin/edit.php2,122 ▲222.01 ▲0.0039.88 ▼0.1934.51 ▼1.33
Add New Post /wp-admin/post-new.php6,379 ▲4,85327.59 ▲4.57923.22 ▲319.1240.91 ▼10.20
Media Library /wp-admin/upload.php1,413 ▲134.23 ▲0.02105.47 ▲5.4748.03 ▲5.81

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 11× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/review-widgets-for-amazon/tabs/rate.php
    • > /wp-content/plugins/review-widgets-for-amazon/tabs/feature_request.php
    • > /wp-content/plugins/review-widgets-for-amazon/tabs/setup_trustindex_join.php
    • > /wp-content/plugins/review-widgets-for-amazon/tabs/my_reviews.php
    • > /wp-content/plugins/review-widgets-for-amazon/settings.php
    • > /wp-content/plugins/review-widgets-for-amazon/tabs/advanced.php
    • > /wp-content/plugins/review-widgets-for-amazon/tabs/get_reviews.php
    • > /wp-content/plugins/review-widgets-for-amazon/tabs/setup_no_reg_header.php
    • > /wp-content/plugins/review-widgets-for-amazon/trustindex-amazon-widget.class.php
    • > /wp-content/plugins/review-widgets-for-amazon/review-widgets-for-amazon.php
  • 12× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/review-widgets-for-amazon/include/activate.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'TrustindexPlugin_amazon' not found in wp-content/plugins/review-widgets-for-amazon/tabs/demo_widgets.php:6
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/review-widgets-for-amazon/include/activate.php on line 2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/review-widgets-for-amazon/include/schema.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/review-widgets-for-amazon/include/troubleshooting.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/review-widgets-for-amazon/include/uninstall.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'TrustindexPlugin_amazon' not found in wp-content/plugins/review-widgets-for-amazon/tabs/setup_no_reg_platform.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/review-widgets-for-amazon/uninstall.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'TrustindexPlugin_amazon' not found in wp-content/plugins/review-widgets-for-amazon/tabs/_rate_us_feedback.php:2
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/review-widgets-for-amazon/include/activate.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
You can take inspiration from this readme.txt

review-widgets-for-amazon/review-widgets-for-amazon.php Passed 13 tests

The main PHP file in "Widgets for Amazon Reviews" ver. 11.1 adds more information about the plugin and also serves as the entry point for this plugin
114 characters long description:
Embed Amazon reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Amazon reviews.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin10,485 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP2343389,291
JavaScript63011751,018
CSS413063
SVG42061
JSON10052

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity127.00
▷ Minimum class complexity10.00
▷ Maximum class complexity348.00
Average method complexity4.17
▷ Minimum method complexity1.00
▷ Maximum method complexity59.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods98
▷ Static methods66.12%
▷ Public methods9697.96%
▷ Protected methods00.00%
▷ Private methods22.04%
Functions17
▷ Named functions847.06%
▷ Anonymous functions952.94%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
4 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
static/img/yes.png1.91KB0.25KB▼ 87.08%
static/img/platforms.png10.24KB4.08KB▼ 60.12%
static/img/trustindex-sign-logo.png3.34KB0.59KB▼ 82.47%
static/img/no.png1.92KB0.28KB▼ 85.53%