Support » Plugin: YOP Poll » Bad Request

  • Resolved Bmadley

    (@bmadley)


    Hi,

    First off, love the plugin. It’s great. One thing I noticed recently was that sometimes when someone fills out a poll they get a “Bad Request” message at the top and I was wondering if you had any thoughts on what might cause that. It seemed to be happening in Google Chrome but not in Safari when I checked. I recently installed W3 Total Cache and wondered if that might be causing the hiccup and when I cleared the cache the polls did seem to work again so perhaps that’s it. Do you know if caching plugins can occasionally conflict with the polls?

    Also, if I wanted to change the “Bad Request” message that appears at the top of the poll when that happens, is there a place in the code that I could make that alteration?

    Thanks for all your help and this great plugin!

    Brad

    https://wordpress.org/plugins/yop-poll/

Viewing 6 replies - 1 through 6 (of 6 total)
  • I am getting the same problem but it is an apparently random – but quite frequent – issue for my users that is starting to annoy them.

    I use WP Super Cache, but again, most users are able to vote ok but on occasions they get the ‘bad request’ error.

    To be clear, individual users sometimes can vote and sometimes cannot, rather than some always being ok and others always having problems.

    Any thoughts?

    Plugin Author YOP

    (@yourownprogrammer)

    Hi,

    From what we know, W3 Total Cache generates static pages for your posts/website pages and then sends them to the browser.

    Our plugin uses a nonce-field generated each time the poll is being displayed.

    When W3 Total Cache sends static pages it also send the poll and all its fields, including the nonce-field that remains unchanged and this generates the bad request error.

    There is nothing we can do on our end as removing the nonce-field verification would lead to security issues with the votes count.

    You can replace the “bad request” message with a custom message if you follow the instructions below:

    edit inc/yop_poll_model.php and in the register_vote function, approximately on line 2799, replace the Bad Request! message in
    $this->error = __( ‘Bad Request!’, ‘yop_poll’ ); with the message you want so in the end you should have
    $this->error = __( ‘desired_message’, ‘yop_poll’ );

    Nest wishes,

    YOP Team

    Thanks for the reply. Just so I can understand (I’m afraid I am not a techie), does this mean the YOP poll does not work with WP Super Cache?

    The odd thing is that it clearly does work most of the time as I have been running a daily poll for several months and get lots of votes every day.

    However, it seems that for a proportion of voters they either get a ‘bad request’ message or, for some, the poll just does not take their vote.

    Although I am still trying to clarify, it appears those having problems are on mobile devices and possibly using the WPTouch mobile version of the site. Again, others on mobile platforms have been able to vote and those having problems have previously been able to vote.

    The really puzzling thing is that WP Super Cache is specifically set to allow WP Touch so I would not have expected the problem from people viewing this way.

    Anyone successfully using YOP with WPTouch running for mobile devices?
    Anyone doing the same with WP SuperCache too?

    Thanks!

    Update:

    I have been able to repeat the issue myself using a mobile device and the mobile platform served up by WP Touch.

    Basically it is not giving the “Bad response” error but it just doesn’t work – when you click to vote it just refreshes the page but no vote is registered. Same if you click “View results” – it just reloads and doesn’t show the results.

    I have turned WP SUper Cache off and the problem is not changed so this particular aspect does not seem to be related to that but instead seems to be, if anything, a WPTouch issue.

    However, as I have said previously, it has not been as issue previously.

    Plugin Author YOP

    (@yourownprogrammer)

    Hi fratony,

    Edit js/yop-poll-public.js and in yop_poll_show_loading function comment this line

    target_loading_image.alt = yop_poll_public_config.loading_image_alt;

    Regards,

    YOP Team

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Bad Request’ is closed to new replies.