Giter Club home page Giter Club logo

wp-polls's Introduction

WP-Polls

Contributors: GamerZ
Donate link: https://lesterchan.net/site/donation/
Tags: poll, polls, polling, vote, booth, democracy, ajax, survey, post, widget
Requires at least: 4.9.6
Tested up to: 6.3
Stable tag: 2.77.2

Adds an AJAX poll system to your WordPress blog. You can also easily add a poll into your WordPress's blog post/page.

Description

WP-Polls is extremely customizable via templates and css styles and there are tons of options for you to choose to ensure that WP-Polls runs the way you wanted. It now supports multiple selection of answers.

Development

https://github.com/lesterchan/wp-polls

Credits

Donations

I spent most of my free time creating, updating, maintaining and supporting these plugins, if you really love my plugins and could spare me a couple of bucks, I will really appreciate it. If not feel free to use it without any obligations.

Changelog

Version 2.77.2

  • FIXED: Read from default REMOTE_ADDR unless specified in options

Version 2.77.1

  • FIXED: Support mutex lock for multi-site. Props @yrkmann.

Version 2.77.0

  • NEW: Use mutex lock to prevent race condition.

Version 2.76.0

  • NEW: Supports specifying which header to read the user's IP from. Props Marc Montpas.

Version 2.75.6

  • NEW: New filter for template variables: wp_polls_template_votebody_variables, wp_polls_template_votefooter, wp_polls_template_resultheader_variables, wp_polls_template_resultbody_variables, wp_polls_template_resultfooter_variables. Props @Liblastic.
  • NEW: composer.json
  • FIXED: Missing space for check_voted_username MySQL query

Version 2.75.5

  • NEW: New filter for templates: wp_polls_template_resultheader_markup, wp_polls_template_resultbody_markup, wp_polls_template_resultbody2_markup, wp_polls_template_resultfooter_markup, wp_polls_template_resultfooter2_markup. Props @Jaska.

Version 2.75.4

  • FIXED: Unable to edit poll because of class-wp-block-parser.php.

Version 2.75.3

  • FIXED: Broken filter for templates
  • FIXED: Divison by 0 by totalvoters
  • FIXED: Add whitelist to sortby poll answers

Versiob 2.75.2

  • FIXED: Missing str_replace for wp_polls_template filter

Version 2.75.1

  • FIXED: Use array() instead of [] as a few users are still on < PHP 5.4. Props @bearlydoug.
  • FIXED: pollq_expiry is now 0 instead of blank string. Props @hpiirainen.

Version 2.75

  • FIXED: Standardize all filters to begin with wp_polls rather than poll
  • NEW: Added wp_polls_ipaddress and wp_polls_hostname to allow user to overwrite it.

Version 2.74.1

  • FIXED: Don't use PHP 5.4 Short array syntax.
  • FIXED: Division by zero
  • FIXED: Wrong database column type for pollq_expiry

Version 2.74

  • NEW: Hashed IP and anonymize Hostname to make it GDPR compliance
  • NEW: If Do Not Log is set in Poll Options, do not log to DB
  • NEW: Support %POLL_MULTIPLE_ANSWER_PERCENTAGE%. This is total votes divided by total voters.

Version 2.73.8

  • FIXED: Bug fixes and stricter type checking

Version 2.73.7

  • FIXED: Unable to save input HTML tags for footer templates

Version 2.73.6

  • FIXED: Unable to vote for multiple answers
  • FIXED: input HTML tags being removed when saving templates

Version 2.73.5

  • FIXED: Parsed error in SERVER variable.

Version 2.73.4

  • FIXED: sanitize_key on top of intval.

Version 2.73.3

  • NEW: Added sort by votes casted to poll answers.
  • NEW: For polls with mutiple answers, we divided by total votes instead of total voters. Props @ljxprime.
  • FIXED: Do not display poll option is not respected when poll is closed.
  • FIXED: pollip_qid, pollip_aid, pollip_timestamp are now int(10) in pollsip table.
  • FIXED: pollq_expiry is now int(10) in pollsq table.

Version 2.73.2

  • NEW: Bump WordPress 4.7
  • FIXED: Change cron to hourly instead of twice daily.

