83% popular-products-block

Code Review | Popular Products Block for WooCommerce

WordPress plugin Popular Products Block for WooCommerce scored83%from 54 tests.

About plugin

  • Plugin page: popular-products-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Aug 1, 2022
  • Latest release: Oct 3, 2023
  • Number of updates: 12
  • Update frequency: every 35.7 days
  • Top authors: charlescormier (83.33%)abuhayat (25%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /888 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.08MB] [CPU: ▼2.35ms] Passed 4 tests

Server-side resources used by Popular Products Block for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0940.94 ▼0.31
Dashboard /wp-admin3.38 ▲0.0847.37 ▼0.55
Posts /wp-admin/edit.php3.43 ▲0.0845.22 ▼4.22
Add New Post /wp-admin/post-new.php5.97 ▲0.0996.04 ▼2.90
Media Library /wp-admin/upload.php3.31 ▲0.0835.95 ▼1.74

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

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

Browser metrics Passed 4 tests

Popular Products Block for WooCommerce: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,889 ▲15413.97 ▼0.677.34 ▲5.4043.87 ▼0.19
Dashboard /wp-admin2,218 ▲274.87 ▼1.03106.52 ▼9.4242.81 ▼4.40
Posts /wp-admin/edit.php2,100 ▲142.01 ▼0.0135.54 ▲0.1137.50 ▲4.03
Add New Post /wp-admin/post-new.php6,266 ▲4,73219.88 ▼3.33817.87 ▲135.7335.97 ▼14.89
Media Library /wp-admin/upload.php1,400 ▲124.21 ▼0.0197.09 ▼2.9842.87 ▼0.22

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant WPP_PLUGIN_VERSION - assumed 'WPP_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/popular-products-block/dist/editor.asset.php on line 3
    • > PHP Warning
      Use of undefined constant WPP_PLUGIN_VERSION - assumed 'WPP_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/popular-products-block/dist/script.asset.php on line 3

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Requires at least: Invalid plugin version format
The official readme.txt might help

popular-products-block/index.php 85% from 13 tests

The entry point to "Popular Products Block for WooCommerce" version 1.0.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("popular-products-block.php" instead of "index.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 plugin539 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP34415263
JSON200159
PO File14886114
CSS2022
JavaScript1011

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.23
Average class complexity13.00
▷ Minimum class complexity5.00
▷ Maximum class complexity21.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods213.33%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.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
There are no PNG files in this plugin