• Resolved LeslieTP

    (@leslietp)


    I am getting the error message:

    Give needs to upgrade the database but cannot because AJAX does not appear accessible. This could be because your website is password protected, in maintenance mode, or has a specific hosting configuration or plugin active that is preventing access.

    Ajax is enabled on my server at SiteGround and none of the other issues apply.

    What do I need to do to make this error message go away?

    When I added the following code to the plugin it broke my site:

    /**
    * Always return true for Give’s AJAX check.
    *
    * If Give is throwing a false positive for admin-ajax accessibility this will bypass the check within give_test_ajax_works.
    *
    * @return bool
    */
    function my_ajax_works_and_im_positive() {
    return true;
    }

    add_filter( ‘give_test_ajax_works’, ‘my_ajax_works_and_im_positive’ );

    Am I supposed to add that to the functions.php file?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 23 total)
  • Plugin Author Devin Walker

    (@dlocc)

    Hey @leslietp

    Thanks for your question and I’m sorry to hear you’re having problem upgrading. I would only recommend you use that override function if you’ve first created a backup and are completely sure it’s a false positive. To answer your question, you can put that function in your functions.php file. It should work fine. What happened when you used it? You said it “broke” your site. What do you mean by that? What exactly happened?

    Have you checked to see if any plugins like Spam Guard or any other plugins could be preventing our plugin from using admin-ajax.php?

    The problem with telling people to put this in functions.php is that is part of their theme. We need to be putting this not in theme files, which I generally stay away fro editing, unless it’s my own custom theme.

    I actually tried adding the define('ALTERNATE_WP_CRON', true) and it wasn’t fixing my loopback error in Health Check but now it looks like perhaps that had somehow sort of fixed things for this issue but now I’m getting the error:

    Database Update – An unexpected issue occurred during the database update which caused it to stop automatically. Please contact support for assistance.

    ??

    Well, finally got down to the bottom of my web hosts setup with caching and this messages seems to have gone away now. It sure would be nice if the update process played nicely with caching setups. Kind of a big pain with this.

    Plugin Author Devin Walker

    (@dlocc)

    @tnolte – thanks for the update. We are attempting to make the upgrades as compatible as possible but it can be difficult with the many WordPress setups out there. Sometimes things can conflict even despite our best efforts. We’ll keep on tryin’ to make it as close to 100% compatible with every setup under the sun.

    @dlocc ha, well that isn’t quite what I was driving at. I guess what I really was getting at is that with the wide array of caching setups it would be nice if the update process of a plugin done such that caching wasn’t a factor. I’m not sure if this is due to the ajax nature of the way Give does it’s updates instead of requiring a user to manually step through the steps through traditional page POST requests. I get it that everyone is trying to make things seem “automatic” but sometimes that adds a lot of complexity that ends up requiring a lot of work around.

    It was just a bummer that I feel like I ended up “wasting” a lot of my time to get it fixed. Thanks though.

    Plugin Author Devin Walker

    (@dlocc)

    @tnolte we never want to waste anyones times. We’re definitely looking into ways to improve the update process and appreciate your feedback.

    Hi,

    Sorry but I have the same issue. I use Give Version 2.1.1
    Give needs to upgrade the database but cannot because AJAX does not appear accessible. This could be because your website is password protected, in maintenance mode, or has a specific hosting configuration or plugin active that is preventing access.

    I tried everything above but still can’t update.

    Any tricks ?

    Thanks in advance.

    • This reply was modified 6 years, 6 months ago by natdepierre.
    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    Hi @natdepierre

    If you KNOW that admin-ajax works, you can add this snippet:

    function my_ajax_works_and_im_positive() {
    return true;
    }
    
    add_filter( 'give_test_ajax_works', 'my_ajax_works_and_im_positive' );

    But if you add that, and it still doesn’t update correctly, then it’s most likely one or more of the following issues:

    1) Database caching can prevent the update from working. Ask your host about memcache and ask them to temporarily disable is while you run the update. Or you might have a plugin like W3TC or Siteground’s SuperCacher that has memcache built into it. Disable ALL server and plugin caching that you can find.

    2) You might have a security plugin that is preventing Give from adding new database tables. Ask your host about that, and/or deactivate any security plugins you have running while you do the update.

    Try both of those and let me know how it goes.

    Thanks!

    Hi,

    Thanks for replying.
    I really can’t update the database.

    I don’t have security plugin, I talked with the host team and I don’t have Memche (they said).

    Is there any way we can resolve this problem ?

    Many thanks

    Thread Starter LeslieTP

    (@leslietp)

    My post is marked as resolved, but it’s really not.

    This happens on every site where I try to use your plugin.

    At this point I’m ready to uninstall it and try something else. Seems like you’d take more of an interest in solving this.

    Just saying.

    Plugin Author Matt Cromwell

    (@webdevmattcrom)

    @natdepierre — if you add that snippet I provided, then you’ll be able to access “Donations > Updates” and then you just click the Update button in order to have Give do the database update automatically.

    @leslietp — we have solved this issue with many users and have taken it very seriously. What is the current state of your issue? Have you reached out to us via our contact form? I might be able to help more over there: https://givewp.com/contact-us
    Choose the option: “You requested that I contact you here” and reference this support ticket and ask for me. Thanks!

    Thread Starter LeslieTP

    (@leslietp)

    The state of the issue is it doesn’t work.

    @leslietp I completely understand your frustrations as I was there also. For me I’m not a WordPress newbie, and even have done my own share of plugin development, so I was sure the Give plugin was the problem. However, I did work with my hosting provider and discovered that CloudFlare featute that was turned was actually to blame. Have you sufficiently worked with your hosting provider and ensured no server caching or configuration is to blame?

    Also, please do contact @webdevmattcrom via the website and provide as much detail as possible as this will help to narrow down the cause.

    The host is completely useless (godaddy). They says it’s the code.
    I have no idea how I can sort this problem out.

    Thanks anyway

    Actually it seems that host was right. ?? I set up an older version of WORD PRESS 4.9.3 and it sorted my problem out.

    Thanks for your time.

Viewing 15 replies - 1 through 15 (of 23 total)
  • The topic ‘Give needs to upgrade the database but cannot because AJAX does not appear’ is closed to new replies.