84% product-demand-tracker

Code Review | ProductFlow - Product Demand Tracker for WooCommerce

WordPress plugin ProductFlow - Product Demand Tracker for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: product-demand-tr...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.2
  • WordPress version: 6.3.1
  • First release: Jun 6, 2023
  • Latest release: Jun 6, 2023
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: wdraihan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /55 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼3.72ms] Passed 4 tests

An overview of server-side resources used by ProductFlow - Product Demand Tracker for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0342.22 ▲8.13
Dashboard /wp-admin3.34 ▲0.0446.57 ▼1.75
Posts /wp-admin/edit.php3.46 ▲0.1053.81 ▲3.06
Add New Post /wp-admin/post-new.php5.94 ▲0.0685.81 ▼18.64
Media Library /wp-admin/upload.php3.27 ▲0.0437.98 ▲2.46

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

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

Browser metrics Passed 4 tests

ProductFlow - Product Demand Tracker for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲2614.73 ▲0.381.82 ▼0.2241.39 ▼4.43
Dashboard /wp-admin2,218 ▲415.88 ▲0.21104.77 ▲16.5740.66 ▼0.08
Posts /wp-admin/edit.php2,123 ▲202.26 ▲0.2954.53 ▲12.3741.91 ▲3.88
Add New Post /wp-admin/post-new.php1,547 ▲2123.35 ▼0.17693.75 ▼63.3655.44 ▼4.38
Media Library /wp-admin/upload.php1,423 ▲234.51 ▲0.33114.58 ▲10.8946.25 ▲3.18

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

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 everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_users() in wp-content/plugins/product-demand-tracker/admin/partials/product-demand-tracker-admin-display.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 22 tag instead of maximum 10
You can look at the official readme.txt

product-demand-tracker/product-demand-tracker.php Passed 13 tests

"ProductFlow - Product Demand Tracker for WooCommerce" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
129 characters long description:
With this plugin, you can easily track the number of items added to users' carts and get insights into product demand and trends.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin297 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP798306236
CSS113455
JavaScript1216

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity2.25
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.26
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods1578.95%
▷ Protected methods00.00%
▷ Private methods421.05%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
No PNG files were detected