Changeset 3146050
- Timestamp:
- 09/03/2024 03:21:41 PM (19 months ago)
- Location:
- helpfulnessmeter/trunk
- Files:
-
- 8 edited
-
changelog.txt (modified) (2 diffs)
-
css/style.css (modified) (1 diff)
-
helpfulnessmeter.php (modified) (9 diffs)
-
js/script.js (modified) (1 diff)
-
languages/hfnm-fr_FR.mo (modified) (previous)
-
languages/hfnm-fr_FR.po (modified) (7 diffs)
-
languages/hfnm.pot (modified) (7 diffs)
-
readme.txt (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
helpfulnessmeter/trunk/changelog.txt
r3077813 r3146050 1 1 *** Was This Information Useful To You Changelog *** 2 2024.09.03 - version 1.3 3 * Add: it is now possible to have different answers depending on the user's vote. 4 2 5 2024.04.26 - version 1.2 3 6 * Update: the plugin is now translatable. … … 6 9 2023.04.24 - version 1.1 7 10 * Update: Wrapping code in a class. 8 * Add: A new shortcode `[hfnm_shortcode_list]` and its CSS to give the possibility to list on a private page, the statistics of the content where the shortcode `[helpfulness_meter] has been placed.11 * Add: A new shortcode `[hfnm_shortcode_list]` and its CSS to give the possibility to list on a private page, the statistics of the content where the shortcode `[helpfulness_meter]` has been placed. 9 12 10 13 2023.04.22 - version 1.0 -
helpfulnessmeter/trunk/css/style.css
r3024710 r3146050 63 63 } 64 64 65 #helpfulnessmeter.hfnm-disabled * { 65 #was-this-helpful.wthf-disabled #wthf-title, 66 #was-this-helpful.wthf-disabled #wthf-yes-no { 66 67 opacity: 0; 67 68 } -
helpfulnessmeter/trunk/helpfulnessmeter.php
r3077823 r3146050 3 3 Plugin Name: HelpfulnessMeter 4 4 Description: Improve your WordPress content by easily collecting feedback from your visitors. 5 Version: 1. 2.25 Version: 1.3 6 6 Author: Ludovic S. Clain 7 7 Author URI: https://ludovicclain.com … … 21 21 add_action("admin_notices", array($this, "hfnm_activation_notice")); 22 22 add_filter('plugin_action_links', array($this, 'hfnm_custom_action_links'), 10, 5); 23 add_action('plugins_loaded', array($this, ' load_textdomain'));23 add_action('plugins_loaded', array($this, 'hfnm_load_textdomain')); 24 24 add_filter("the_content", array($this, "hfnm_after_post_content"), 10000); 25 25 add_action('wp_enqueue_scripts', array($this, 'hfnm_style_scripts')); … … 34 34 35 35 // Load translation files 36 public function load_textdomain()37 { 38 load_plugin_textdomain('hfnm', false, dirname(plugin_basename(__FILE__)) . '/languages /');36 public function hfnm_load_textdomain() 37 { 38 load_plugin_textdomain('hfnm', false, dirname(plugin_basename(__FILE__)) . '/languages'); 39 39 } 40 40 … … 47 47 add_option('hfnm_yes_text', __('Yes', 'hfnm')); 48 48 add_option('hfnm_no_text', __('No', 'hfnm')); 49 add_option('hfnm_thank_text', __('Thanks for your feedback!', 'hfnm')); 49 add_option('hfnm_thank_yes_text', __('Thanks for your positive feedback!', 'hfnm')); 50 add_option('hfnm_thank_no_text', __('Thanks for your negative feedback!', 'hfnm')); 50 51 // Add activation option 51 52 add_option('hfnm_activated', '1'); … … 91 92 delete_option('hfnm_yes_text'); 92 93 delete_option('hfnm_no_text'); 93 delete_option('hfnm_thank_text'); 94 delete_option('hfnm_thank_yes_text'); 95 delete_option('hfnm_thank_no_text'); 94 96 delete_option('hfnm_activated'); 95 97 // Delete custom fields … … 111 113 // Dont show if already voted 112 114 if (!isset($_COOKIE["helpfulnessmeter_id_" . $post_id])) { 113 $content .= '<div id="helpfulnessmeter" data-post-id="' . $post_id . '" data-thank-text="' . get_option("hfnm_thank_text") . '"><div id="hfnm-title">' . get_option("hfnm_question_text") . '</div><div id="hfnm-yes-no"><span data-value="1">' . get_option("hfnm_yes_text") . '</span><span data-value="0">' . get_option("hfnm_no_text") . '</span></div></div>'; 114 } 115 $content .= sprintf( 116 '<div id="helpfulnessmeter" data-post-id="%s"> 117 <div id="hfnm-title">%s</div> 118 <div id="hfnm-yes-no"> 119 <span data-value="1">%s</span> 120 <span data-value="0">%s</span> 121 </div> 122 <div id="hfnm-thank-yes" style="display:none;">%s</div> 123 <div id="hfnm-thank-no" style="display:none;">%s</div> 124 </div>', 125 $post_id, 126 get_option("hfnm_question_text"), 127 get_option("hfnm_yes_text"), 128 get_option("hfnm_no_text"), 129 get_option("hfnm_thank_yes_text"), 130 get_option("hfnm_thank_no_text") 131 ); 132 } 115 133 } 116 134 return $content; … … 247 265 update_option('hfnm_yes_text', sanitize_text_field($_POST["hfnm_yes_text"])); 248 266 update_option('hfnm_no_text', sanitize_text_field($_POST["hfnm_no_text"])); 249 update_option('hfnm_thank_text', sanitize_text_field($_POST["hfnm_thank_text"])); 267 update_option('hfnm_thank_yes_text', sanitize_text_field($_POST["hfnm_thank_yes_text"])); 268 update_option('hfnm_thank_no_text', sanitize_text_field($_POST["hfnm_thank_no_text"])); 250 269 // Settings saved 251 270 echo '<div id="setting-error-settings_updated" class="updated settings-error notice is-dismissible"><p><strong>' . __('Settings saved.', 'hfnm') . '</strong></p></div>'; … … 321 340 </tr> 322 341 <tr> 323 <th scope="row"><label for="hfnm_thank_text"> 324 <?php _e('Thank You Message', 'hfnm'); ?> 325 </label></th> 326 <td><input type="text" placeholder="Thanks for your feedback!" class="regular-text" id="hfnm_thank_text" 327 name="hfnm_thank_text" value="<?php echo get_option('hfnm_thank_text'); ?>" /></td> 328 </tr> 342 <th scope="row"><label for="hfnm_thank_yes_text"> 343 <?php _e('Thank You Message for Positive Answer', 'hfnm'); ?> 344 </label></th> 345 <td><textarea type="text" placeholder="Thanks for your positive feedback!" class="regular-text" id="hfnm_thank_yes_text" name="hfnm_thank_yes_text"><?php echo esc_textarea(get_option('hfnm_thank_yes_text')); ?></textarea> 346 </td> 347 </tr> 348 <tr> 349 <th scope="row"><label for="hfnm_thank_no_text"> 350 <?php _e('Thank You Message for Negative Answer', 'hfnm'); ?> 351 </label></th> 352 <td><textarea type="text" placeholder="Thanks for your negative feedback!" class="regular-text" id="hfnm_thank_no_text" name="hfnm_thank_no_text"><?php echo esc_textarea(get_option('hfnm_thank_no_text')); ?></textarea> 353 </td> 354 </tr> 329 355 <tr> 330 356 <th scope="row"><label for="hfnm_reset_stats"> … … 360 386 wp_add_inline_script('hfnm-script', 'var nonce_wthf = "' . wp_create_nonce("hfnm_nonce") . '";var ajaxurl = "' . admin_url('admin-ajax.php') . '";', TRUE); 361 387 // The widget markup 362 $content = '<div id="helpfulnessmeter" data-post-id="' . $post_id . '" data-thank-text="' . get_option("hfnm_thank_text") . '"><div id="hfnm-title">' . get_option("hfnm_question_text") . '</div><div id="hfnm-yes-no"><span data-value="1">' . get_option("hfnm_yes_text") . '</span><span data-value="0">' . get_option("hfnm_no_text") . '</span></div></div>'; 388 $content = sprintf( 389 '<div id="helpfulnessmeter" data-post-id="%s"> 390 <div id="hfnm-title">%s</div> 391 <div id="hfnm-yes-no"> 392 <span data-value="1">%s</span> 393 <span data-value="0">%s</span> 394 </div> 395 <div id="hfnm-thank-yes" style="display:none;">%s</div> 396 <div id="hfnm-thank-no" style="display:none;">%s</div> 397 </div>', 398 $post_id, 399 get_option("hfnm_question_text"), 400 get_option("hfnm_yes_text"), 401 get_option("hfnm_no_text"), 402 get_option("hfnm_thank_yes_text"), 403 get_option("hfnm_thank_no_text") 404 ); 363 405 } 364 406 return $content; -
helpfulnessmeter/trunk/js/script.js
r3024710 r3146050 16 16 // Disable and show a thank message 17 17 setTimeout(function () { 18 $("#helpfulnessmeter").addClass("hfnm-disabled"); 19 }, 20); 18 $("#hfnm-yes-no, #hfnm-title").hide(); 19 if (value === 1) { 20 $("#hfnm-thank-yes").show(); 21 } else { 22 $("#hfnm-thank-no").show(); 23 } 24 $("#helpfulnessmeter").addClass("hfnm-disabled"); 25 }, 20); 20 26 }); 21 27 // Set Cookie -
helpfulnessmeter/trunk/languages/hfnm-fr_FR.po
r3077815 r3146050 3 3 "Plural-Forms: nplurals=2; plural=(n > 1);\n" 4 4 "Project-Id-Version: HelpfulnessMeter\n" 5 "POT-Creation-Date: 2023-05-06 10: 19+0400\n"6 "PO-Revision-Date: 2023-05-06 10: 21+0400\n"5 "POT-Creation-Date: 2023-05-06 10:49+0400\n" 6 "PO-Revision-Date: 2023-05-06 10:51+0400\n" 7 7 "Language-Team: Clain <ludovic.clain@gmail.com>\n" 8 8 "MIME-Version: 1.0\n" … … 35 35 36 36 #: helpfulnessmeter.php:49 37 msgid "Thanks for your feedback!"38 msgstr "Merci pour votre retour!"37 msgid "Thanks for your positive feedback!" 38 msgstr "Merci pour votre avis positif !" 39 39 40 #: helpfulnessmeter.php:63 40 #: helpfulnessmeter.php:50 41 msgid "Thanks for your negative feedback!" 42 msgstr "Merci pour votre avis négatif !" 43 44 #: helpfulnessmeter.php:64 41 45 msgid "Please" 42 46 msgstr "Veuillez" 43 47 44 #: helpfulnessmeter.php:6 348 #: helpfulnessmeter.php:64 45 49 msgid "fill in the options" 46 50 msgstr "renseigner les options" 47 51 48 #: helpfulnessmeter.php:6 452 #: helpfulnessmeter.php:65 49 53 msgid "in order to use HelpfulnessMeter." 50 54 msgstr "afin d’utiliser HelpfulnessMeter." 51 55 52 #: helpfulnessmeter.php: 7956 #: helpfulnessmeter.php:80 53 57 msgid "Settings" 54 58 msgstr "Réglages" 55 59 56 #: helpfulnessmeter.php: 18860 #: helpfulnessmeter.php:206 57 61 msgid "helpful" 58 62 msgid_plural "helpful" … … 60 64 msgstr[1] "utiles" 61 65 62 #: helpfulnessmeter.php: 19066 #: helpfulnessmeter.php:208 63 67 msgid "not helpful" 64 68 msgid_plural "not helpful" … … 66 70 msgstr[1] "pas utiles" 67 71 68 #: helpfulnessmeter.php:2 3772 #: helpfulnessmeter.php:255 69 73 msgid "Statistics have been reset." 70 74 msgstr "Les statistiques ont été réinitialisées." 71 75 72 #: helpfulnessmeter.php:2 5176 #: helpfulnessmeter.php:270 73 77 msgid "Settings saved." 74 78 msgstr "Réglages enregistrés." 75 79 76 #: helpfulnessmeter.php:2 5780 #: helpfulnessmeter.php:276 77 81 msgid "HelpfulnessMeter Options" 78 82 msgstr "Options d'HelpfulnessMeter" 79 83 80 #: helpfulnessmeter.php:2 6084 #: helpfulnessmeter.php:279 81 85 msgid "" 82 86 "The HelpfulnessMeter widget will automatically appear at the end of the " … … 88 92 "souhaitez afficher ce widget." 89 93 90 #: helpfulnessmeter.php:2 6394 #: helpfulnessmeter.php:282 91 95 msgid "" 92 96 "Alternatively, you can manually display the widget anywhere in your content " … … 96 100 "votre contenu à l’aide du shortcode suivant : " 97 101 98 #: helpfulnessmeter.php:2 66102 #: helpfulnessmeter.php:285 99 103 msgid "" 100 104 "You may also need to list all content stats where the above shortcode is " … … 106 110 "à créer une page privée et à coller le shortcode suivant pour le faire : " 107 111 108 #: helpfulnessmeter.php:2 73112 #: helpfulnessmeter.php:292 109 113 msgid "Post Types" 110 114 msgstr "Types de publication" 111 115 112 #: helpfulnessmeter.php:3 03116 #: helpfulnessmeter.php:322 113 117 msgid "Question" 114 118 msgstr "Question" 115 119 116 #: helpfulnessmeter.php:3 10120 #: helpfulnessmeter.php:329 117 121 msgid "Positive Answer" 118 122 msgstr "Réponse positive" 119 123 120 #: helpfulnessmeter.php:3 17124 #: helpfulnessmeter.php:336 121 125 msgid "Negative Answer" 122 126 msgstr "Réponse négative" 123 127 124 #: helpfulnessmeter.php:3 24125 msgid "Thank You Message "126 msgstr "Message de remerciement"128 #: helpfulnessmeter.php:343 129 msgid "Thank You Message for Positive Answer" 130 msgstr "Message de remerciement pour un avis positif" 127 131 128 #: helpfulnessmeter.php:331 132 #: helpfulnessmeter.php:350 133 msgid "Thank You Message for Negative Answer" 134 msgstr "Message de remerciement pour un avis négatif" 135 136 #: helpfulnessmeter.php:357 129 137 msgid "Reset Statistics" 130 138 msgstr "Réinitialiser les statistiques" 131 139 132 #: helpfulnessmeter.php: 388140 #: helpfulnessmeter.php:430 133 141 msgid "Content Title" 134 142 msgstr "Titre du contenu" 135 143 136 #: helpfulnessmeter.php: 388144 #: helpfulnessmeter.php:430 137 145 msgid "HelpfulnessMeter Statistics" 138 146 msgstr "Statistiques HelpfulnessMeter" -
helpfulnessmeter/trunk/languages/hfnm.pot
r3077815 r3146050 4 4 "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" 5 5 "Project-Id-Version: HelpfulnessMeter\n" 6 "POT-Creation-Date: 2023-05-06 10: 19+0400\n"7 "PO-Revision-Date: 2023-05-06 10: 19+0400\n"6 "POT-Creation-Date: 2023-05-06 10:49+0400\n" 7 "PO-Revision-Date: 2023-05-06 10:49+0400\n" 8 8 "Last-Translator: Clain <ludovic.clain@gmail.com>\n" 9 9 "Language-Team: Clain <ludovic.clain@gmail.com>\n" … … 35 35 36 36 #: helpfulnessmeter.php:49 37 msgid "Thanks for your feedback!"37 msgid "Thanks for your positive feedback!" 38 38 msgstr "" 39 39 40 #: helpfulnessmeter.php:63 40 #: helpfulnessmeter.php:50 41 msgid "Thanks for your negative feedback!" 42 msgstr "" 43 44 #: helpfulnessmeter.php:64 41 45 msgid "Please" 42 46 msgstr "" 43 47 44 #: helpfulnessmeter.php:6 348 #: helpfulnessmeter.php:64 45 49 msgid "fill in the options" 46 50 msgstr "" 47 51 48 #: helpfulnessmeter.php:6 452 #: helpfulnessmeter.php:65 49 53 msgid "in order to use HelpfulnessMeter." 50 54 msgstr "" 51 55 52 #: helpfulnessmeter.php: 7956 #: helpfulnessmeter.php:80 53 57 msgid "Settings" 54 58 msgstr "" 55 59 56 #: helpfulnessmeter.php: 18860 #: helpfulnessmeter.php:206 57 61 msgid "helpful" 58 62 msgid_plural "helpful" … … 60 64 msgstr[1] "" 61 65 62 #: helpfulnessmeter.php: 19066 #: helpfulnessmeter.php:208 63 67 msgid "not helpful" 64 68 msgid_plural "not helpful" … … 66 70 msgstr[1] "" 67 71 68 #: helpfulnessmeter.php:2 3772 #: helpfulnessmeter.php:255 69 73 msgid "Statistics have been reset." 70 74 msgstr "" 71 75 72 #: helpfulnessmeter.php:2 5176 #: helpfulnessmeter.php:270 73 77 msgid "Settings saved." 74 78 msgstr "" 75 79 76 #: helpfulnessmeter.php:2 5780 #: helpfulnessmeter.php:276 77 81 msgid "HelpfulnessMeter Options" 78 82 msgstr "" 79 83 80 #: helpfulnessmeter.php:2 6084 #: helpfulnessmeter.php:279 81 85 msgid "" 82 86 "The HelpfulnessMeter widget will automatically appear at the end of the " … … 85 89 msgstr "" 86 90 87 #: helpfulnessmeter.php:2 6391 #: helpfulnessmeter.php:282 88 92 msgid "" 89 93 "Alternatively, you can manually display the widget anywhere in your content " … … 91 95 msgstr "" 92 96 93 #: helpfulnessmeter.php:2 6697 #: helpfulnessmeter.php:285 94 98 msgid "" 95 99 "You may also need to list all content stats where the above shortcode is " … … 98 102 msgstr "" 99 103 100 #: helpfulnessmeter.php:2 73104 #: helpfulnessmeter.php:292 101 105 msgid "Post Types" 102 106 msgstr "" 103 107 104 #: helpfulnessmeter.php:3 03108 #: helpfulnessmeter.php:322 105 109 msgid "Question" 106 110 msgstr "" 107 111 108 #: helpfulnessmeter.php:3 10112 #: helpfulnessmeter.php:329 109 113 msgid "Positive Answer" 110 114 msgstr "" 111 115 112 #: helpfulnessmeter.php:3 17116 #: helpfulnessmeter.php:336 113 117 msgid "Negative Answer" 114 118 msgstr "" 115 119 116 #: helpfulnessmeter.php:3 24117 msgid "Thank You Message "120 #: helpfulnessmeter.php:343 121 msgid "Thank You Message for Positive Answer" 118 122 msgstr "" 119 123 120 #: helpfulnessmeter.php:331 124 #: helpfulnessmeter.php:350 125 msgid "Thank You Message for Negative Answer" 126 msgstr "" 127 128 #: helpfulnessmeter.php:357 121 129 msgid "Reset Statistics" 122 130 msgstr "" 123 131 124 #: helpfulnessmeter.php: 388132 #: helpfulnessmeter.php:430 125 133 msgid "Content Title" 126 134 msgstr "" 127 135 128 #: helpfulnessmeter.php: 388136 #: helpfulnessmeter.php:430 129 137 msgid "HelpfulnessMeter Statistics" 130 138 msgstr "" -
helpfulnessmeter/trunk/readme.txt
r3077823 r3146050 3 3 Tags: user feedback, content rating, vote, user experience, content improvement 4 4 Requires at least: 6.0 5 Tested up to: 6. 56 Stable tag: 1. 2.25 Tested up to: 6.6 6 Stable tag: 1.3 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html 10 10 11 Improve your WordPress content easily with HelpfulnessMeter, effectively collecting feedback from your visitors. 11 12 12 13 == Description == 14 13 15 HelpfulnessMeter is your ally to collect valuable information on the perception of your content by your visitors. Thanks to its small voting insert located at the bottom of each post, you offer your readers the possibility of giving their opinion anonymously. It's simple, fast and extremely useful! 14 16 … … 26 28 27 29 = Key Features = 30 28 31 * Global or individual activation by shortcode 29 32 * Compatible with posts, pages, and custom post types … … 32 35 33 36 = How to use = 37 34 38 Simply activate HelpfulnessMeter, go to settings, configure your preferences… and voilà! 35 39 36 40 = Credit Where Credit’s Due = 41 37 42 This plugin is 95% fork of WaspThemes’s WordPress plugin [Was This Helpful?](https://wordpress.org/plugins/was-this-article-helpful/). Since the "Was This Helpful?" plugin is not actively maintained and not tested with the latest version of WordPress, I decided to take it over and continue to improve. 38 43 39 44 = Review = 45 40 46 Great people use HelpfulnessMeter to [leave their best review afterwards…](https://wordpress.org/support/plugin/helpfulnessmeter/reviews/) and you are great too! 41 47 42 48 == Installation == 49 43 50 = From your WordPress dashboard = 44 51 45 52 1. Visit `Plugins > Add New` 46 53 2. Search for `HelpfulnessMeter` 47 2. Click on `Install Now` then `Activate` to activate it54 3. Click on `Install Now` then `Activate` to activate it 48 55 49 56 = From wordpress.org = 57 50 58 1. Download [HelpfulnessMeter](https://wordpress.org/plugins/helpfulnessmeter) 51 59 2. Upload the `HelpfulnessMeter` directory to your `/wp-content/plugins/` directory, using your favorite method (ftp, sftp, scp…) … … 53 61 54 62 = Once activated = 63 55 64 Visit `Settings > HelpfulnessMeter` and configure the settings to best match your needs. 56 65 57 66 = Once configured = 67 58 68 Depending on your configuration choices, you could find the voting statistics for your content in a new column in the list of your posts for example (if you have configured HelpfulnessMeter globally for your posts). You can also use the shortcode `[helpfulness_meter]` to manually put the HelpfulnessMeter voting inset in your content. You may also need to list all content stats where the above shortcode is manually added, in that case I invite you to create a private page and paste the below shortcode to do so: `[hfnm_shortcode_list]`. 59 69 60 70 == Frequently Asked Questions == 71 61 72 = Can I customize the look and feel of the plugin? = 73 62 74 Yes, you can customize the appearance of HelpfulnessMeter using custom CSS. 63 75 64 76 = I know this plugin! = 77 65 78 You are right, this plugin is a fork of "Was This Helpful?" plugin by waspthemes. 66 79 67 80 = How is the HelpfulnessMeter plugin Different? = 81 68 82 This first release is bug free, UX is improved for admin and I'm already working on next releases to make visitor experience even better and you can get quality and actionable feedback. 69 83 70 84 = Who are the developers? = 85 71 86 [Ludovic S. CLAIN](https://ludovicclain.com) from Reunion island 🇷🇪 who has the honor of being part of the [WordPress community](https://profiles.wordpress.org/ludovicsclain) 72 87 73 88 = Can I help you? = 89 74 90 Of course! Please contact me by [opening a support ticket](https://wordpress.org/support/plugin/helpfulnessmeter/), it's always a blessing to have help on a plugin. 75 91 76 92 == Screenshots == 93 77 94 1. HelpfulnessMeter question displayed at the bottom of the page. 78 95 2. HelpfulnessMeter Thank You Message displayed at the bottom of the page after the user vote. … … 84 101 85 102 == Changelog == 103 86 104 For the complete changelog history, please [click here](https://plugins.svn.wordpress.org/helpfulnessmeter/trunk/changelog.txt) or refer to the separate "changelog.txt" file included in the plugin directory. 87 105 88 106 == Latest Updates == 107 108 = 1.3 = 109 * Added different answers depending on the user's vote 110 89 111 = 1.2 = 90 112 * Added option to reset site vote statistics … … 107 129 108 130 == Upgrade Notice == 131 109 132 = 1.0 = 110 133 * Initial Release
Note: See TracChangeset
for help on using the changeset viewer.