83% trustpilot-reviews

Code Review | Trustpilot Reviews

WordPress plugin Trustpilot Reviews scored83%from 54 tests.

About plugin

  • Plugin page: trustpilot-reviews
  • Plugin version: 2.5.925
  • PHP compatiblity: 5.2.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Oct 30, 2018
  • Latest release: Jul 25, 2023
  • Number of updates: 80
  • Update frequency: every 21.6 days
  • Top authors: trustpilotapp (100%)

Code review

54 tests

User reviews

55 reviews

Install metrics

30,000+ active /286,589 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.00MB] [CPU: ▼7.14ms] Passed 4 tests

Server-side resources used by Trustpilot Reviews
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0043.70 ▼1.22
Dashboard /wp-admin3.31 ▲0.0054.87 ▼4.36
Posts /wp-admin/edit.php3.36 ▲0.0051.54 ▼0.28
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.05 ▼22.69
Media Library /wp-admin/upload.php3.23 ▲0.0039.78 ▲2.06

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Trustpilot Reviews
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.75 ▼0.251.78 ▲0.0244.04 ▲1.05
Dashboard /wp-admin2,206 ▲185.84 ▲0.92105.76 ▼1.8241.31 ▼5.62
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0235.05 ▼8.1635.39 ▼1.24
Add New Post /wp-admin/post-new.php1,533 ▼923.12 ▲4.55722.63 ▲86.3252.68 ▼5.28
Media Library /wp-admin/upload.php1,388 ▲34.15 ▼0.03113.03 ▲9.0946.30 ▼4.36

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for 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
Almost there! Just fix the following items
  • 7× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/trustpilot-reviews/helper.php on line 3
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/trustpilot-reviews/helper.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/trustpilot-reviews/helper.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/trustpilot-reviews/review/Plugin.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/trustpilot-reviews/uninstall.php:3
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/trustpilot-reviews/review/Plugin.php on line 11
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/trustpilot-reviews/review/Plugin.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: Please delete some tags, you are using 19 tag instead of maximum 10
The official readme.txt is a good inspiration

trustpilot-reviews/wc_trustpilot.php 77% from 13 tests

The main file in "Trustpilot Reviews" v. 2.5.925 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("trustpilot-reviews.php" instead of "wc_trustpilot.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Requires at least: The required version number must match the one declared in readme.txt ("3.5.1" instead of "3.0")

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 plugin2,474 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP152462872,047
JavaScript83814388
CSS25024
SVG10115

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity23.20
▷ Minimum class complexity3.00
▷ Maximum class complexity56.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods97
▷ Static methods1111.34%
▷ Public methods6061.86%
▷ Protected methods00.00%
▷ Private methods3738.14%
Functions27
▷ Named functions2281.48%
▷ Anonymous functions518.52%
Constants30
▷ Global constants2996.67%
▷ Class constants13.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
logo.png6.14KB3.69KB▼ 39.86%