10% woocommerce-order-product-count

Code Review | WooCommerce Order Product Count

WordPress plugin WooCommerce Order Product Count scored10%from 54 tests.

About plugin

  • Plugin page: woocommerce-order...
  • Plugin version: 2.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-6.3
  • WordPress version: 6.3.1
  • First release: Apr 4, 2014
  • Latest release: Aug 2, 2023
  • Number of updates: 20
  • Update frequency: every 170.4 days
  • Top authors: dkjensen (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /2,574 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > User error in wp-content/plugins/woocommerce-order-product-count/vendor/composer/platform_check.php+24
    Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.0". You are running 7.4.16.

Server metrics [RAM: ▼1.92MB] [CPU: ▼53.40ms] Passed 4 tests

Analyzing server-side resources used by WooCommerce Order Product Count
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.85 ▼35.49
Dashboard /wp-admin2.10 ▼1.245.90 ▼56.23
Posts /wp-admin/edit.php2.10 ▼1.255.60 ▼40.42
Add New Post /wp-admin/post-new.php2.10 ▼3.796.09 ▼81.45
Media Library /wp-admin/upload.php2.10 ▼1.135.96 ▼27.55

Server storage [IO: ▲92.21MB] [DB: ▲0.00MB] 67% from 3 tests

Input-output and database impact of this plugin
Please fix the following
  • Try to limit filesystem usage to 25MB (currently using 92.21MB)
Filesystem: 668 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

WooCommerce Order Product Count: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲5414.43 ▼0.121.57 ▲0.0243.58 ▲2.37
Dashboard /wp-admin2,194 ▲195.51 ▼0.1180.78 ▼20.5776.96 ▲33.54
Posts /wp-admin/edit.php2,103 ▲32.00 ▲0.0134.44 ▼2.9333.86 ▼4.27
Add New Post /wp-admin/post-new.php1,526 ▼022.71 ▼0.95659.75 ▲3.8957.77 ▲2.16
Media Library /wp-admin/upload.php1,397 ▼34.14 ▼0.0998.77 ▼6.9242.26 ▼3.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall gracefully
    • > User error in wp-content/plugins/woocommerce-order-product-count/vendor/composer/platform_check.php+24
    Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 8.0.0". You are running 7.4.16.
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 230× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/woocommerce-order-product-count/vendor/mpdf/mpdf/src/Tag/Q.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/woocommerce-order-product-count/vendor/mpdf/mpdf/src/Tag/Cite.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Barcode\\AbstractBarcode' not found in wp-content/plugins/woocommerce-order-product-count/vendor/mpdf/mpdf/src/Barcode/Code93.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/woocommerce-order-product-count/vendor/mpdf/mpdf/src/Tag/Dd.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\InlineTag' not found in wp-content/plugins/woocommerce-order-product-count/vendor/mpdf/mpdf/src/Tag/S.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'DeepCopy\\TypeFilter\\TypeFilter' not found in wp-content/plugins/woocommerce-order-product-count/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/ShallowCopyFilter.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\TTFontFile' not found in wp-content/plugins/woocommerce-order-product-count/vendor/mpdf/mpdf/src/TTFontFileAnalysis.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\BlockTag' not found in wp-content/plugins/woocommerce-order-product-count/vendor/mpdf/mpdf/src/Tag/Dt.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Mpdf\\Tag\\SubstituteTag' not found in wp-content/plugins/woocommerce-order-product-count/vendor/mpdf/mpdf/src/Tag/Tts.php:5
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/woocommerce-order-product-count/vendor/mpdf/mpdf/data/CJKdata.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
5 plugin tags: bulk, pdf, export, order, woocommerce

woocommerce-order-product-count/wc-order-product-count.php 85% from 13 tests

This is the main PHP file of "WooCommerce Order Product Count" version 2.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woocommerce-order-product-count.php" instead of "wc-order-product-count.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin79,055 lines of code in 464 files:
LanguageFilesBlank linesComment linesLines of code
PHP41311,69112,75776,410
Markdown1348101,472
JSON2300454
CSS26518405
YAML9634236
XML310075
Bourne Shell1203

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 7,021)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 460)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity55.90
▷ Minimum class complexity1.00
▷ Maximum class complexity7,021.00
Average method complexity13.42
▷ Minimum method complexity1.00
▷ Maximum method complexity460.00
Code structure
Namespaces50
Interfaces20
Traits9
Classes295
▷ Abstract classes82.71%
▷ Concrete classes28797.29%
▷ Final classes144.88%
Methods1,509
▷ Static methods1449.54%
▷ Public methods1,31286.94%
▷ Protected methods563.71%
▷ Private methods1419.34%
Functions36
▷ Named functions1336.11%
▷ Anonymous functions2363.89%
Constants429
▷ Global constants51.17%
▷ Class constants42498.83%
▷ Public constants424100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin