Plugin Directory

Changeset 3146050


Ignore:
Timestamp:
09/03/2024 03:21:41 PM (19 months ago)
Author:
ludovicsclain
Message:

Update and check

Location:
helpfulnessmeter/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • helpfulnessmeter/trunk/changelog.txt

    r3077813 r3146050  
    11*** Was This Information Useful To You Changelog ***
     22024.09.03 - version 1.3
     3 * Add: it is now possible to have different answers depending on the user's vote.
     4
    252024.04.26 - version 1.2
    36 * Update: the plugin is now translatable.
     
    692023.04.24 - version 1.1
    710 * 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.
    912
    10132023.04.22 - version 1.0
  • helpfulnessmeter/trunk/css/style.css

    r3024710 r3146050  
    6363}
    6464
    65 #helpfulnessmeter.hfnm-disabled * {
     65#was-this-helpful.wthf-disabled #wthf-title,
     66#was-this-helpful.wthf-disabled #wthf-yes-no {
    6667    opacity: 0;
    6768}
  • helpfulnessmeter/trunk/helpfulnessmeter.php

    r3077823 r3146050  
    33Plugin Name: HelpfulnessMeter
    44Description: Improve your WordPress content by easily collecting feedback from your visitors.
    5 Version: 1.2.2
     5Version: 1.3
    66Author: Ludovic S. Clain
    77Author URI: https://ludovicclain.com
     
    2121        add_action("admin_notices", array($this, "hfnm_activation_notice"));
    2222        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'));
    2424        add_filter("the_content", array($this, "hfnm_after_post_content"), 10000);
    2525        add_action('wp_enqueue_scripts', array($this, 'hfnm_style_scripts'));
     
    3434
    3535    // 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');
    3939    }
    4040
     
    4747        add_option('hfnm_yes_text', __('Yes', 'hfnm'));
    4848        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'));
    5051        // Add activation option
    5152        add_option('hfnm_activated', '1');
     
    9192        delete_option('hfnm_yes_text');
    9293        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');
    9496        delete_option('hfnm_activated');
    9597        // Delete custom fields
     
    111113            // Dont show if already voted
    112114            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            }
    115133        }
    116134        return $content;
     
    247265                update_option('hfnm_yes_text', sanitize_text_field($_POST["hfnm_yes_text"]));
    248266                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"]));
    250269                // Settings saved
    251270                echo '<div id="setting-error-settings_updated" class="updated settings-error notice is-dismissible"><p><strong>' . __('Settings saved.', 'hfnm') . '</strong></p></div>';
     
    321340                    </tr>
    322341                    <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>
    329355                    <tr>
    330356                        <th scope="row"><label for="hfnm_reset_stats">
     
    360386            wp_add_inline_script('hfnm-script', 'var nonce_wthf = "' . wp_create_nonce("hfnm_nonce") . '";var ajaxurl = "' . admin_url('admin-ajax.php') . '";', TRUE);
    361387            // 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            );
    363405        }
    364406        return $content;
  • helpfulnessmeter/trunk/js/script.js

    r3024710 r3146050  
    1616        // Disable and show a thank message
    1717        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);
    2026    });
    2127    // Set Cookie
  • helpfulnessmeter/trunk/languages/hfnm-fr_FR.po

    r3077815 r3146050  
    33"Plural-Forms: nplurals=2; plural=(n > 1);\n"
    44"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"
    77"Language-Team: Clain <ludovic.clain@gmail.com>\n"
    88"MIME-Version: 1.0\n"
     
    3535
    3636#: helpfulnessmeter.php:49
    37 msgid "Thanks for your feedback!"
    38 msgstr "Merci pour votre retour !"
     37msgid "Thanks for your positive feedback!"
     38msgstr "Merci pour votre avis positif !"
    3939
    40 #: helpfulnessmeter.php:63
     40#: helpfulnessmeter.php:50
     41msgid "Thanks for your negative feedback!"
     42msgstr "Merci pour votre avis négatif !"
     43
     44#: helpfulnessmeter.php:64
    4145msgid "Please"
    4246msgstr "Veuillez"
    4347
    44 #: helpfulnessmeter.php:63
     48#: helpfulnessmeter.php:64
    4549msgid "fill in the options"
    4650msgstr "renseigner les options"
    4751
    48 #: helpfulnessmeter.php:64
     52#: helpfulnessmeter.php:65
    4953msgid "in order to use HelpfulnessMeter."
    5054msgstr "afin d’utiliser HelpfulnessMeter."
    5155
    52 #: helpfulnessmeter.php:79
     56#: helpfulnessmeter.php:80
    5357msgid "Settings"
    5458msgstr "Réglages"
    5559
    56 #: helpfulnessmeter.php:188
     60#: helpfulnessmeter.php:206
    5761msgid "helpful"
    5862msgid_plural "helpful"
     
    6064msgstr[1] "utiles"
    6165
    62 #: helpfulnessmeter.php:190
     66#: helpfulnessmeter.php:208
    6367msgid "not helpful"
    6468msgid_plural "not helpful"
     
    6670msgstr[1] "pas utiles"
    6771
    68 #: helpfulnessmeter.php:237
     72#: helpfulnessmeter.php:255
    6973msgid "Statistics have been reset."
    7074msgstr "Les statistiques ont été réinitialisées."
    7175
    72 #: helpfulnessmeter.php:251
     76#: helpfulnessmeter.php:270
    7377msgid "Settings saved."
    7478msgstr "Réglages enregistrés."
    7579
    76 #: helpfulnessmeter.php:257
     80#: helpfulnessmeter.php:276
    7781msgid "HelpfulnessMeter Options"
    7882msgstr "Options d'HelpfulnessMeter"
    7983
    80 #: helpfulnessmeter.php:260
     84#: helpfulnessmeter.php:279
    8185msgid ""
    8286"The HelpfulnessMeter widget will automatically appear at the end of the "
     
    8892"souhaitez afficher ce widget."
    8993
    90 #: helpfulnessmeter.php:263
     94#: helpfulnessmeter.php:282
    9195msgid ""
    9296"Alternatively, you can manually display the widget anywhere in your content "
     
    96100"votre contenu à l’aide du shortcode suivant : "
    97101
    98 #: helpfulnessmeter.php:266
     102#: helpfulnessmeter.php:285
    99103msgid ""
    100104"You may also need to list all content stats where the above shortcode is "
     
    106110"à créer une page privée et à coller le shortcode suivant pour le faire : "
    107111
    108 #: helpfulnessmeter.php:273
     112#: helpfulnessmeter.php:292
    109113msgid "Post Types"
    110114msgstr "Types de publication"
    111115
    112 #: helpfulnessmeter.php:303
     116#: helpfulnessmeter.php:322
    113117msgid "Question"
    114118msgstr "Question"
    115119
    116 #: helpfulnessmeter.php:310
     120#: helpfulnessmeter.php:329
    117121msgid "Positive Answer"
    118122msgstr "Réponse positive"
    119123
    120 #: helpfulnessmeter.php:317
     124#: helpfulnessmeter.php:336
    121125msgid "Negative Answer"
    122126msgstr "Réponse négative"
    123127
    124 #: helpfulnessmeter.php:324
    125 msgid "Thank You Message"
    126 msgstr "Message de remerciement"
     128#: helpfulnessmeter.php:343
     129msgid "Thank You Message for Positive Answer"
     130msgstr "Message de remerciement pour un avis positif"
    127131
    128 #: helpfulnessmeter.php:331
     132#: helpfulnessmeter.php:350
     133msgid "Thank You Message for Negative Answer"
     134msgstr "Message de remerciement pour un avis négatif"
     135
     136#: helpfulnessmeter.php:357
    129137msgid "Reset Statistics"
    130138msgstr "Réinitialiser les statistiques"
    131139
    132 #: helpfulnessmeter.php:388
     140#: helpfulnessmeter.php:430
    133141msgid "Content Title"
    134142msgstr "Titre du contenu"
    135143
    136 #: helpfulnessmeter.php:388
     144#: helpfulnessmeter.php:430
    137145msgid "HelpfulnessMeter Statistics"
    138146msgstr "Statistiques HelpfulnessMeter"
  • helpfulnessmeter/trunk/languages/hfnm.pot

    r3077815 r3146050  
    44"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
    55"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"
    88"Last-Translator: Clain <ludovic.clain@gmail.com>\n"
    99"Language-Team: Clain <ludovic.clain@gmail.com>\n"
     
    3535
    3636#: helpfulnessmeter.php:49
    37 msgid "Thanks for your feedback!"
     37msgid "Thanks for your positive feedback!"
    3838msgstr ""
    3939
    40 #: helpfulnessmeter.php:63
     40#: helpfulnessmeter.php:50
     41msgid "Thanks for your negative feedback!"
     42msgstr ""
     43
     44#: helpfulnessmeter.php:64
    4145msgid "Please"
    4246msgstr ""
    4347
    44 #: helpfulnessmeter.php:63
     48#: helpfulnessmeter.php:64
    4549msgid "fill in the options"
    4650msgstr ""
    4751
    48 #: helpfulnessmeter.php:64
     52#: helpfulnessmeter.php:65
    4953msgid "in order to use HelpfulnessMeter."
    5054msgstr ""
    5155
    52 #: helpfulnessmeter.php:79
     56#: helpfulnessmeter.php:80
    5357msgid "Settings"
    5458msgstr ""
    5559
    56 #: helpfulnessmeter.php:188
     60#: helpfulnessmeter.php:206
    5761msgid "helpful"
    5862msgid_plural "helpful"
     
    6064msgstr[1] ""
    6165
    62 #: helpfulnessmeter.php:190
     66#: helpfulnessmeter.php:208
    6367msgid "not helpful"
    6468msgid_plural "not helpful"
     
    6670msgstr[1] ""
    6771
    68 #: helpfulnessmeter.php:237
     72#: helpfulnessmeter.php:255
    6973msgid "Statistics have been reset."
    7074msgstr ""
    7175
    72 #: helpfulnessmeter.php:251
     76#: helpfulnessmeter.php:270
    7377msgid "Settings saved."
    7478msgstr ""
    7579
    76 #: helpfulnessmeter.php:257
     80#: helpfulnessmeter.php:276
    7781msgid "HelpfulnessMeter Options"
    7882msgstr ""
    7983
    80 #: helpfulnessmeter.php:260
     84#: helpfulnessmeter.php:279
    8185msgid ""
    8286"The HelpfulnessMeter widget will automatically appear at the end of the "
     
    8589msgstr ""
    8690
    87 #: helpfulnessmeter.php:263
     91#: helpfulnessmeter.php:282
    8892msgid ""
    8993"Alternatively, you can manually display the widget anywhere in your content "
     
    9195msgstr ""
    9296
    93 #: helpfulnessmeter.php:266
     97#: helpfulnessmeter.php:285
    9498msgid ""
    9599"You may also need to list all content stats where the above shortcode is "
     
    98102msgstr ""
    99103
    100 #: helpfulnessmeter.php:273
     104#: helpfulnessmeter.php:292
    101105msgid "Post Types"
    102106msgstr ""
    103107
    104 #: helpfulnessmeter.php:303
     108#: helpfulnessmeter.php:322
    105109msgid "Question"
    106110msgstr ""
    107111
    108 #: helpfulnessmeter.php:310
     112#: helpfulnessmeter.php:329
    109113msgid "Positive Answer"
    110114msgstr ""
    111115
    112 #: helpfulnessmeter.php:317
     116#: helpfulnessmeter.php:336
    113117msgid "Negative Answer"
    114118msgstr ""
    115119
    116 #: helpfulnessmeter.php:324
    117 msgid "Thank You Message"
     120#: helpfulnessmeter.php:343
     121msgid "Thank You Message for Positive Answer"
    118122msgstr ""
    119123
    120 #: helpfulnessmeter.php:331
     124#: helpfulnessmeter.php:350
     125msgid "Thank You Message for Negative Answer"
     126msgstr ""
     127
     128#: helpfulnessmeter.php:357
    121129msgid "Reset Statistics"
    122130msgstr ""
    123131
    124 #: helpfulnessmeter.php:388
     132#: helpfulnessmeter.php:430
    125133msgid "Content Title"
    126134msgstr ""
    127135
    128 #: helpfulnessmeter.php:388
     136#: helpfulnessmeter.php:430
    129137msgid "HelpfulnessMeter Statistics"
    130138msgstr ""
  • helpfulnessmeter/trunk/readme.txt

    r3077823 r3146050  
    33Tags: user feedback, content rating, vote, user experience, content improvement
    44Requires at least: 6.0
    5 Tested up to: 6.5
    6 Stable tag: 1.2.2
     5Tested up to: 6.6
     6Stable tag: 1.3
    77Requires PHP: 7.4
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     10
    1011Improve your WordPress content easily with HelpfulnessMeter, effectively collecting feedback from your visitors.
    1112
    1213== Description ==
     14
    1315HelpfulnessMeter 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!
    1416
     
    2628
    2729= Key Features =
     30
    2831 * Global or individual activation by shortcode
    2932 * Compatible with posts, pages, and custom post types
     
    3235 
    3336= How to use =
     37
    3438Simply activate HelpfulnessMeter, go to settings, configure your preferences… and voilà!
    3539
    3640= Credit Where Credit’s Due =
     41
    3742This 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.
    3843
    3944= Review =
     45
    4046Great people use HelpfulnessMeter to [leave their best review afterwards…](https://wordpress.org/support/plugin/helpfulnessmeter/reviews/) and you are great too!
    4147
    4248== Installation ==
     49
    4350= From your WordPress dashboard =
    4451
    45521. Visit `Plugins > Add New`
    46532. Search for `HelpfulnessMeter`
    47 2. Click on `Install Now` then `Activate` to activate it
     543. Click on `Install Now` then `Activate` to activate it
    4855
    4956= From wordpress.org =
     57
    50581. Download [HelpfulnessMeter](https://wordpress.org/plugins/helpfulnessmeter)
    51592. Upload the `HelpfulnessMeter` directory to your `/wp-content/plugins/` directory, using your favorite method (ftp, sftp, scp…)
     
    5361
    5462= Once activated =
     63
    5564Visit `Settings > HelpfulnessMeter` and configure the settings to best match your needs.
    5665
    5766= Once configured =
     67
    5868Depending 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]`.
    5969
    6070== Frequently Asked Questions ==
     71
    6172= Can I customize the look and feel of the plugin? =
     73
    6274Yes, you can customize the appearance of HelpfulnessMeter using custom CSS.
    6375
    6476= I know this plugin! =
     77
    6578You are right, this plugin is a fork of "Was This Helpful?" plugin by waspthemes.
    6679
    6780= How is the HelpfulnessMeter plugin Different? =
     81
    6882This 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.
    6983
    7084= Who are the developers? =
     85
    7186[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)
    7287
    7388= Can I help you? =
     89
    7490Of 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.
    7591
    7692== Screenshots ==
     93
    77941. HelpfulnessMeter question displayed at the bottom of the page.
    78952. HelpfulnessMeter Thank You Message displayed at the bottom of the page after the user vote.
     
    84101
    85102== Changelog ==
     103
    86104For 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.
    87105
    88106== Latest Updates ==
     107
     108= 1.3 =
     109* Added different answers depending on the user's vote
     110
    89111= 1.2 =
    90112* Added option to reset site vote statistics
     
    107129
    108130== Upgrade Notice ==
     131
    109132= 1.0 =
    110133* Initial Release
Note: See TracChangeset for help on using the changeset viewer.