Topic Resolution: Resolved
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #258
    hwillson
    Participant

    Hi guys – I just stumbled across what appears to be a bug in the most recent version. In the wjecf-autocoupon.php file, within the get_all_auto_coupons() function, the meta_query in $query_args is invalid. This means it’s being dropped, always rendering an SQL query like:

    SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = ‘shop_coupon’ AND ((wp_posts.post_status = ‘publish’)) ORDER BY wp_posts.post_title ASC

    The meta_query value should be wrapped in another array() – something like:

    ‘meta_query’ => array(array( ‘key’ => ‘_wjecf_is_auto_coupon’, ‘compare’ => ‘=’, ‘value’ => ‘yes’))

    Thanks!

    #259
    Soft79
    Keymaster

    Yes, you’re right!

    Fortunately the bug causes no issues, as later another check is performed to be sure it’s an autocoupon.

    I will fix this in the next release, though. Thanks for letting me know!

    I wonder, how did you stumble upon this?

    #260
    hwillson
    Participant

    Great, and no problem at all!

    Actually in my case it is causing a bit of an issue with regards to performance. I stumbled upon the issue while troubleshooting recent performance issues on our site. See http://cl.ly/0V1r0U1s2L39 for an example of what we’re seeing – a large performance hit when hitting the get_all_auto_coupons() method (we have a lot of coupons so without the restriction check in place, processing takes a while).

    Thanks!

    #261
    Soft79
    Keymaster

    Oops, that’s nasty. And how many msecs for that function after the edit?

    #262
    hwillson
    Participant

    The entire index.php request is down to around 500 ms after the change. Thanks!

    #287
    brianyerkes
    Participant

    I see the 2.3.1 updated version for the free plugin. Is there an update for the pro version? I can’t seem to find where to download the plugin within my account on soft79.nl.

    I’ve been having major performance issues for a few versions now , and the last two have been unusable. We have over 5,000 coupons on the site. Hoping to try this fix with the pro version. Thanks

    #288
    Soft79
    Keymaster

    Hi Brian,

    If you purchased through soft79.nl the file can be find on your account page, otherwise please let me know your order number (through the contact form). If you purchased through CodeCanyon; the new version has been sent for approval so it should be available soon.

    #296
    brianyerkes
    Participant

    Perfect, thanks. Downloaded the latest from codecanyon

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