78% blocks-for-products

Code Review | Blocks for Products

WordPress plugin Blocks for Products scored78%from 54 tests.

About plugin

  • Plugin page: blocks-for-products
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.5-5.5
  • WordPress version: 6.3.1
  • First release: Jan 24, 2020
  • Latest release: Mar 31, 2021
  • Number of updates: 7
  • Update frequency: every 61.7 days
  • Top authors: mariovalney (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

70+ active /1,677 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼3.04ms] Passed 4 tests

An overview of server-side resources used by Blocks for Products
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1042.44 ▲4.80
Dashboard /wp-admin3.39 ▲0.0945.14 ▼3.81
Posts /wp-admin/edit.php3.51 ▲0.1549.80 ▲6.15
Add New Post /wp-admin/post-new.php5.97 ▲0.0978.87 ▼18.10
Media Library /wp-admin/upload.php3.31 ▲0.0836.52 ▲4.96

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Blocks for Products: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.33 ▼0.021.71 ▲0.1643.84 ▲6.45
Dashboard /wp-admin2,203 ▲265.52 ▼0.0885.02 ▼1.9242.22 ▼0.45
Posts /wp-admin/edit.php2,112 ▲91.96 ▼0.0234.74 ▼6.5432.70 ▲1.26
Add New Post /wp-admin/post-new.php1,537 ▲1123.41 ▲0.35675.07 ▲48.5357.31 ▼1.74
Media Library /wp-admin/upload.php1,411 ▲174.19 ▼0.0298.04 ▼4.2741.18 ▼3.07

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • 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
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 4× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/blocks-for-products/blocks-for-products.php
    • > /wp-content/plugins/blocks-for-products/modules/dependence/includes/views/html-notice.php
    • > /wp-content/plugins/blocks-for-products/modules/dependence/class-module-dependence.php
    • > /wp-content/plugins/blocks-for-products/modules/woocommerce/class-module-woocommerce.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/blocks-for-products/modules/woocommerce/views/back-to-blocks.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/blocks-for-products/modules/woocommerce/views/new-editor.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/blocks-for-products/modules/woocommerce/views/editor.php:2

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% 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
5 plugin tags: woocommerce, vizir, mariovalney, products, gutenberg

blocks-for-products/blocks-for-products.php 85% from 13 tests

"Blocks for Products" version 1.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("4.7" instead of "3.6.5")
  • Domain Path: The domain path folder does not exist ("/languages")

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
No dangerous file extensions were detected396 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP9117264355
JavaScript22021
CSS12020

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity20.00
▷ Minimum class complexity6.00
▷ Maximum class complexity28.00
Average method complexity3.04
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods28
▷ Static methods00.00%
▷ Public methods2071.43%
▷ Protected methods00.00%
▷ Private methods828.57%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants777.78%
▷ Class constants222.22%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin