WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Poll
Great looking simple plugin but my votes wont register (3 posts)

  1. modelcitizen
    Member
    Posted 2 years ago #

    Hi - great, simple poll plugin but votes wont register on mine.

    I can select an answer from the poll, and the answers disappear and the 'view result' link shows, but it shows 0 votes and 0 score for each response.

    Have tried different browsers and different accounts (only logged-in user may vote) and it's just not registering the votes.

    Any ideas?

    http://wordpress.org/extend/plugins/cardoza-wordpress-poll/

  2. badgeguy
    Member
    Posted 2 years ago #

    I am having a very similar issue.

    I am using the WP Mingle plug-in and having members register their accounts through it.

    Members registered through Mingle can not vote and after clicking the Vote button, are directed to their Mingle Activity page.

    Administrators may vote without issue though.

    Could this be a conflict between WP Mingle and WordPress Poll?

    This issue occurs even if I set the voting option to "Anyone can poll."

    Any thoughts?

  3. badgeguy
    Member
    Posted 1 year ago #

    Solved it!!!!!!!!!!!

    My issues were multiple:

    WPPoll utilizes AJAX for storing data, and as such, required access to /wp-admin/admin-ajax.php. This was disabled by selecting (checking) "Prevent Subscribers Access to the WordPress Admin" in the Mingle plug-in settings. When this was unchecked, WPPoll began functioning as expected, but this left the ability for Subscribers to get to the Dashboard.

    To override this, it is necessary to add a few lines of code to the functions.php file in your theme to allow access to admin-ajax.php, but nothing else.

    add_action( 'admin_init', 'blockusers_init' );
    function blockusers_init() {
      if (! is_super_admin() && $_SERVER['PHP_SELF'] != '/wp-admin/admin-ajax.php' ) {
        wp_redirect( home_url() ); exit;
    	}
    }

    This will cause any requests into /wp-admin/ to be redirected to the home page if the user is not logged in as an administrator.

    Note: Make sure that if your site is not in the root of your domain (e.g. http://www.somesiteurl.net/something/), you will need to add the appropriate directory(ies) to the beginning of the /wp-admin/admin-ajax.php path.

    Now the code will run and the directory is not easily accessible.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic