Comment Validation Reloaded

Avoid those pesky blank page with an error message like “please fill out required fields” then loosing your/users comment info. This plugin aims to help by adding validation to the comment form. When a user submits the form and something is missing, an appropiate message is displayed and individual fields are highlighted. When the email or url is in an incorrect format, a message is displayed accordingly. Requires the user to have javascript activated.

Why should you install it? Because you care for comments and want to help users reduce mistakes that hold them off from commenting at all.

Whats the technology used? jQuery and the jQuery Validation plugin with a few customizations to make it fit into any WordPress theme.

Download

Latest version: Download Comment Validation Reloaded v0.4.3.1 [[zip]] (Downloaded: 7331 times)

FAQ

Why create this plugin?

Because there is a newer validation script out there, but no updated plugins.

I think i want to uninstall but…

Just delete the plugin.

Changelog

Version 0.4 (04/17/12)
  • Fixed jQuery script to run on document ready.
  • Updated Sprite
  • Updated dashboard cache issues.
Version 0.3.9 (12/25/11)
  • Fixed script causing server error on singluar pages.
Version 0.3.8.1 (12/19/11)
  • Fixed broken translation output file.
Version 0.3.8 (11/17/11)
  • Spelled fields wrong in the filter.
  • Updated localization to not output when in english.
Version 0.3.7 (11/15/11)
  • Added filter for required fields text cvr_required_fields_text.
  • Removed uninstall.php
Version 0.3.6 (11/14/11)
  • Updated validation script to 1.9.
  • Moved inline jQuery into redirect script.
    -fixed so script loads after validation function.
Version 0.3.5 (11/8/11)
  • Feeds updated.
  • WordPress 3.3 check.
Version 0.3.4 (9/8/11)
  • Dashboard fix.
Version 0.3.3 (6/23/11)
  • [BUG FIX] An error in the dashboard widget is casuing some large images. Sorry. Always escape.
Version 0.3.2 (6/7/11)
  • Bug fix for WordPress installs that have WPLANG defined.
Version 0.3.1 (6/1/11)
  • Set up whole plugin for translation.
  • New version of validation script version.
  • Added translatable jQuery script, please visit settings to change!
  • Fixed error when setting validator to external didn’t validate.
  • Getting ready for plugin overhaul.
Version 0.3 (4/5/11)
  • Updated multiple error when running WP_DEBUG.
  • Updated has_cap from 10 to role moderate_comments.
  • Updated constants.
  • Fixed dashboard cache error.
  • Removed outdated javascript that might cause hangups.
Version 0.2.9 (3/30/11)
  • Dashboard widget updated.
Version 0.2.8 (2/24/11)
  • Removed javscript link causing hang-ups.
Version 0.2.7 (2/9/11)
  • Updated the feed parser to comply with deprecated rss.php and use class-simplepie.php
Version 0.2.6
  • Updated version numbers.
  • New version for external hosted script.
Version 0.2.5.1
  • Minor update for anchor class.
Version 0.2.5
  • Fixed XHTML in author link love.
Version 0.2.4
  • Fixed error where external code wasn’t working
  • Use of external file will not validate correctly & work ;)
