83% yotpo-social-reviews-for-woocommerce

Code Review | Yotpo: Product & Photo Reviews for WooCommerce

WordPress plugin Yotpo: Product & Photo Reviews for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: yotpo-social-revi...
  • Plugin version: 1.6.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 7, 2013
  • Latest release: Sep 18, 2023
  • Number of updates: 78
  • Update frequency: every 47.8 days
  • Top authors: Yotpo (100%)

Code review

54 tests

User reviews

179 reviews

Install metrics

4,000+ active /88,553 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼11.29ms] Passed 4 tests

This is a short check of server-side resources used by Yotpo: Product & Photo Reviews for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0035.68 ▼2.69
Dashboard /wp-admin3.31 ▼0.0447.06 ▼11.65
Posts /wp-admin/edit.php3.36 ▲0.0042.57 ▼3.37
Add New Post /wp-admin/post-new.php5.89 ▲0.0080.01 ▼27.45
Media Library /wp-admin/upload.php3.23 ▲0.0033.14 ▼2.66

Server storage [IO: ▲0.14MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 27 new files
Database: no new tables, 7 new options
New WordPress options
wc_yotpo_just_installed
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Yotpo: Product & Photo Reviews for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.17 ▼0.181.77 ▼0.0142.50 ▼0.32
Dashboard /wp-admin2,195 ▲185.63 ▲0.0990.85 ▲1.0941.33 ▼0.28
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0433.52 ▼2.0234.16 ▼2.04
Add New Post /wp-admin/post-new.php1,525 ▼323.61 ▲0.69657.76 ▲18.0050.97 ▼12.25
Media Library /wp-admin/upload.php1,403 ▲64.32 ▲0.1597.06 ▼8.2442.53 ▼2.40

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • wc_yotpo_just_installed
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% 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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/yotpo-social-reviews-for-woocommerce/wc_yotpo.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/yotpo-social-reviews-for-woocommerce/templates/wc-yotpo-settings.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Tags: Too many tags (13 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: Add descriptions for screenshots #10, #12, #2, #4, #6, #8 in yotpo-social-reviews-for-woocommerce/assets to your readme.txt
You can look at the official readme.txt

yotpo-social-reviews-for-woocommerce/wc_yotpo.php 77% from 13 tests

The entry point to "Yotpo: Product & Photo Reviews for WooCommerce" version 1.6.6 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Requires at least: Required version does not match the one declared in readme.txt ("3.5.1" instead of "3.0")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 257 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("yotpo-social-reviews-for-woocommerce.php" instead of "wc_yotpo.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,896 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP14109381,681
JavaScript4180127
CSS37072
YAML14216

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity21.00
▷ Minimum class complexity8.00
▷ Maximum class complexity34.00
Average method complexity1.98
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods41
▷ Static methods37.32%
▷ Public methods2458.54%
▷ Protected methods1536.59%
▷ Private methods24.88%
Functions69
▷ Named functions69100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants120.00%
▷ Class constants480.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/logo.png1.24KB0.62KB▼ 50.20%
assets/images/logo_small.png1.45KB0.61KB▼ 57.65%