94% woocommerce-trusted-shops

Code Review | Trustbadge Reviews for WooCommerce

WordPress plugin Trustbadge Reviews for WooCommerce scored 94% from 54 tests.

About plugin

  • Plugin page: woocommerce-trust...
  • Plugin version: 4.0.13
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9
  • WordPress version: 5.9.2
  • First release: Dec 8, 2014
  • Latest release: Jan 21, 2022
  • Number of updates: 31
  • Update frequency: every 84.0 days
  • Top authors: vendidero (96.77%)trustbadge (6.45%)

Code review

54 tests

User reviews

4 reviews

Install metrics

3,000+ active / 24,620 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.18MB] [CPU: ▼295.83ms] Passed 4 tests

Server-side resources used by Trustbadge Reviews for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.76 ▲0.2457.90 ▲9.51
Dashboard /wp-admin3.59 ▲0.1833.84 ▲1.35
Posts /wp-admin/edit.php3.81 ▲0.1838.60 ▲0.54
Add New Post /wp-admin/post-new.php7.11 ▲0.1592.85 ▼1,186.33
Media Library /wp-admin/upload.php3.53 ▲0.2424.15 ▲1.14

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 126 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Trustbadge Reviews for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,805 ▲8315.69 ▲0.026.32 ▲0.802.62 ▲0.47
Dashboard /wp-admin2,905 ▲446.10 ▼0.12114.11 ▼19.97157.35 ▼8.05
Posts /wp-admin/edit.php2,698 ▲103.24 ▲0.0064.99 ▼3.74141.54 ▼15.28
Add New Post /wp-admin/post-new.php1,667 ▲616.28 ▲0.55400.93 ▼60.45159.39 ▲7.15
Media Library /wp-admin/upload.php1,708 ▲105.53 ▼0.02139.73 ▲0.10186.98 ▲0.06

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Almost there! Just fix the following items
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/woocommerce-trusted-shops/vendor/automattic/jetpack-autoloader/src/jetpack-autoloader/class-autoloader.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-trusted-shops/vendor/automattic/jetpack-autoloader/src/autoload.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Automattic\\Jetpack\\Autoloader\\jp5e65e593b1f19f655df5439e3ecd3ec5\\wp_normalize_path() in wp-content/plugins/woocommerce-trusted-shops/vendor/jetpack-autoloader/class-path-processor.php:73
    • > PHP Warning
      require_once(wp-content/plugins/woocommerce-trusted-shops/vendor/automattic/jetpack-autoloader/src/jetpack-autoloader/class-autoloader.php): failed to open stream: No such file or directory in wp-content/plugins/woocommerce-trusted-shops/vendor/automattic/jetpack-autoloader/src/autoload.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WC_TS_Compatibility' not found in wp-content/plugins/woocommerce-trusted-shops/includes/compatibility/class-wc-ts-compatibility-wpml-string-translation.php:11
    • > PHP Fatal error
      Uncaught Error: Interface 'Composer\\Plugin\\PluginInterface' not found in wp-content/plugins/woocommerce-trusted-shops/vendor/automattic/jetpack-autoloader/src/CustomAutoloaderPlugin.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: Too many tags (33 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

woocommerce-trusted-shops/woocommerce-trusted-shops.php Passed 13 tests

The main file in "Trustbadge Reviews for WooCommerce" v. 4.0.13 serves as a complement to information provided in readme.txt and as the entry point to the plugin
86 characters long description:
Adds Seller and Product Reviews or Trusted Shops Integration to your WooCommerce Shop.

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
There were no executable files found in this plugin8,794 lines of code in 99 files:
LanguageFilesBlank linesComment linesLines of code
PHP841,7002,8575,851
PO File35326692,302
Sass3380215
JavaScript26313203
CSS6301163
JSON10060

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity15.87
▷ Minimum class complexity1.00
▷ Maximum class complexity89.00
Average method complexity2.88
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes54
▷ Abstract classes11.85%
▷ Concrete classes5398.15%
▷ Final classes11.89%
Methods430
▷ Static methods5913.72%
▷ Public methods36284.19%
▷ Protected methods214.88%
▷ Private methods4710.93%
Functions20
▷ Named functions1470.00%
▷ Anonymous functions630.00%
Constants10
▷ Global constants440.00%
▷ Class constants660.00%
▷ Public constants6100.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
11 PNG files occupy 0.46MB with 0.32MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/ts/ts_trustbadge_trustmark_reviews_fr.png43.10KB10.51KB▼ 75.61%
assets/images/ts/ts_fr.png67.03KB26.41KB▼ 60.60%
assets/images/ts/ts_trustbadge_trustmark_reviews_de.png43.23KB10.64KB▼ 75.38%
assets/images/ts/trusted-shops-badge@2x.png56.67KB15.90KB▼ 71.94%
assets/images/ts/ts_trustbadge_trustmark-only_en.png21.51KB7.70KB▼ 64.22%