Version 0.2.3
  • Added check for singular post with comments open to enqueue scripts and style
  • Check for valication version
  • Allow for internal or external validation script
    • Use internal if having issues (external is a php file with header JS
    • Having issues with external javascript (trying to execute with PHP)…
Version 0.2.2
  • Setting page version update
  • Default version update
Version 0.2.1
  • Removed CDN(hosted) library in favor of version 1.7, which isn’t hosted yet.
  • Bug fix
Version 0.2
  • Using CDN(hosted) library version 1.6
  • Added options to admin
Version 0.1
  • Initial release.

Screenshots

  1. comment-validation-reloaded screenshot 1

    Admin options panel in 0.1

  2. comment-validation-reloaded screenshot 2

    Defualt error display

48 Comments



  1. I just wanted to drop you a note and show my appreciation for the plugin, it works like a charm.

    Thank you,

    Karl

    Reply
  2. Arjun Parsi

    The plugin is not working for me. I am using wordpress Version 3.0.1

    Reply

    • Could you be more specific? Did you update your settings? Follow the directions?

      Reply
  3. Matt

    Hi Frosty,

    Your plugin did the trick, great.

    Just 1 question, I tried to modify the error messages, I assume it’s the file “validate.js”. See messages below:

    required: “This field is required.”,
    remote: “Please fix this field.”,
    email: “Please enter a valid email address.”,
    url: “Please enter a valid URL.”,
    …..

    But everytime I try to modify, it sticks 2 the old error messages. Or am I looking at the wrong area of your code?

    Reply
  4. deleted

    Hey man,
    Your plugin don’t expect that it could be translated because you use another javascript and it is dependent from it :( . Better for you to add customization for messages. Hope this will help.

    Reply

  5. jeffery

    I’m using WP 3.1 and am not able to uninstall. Please advise.

    Reply
      • jeffery

        Actually…It was just me being lame and not paying attention. :) Fixed and reinstalled correctly. Thanks.

        Reply

  6. I seem to be doing something wrong, because after I installed and activated your plugin, WordPress just give me that annoying standard error page ( which for some reason always says i need to fill in Name allthough I filled it in ^^ )
    What could I be doing wrong ?

    Reply
  7. Elena

    Hi
    Same here, I add form ID/Class: comment-form but plugin don’t work.
    My comments.php code:


    post_password)) : ?>
    post_password) : ?>

    ‘ul’, ‘max_depth’ => 2, ‘avatar_size’ => 48 ) ); ?>

    Do I do something wrong?
    Or is a plugin issue?
    Thank you
    Elena

    Reply
  8. lisa

    I cannot get this plugin to work. Is there anything I need to add to my single.php or comments.php file?

    Reply

  9. To @wannesv, @Elena and @Lisa please be sure to find your form id or class name and paste that in the options for it to validate your comment form.

    Reply
  10. Elena

    Hi frosty
    I paste my code from comments.php:

    	
    	post_password)) : ?>
    	    post_password) : ?>
    	    
    	 'ul', 'max_depth' => 2, 'avatar_size' => 48 ) ); ?>
    

    I tryed, “comments” and “comment-form” but it don’ t work.
    I use WordPress 3.1 is maybe the reason?
    Elena

    Reply

    • What’s your website? Or, what is the id or class of your contact <form>

      example:

      <form id="someid" class="someclass">
              …
      </form>
      
      Reply
  11. Elena

    Hi frosty
    These is my comments.php code:
    http://pastebin.com/mAmUrQ1D
    I try the ID=comment-form and ID=comments wihtout success.
    Could be the newer WordPress 3.1 the reason for the problem?
    Do your plugin works with WordPress 3.1?
    Here on WordPress Plugin Site only 1 user says that works with WordPress 3.1.
    http://wordpress.org/extend/plugins/comment-validation-reloaded/
    Could be the problem because the theme I use have already a jquery validation integrated?
    Thank you for your effort in advance.
    Elena

    Reply

  12. hello i’ve updated the last version with my WP3.1 site and I get the following message in the frosty network dashboard widget :
    Warning: ….. /httpdocs/wp-content/plugins/comment-validation-reloaded/library/admin/cache/8a42b9825936779b780471a79361676a.spc is not writeable in /home/httpd/vhosts/bmxracepassion.ch/httpdocs/wp-includes/class-simplepie.php on line 1780

    I’ve search into my server and I did not find the /cache/8a42… file
    Is this message impact the plugin or is it just causing problems to the dashboard widget ?

    thanks for your advice.

    Reply

    • This will not effect the plugin. Looks like a server problem with writing a cache file for the dashboard widget.

      Reply

    • Seems to be working for me. But just to be sure, enter commentform in the settings page. That is your form ID.

      Reply
  13. Elena

    Hi frosty

    Sorry for my late respoond, thank you very much for your motivation. But it doesn’t work. I think it is a theme issue.
    Best regards and have a nice weekend
    Elena

    Reply
  14. Sven

    Thanks for a useful plugin Frosty.

    I am having a small problem. My WordPress site is in Norwegian, and after updating to the latest version I get this message on top of my admin panel:

    “Please set your Language on the settings page for the script to translate proper.”

    In Avtivate Comment Validation Reloaded i have tried to enter NO (Norwegian) and saved, but message did not go away. Not even saving GB as language did remove the message.

    So where does Comment Validation want med to set the language?

    Reply

    • In the input field type in your country’s two digit code, ie NO if that’s Norwegians country code.

      Reply
      • Sven

        Thanks for the reply Frosty.

        “NO” is the internet country code for Norway, but in WordPress they use “nb_no” and it is not possible to put that in the input field (in Comment Validation Reloaded admin panel) because it is limited to two letters…

        Reply
          • Sven

            Austin

            I have tried with “NO”, but I am still getting the message “Please set your Language on the settings page for the script to translate proper”.

            Also noticed that the new CVR have a conflict with the GetSocial plugin (may have something to do with the language setting?). I tried different version setting in CVR, cleaned the cache, logged out and in again, etc – no change.

            I have downgraded CVR and all is back to normal :)


          • But it’s still translating? Looks like I’ve got a bug that will leave the admin notice up if WPLANG is defined. Will have to check into that a bit more.


          • BTW, what’s the problem with GetSocial? Why do you think there is a conflict?


  15. Hi,

    Is there an easier way to change the error messages and remove the error container than editing `comment-validation-reloaded.php` I can make it work this way but it means I have to redit the file with each upgrade.

    What I’m looking for is a hook/filter or translate file to do the trick.

    Thanks!

    Reply

      • Awesome I see the filter now can I bother you for a simple example on how to use it.?
        I know how to write a function and add the function the filter just not sure what to put into the function.

        Reply

        • Sorry for the multiple comments. I see what you did and that’s great to be able to change the text of the error container. What I’m looking to do is to remove the container and change the message. See http://bandonrandon.com/blog for an example.

          Reply

        • In your functions.php file, or ideally in your functionality plugin (giving a talk about this next moth at WordCamp Las Vegas) add:

          add_filter( 'cvr_required_fields_text', 'custom_cvr_required_text' );
          
          function custom_cvr_required_text() {
              return 'Fill in the fields or feel my wrath';
          }
          

          You’ll have to wait for the 0.3.8 update today as I misspelled the filter text. Sending that in right now.

          Reply

          • Cool, that still doesn’t fully solve my issue or customizing all the messages and removing the container completely. I think I’m gonna fork your awesome plugin to suite my needs :)


  16. Hi Austin,

    I’m running WP 3.2 and your plugin seems to be tested even with 3.3 but when I install and activate it, it just doesn’t load anything. I already tested Jörns comment validation plugin before and there it always just loaded the css but no js. I also tried changing the version of validation js (1.7, 1.8, 1.9) but that helps nothing.

    I really need that plugin to work.

    Cheers Simon

    Reply

    • To specify: I checked loading of the files via firebug net tab, but nothing at all…

      Reply
  17. Patrik

    Thanks for a great plugin.

    I only had one request. Make it possible to add your own rules.
    For example if I want to block certain words.

    The problem I have:
    Since IE doesn’t support placeholders the placeholder is set as a value and the user can now post a comment where the username is “Name” and comment is “Your comment”.
    And I want to make so that these words are not accepted as name/comment and the user will get the default “fill in all fields” error.

    Reply
    • Patrik

      Here is my quick and ugly little solution. :)

      	jQuery.validator.addMethod('denyWords', function(value, element) {
      		if(value == '".getLang('Your comment')."' || value == '".getLang('Name')."' || value == '".getLang('E-mail')."') {
      			return this.optional(element);
      		} else {
      			return true;
      		}
      	}, 'Please fill out the required fields');
      

      (getLang is just a custom translator)

      Reply
  18. Zohar

    It would be great if we can add specific class (or div class) to the validation messages (e.g. other than ‘.error’). At the moment they share the same class with the input fields.

    Reply

    • Along with this, maybe just make it so we can enter custom javascript for validation (as an advanced option) I tend to to set the custom validation up a bit different than you but love having a plugin do all the hard work for me.

      Reply

  19. Thanks for a useful plugin Frosty.

    I am having a small problem. My WordPress site is in french, and after updating to the latest version I get this message on top of my admin panel:

    “Please set your Language on the settings page for the script to translate proper.”

    david french

    Reply
  20. Martin

    Hi frosty,

    I’m building a photo website and I have created a page which contains several photos (in a list) and under each photo I have placed the commentform (of which the ID is #comment_form + the postID), so people can give their comment to each photo separately.

    But now your great plugin doesn’t function here, how can I get the validation to work in this (kind of) page(s)?

    Some of my code for this page looks like this:

            	
                     -1, 'category' => 12, 'orderby' => 'post_date', 'order' => 'ASC', 'paged' => $paged,); // neg 1 means all posts 
                        $myposts = get_posts($args);
                        
                        foreach($myposts as $post) :
                        setup_postdata($post);
                    ?>
                                   
                        
                          
                        <!--  -->
                        
                        	<a class="show_comments" onclick="toggle_visibility(ID; ?>);">Click here to see the comments (), add a new comment or hide again 				the comments
                        
                        <!--  -->
                        
                        <div id="ID; ?>" class="show_comments_template" style="display: none;"> 
                        
                                 
                        
                        
                
             	            
    	            
    	    
    

    In your Comment Form Option you can set the form ID/Class: (like) #comment_form

    Is there a way to concatenate the postID in here or can this (only) be done inside the php code of your plugin? If yes, how can I do this?

    Martin

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>