• Resolved WebPrezence

    (@webprezence)


    Hey fellas!

    I know this is a free plugin on the repository, so by all means, I’m not complaining. You guys have the #1 polling system for WordPress, and I’ve tried ’em all.

    I also like the new templates, and I’m a sucker for premium plugins, so I’d like to look at that.

    In the meantime, after voting, I click “Back to vote”, as I allow 3 votes.

    I get an error: “Bad Request!Try again later

    I’ve refreshed, cleared website & browser cache, etc.; is this a known issue, or am I doing soething wrong with this new administrative interface?

    Thanks!

    https://www.ads-software.com/plugins/yop-poll/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author YOP

    (@yourownprogrammer)

    Hello

    could you send us a link so we can see what is going on?

    Best
    YOP Team

    Thread Starter WebPrezence

    (@webprezence)

    Sure, thanks!

    https://www.justice4jodiarias.com/polls/

    Appreciate your help!

    Plugin Author YOP

    (@yourownprogrammer)

    Hello

    Thank you for sending over the link.
    We were able to identify the problem.

    Please edit the file called admin.php under inc folder and the function called yop_poll_back _to_vote()

    Replace

    if ( wp_verify_nonce( $_REQUEST['nonce'], 'yop_poll-' . $poll_id . $unique_id . '-user-actions' ) ){
                    if( $poll_id ) {
                        require_once( YOP_POLL_MODELS . 'poll_model.php' );
                        $yop_poll_model            = new YOP_POLL_Poll_Model ( $poll_id );
                        $yop_poll_model->unique_id = $unique_id;
                        $poll_html                 = do_shortcode( $yop_poll_model->return_poll_html( array(
                            'tr_id'    => $tr_id,
                            'location' => $location
                        ) ) );
                        if( $poll_html ) {
                            $message = $poll_html;
                            $success = $yop_poll_model->success;
                        }
                        else {
                            $error = $yop_poll_model->error;
                        }
                        unset ( $yop_poll_model );
                    }
                    else {
                        $error = __( 'Invalid Request! Try later!', 'yop_poll' );
                    }
                }
                else $error=__('Bad Request!Try again later','yop_poll');

    with

    if( $poll_id ) {
                        require_once( YOP_POLL_MODELS . 'poll_model.php' );
                        $yop_poll_model            = new YOP_POLL_Poll_Model ( $poll_id );
                        $yop_poll_model->unique_id = $unique_id;
                        $poll_html                 = do_shortcode( $yop_poll_model->return_poll_html( array(
                            'tr_id'    => $tr_id,
                            'location' => $location
                        ) ) );
                        if( $poll_html ) {
                            $message = $poll_html;
                            $success = $yop_poll_model->success;
                        }
                        else {
                            $error = $yop_poll_model->error;
                        }
                        unset ( $yop_poll_model );
                    }
                    else {
                        $error = __( 'Invalid Request! Try later!', 'yop_poll' );
                    }

    Also, in function yop_poll_view_results() replace the code

    if ( wp_verify_nonce( $_REQUEST['nonce'], 'yop_poll-' . $poll_id . $unique_id . '-user-actions' ) ){
                    if( $poll_id ) {
                        require_once( YOP_POLL_MODELS . 'poll_model.php' );
                        $yop_poll_model            = new YOP_POLL_Poll_Model ( $poll_id );
                        $yop_poll_model->unique_id = $unique_id;
                        $yop_poll_model->vote      = true;
                        $poll_html                 = do_shortcode( $yop_poll_model->return_poll_html( array(
                            'tr_id'    => $tr_id,
                            'location' => $location
                        ) ) );
                        if( $poll_html ) {
                            $message = $poll_html;
                            $success = $yop_poll_model->success;
                        }
                        else {
                            $error = $yop_poll_model->error;
                        }
                        unset ( $yop_poll_model );
                    }
                    else {
                        $error = __( 'Invalid Request! Try later!', 'yop_poll' );
                    }
                }
                else
                {
                    $error=__('Bad request!Try again later','yop_poll');
                }

    with

    if( $poll_id ) {
                        require_once( YOP_POLL_MODELS . 'poll_model.php' );
                        $yop_poll_model            = new YOP_POLL_Poll_Model ( $poll_id );
                        $yop_poll_model->unique_id = $unique_id;
                        $yop_poll_model->vote      = true;
                        $poll_html                 = do_shortcode( $yop_poll_model->return_poll_html( array(
                            'tr_id'    => $tr_id,
                            'location' => $location
                        ) ) );
                        if( $poll_html ) {
                            $message = $poll_html;
                            $success = $yop_poll_model->success;
                        }
                        else {
                            $error = $yop_poll_model->error;
                        }
                        unset ( $yop_poll_model );
                    }
                    else {
                        $error = __( 'Invalid Request! Try later!', 'yop_poll' );
                    }

    Let us know if that fixes your issue.

    Best
    YOP Team

    Thread Starter WebPrezence

    (@webprezence)

    Thanks guys. That seemed to have fixed the issue.

    Appreciate you taking the time to help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Having issues w/ latest update, "Back to vote"’ is closed to new replies.