Version 2.73.1

Version 2.73

  • NEW: Display Poll Questions at the top of the Poll Logs table
  • FIXED: Remove slashes

Version 2.72

  • NEW: Use translate.wordpress.org to translate the plugin
  • FIXED: SQL Injection fixes. Props Jay Dansand
  • FIXED: Use $wpdb->insert(), $wpdb->update() and $wpdb->delete() as much as possible
  • FIXED Remove poll_archive_show option from UI

Version 2.71

  • FIXED: Use wp_kses_post() to get filter always bad tags

Version 2.70

  • NEW: Add wp_polls_vote_poll_success action hook
  • NEW: Add wp_polls_add_poll, wp_polls_update_poll, wp_polls_delete_poll action hooks
  • FIXED: PHP Notices
  • FIXED: Removed not needed wp_print_scripts
  • FIXED: Use esc_attr() and esc_textarea() instead of htmlspecialchars(). Props Govind Singh

Screenshots

  1. Admin - All Poll
  2. Admin - Manage Polls
  3. Admin - Poll Options
  4. Admin - Poll Templates
  5. Admin - Poll Widget
  6. Admin - Uninstall Poll
  7. Poll - Single Poll Answer
  8. Poll - Mutiple Poll Answers
  9. Poll - Results
  10. Poll - Archive

Frequently Asked Questions

General Usage (Without Widget)

<?php if ( function_exists( 'vote_poll' ) && ! in_pollarchive() ): ?>
	<li>
		<h2>Polls</h2>
		<ul>
			<li><?php get_poll();?></li>
		</ul>
		<?php display_polls_archive_link(); ?>
	</li>
<?php endif; ?>
  • To show specific poll, use <?php get_poll(2); ?> where 2 is your poll id.
  • To show random poll, use <?php get_poll(-2); ?>
  • To embed a specific poll in your post, use [poll id="2"] where 2 is your poll id.
  • To embed a random poll in your post, use [poll id="-2"]
  • To embed a specific poll's result in your post, use [poll id="2" type="result"] where 2 is your poll id.

General Usage (With Widget)

  1. Go to WP-Admin -> Appearance -> Widgets.
  2. You can add the Polls Widget by clicking on the 'Add' link besides it.
  3. After adding, you can configure the Polls Widget by clicking on the 'Edit' link besides it.
  4. Click 'Save Changes'.
  5. Scroll down for instructions on how to create a Polls Archive.

How To Add A Polls Archive?

  1. Go to WP-Admin -> Pages -> Add New.
  2. Type any title you like in the post's title area.
  3. If you ARE using nice permalinks, after typing the title, WordPress will generate the permalink to the page. You will see an 'Edit' link just beside the permalink.
  4. Click 'Edit' and type in pollsarchive in the text field and click 'Save'.
  5. Type [page_polls] in the post's content area.
  6. Click 'Publish'.
  • If you ARE NOT using nice permalinks, you need to go to WP-Admin -> Polls -> Poll Options and under Poll Archive -> Polls Archive URL, you need to fill in the URL to the Polls Archive Page you created above.

Why doesn't my poll's answers add up to 100%?

  • It is because of rounding issues. To make it always round up to 100%, the last poll's answer will get the remainding percentage added to it. To enable this feature, add this to your theme's functions.php: add_filter( 'wp_polls_round_percentage', '__return_true' );

How Does WP-Polls Load CSS?

  • WP-Polls will load polls-css.css from your theme's directory if it exists.
  • If it doesn't exists, it will just load the default polls-css.css that comes with WP-Polls.
  • This will allow you to upgrade WP-Polls without worrying about overwriting your polls styles that you have created.

Why In Internet Explorer (IE) The poll's Text Appear Jagged?

  • To solve this issue, Open poll-css.css
  • Find: /* background-color: #ffffff; */
  • Replace: background-color: #ffffff; (where #ffffff should be your background color for the poll.)

How Do I Have Individual Colors For Each Poll's Bar?

  • Courtesy Of TreedBox.com
  • Open poll-css.css
  • Add to the end of the file:
