This class creates and fills the product attributes lookup table
from the existing products. It does so by in small chunks by using
Action Scheduler; it handles all the batches and the scheduling
by itself.
It also adds two entries to the debug tools menu:
- Initiate lookup table regeneration (deleting the existing table first)
- Enable or disable the actual usage of the lookup table
for product filtering
The first one is the only way to generate the lookup table for now
(there's no explicit data migration).
The actual filling of the table is delegated to a LookupDataStore class
that is not implemented yet, so for now the table isn't actually filled.
Also enabling/disabling the lookup table usage has no real effect yet.
Two new optional keys have been added to the tool definition array:
- 'disabled': when true the tool button will appear disabled.
- 'needs_refresh': when running a tool, by default the tool definitions
are retrieved first, then the selected tool is executed,
then the definitions previously retrieved are rendered.
When this key is true the tool definitions are retrieved again
after execution, useful for cases where the tool description
or button enable/disable state changes after the tool execution.
Also now if a tool execution throws an exception a notice will be
shown with the execption message, previously the exception
was unhandled.
- Renaming to prevent conflicts with the existing method in
the newer PHPUnit used in PHP 8.
- Making it static because "assertIsInt" is static too, so it'll be
easier to replace in the future.
Previously, if the product didn't have an explicit low stock value
amount the value of the woocommerce_notify_low_stock_amount option,
which is a string, was returned verbatim.
Also, update related unit tests to create the option value as a string,
and to check that the value returned by woocommerce_notify_low_stock_amount
is always an integer.
The milestone is chosen as follows:
1. List all the open milestones with a title of "X.Y.Z"
2. Sort them desc using verson_compare
3. foreach them in order, and take the last one not having a
corresponding release branch ("release/X.Y")