• Resolved max_Q

    (@max_q)


    Hi,

    Your function, prowc_empty_cart_button_check_version(), is evaluating plugin version 1.3.3 to be less than version 1.3.0, leading it to run on every page load.

    Since the first time it runs it creates all the database keys it’s going to create, every additional run throws duplicate entry database errors. Over one hundred on my client’s site on every page load.

    Also, it seems the logic is flawed. It’s looking for options keys that start with “alg_wc_”, from when the plugin belonged to Algoritmika, and migrates them to “prowc_”. But Algoritmika had lots of plugins, not just Empty Cart Button, and when there’s more than just your plugin installed your function grabs options keys from all the other Algoritmika plugins and creates versions of them prefixed with “prowc_”. On my client’s site that’s 115 options keys created for non-existent plugins.

    I’ve had to deactivate your plugin on my client’s site. I’ll keep an eye on your changelogs going forward.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author prowcplugins

    (@prowcplugins)

    Hi,

    I have reviewed your ticket and working on this. Will update our plugin’s next version soon with fixed this issue

    Thanks!

    @prowcplugins Thanks, I just had a related issue here too. It should have been updated 5 months ago!
    The problem is in prowc_empty_cart_button_check_version() function, you are referencing global $version and this returns NULL because $version is not global. This is inside a class, it should be referenced as $this->version.
    The correct code would be:

    function prowc_empty_cart_button_check_version() {
     if (version_compare($this->version, '1.3.0', '<')) {...}
    }

    Maybe I shouldn’t assume global $version is always wrong, maybe that works sometimes in some environments? But for me, since this is in an instantiated class, $this->version returned the version number, otherwise it was NULL.
    This issue was marked resolved by I don’t know how, as both the version check and the database renaming are still a problem in 1.3.4.

    Also, the maker “Algoritmika” was mentioned. In my case the other plugin that got “caught up” in the key renaming problem was by a plugin “Product Prices by User Roles for WooCommerce” by Tyche Softwares. It also uses “alg_wc_” key names. This lead to the same massive debug log file of duplicate key issues.

    Please at least fix the version check problem as that will prevent the DB issues for anybody using the latest version.

    Thanks!

    • This reply was modified 4 years, 1 month ago by Guyinpv. Reason: clarification
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Empty Cart Button creating multiple database errors’ is closed to new replies.