83% recent-products-block

Code Review | Recent Products Block for WooCommerce

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

About plugin

  • Plugin page: recent-products-b...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 29, 2022
  • Latest release: Oct 3, 2023
  • Number of updates: 13
  • Update frequency: every 33.2 days
  • Top authors: charlescormier (76.92%)abuhayat (30.77%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /1,192 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
Installer ran successfully

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

A check of server-side resources used by Recent Products Block for WooCommerce
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0942.14 ▲1.97
Dashboard /wp-admin3.39 ▲0.0849.73 ▼1.50
Posts /wp-admin/edit.php3.44 ▲0.0849.54 ▼4.00
Add New Post /wp-admin/post-new.php5.97 ▲0.0891.33 ▲2.26
Media Library /wp-admin/upload.php3.31 ▲0.0840.07 ▲1.37

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Recent Products Block for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,852 ▲9113.76 ▼0.8311.66 ▲9.9243.45 ▼3.80
Dashboard /wp-admin2,206 ▲265.52 ▼0.0492.73 ▲2.3339.83 ▼2.21
Posts /wp-admin/edit.php2,111 ▲112.14 ▲0.1239.21 ▲4.4834.11 ▲3.19
Add New Post /wp-admin/post-new.php6,382 ▲4,83728.13 ▲4.84966.59 ▲284.8439.66 ▼11.13
Media Library /wp-admin/upload.php1,408 ▲84.26 ▲0.01102.79 ▼7.8848.91 ▲1.76

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • 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)
Even though no errors were found, this is by no means 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 take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant WRP_PLUGIN_VERSION - assumed 'WRP_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/recent-products-block/dist/editor.asset.php on line 3
    • > PHP Warning
      Use of undefined constant WRP_PLUGIN_VERSION - assumed 'WRP_PLUGIN_VERSION' (this will throw an Error in a future version of PHP) in wp-content/plugins/recent-products-block/dist/script.asset.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Requires at least: The plugin version is formatted incorrectly
The official readme.txt is a good inspiration

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

The principal PHP file in "Recent Products Block for WooCommerce" v. 1.0.0 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • 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: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("recent-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 plugin538 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP34415262
JSON200159
PO File14886114
CSS2022
JavaScript1011

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
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

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected