84% product-blocks-for-woocommerce

Code Review | Product Blocks for WooCommerce

WordPress plugin Product Blocks for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: product-blocks-fo...
  • Plugin version: 1.6
  • PHP compatiblity: 5.5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Jan 23, 2019
  • Latest release: Feb 15, 2023
  • Number of updates: 66
  • Update frequency: every 22.5 days
  • Top authors: getbowtied (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

6,000+ active /77,847 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼8.00ms] Passed 4 tests

A check of server-side resources used by Product Blocks for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.79 ▼2.93
Dashboard /wp-admin3.32 ▼0.0348.20 ▼22.21
Posts /wp-admin/edit.php3.37 ▲0.0155.55 ▲7.98
Add New Post /wp-admin/post-new.php5.90 ▲0.0195.00 ▼11.53
Media Library /wp-admin/upload.php3.24 ▲0.0138.55 ▲4.66

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 104 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Product Blocks for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7414.31 ▼0.261.92 ▲0.3145.62 ▲5.02
Dashboard /wp-admin2,201 ▲205.59 ▼0.1294.83 ▼8.9941.68 ▼1.44
Posts /wp-admin/edit.php2,107 ▲72.01 ▲0.0135.05 ▼3.7334.39 ▼0.11
Add New Post /wp-admin/post-new.php1,541 ▲1518.32 ▼5.09661.51 ▼65.4064.01 ▲2.28
Media Library /wp-admin/upload.php1,406 ▲64.27 ▲0.0898.70 ▼17.6844.09 ▼4.71

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/product-blocks-for-woocommerce/includes/gbt-blocks/index.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
6 plugin tags: woocommerce, gutenberg, block, store, product...

product-blocks-for-woocommerce/product-blocks-for-woocommerce.php Passed 13 tests

This is the main PHP file of "Product Blocks for WooCommerce" version 1.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
32 characters long description:
Advanced Blocks for WooCommerce.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin13,390 lines of code in 98 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript286112506,462
Sass29517443,256
CSS27124112,579
PHP141231331,093

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions2395.83%
▷ Anonymous functions14.17%
Constants2
▷ Global constants2100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/placeholder.png23.12KB9.76KB▼ 57.77%