Checks WooCommerce product database via Woo's REST API to identify items that have no weight or dimensions.

0.1 2019-02-17 09:04 UTC

This package is auto-updated.

Last update: 2022-05-16 13:51:06 UTC


woo-dimension-check is a library that helps to identify WooCommerce products with no weight, length, width, or height.


composer require ckreidl/woo-dimension-check


use ckreidl\WooDimensionCheck;

$url = '';
$key = 'consumer_key';
$secret = 'consumer_secret';

$missing = new WooDimensionCheck\DimChecker($url, $key, $secret);


$missing = new WooDimensionCheck\DimChecker($url, $key, $secret);

print "There are " . count($missing->weight()) . " items missing weights. They are: \n";
array_walk($missing->weight(), function($prod) { print "{$prod->id} "; }); print "\n";


I ran into some issues where the shipping calculators we were using wouldn't play nicely if items didn't have weights and/or measures entered. For example:

  1. Customer adds widget A to their cart, which doesn't have dimensions or a weight listed
  2. Customer proceeds to checkout
  3. Shipping calculator, not knowing the size or weight of widget A, declines to show them shipping options

Meanwhile, another customer adds the same widget A as well as widget B, which does have weight & dimensions

  1. Customer adds widget A to their cart, with no weight or dims
  2. Customer adds widget B, with weight & dims
  3. Shipping calculator defaults to 0 for widget A, solely calculating shipping based off weight and dims of widget B

We can go back and forth all day about what the default behavior should be when an item without this information is encountered. It's my opinion that the database should have that information, so I wrote this little tool to identify items that don't have that data entered.


GPL 3.0