.wp-polls-ul li:nth-child(01) .pollbar{ background:#8FA0C5}
.wp-polls-ul li:nth-child(02) .pollbar{ background:#FF8}
.wp-polls-ul li:nth-child(03) .pollbar{ background:#ff8a3b}
.wp-polls-ul li:nth-child(04) .pollbar{ background:#a61e2a}
.wp-polls-ul li:nth-child(05) .pollbar{ background:#4ebbff}
.wp-polls-ul li:nth-child(06) .pollbar{ background:#fbca54}
.wp-polls-ul li:nth-child(07) .pollbar{ background:#aad34f}
.wp-polls-ul li:nth-child(08) .pollbar{ background:#66cc9a}
.wp-polls-ul li:nth-child(09) .pollbar{ background:#98CBCB}
.wp-polls-ul li:nth-child(10) .pollbar{ background:#a67c52}
.wp-polls-ul li .pollbar{ transition: background 0.7s ease-in-out }
.wp-polls-ul li .pollbar:hover{ background:#F00 }

To Display Total Polls

<?php if ( function_exists( 'get_pollquestions' ) ): ?>
	<?php get_pollquestions(); ?>
<?php endif; ?> 

To Display Total Poll Answers

<?php if ( function_exists( 'get_pollanswers' ) ): ?>
	<?php get_pollanswers(); ?>
<?php endif; ?> 

To Display Total Poll Votes

<?php if ( function_exists( 'get_pollvotes' ) ): ?>
	<?php get_pollvotes(); ?>
<?php endif; ?> 

To Display Poll Votes by ID

<?php if ( function_exists( 'get_pollvotes_by_id' ) ): ?>
	<?php get_pollvotes_by_id($poll_id); ?>
<?php endif; ?>

To Display Total Poll Voters

<?php if ( function_exists( 'get_pollvoters' ) ): ?>
	<?php get_pollvoters(); ?>
<?php endif; ?> 

To Display Poll Time by ID and date format

<?php if ( function_exists( 'get_polltime' ) ): ?>
	<?php get_polltime( $poll_id, $date_format ); ?>
<?php endif; ?>

Translating the template

The plugin templates can be translated via template variables. There are these filters for the custom template variables

wp_polls_template_votebody_variables
wp_polls_template_votefooter
wp_polls_template_resultheader_variables
wp_polls_template_resultbody_variables
wp_polls_template_resultfooter_variables

Add filter to your theme and register custom variable where you will add your translation. Good practice is to name them for example with prefix STR_ in the example STR_TOTAL_VOTERS.

    /**
     * Localize wp_polls_template_resultfooter_variables.
     *
     * @param array $variables An array of template variables.
     * @return array $variables Modified template variables.
     */
    function wp_polls_template_resultfooter_variables( $variables ) {

        // Add strings.
        $variables['%STR_TOTAL_VOTERS%'] = __( 'Total voters', 'theme-textdomain' );

        return $variables;
    }

// Trigger the filter
add_filter( 'wp_polls_template_resultfooter_variables', 'wp_polls_template_resultfooter_variables' , 10, 1 );

In the admin side just call the custom variable like so and the variable has been translated in the front-end. %STR_TOTAL_VOTERS%'

wp-polls's People

Contributors

afragen avatar bderstine avatar eduardoarandah avatar elkirkmo avatar gabcoh avatar ianmezza avatar jamesgol avatar jaska avatar jaydansand avatar judder avatar kasn avatar kmd-thomasbrace avatar lesterchan avatar lockeexile avatar mattskala avatar melson-wesleyan avatar nodecode avatar pakku avatar pathawks avatar raamdev avatar sbruner avatar thesebas avatar xbracey avatar zoul0813 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wp-polls's Issues

/wp-admin/ajax.php

The plug works fine but appearently it needs the visitor/voter access to the '/wp-admin' directory.

We always shut down access to that directory to a few ip-adresses - using .htaccess - to prevent hacking. I run some 30ish sites and the wp-admin directory is locked down in all of them. That normally works fine and we have zero malicious login attempts. Of course there are a hundred or more tries to access that dir per day but with no luck.

Anyway; the issue with WP-polls is that with the .htaccess limits active a casual visitor cannot vote or see the results.

I saw that /wp-admin/admin-ajax.php is mentioned in the shown page source but are there other files?

I will try open that file for reading and close access to the rest.

Adding soundcloud widget to poll

Im trying to find where the information is stored for each poll, to add an option to insert a embedded soundcloud player for a client.

Ive checked phpmyadmin in the database for the entries and it did not match the information from wordpress.

I have no problem editing the template but I need to know how I would be able to add a new column for the soundcloud embed.

Thank you very much.

Does't work for sites with custom home URL

Hello Lester,

our site URL is: http://site.com/wordpress

But our site is operated on (home URL): http://site.com

The voted_{ID of poll} cookies are getting set incorrectly for http://site.com/wordpress because of using the SITECOOKIEPATH define.

Could you please figure out a right way of doing this - that means using the home URL for it? Looking at wp-includes/default-constants.php it appears you only need to change it to COOKIEPATH and it will be fine.

Thanks,
Martin

Voting on iPhones does not work

Hi there,

got a poll running. Everything is working fine, but not on iPhones. If I try to vote there, nothing is counted, the page reloads and the poll is shown again (logging is set to username).

Had a look at the action that is performed when the form is submitted. It says “/index.php”, but my homepage template is set to page-home.php. Maybe this could be the problem, but why is it working on desktop browsers (Safari, Chrome, Firefox etc.).

Kind regards
Alex

Wrong column datatypes?

Hello,

is there any special reason why columns pollip_qid and pollip_aid in pollsip table are VARCHAR and not INT? Also pollip_timestamp is VARCHAR which is rather strange.
Also in pollsq table you have pollq_expiry which seems to be timestamp, stored as varchar.

Could you update those, as you're using ints in your code and indexes don't work if you do polla_qid = 10 and polla_qid is VARCHAR as it needs to convert the value being searched.

Best regards,
Dejan

max_input_vars limitation

When having a poll of around 500 possible answers, you'll hit the default max_input_vars limit of 1000 in PHP. This makes it unable for the user to edit the poll (e.g. add options).

I will submit a pull request later.

Got Problem on manage poll

The problem when i create poll and after that i edit that poll but why some of my answer are display none.
I use code editor to inpect an element and they show me display:none;

notice: yesterday before u commit the new code i try this plugin and it's work fine on one of my project but today i apply it with my second project and the problem come up.

sorry for bad english
Thank

It is not correctly managing the plural form for "votes" in poll results.

The plugin is not showing the singular form "vote" when showing results for only one vote.

Instead of saying "(11%, 1 Vote)" it says "(11%, 1 Votes)".

The problem is in the .' %POLL_ANSWER_VOTES% '.__('Votes', 'wp-polls'). of the line:

add_option('poll_template_resultbody', '<li>%POLL_ANSWER% <small>(%POLL_ANSWER_PERCENTAGE%%'.__(',', 'wp-polls').' %POLL_ANSWER_VOTES% '.__('Votes', 'wp-polls').')</small><div class="pollbar" style="width: %POLL_ANSWER_IMAGEWIDTH%%;" title="%POLL_ANSWER_TEXT% (%POLL_ANSWER_PERCENTAGE%% | %POLL_ANSWER_VOTES% '.__('Votes', 'wp-polls').')"></div></li>');

of the file wp-polls.php.

I wanted to fix it replacing the __() function with the _n() function, but your code does not process the variables there, so i ignore how to properly fix the issue there.

Could to rephrase "(11%, 1 Votes)" this way "(11%, Votes: 1)" be a workaround?

Reference:
_n() function, function to provide alternate translation texts based on the singular|plural value used in the text.

Trust to X-Forwarded-For HTTP header

WP-Polls plugin trust to X-Forwarded-For HTTP header. This header may be add/modified by the client. For example i can add header X-Forwarded-For: 8.8.8.8 to may HTTP request using browser addon or proxy server like mitmproxy and then WP-Polls write to log IP 8.8.8.8
This is an easy way to get around the restriction on voting from the same IP.

just replace
if (empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
$ip_address = $_SERVER["REMOTE_ADDR"];
} else {
$ip_address = $_SERVER["HTTP_X_FORWARDED_FOR"];
}
to
$ip_address = $_SERVER["REMOTE_ADDR"];
in wp-polls.php

P.S. also $_SERVER["REMOTE_ADDR"] it is always IP addres, but $_SERVER["HTTP_X_FORWARDED_FOR"] can contain anything. For example:
X-Forwarded-For: 127.0.0.1;DROP TABLE wp_posts;
It requires more careful handling than $_SERVER["REMOTE_ADDR"]

Fix line 162 spelling

Fix line 162 spelling:
$poll_totalvotes = intval($poll_question->pollq_totalvote);
to:
$poll_totalvotes = intval($poll_question->pollq_totalvotes);

pollsip index on wrong column

The pollsip table pollip_ip index currently covers the pollip_id column, which is likely a typo. This wrong column overlaps with the primary key and leaves IP queries without an index at all.

Once the correct index is created, the old key needs removed.

From

"KEY pollip_ip (pollip_id),".

"KEY pollip_ip (pollip_id),".

wp-polls edit issues

I helped make a wp-polls plugin edit but it was rejected by WordPress. If anyone wants to fix the issues so that WordPress will accept it go ahead. The issues are listed below.

Link to plugin: http://www.mediafire.com/download/cc404k9vl35ge43/wp-polls.zip

You should probably uninstall and delete the original wp-polls plugin before using this.

Changes:
Uses buttons for poll answers instead of text.
Users can edit and delete votes.
Clone poll feature.

Notes:
It only logs by IP and it does this through the "do not log" option so you might not want to change this option.

WordPress Rejection Message:

Including jquery files (or calling them remotely)

WordPress includes its own version of jquery and many other similar JS files, which have all been rigorously tested with WP and many of the most common plugins. In order to provide the best compatibility and experience for our users, we ask that you not package your own (especially not an older version) and instead use wp_enqueue_script() to pull in WordPress's version.
Please review http://codex.wordpress.org/Function_Reference/wp_enqueue_script and update your plugin accordingly. You need to both change your code to use our jquery as well as remove the unused files. Remember! Keeping unused files out of your plugins makes them smaller and less potentially vulnerable! if you have any jquery files included in your plugin that WP core has, just delete them.

Offloading jquery js, css, and other scripts to Google (or jquery.com or anywhere else frankly) is similarly disallowed for the same reasons, but also because you're introducing an unnecessary dependency on another site. If the file you're trying to use isn't a part of WordPress Core, then you should include it -locally- in your plugin, not remotely.
If your code doesn't work with the built-in versions of jquery, it's most likely a no conflict issue. If you can't guess, we -really- want you to use our JS files, and if you can't, we need to know why so we can fix things for everyone. If you're just including it because you want to support old versions of WP, or because you think they may not have jquery, please don't. If they don't have the default jquery, a lot more than your plugin will break. And if they're on older versions of WordPress, they need to upgrade, and we don't recommend you support anything except the most recent version of WP and one release back.

Generic function names

Currently you have very generic function names that are likely to conflict with functions from other plugins or themes.
This is especially true since you forked a plugin.
Every function in your plugin should be prefixed with a prefix that is unique to your plugin.
For example, if your plugin is called "Easy Custom Post Types", then you might prefix your functions with ecpt_{your function name here}.

Update author information

Since this plugin is a fork, you need to update the plugin headers to include your information as well as the original author's.

https://wordpress.org/plugins/wp-polls/

Bug: WP-Polls 2.72 with WordPress 4.4.1 do not load a language localization

Please consider, I am not familiar with WordPress programming, so could be uncertain with terminology... But, I have found a bug with localization in "WP-Polls 2.72", and experimentally I have found a workaround.

Story:
When I set up a Site on WordPress 4.4.1...
I have installed a plugin WP-Polls 2.72...
Then, I have downloaded translation (wp-polls-ru_RU.po and wp-polls-ru_RU.mo) from https://plugins.trac.wordpress.org/browser/wp-polls/i18n and put it to the plugin's folder (as pointed in instruction).
Then, I have Activated the plugin...
But, my language have not appeared in interface - It still in English!

I have checked many things, but nothing helps.
BTW, I have noticed, that WordPress pick up the localization (since I see translated description on plugin's manage page). But, when the "WP-Polls" activated, it could not see own translation!
So, I suspect a bug in code.

I have found a suspicious call to "load_plugin_textdomain" method in "wp-polls.php" on 39 line. https://github.com/lesterchan/wp-polls/blob/master/wp-polls.php#L39
There have used a reduced call form, with one parameter.
Yes, normally, you could omit the second and third parameter in "load_plugin_textdomain" method
https://codex.wordpress.org/Function_Reference/load_plugin_textdomain
It must work... But, something goes wrong! I do not known "why". (Maybe bug in WordPress core? or wrong environment variables? BTW, have "plugin_dir_path()" set correctly?)

Experimentally, I have found this code repair an issue (it fix translation):

--- D:/Original/wp-polls/wp-polls.php   Вт дек 15 04:18:24 2015
+++ D:/Fixed/wp-polls/wp-polls.php  Ср янв 13 06:18:00 2016
@@ -36,7 +36,7 @@
 ### Create Text Domain For Translations
 add_action( 'plugins_loaded', 'polls_textdomain' );
 function polls_textdomain() {
-    load_plugin_textdomain( 'wp-polls' );
+    load_plugin_textdomain( 'wp-polls', '', dirname( plugin_basename( __FILE__ ) ) );
 }

Maybe safer to use a distinct call form? Consider to commit this to code.

unexpected output

The plugin generated 250 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.
Wordpres v4.1.1

REST API support?

Is there any support on the way at all for the Wordpress REST API? (via /wp-json/ )
ie: Creating custom endpoints for the polls and votes data?

2.73.4 syntax error crashes site

Hi there,
There's a syntax error in wp-polls.php line 468:
$temp_pollvote .= "\t<form id="polls_form_$poll_question_id" class="wp-polls-form" action="" . sanitize_text_field( _SERVER['SCRIPT_NAME'] ) ."" method="post">\n";
Our sites crash until _SERVER is fixed up.
Cheers,
Iestyn.

FORCE_SSL_ADMIN Wordpress option makes the plugin unusable (with a self-signed cert)

Wordpress has a FORCE_SSL_ADMIN option where connections to the admin interface of Wordpress is forced to HTTPS.

This function doesn't force wp-admin/admin-ajax.php to SSL since many plugins (like wp-polls) use this for ajax calls.

However when wp-polls forms the URL for admin-ajax.php, it calls the admin_url() function which returns the admin interface URL in https (if FORCE_SSL_ADMIN is enabled).

At that time we have a mixed content, where the rest of the site is served through http and the admin-ajax.php is served through https. If the site doesn't have a SSL certificate that is trusted, the browser's default behavior is to block that https connection thus breaking wp-polls plugin.

The only fix I could apply was to use the home_url() function instead and hardcode the "wp-admin" directory (diff below).

--- wp-polls.php.orig   2015-05-20 10:52:34.313748336 +0300
+++ wp-polls.php        2015-05-20 14:12:13.803681346 +0300
@@ -212,7 +212,7 @@
        $pollbar = get_option('poll_bar');
        wp_enqueue_script('wp-polls', plugins_url('wp-polls/polls-js.js'), array('jquery'), WP_POLLS_VERSION, true);
        wp_localize_script('wp-polls', 'pollsL10n', array(
-               'ajax_url' => admin_url('admin-ajax.php'),
+               'ajax_url' => home_url('wp-admin/admin-ajax.php'),
                'text_wait' => __('Your last request is still being processed. Please wait a while ...', 'wp-polls'),
                'text_valid' => __('Please choose a valid poll answer.', 'wp-polls'),
                'text_multiple' => __('Maximum number of choices allowed: ', 'wp-polls'),
@@ -230,7 +230,7 @@
                wp_enqueue_style('wp-polls-admin', plugins_url('wp-polls/polls-admin-css.css'), false, WP_POLLS_VERSION, 'all');
                wp_enqueue_script('wp-polls-admin', plugins_url('wp-polls/polls-admin-js.js'), array('jquery'), WP_POLLS_VERSION, true);
                wp_localize_script('wp-polls-admin', 'pollsAdminL10n', array(
-                       'admin_ajax_url' => admin_url('admin-ajax.php'),
+                       'admin_ajax_url' => home_url('wp-admin/admin-ajax.php'),
                        'text_direction' => is_rtl() ? 'right' : 'left',
                        'text_delete_poll' => __('Delete Poll', 'wp-polls'),
                        'text_no_poll_logs' => __('No poll logs available.', 'wp-polls'),

If you don't have a better solution, I can make a pull request for this patch.

2.73.4 Crashes WP Site

Greetings, wanted to let you know that when my wp-polls plugin updated to 2.73.4 it gave 500 errors to my entire site. I had to FTP in and change the wp-polls directory to wp-polls.old for it to continue working. I'm sure it's something on my end if nobody else is experiencing this.

If they are though, changing the directory seems to fix it. I'm not really sure how to revert back to a previous version and still keep the old polls I made.

Let me know if I can provide in logs to assist.

File-based templates

I've forked wp-polls and am working on a file-based templating system (in addition to the wp_option based system). You can check the current state of my version at: https://github.com/klassebe/wp-polls
Its current state is usable for my particular situation, but I will improve upon it. I'm also looking for other people's input or thoughts on a feature like this.

The main reason for doing this is to enable poll styling to be done within a theme's folder, instead of only via wp-admin. I've tried to take a backwards-compatible approach, so file-based templating can be easily integrated if that would ever be an option, without breaking lots of people's existing setups.

Also, I think the default templates are rather lacking. They have a lot of inline styles, and few classes to enable custom styling. So I find myself needing custom templates most of the time.

How it works:

  • A theme creator can create a 'wp-polls' folder in their theme folder, and populate it with template files. These are simple html files, named according to the option names that are used for the different templates by the plugin.
  • Upon activation, the plugin checks whether template files are present in a /wp-polls directory within the current theme's stylesheet directory (so that means child themes need to have their own templates)
  • For each individual template, if it is present in the theme's 'wp-polls' folder, the contents of the html file is saved as the value for that template's corresponding option.
  • When a theme creator adds or modifies files in the theme's 'wp-polls' folder, they need to update the option values for the templates via the plugin's template screen in wp-admin. Users can also reset the templates to their default version. Each template option now has two 'reset' buttons, one for the plugin's version of the template, and one for the theme's version. The second button is not visible if the needed file does not exist.

Proposed modifications/additions:

  • Provide a global templating option (toggle) to either use wp-polls' own templates, or the theme's templates
  • Better parent/child theme support
  • Move wp-polls' own templates to individual html files, which can be copied to a theme's folder by theme creators

Open/Close Poll should update poll_latestpoll?

  1. Check your current poll on the widget.
  2. Close this poll.
  3. Create a new poll.
  4. Check if this poll is online.
  5. Delete this new poll.
  6. Check the widget. The message "Sorry, there are no polls available at the moment." appears.
  7. Reopen the first poll.
  8. Nothing happens, the message is still shown.

Multiple Polls in Sidebar have same ID

Hi!

I'm using WP-Polls on some of my sites in combination with WP Fastest Cache plugin, which is actually the only caching plugin which is fully compatible with WP-Polls.

However, as soon as there are multiple polls in the sidebar, there's a bug when the caching plugin tries to update the polls.

Please take a look at the below screenshot. As you can see, I have two polls in my sidebar. ID 20 and ID 22. But the div-id and polls-id are both the same (20). If you could fix this, WP Fastest Cache would work correctly again.

wp-polls_bug

Thanks so much!

You can also refer to the thread in the WP support forums:
http://wordpress.org/support/topic/found-an-issue-with-wp-polls-plugin

Best regards
Nils

Translation don't work

put .po and mo in plugin folder, but don't work

use pt_BR.mo and pt_BR.po

how i can use?

Hide the results till the vote isn't been closed

-option on the admin page to be able to set this feature for a vote
-add result templates to be able displaying this stance in case of the user has voted yet but the vote still running and the "hide-result" option is set

Poll Button Unstyled In WordPress 3.9 Text Editor

While beta testing WordPress 3.9 which ships with TinyMCE 4.0, I noticed the poll button in the text editor is not styled to match the rest of the buttons. The button still works, it just doesn't look nice. By the way, the colored button looks and works just fine in the visual editor.

unstyledbutton

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.