78% review-widgets-for-hotels-com

Code Review | Widgets for Hotels.com Reviews

WordPress plugin Widgets for Hotels.com 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: Jun 4, 2020
  • Latest release: Nov 24, 2023
  • Number of updates: 142
  • Update frequency: every 8.9 days
  • Top authors: trustindex (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /7,959 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▲0.94ms] Passed 4 tests

Server-side resources used by Widgets for Hotels.com Reviews
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1043.64 ▲6.06
Dashboard /wp-admin3.43 ▲0.1351.74 ▲1.13
Posts /wp-admin/edit.php3.53 ▲0.1750.74 ▲1.57
Add New Post /wp-admin/post-new.php6.14 ▲0.2586.12 ▼2.62
Media Library /wp-admin/upload.php3.37 ▲0.1437.67 ▲3.69

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 131 new files
Database: 1 new table, 8 new options
New tables
wp_trustindex_hotels_reviews
New WordPress options
db_upgraded
can_compress_scripts
trustindex-hotels-active
trustindex-hotels-version
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Widgets for Hotels.com Reviews
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,809 ▲4714.58 ▼0.131.75 ▲0.0144.01 ▲5.93
Dashboard /wp-admin2,202 ▲285.54 ▼0.1293.76 ▼2.9476.76 ▲32.96
Posts /wp-admin/edit.php2,122 ▲191.99 ▲0.0139.40 ▼0.6235.24 ▲4.08
Add New Post /wp-admin/post-new.php6,426 ▲4,90029.26 ▲5.42940.43 ▲304.0442.66 ▼3.80
Media Library /wp-admin/upload.php1,413 ▲134.23 ▲0.04100.22 ▲5.0466.28 ▲26.70

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

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 | 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
  • 11× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/review-widgets-for-hotels-com/settings.php
    • > /wp-content/plugins/review-widgets-for-hotels-com/review-widgets-for-hotels-com.php
    • > /wp-content/plugins/review-widgets-for-hotels-com/tabs/advanced.php
    • > /wp-content/plugins/review-widgets-for-hotels-com/tabs/feature_request.php
    • > /wp-content/plugins/review-widgets-for-hotels-com/trustindex-hotels-widget.class.php
    • > /wp-content/plugins/review-widgets-for-hotels-com/tabs/my_reviews.php
    • > /wp-content/plugins/review-widgets-for-hotels-com/tabs/setup_no_reg_header.php
    • > /wp-content/plugins/review-widgets-for-hotels-com/tabs/rate.php
    • > /wp-content/plugins/review-widgets-for-hotels-com/tabs/get_reviews.php
    • > /wp-content/plugins/review-widgets-for-hotels-com/tabs/setup_trustindex.php
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > 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-hotels-com/include/activate.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/review-widgets-for-hotels-com/tabs/setup_no_reg.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'TrustindexPlugin_hotels' not found in wp-content/plugins/review-widgets-for-hotels-com/tabs/demo_widgets.php:6
    • > 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-hotels-com/include/activate.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'TrustindexPlugin_hotels' not found in wp-content/plugins/review-widgets-for-hotels-com/tabs/setup_no_reg_platform.php:1
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/review-widgets-for-hotels-com/include/schema.php:4
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/review-widgets-for-hotels-com/include/uninstall.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'TrustindexPlugin_hotels' not found in wp-content/plugins/review-widgets-for-hotels-com/tabs/_get_more_customers.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/review-widgets-for-hotels-com/uninstall.php:2
    • > 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-hotels-com/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
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Please fix the following attributes:
  • Tags: There are too many tags (14 tag instead of maximum 10)
You can look at the official readme.txt

review-widgets-for-hotels-com/review-widgets-for-hotels-com.php Passed 13 tests

The primary PHP file in "Widgets for Hotels.com Reviews" version 11.1 is used by WordPress to initiate all plugin functionality
122 characters long description:
Embed Hotels.com reviews fast and easily into your WordPress site. Increase SEO, trust and sales using Hotels.com reviews.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected10,475 lines of code in 38 files:
LanguageFilesBlank linesComment linesLines of code
PHP2343389,281
JavaScript63011751,018
CSS413063
SVG42061
JSON10052

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in 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

PNG files should be compressed to save space and minimize bandwidth usage
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/platforms.png10.24KB4.08KB▼ 60.12%
static/img/yes.png1.91KB0.25KB▼ 87.08%
static/img/trustindex-sign-logo.png3.34KB0.59KB▼ 82.47%
static/img/no.png1.92KB0.28KB▼ 85.53%