• Resolved Wayne

    (@waynep16)


    The new version 5.1.0.1 breaks our load more blocks.

    I can’t show you the URL as we have rolled back to the previous version to fix but the console was

    400 error

    admin-ajax.php?id=&post_id=0&slug=home&canonical_url=https%3A%2F%2Fmoneybox.staging.wpengine.com%2Fblog%2F&posts_per_page=4&page=0&offset=0&post_type=post&repeater=default&seo_start_page=1&preloaded=false&preloaded_amount=0&category=academy&order=DESC&orderby=date&action=alm_get_posts&query_type=standard”

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Darren Cooney

    (@dcooney)

    Hi @waynep16,
    Is version 5.0.2 working?

    thanks,

    Thread Starter Wayne

    (@waynep16)

    Yes, 5.02 is working as you can see here :

    https://www.moneyboxapp.com/blog/ (underneath the featured post you will see all our load mores)

    but when we upgrade to 5.1.0.1. all our load mores appear blank

    Plugin Author Darren Cooney

    (@dcooney)

    Hi @waynep16 Not sure what would be causing this. Until another user reports it I’ll have to assume an issue occurred during the update and it was an anomaly.

    Same issue here since latest updates. I am currently investigating why this happens.

    Request failed with status code 400
    ajax-load-more.min.js:1 XHR failed loading: GET "https://.../wp-admin/admin-ajax.php?action=alm_query_posts&nonce=688c0950ab&query_type=standard&id=&post_id=137&slug=cat&canonical_url=removed&posts_per_page=3&page=5&offset=3&post_type=post&repeater=default&seo_start_page=1&preloaded=false&preloaded_amount=0&category=cat&order=DESC&orderby=date"

    I can confirm that reverting to 5.0.2 is working, as previously reported above.

    After repeating update from 5.0.2 -> 5.1.0.1 issue re-appeared. It was definitely not an update glitch (unless it occurred exactly the same again).

    • This reply was modified 5 years, 6 months ago by Darko A7.
    • This reply was modified 5 years, 6 months ago by Darko A7.
    Plugin Author Darren Cooney

    (@dcooney)

    thanks @darko-a7. Im just not sure, I don’t believe anything changed in the query parameters from 5.0.2 to 5.1.

    The server appears to be blocking the request, are you running a security plugin?

    No, and shortcode is the same in the theme. I cleared cache, but maybe that command is broken in the caching plugin, and nonce was invalid. That is my only guess atm.

    Update (I was testing while typing above): nope, disabled cache, performed auto-update from WP admin dash and it still doesn’t work. Same 400 error in server logs.

    * * *

    Further testing reveals that it is not server-related, this is definitely WP (or most probably your plugin) doing somewhere, since reverting back to plugin’s version 5.0.2 (while keeping WordPress 5.2.0, of course) works. Have you changed something in shortcode-related processing?

    admin-ajax.php is correctly hit with the e.g. request:

    [Fri May 10 07:48:38.052145 2019] [:error] [pid 14484] [client 1.2.3.4:62152] a:18:{s:6:"action";s:15:"alm_query_posts";s:5:"nonce";s:10:"146544c70d";s:10:"query_type";s:8:"standard";s:2:"id";s:0:"";s:7:"post_id";s:1:"0";s:4:"slug";s:4:"home";s:13:"canonical_url";s:22:"https://example.org/";s:14:"posts_per_page";s:1:"3";s:4:"page";s:1:"0";s:6:"offset";s:1:"3";s:9:"post_type";s:4:"post";s:8:"repeater";s:7:"default";s:14:"seo_start_page";s:1:"1";s:9:"preloaded";s:5:"false";s:16:"preloaded_amount";s:1:"0";s:16:"category__not_in";s:3:"137";s:5:"order";s:4:"DESC";s:7:"orderby";s:4:"date";}, referer: https://example.org/

    Reverting back to plugin version 5.0.2 it immediately starts working again, even without original page reload. This indicates it is related to php code change somewhere.

    Plugin Author Darren Cooney

    (@dcooney)

    Thanks for this @darko-a7
    The only thing that changed in the query was the addition of this custom WP_Query argument.
    $args['alm_query'] = ($single_post) ? 'single_posts' : 'alm';

    Mind telling me is this is localhost or hosted somewhere else?

    This is production server running PHP 7.0.33-0ubuntu0.16.04.3, not tested on localhost yet.

    Maybe there’s a conflict with this plugin https://www.ads-software.com/plugins/disable-json-api/ which I use.

    update #1: nope, disabling that plugin doesn’t solve the issue.

    update #2: I forgot to clear the browser’s cache, yes, it is working now! So, that plugin which disables REST API, is the problem, apparently! I have uninstalled it, wonder if there’s a better way to disable REST API without some ‘hacks’.

    Not sure why this happens, as I haven’t really looked into the code of your plugin yet, this was just basic checking.

    Also, I see that in admin-ajax.php we have some action checks that throw 400 in certain cases, wonder if that is the problem here.

    • This reply was modified 5 years, 6 months ago by Darko A7.
    Plugin Author Darren Cooney

    (@dcooney)

    Also, I see that in admin-ajax.php we have some action checks that throw 400 in certain cases, wonder if that is the problem here.

    That’s what I don’t understand because the actual querystring params have not changed from 5.0 to 5.1.

    You dont happen to have a stage environment of this site, do you?

    Hi, check my edited post – problem is fixed! ??
    Thanks for your time & support!

    Plugin Author Darren Cooney

    (@dcooney)

    Hmm, ok thanks!
    Wonder why tho, since 5.1.0.1 actually removes the REST API update which I added in 5.1.0 ??

    Hoping to hear back from this user as well.
    https://www.ads-software.com/support/topic/broken-all-after-update-5-2/

    Hmm, I also wanted to check 5.1.0, but it is not available in download section, because in that version I think you had an option to revert back to admin-ajax. I hope that while doing the revert you didn’t forget some important place? Just speculating ??

    I still have to figure out how to prevent anonymous guests accessing api (without breaking your plugin).

    Replaced with this plugin: https://www.ads-software.com/plugins/disable-wp-rest-api/

    and it is working so far.

    I am also having issues with this plugin. I’ve been using the plugin successfully for a couple of year and issues only started last month. I’m seeing error 400’s and am not sure how to resolve them.

    • This reply was modified 5 years, 5 months ago by highclarity.
Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Latest update breaks site’ is closed to new replies.