88% review-widgets-for-tripadvisor

Code Review | WP Tripadvisor Review Widgets

WordPress plugin WP Tripadvisor Review Widgets scored 88% from 54 tests.

About plugin

  • Plugin page: review-widgets-fo...
  • Plugin version: 8.2.1
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9
  • WordPress version: 5.9.2
  • First release: Dec 5, 2019
  • Latest release: Mar 2, 2022
  • Number of updates: 129
  • Update frequency: every 6.3 days
  • Top authors: trustindex (100%)

Code review

54 tests

User reviews

37 reviews

Install metrics

6,000+ active / 84,686 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.74MB] [CPU: ▼293.42ms] Passed 4 tests

Analyzing server-side resources used by WP Tripadvisor Review Widgets
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.27 ▲0.7561.24 ▲9.77
Dashboard /wp-admin4.13 ▲0.7238.00 ▲4.88
Posts /wp-admin/edit.php4.34 ▲0.7045.04 ▲9.03
Add New Post /wp-admin/post-new.php7.99 ▲1.0186.22 ▼1,191.21
Media Library /wp-admin/upload.php4.08 ▲0.7827.28 ▲3.61

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 113 new files
Database: no new tables, 2 new options
New WordPress options
trustindex-tripadvisor-active
trustindex-tripadvisor-version

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP Tripadvisor Review Widgets
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,848 ▲10416.14 ▲0.517.10 ▲1.232.07 ▼0.49
Dashboard /wp-admin2,978 ▲1206.17 ▼0.02124.44 ▼8.68175.08 ▲19.36
Posts /wp-admin/edit.php2,772 ▲783.15 ▼0.0867.02 ▼0.17145.02 ▲0.63
Add New Post /wp-admin/post-new.php1,723 ▲6216.79 ▲0.20420.17 ▼18.16178.07 ▲20.01
Media Library /wp-admin/upload.php1,783 ▲825.76 ▲0.22128.46 ▼14.35201.25 ▲18.97

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
Please fix the following items
  • 10× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/review-widgets-for-tripadvisor/tabs/get_reviews.php
    • > /wp-content/plugins/review-widgets-for-tripadvisor/tabs/my_reviews.php
    • > /wp-content/plugins/review-widgets-for-tripadvisor/settings.php
    • > /wp-content/plugins/review-widgets-for-tripadvisor/tabs/setup_no_reg_header.php
    • > /wp-content/plugins/review-widgets-for-tripadvisor/tabs/setup_trustindex.php
    • > /wp-content/plugins/review-widgets-for-tripadvisor/tabs/rate.php
    • > /wp-content/plugins/review-widgets-for-tripadvisor/tabs/troubleshooting.php
    • > /wp-content/plugins/review-widgets-for-tripadvisor/tabs/setup_trustindex_join.php
    • > /wp-content/plugins/review-widgets-for-tripadvisor/trustindex-tripadvisor-widget.class.php
    • > /wp-content/plugins/review-widgets-for-tripadvisor/review-widgets-for-tripadvisor.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/review-widgets-for-tripadvisor/tabs/setup_no_reg.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'TrustindexPlugin_tripadvisor' not found in wp-content/plugins/review-widgets-for-tripadvisor/tabs/demo_widgets.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'TrustindexPlugin_tripadvisor' not found in wp-content/plugins/review-widgets-for-tripadvisor/tabs/setup_no_reg_platform.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/review-widgets-for-tripadvisor/uninstall.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
The official readme.txt might help

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

The primary PHP file in "WP Tripadvisor Review Widgets" version 8.2.1 is used by WordPress to initiate all plugin functionality
124 characters long description:
Embed Tripadvisor reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Tripadvisor reviews.

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
Good job! No executable or dangerous file extensions detected7,208 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP1643337,163
SVG40027
CSS32012
JavaScript6006

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity99.67
▷ Minimum class complexity9.00
▷ Maximum class complexity266.00
Average method complexity4.01
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods78
▷ Static methods67.69%
▷ Public methods7697.44%
▷ Protected methods00.00%
▷ Private methods22.56%
Functions12
▷ Named functions541.67%
▷ Anonymous functions758.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.01MB 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/trustindex-sign-logo.png0.68KB0.46KB▼ 32.04%
static/img/no.png1.92KB0.28KB▼ 85.53%
static/img/platforms.png10.24KB4.08KB▼ 60.12%