78% woo-gutenberg-products-block

Code Review | WooCommerce Blocks

WordPress plugin WooCommerce Blocks scored78%from 54 tests.

About plugin

  • Plugin page: woo-gutenberg-pro...
  • Plugin version: 11.5.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.3-6.4
  • WordPress version: 6.3.1
  • First release: Apr 24, 2018
  • Latest release: Nov 13, 2023
  • Number of updates: 239
  • Update frequency: every 8.5 days
  • Top authors: automattic (62.76%)ryelle (12.13%)aljullu (8.79%)nerrad (5.02%)claudiulodro (4.18%)

Code review

54 tests

User reviews

90 reviews

Install metrics

100,000+ active /15,363,996 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.02MB] [CPU: ▼4.40ms] Passed 4 tests

Server-side resources used by WooCommerce Blocks
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0239.95 ▼0.05
Dashboard /wp-admin3.33 ▲0.0247.95 ▼3.40
Posts /wp-admin/edit.php3.38 ▲0.0246.44 ▲3.21
Add New Post /wp-admin/post-new.php5.91 ▲0.0292.57 ▼14.79
Media Library /wp-admin/upload.php3.25 ▲0.0234.70 ▲0.66

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 3,189 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for WooCommerce Blocks
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲2814.72 ▲0.372.09 ▲0.1341.40 ▼2.62
Dashboard /wp-admin2,195 ▲185.60 ▼0.0596.01 ▼7.6542.88 ▼2.16
Posts /wp-admin/edit.php2,100 ▼32.03 ▼0.0738.01 ▼1.2429.98 ▼8.28
Add New Post /wp-admin/post-new.php1,526 ▼1023.11 ▲0.08618.31 ▼26.4463.82 ▲8.96
Media Library /wp-admin/upload.php1,403 ▲64.18 ▼0.0398.51 ▼5.0541.11 ▼2.13

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 14× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/woo-gutenberg-products-block/patterns/product-collection-simple-grid.php
    • > /wp-content/plugins/woo-gutenberg-products-block/patterns/product-query-4-column-product-row.php
    • > /wp-content/plugins/woo-gutenberg-products-block/patterns/product-collection-rows.php
    • > /wp-content/plugins/woo-gutenberg-products-block/patterns/product-query-product-list-with-full-product-description.php
    • > /wp-content/plugins/woo-gutenberg-products-block/patterns/header-centered-pattern.php
    • > /wp-content/plugins/woo-gutenberg-products-block/patterns/header-essential.php
    • > /wp-content/plugins/woo-gutenberg-products-block/patterns/product-collection-full-grid.php
    • > /wp-content/plugins/woo-gutenberg-products-block/patterns/product-query-product-list-with-1-1-images.php
    • > /wp-content/plugins/woo-gutenberg-products-block/patterns/product-collection-grid.php
    • > /wp-content/plugins/woo-gutenberg-products-block/patterns/product-query-minimal-product-list.php
  • 438× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\BlockTypes\\AbstractInnerBlock' not found in wp-content/plugins/woo-gutenberg-products-block/src/BlockTypes/CheckoutContactInformationBlock.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-gutenberg-products-block/vendor/composer/installers/src/Composer/Installers/KodiCMSInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-gutenberg-products-block/vendor/composer/installers/src/Composer/Installers/GravInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\StoreApi\\Routes\\V1\\AbstractCartRoute' not found in wp-content/plugins/woo-gutenberg-products-block/src/StoreApi/Routes/V1/CartExtensions.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\Templates\\AbstractTemplateCompatibility' not found in wp-content/plugins/woo-gutenberg-products-block/src/Templates/SingleProductTemplateCompatibility.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\StoreApi\\Routes\\V1\\AbstractTermsRoute' not found in wp-content/plugins/woo-gutenberg-products-block/src/StoreApi/Routes/V1/ProductAttributeTerms.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-gutenberg-products-block/vendor/composer/installers/src/Composer/Installers/VanillaInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\StoreApi\\Routes\\V1\\AbstractTermsRoute' not found in wp-content/plugins/woo-gutenberg-products-block/src/StoreApi/Routes/V1/ProductTags.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woo-gutenberg-products-block/vendor/composer/installers/src/Composer/Installers/PantheonInstaller.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\WooCommerce\\Blocks\\BlockTypes\\AbstractBlock' not found in wp-content/plugins/woo-gutenberg-products-block/src/BlockTypes/ProductGalleryThumbnails.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: woocommerce, gutenberg, products, woo commerce, woocommerce blocks...

woo-gutenberg-products-block/woocommerce-gutenberg-products-block.php 92% from 13 tests

Analyzing the main PHP file in "WooCommerce Blocks" version 11.5.4
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("woo-gutenberg-products-block.php" instead of "woocommerce-gutenberg-products-block.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin148,561 lines of code in 2,897 files:
LanguageFilesBlank linesComment linesLines of code
TypeScript1,1776,90110,93069,559
PHP7348,14122,68939,056
JavaScript4551,4023,14013,459
Sass2071,2602039,241
JSON112005,466
Markdown311,38004,867
XML4304,196
JSX121911871,534
CSS11600610
SVG2710347
YAML4313125
HTML178425098
Bourne Shell1103

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity9.44
▷ Minimum class complexity1.00
▷ Maximum class complexity215.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity46.00
Code structure
Namespaces39
Interfaces5
Traits4
Classes486
▷ Abstract classes173.50%
▷ Concrete classes46996.50%
▷ Final classes142.99%
Methods2,137
▷ Static methods30414.23%
▷ Public methods1,26659.24%
▷ Protected methods65030.42%
▷ Private methods22110.34%
Functions197
▷ Named functions157.61%
▷ Anonymous functions18292.39%
Constants190
▷ Global constants52.63%
▷ Class constants18597.37%
▷ Public constants185100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
34 PNG files occupy 6.28MB with 1.85MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/pattern-placeholders/wood-home-wall-decoration-shelf-living-room.png636.81KB187.94KB▼ 70.49%
assets/js/blocks/classic-template/assets/doc-image-single-product-classic-block.png188.40KB44.24KB▼ 76.52%
images/pattern-placeholders/hand-made-pots.png122.40KB132.94KB0.00%
images/pattern-placeholders/crafting-pots.png148.74KB162.37KB0.00%
images/pattern-placeholders/table-wood-chair-floor-living-room-furniture-horizontal.png279.29KB279.30KB0.00%