• Resolved philbee

    (@philbee)


    So I noticed that some WooCommerce plugins throw an error when SQLite Object Cache is enabled while adding products / creating product variations. Nothing dramatic, I thought, just disable the plugin.
    Well, turns out that WooCommerce product variations that use WooCommerce Attribute Swatches by Iconic and created while SQLite is active just disappear when SQLite is off – and, in fact, so do entire attributes, resulting in “Invalid taxonomy” errors. This obviously means it’s not possible to use the edit a single trick described here – the trick is to change the attribute back to normal, non-Swatches, save it, and then disable SQLite.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author OllieJones

    (@olliejones)

    I’v seen similar issues. If you know which plugins throw errors, I can investigate that. If you know whether the same issues happen when you use the Redis Object Cache or some other persistent cache, that will help too.

    I’ll investigate.

    Thread Starter philbee

    (@philbee)

    Hi Ollie,
    thanks a lot for the feedback (and your extremely cool plugin)!
    The plugin that really really didn’t like SQLite was this one. I suspect they’re doing crazy stuff with metadata and taxonomies when saving their modified WooCommerce attributes; I also suspect from experience that it’s not quite as solidly programmed as one would hope for.
    I currently don’t have easy access to a real server with Redis, but I might try to see what happens on my local MAMP Pro – I usually don’t use it as I had not-so-good experiences with Redis on spinupwp-based servers.

    Plugin Author OllieJones

    (@olliejones)

    I have found the problem you describe with plain’ole WooCommerce. It happens also with Redis Object Cache.

    Plugin Author OllieJones

    (@olliejones)

    Steps to reproduce

    1. Enable either SQLite Object Cache (this plugin) or Redis Object Cache.
    2. Create a new variable product.
      • New Product.
      • Product data — variable product
      • Pick the Attributes tab
      • Add New — name it Sides or something.
      • Give the values 4|6|8|12|20
      • Save Attributes.
      • Pick the Variations tab.
      • Generate variations.
      • Add a price
      • Remove a variation.
      • Publish the product
      • View Product, and observe correct set of variations.
    3. Add a variation to the product.
      • Go back to edit the product.
      • Add a new variation and update the product.
      • View the product again, and observe correct set of variations.
      • Deactivate the object cache plugin
      • Refresh the View Product page, and observe that the variation added in step 2 is now gone.

    The edited variation should not vanish when the persistent object cache plugin is disabled.

    Imma reach out to Till and to the WooCommerce team about this

    Oddly enough, flushing the object cache rather than deactivating it does not cause the problem.

    Plugin Author OllieJones

    (@olliejones)

    Here’s the report to WooCommerce. https://github.com/woocommerce/woocommerce/issues/61259

    Here’s the report to Redis Object Cache. https://wordpress.org/support/topic/woocommerce-variations-vanish-upon-object-cache-plugin-deactivation/

    Stephen King might be able to turn this into a story. Vanishing red sweaters reapper mysteriously.

    Plugin Author OllieJones

    (@olliejones)

    Ha! Found it!

    WooCommerce creates transients with names like product-transient-revision and uses their values (timestamps) to cons up the names of other transients. Deactivating a persistent object cache plugin makes those transients’ values revert to whatever they were before the object cache was activated. That is, they revert to stale values. In turn that means that other stale transients get used to look up variants and other product stuff.

    This way of using transients made it into WooCommerce as a fix to their performance defect [#5777](https://github.com/woocommerce/woocommerce/issues/5777) .

    The fix to this plugin is to delete all transients from the database upon activation and deactivation, so no stale values are left.

    https://github.com/OllieJones/sqlite-object-cache/issues/95

    Thread Starter philbee

    (@philbee)

    Ha, cool for you to find the source of the bug.

    While turning Object Cache off probably is not a common scenario, relying completely on it not happening seems like… a bit adventurous from the WooCommerce team.

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.