• Resolved robineero

    (@robineero)


    When I try to delete WooCommerce orders with the following CLI command:

    last_saved_order_date=$(date --date="14 days ago" +"%Y-%m-%d")

    for id in $(wp db query "SELECT id FROM $wp_posts WHERE post_date < '$last_saved_order_date' AND post_type='shop_order'" --skip-column-names); do wp wc shop_order delete $id --user=1 --force=1; done

    I get such warning:

    Warning: Trying to access array offset on value of type null in /data01/virt58713/domeenid/www.[domainname].ee/htdocs/wp-content/plugins/wp-super-cache/wp-cache-phase2.php on line 2989

    When I deactivate the plugin then this warning does not appear.

    Using: WP Super Cache 1.12.1. WP 6.5.3. WooCommerce 8.9.1

Viewing 2 replies - 1 through 2 (of 2 total)
  • That’s an odd one. That warning shows in the code that handles comments in the wp_cache_get_postid_from_comment function. It should only be called if modifying a comment status or editing it. I think it’s being called by the wp_set_comment_status action because it’s triggered by the $status check that requires two parameteres to the function.

    Are there comments in the comments table on those orders?

    Plugin Support Joseph B. (a11n)

    (@tamirat22)

    Hello @robineero,

    Do you have updates about that? We usually close inactive threads after one week of no activity, but we want to make sure we’re all set before marking it as solved. Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.