The WooCommerce 11.1 deletion advisory tells custom order data-store maintainers to check existing get_item_ids and delete_items_by_ids declarations. A private helper, different argument order, narrower visibility, incompatible return, or inherited trait method can produce a fatal error or silently retain the old lifecycle.
Use this for HPOS replacements, remote order stores, ERP-backed orders, sharded databases, order-table experiments, traits, decorators, test doubles, and plugins that replace WooCommerce data-store classes.
Quick answer
Build a runtime inventory of every class selected for order and refund data stores, including parent classes and traits. Search source for get_item_ids, delete_items_by_ids, delete_items, remove_order_items, and data-store registration filters. Compare visibility, static state, parameters, defaults, variadics, return declarations, and behavior with the WooCommerce 11.1 class actually installed. Instantiate each selected store in a staging bootstrap, reflect the methods, then run a remove, replace, save, failure, and retry fixture.
Test scenarios to run
Run the same controlled fixture across these branches. Write down the expected result before testing so a surprising response is easy to identify.
| Scenario | Fixture | Expected result |
| Private helper | Same method name | Rename before upgrade |
| Override | Compatible public signature | Runtime fixture passes |
| Old WooCommerce | Class absent | Guard loads safely |
| Trait collision | Inherited method | Resolved explicitly |
Diagnostic table
Use this table to connect the observed behavior to evidence and a verification step.
| Action | Evidence | Verification |
| Inventory selected store classes | Record WooCommerce, PHP, HPOS state, data-store registration filters, selected classes, inheritance chains, traits, autoload order, and supported minimum WooCommerce version. | No incompatible declarations remain in classes or traits. |
| Compare declarations with reflection | Search plugin and must-use code for method declarations and calls, then compare reflection output for declaring class, visibility, static state, required parameters, defaults, and return type. | Old supported WooCommerce versions load without early class-reference failures. |
| Test old and new load order | Test class loading on the oldest supported WooCommerce version as well as 11.1 so compatibility guards do not reference unavailable classes too early. | Original IDs are deleted once and replacements survive. |
| Run removal failure fixtures | Run item removal with a replacement before save, a save exception, and a retry while comparing in-memory items, persisted rows, hooks, totals, and downstream consumers. | Reflection and behavior fixtures run automatically in CI. |
What to check first
- Record WooCommerce, PHP, HPOS state, data-store registration filters, selected classes, inheritance chains, traits, autoload order, and supported minimum WooCommerce version.
- Search plugin and must-use code for method declarations and calls, then compare reflection output for declaring class, visibility, static state, required parameters, defaults, and return type.
- Test class loading on the oldest supported WooCommerce version as well as 11.1 so compatibility guards do not reference unavailable classes too early.
- Run item removal with a replacement before save, a save exception, and a retry while comparing in-memory items, persisted rows, hooks, totals, and downstream consumers.
- Rename unrelated private helpers, implement the documented optional method only when intended, add version guards where needed, and retain a CI reflection fixture.
Field notes
- Write the pass condition before changing anything and keep one repeatable synthetic fixture for the full test window.
- Record exact versions and UTC timestamps because deployments, caches, retries, scheduled actions, and background jobs can change the evidence.
- Test the public path and the stored server-side result, not only an admin preview, isolated command, or API response.
- Repeat verification after the relevant cache, queue, cron, webhook, and observation window has completed.
Useful command or data shape
Adapt paths, IDs, and privacy handling to the site before running commands or storing data on production.
rg -n 'function\s+(get_item_ids|delete_items_by_ids|delete_items)\s*\(' wp-content/plugins wp-content/mu-plugins
wp eval 'print_r((new ReflectionMethod(My_Order_Store::class, "delete_items_by_ids"))->getParameters());'
Why this usually happens
- A generic helper name predates the new optional WooCommerce method.
- A child method narrows visibility or changes required parameters.
- A trait supplies the method unexpectedly after autoload composition.
- A compatibility guard runs after PHP has already validated an incompatible class declaration.
Decision rule
Upgrade only when every selected custom store loads on supported versions, method declarations match the intended contract, and removal plus replacement behavior passes after failure and retry.
Production verification checklist
- No incompatible declarations remain in classes or traits.
- Old supported WooCommerce versions load without early class-reference failures.
- Original IDs are deleted once and replacements survive.
- Reflection and behavior fixtures run automatically in CI.
Safe fix order
Use a sequence that makes each result easy to prove. Stop when new evidence changes the scope or owner of the problem.
- Inventory selected store classes
- Compare declarations with reflection
- Test old and new load order
- Run removal failure fixtures
- Add the scan to CI
Mistakes to avoid
- Changing production before recording exact versions, UTC timestamps, a stable fixture, the expected result, and a tested rollback point.
- Treating one successful screen as proof while stored records, logs, queues, caches, emails, APIs, and downstream systems remain unchecked.
- Testing only as an administrator instead of using the role, device, locale, cache state, and failure branch that real users reach.
- Leaving temporary exclusions, debug output, helper accounts, broad permissions, or one-off repair code active after verification.
Questions teams ask during testing
Can I run this directly in production?
Begin with read-only evidence and use staging for package, code, database, form, or permission changes. If a production canary is necessary, make it identifiable, reversible, monitored, and unable to expose personal data or charge a customer.
How do I avoid a false positive?
Repeat the same fixture with the same versions, role, URL, locale, cache state, and downstream integrations. Compare browser, stored, and log evidence instead of relying on one screen.
What should the evidence packet contain?
Keep UTC time, exact versions, synthetic record ID, expected result, actual result, relevant log lines, change made, rollback point, owner, and final verification. Redact secrets and personal data.
When is the test complete?
Close the work when the primary path passes, failure branches are understood, stored and downstream records reconcile, temporary changes are removed, and monitoring covers the next update.
What to tell the client or owner
Give the owner a concise packet with the affected workflow, exact versions, UTC test time, fixture ID, expected result, actual result, key logs, change made, rollback point, final result, unresolved risks, owner, and next review date. Remove credentials and personal data before sharing it.
When HandL WP should help
Bring in help when this affects leads, checkout, search visibility, security, paid media reporting, or a client production site. HandL WP can trace the issue through WordPress, hosting, cache, tracking, and Search Console, then verify the workflow after the technical fix.
If this is active on a production site, have HandL WP review a custom WooCommerce data store.
Related HandL WP guides
Use these related guides when the same issue touches tracking, security, checkout, or crawler visibility.
Helpful references