WP_ContactMe

July 26th, 2008

What is WP_ContactMe

WP_ContactMe is a free WordPress plug-in that provides you with a very configurable Contact form. Allowing multiple subject, localization , configurable styling, user defined forms and also SPAM protection.

Features

  • Easy to add to post and pages with BBCode.
  • Easy to add to a sidebar with a widget.
  • Easy to add anywhere in a template with a function call.
  • Comes ready configured with a standard Contact form.
  • Has HTML/PHP templates to allow you to customise the form to collect what information you like.
  • Emails the poster of the page/post by default.
  • Allows you to specify the address to receive the message.
  • Allows the setting of subjects to allow dynamic selection of the recipient of the message.
  • SPAM Protection by an optional CAPTCHA question.
  • Optionally allows the sender to receive a copy of the message.
  • Collects standard information About the sender, such as IP , referrer etc.
  • Has its own theme independent stylesheet to allow styling without modifying your theme.
  • Has localisation to allow easy modification of all default messages.

Requirements

  • WordPress 2.3.3 - 2.6 ( only the last 4 versions are supported, it may work with older version ).
  • Basic knowledge of creating forms in HTML If you wish to design your own Contact form.
  • Basic knowledge of PHP if you wish to have advanced forms

Installing WP_ContactMe

  • download WP_ContactMe.
  • Copy to your ‘wp-content/plugins‘ directory.
  • Log in with an administration account.
  • Select the ‘Plugins‘ tab.
  • Scroll down to WP_ContactMe and click ‘activate‘.

Adding The Form

You can use WP_ContactMe with any widget enabled theme by simply adding the ContactMe widget to your sidebar. You may also insert the following BBCode shortcode into your post or page where you would like the widget to appear, or the PHP anywhere your template where you would like the widget to appear.

To use them with a widget enabled theme go to ‘Design->widgets‘ and place them into your sidebars. To use BBCode or PHP insert the example code supplied.

Widget Screen

BBCode

[contactme demo="true" template="example" once="no" timelimit="60" subject="subject" email="email@address.com" antispam="yes" allowcopy="yes"]

PHP

<?PHP do_action('contactme','template="example" once="no" timelimit="60" subject="subject" email="email@address.com" antispam="yes" allowcopy="yes"');  ?>

The above are only meant as an example. All attributes might not be required, check the definitions for further details.

Attributes

  • template
    • Purpose:Sets the template of files that will be used to display the form screens. See the template files section for more information About templates
    • Required: no.
    • Default: The default Contact form will be used.See the default Contact form fields section.
  • once
    • Purpose: Sets whether the form can only be used once in a given time period.
    • Required: no.
    • Default: no.
  • timelimit
    • Purpose: Sets the time limit in seconds, that the form cannot be reused after it has been submitted . Only if the the once attribute has been set.
    • Required: no.
    • Default: 60.
  • subject
    • Purpose: A comma separated list of subjects that the user can select from to state the subject of the Contact. This will appear as the subject of the email.
    • Required: no.
    • Default: The title of the post/page on which the form is placed.
  • email
    • Purpose: A comma separated list of email addresses that the Contact form will be sent to. Each address corresponds to the selected subject. If no subject is supplied the first address in the list will be used.
    • Required: no.
    • Default: The email address of the author of the post/page.
  • antispam
    • Purpose: Whether to use a “Human response check” or “CAPTCHA” to help prevent abuse of the Contact form. The antispam is only applied to non registered users.
    • Required: no.
    • Default: yes
  • allowcopy
    • Purpose: Whether the user will be allowed to select if they wish to receive a copy of the message.
    • Required: no.
    • Default: yes.

Styling

You can easily change to look of the Contact form, This is done through the plug-ins stylesheet. This can be found in the ‘styles’ directory in the plug-ins home directory. The stylesheet contains the basic layout of each of the styles and is commented.

Localization

WP_ContactMe supports Local languages through WordPress’ own localization setting. This can be set in your wp-config.PHP file in the root of your site.

At present there are no available languages , here are a few useful links to help you to create your own.

POedit : A very useful tool for edit the PO Localization files.

Hints for translators: A few tips on translation.

The PO language files can be found in the languages folder in the plug-ins home directory. If you have created your own language file and wish to share, drop up a line using the comments or our Contact form and we will be pleased to link to you. If you also have some suggestion on how to make the translation process simpler please leave us a comment.

Templates

To create a new template.

  • Create a directory inside the ‘pages‘ folder inside the plug-ins directory.
  • Name the folder to represent the template that you will use when inserting the survey into your post or page.

Inside the template directory you can create a number of files to modify the look of the form.

These files can have either a .html extension or a .html.PHP extension. The .html.PHP files allows you in insert PHP code into the template files.

  • form
    • Purpose: this is the most important file of the all. This is the HTML form that will be used for the form. The only requirements for this file is that you omit the <form> tag and submit button as these will supplied by the plug-in.
    • Require: yes ( only when you have selected a template )
  • alreadydonemessage
    • Purpose: This the message that will be displayed to the user if they have already filled in the form.
    • Required: no
  • thanksmessage
    • Purpose: This is the message that will be displayed when the form is submitted.
    • Required: no.
  • rssfeedmessage
    • Purpose: There are problems filling out forms in RSS feeds so the form is disabled in the RSS feed. This is the message that will be displayed when the form is seen from an RSS feed.
    • Required: no.

Default Contact Form

A user wishing to use the default Contact form will be asked to fill in the following fields

Screen Shot

One configuration of the contact form.

Form Fields

    • Your Name
      • Purpose: The name of the user, this is a required field.
      • Default: The registered user name, if the user if logged in.
    • Your Email Address
      • Purpose: The email address of the user, this is a required field.
      • Default: The registered user email address, if the user if logged in.
    • Your Website
      • Purpose: The users site.
      • Default: The registered user site, if the user if logged in.
    • Subject
      • Purpose: Allows the user to select the type of Contact. This field is required if the subject attribute is entered in the form options.
      • Default: The first Item in the list.
    • Message
      • Purpose: The message the user wishes to send.
    • Human Response Check
      • Purspose: To stop abuse of the Contact form. This field is required if the antispam option is enabled on for the form.
    • receive copy?
    • Purpose: Allows the user to select if they wish to receive a copy of their message. This is only asked if the option is enabled for the form.
    • Default: no.

Version History

  • 1.0.0
    • Initial public release.
  • 1.0.1
    • Correct problem with antispam not showing
  • 1.0.2
    • Correct problem with users from address
  • 1.1.0
    • Created library are external repository
    • Added styling through a single stylesheet.
    • Added localization.
  • 1.1.1
    • Removed external library as it doesn’t seem to be include in the zip automatically
  • 1.1.2
    • Corrected problem with message caused by localization.
  • 1.1.3
    • Corrected problem where first subject in the list could not be selected due to its key.
  • 1.2.0
    • Added template.
    • Added time limit.
  • 1.2.1
    • Corrected possible style problems under Opera.
  • 1.3.0
    • Added function to place form in templates.
    • Added widgets to place forms in sidebars.
    • Enabled PHP in template forms.
  • 1.3.1
    • Added greater encapsulation.

Other Plug-ins

If you liked this plug-in visits our download area where you will find many more.

Bugs & Suggestions

If you have questions, have found any bugs, or you would like to see features added to WP_ContactMe please feel free to use the form at the bottom of the page to Contact us. If WP_ContactMe doesn’t fill your needs , feel free to Contact us to discuss a specially commissioned plug-in.

Show Your Appreciation

If you liked WP_ContactMe please:

You can also make a donation to Help support its development.


  1. May 30th, 2008 at 19:29 | #1

    Hello,
    I have on the local side much more plugins active, then on the internet site - therefor I do not thing that the plugins are the problem.
    I feel more that the difference of version of php and MySQL my be the reason, or?

  2. May 30th, 2008 at 19:33 | #2

    I don’t think it could be a Mysql thing as al it doesn;t access MySql directly, only though WordPess Calls.
    The plugin was Written under php 4.3 and tested on PHP 5.
    The safari problem will be looked into, I looks like none of the styling is working under safari.

  3. May 30th, 2008 at 21:46 | #3

    safari i have not tested, i am using Opera - there it is not working.

  4. May 30th, 2008 at 23:23 | #4

    My mistake I did mean Opera I just Had safari on the mind. I has been tested and works on IE, Firefox and Safari.

  5. chris
    June 6th, 2008 at 01:36 | #5

    g’day. This just doesn’t work for me. I paste the code into the page, and it simply displays, it doesn’t get interpreted. I’ve pasted it in WYSIWYG mode, HTML mode, using Safari (3.1.1.) and Firefox (3 RC2)

    WP version is 2.5.1
    ContactMe versions is 1.2.1

    Here’s a link to the page not working
    http://www.chowit.com/idyl/contact/

    thanks

  6. Chris Howard
    June 6th, 2008 at 05:30 | #6

    This is not working for me. It just displays the code. No conversion to a form is happening. Yes, the plugin is activated. :)

    Here’s a link: http://www.chowit.com/idyl/testing/

    WP version is 2.5.1
    ContactMe version is. 1.2.1

    thanks

  7. June 6th, 2008 at 09:17 | #7

    Its just recently become apparent that there is a conflict with WP_Contact, another contact plugin. Do you have this enabled?

    If you could try it with all you plugins disabled to see if it s a conflict.

  8. June 8th, 2008 at 17:24 | #8

    I am having the same problem as Chris Howard, I had another contact form that stopped working since I upgraded my WP and didn’t realise until I went to try this contact form. I removed the other one, and this one still didn’t work. I also disabled all the plugins and tried just this plugin and it still didnt work.

    Here is my form http://she-says.com/?page_id=32
    WP vers 2.5.1
    ContactMe vers. 1.2.1

  9. June 8th, 2008 at 17:56 | #9

    There have been a few people who’s contact form have stopped working when they upgraded WordPress, and when they tried this one it didn’t work either. So far no body has been able to give me a clue as to what could be the cause.
    It does sound like something went wrong with the upgrade, the only thing I can advise is you reinstall. Actually I would strongly advise this as it could be affecting other things too.

  10. June 19th, 2008 at 23:05 | #10

    Hello,
    after upgrading your plugin I got the following error message:
    Fatal error: Cannot loadClass(’wp)’ in /www/htdocs/w007a136/blog/wp-content/plugins/wp-contactme/library/classes/base.php on line 132

  11. Mathieu Lécrivain
    June 20th, 2008 at 06:07 | #11

    Hello,
    I have the same message as Christian Gnoth.
    Fatal error: Cannot loadClass(’wp)’ in /homepages/4/d140735112/htdocs/ledl/wp-content/plugins/wp-contactme/library/classes/base.php on line 132
    Please help !

  12. June 20th, 2008 at 09:37 | #12

    Can I ask, What version did you upgrade from?
    There seems to be a problem with the current class loader on some systems.
    It is being looked into.

  13. June 25th, 2008 at 13:42 | #13

    Hello,
    I have the same message as Christian Gnoth and Mathieu Lécrivain
    Fatal error: Cannot loadClass(’wp)’ in /homepages/4/d140735112/htdocs/ledl/wp-content/plugins/wp-contactme/library/classes/base.php on line 132
    Please help !

  14. June 25th, 2008 at 13:54 | #14

    @Asterope: It would seem that there is a problem loading some of the library classes on some operating systems.
    We are working with a user who is experiencing a the same problem on another plug-in to solve the problem, as this is one that we cannot seem to recreate it here.
    If you would like to help solve the problem , let us know an we will know and we will create a development version for this plug-in to test a solution and help diagnose the problem.

  15. July 12th, 2008 at 07:54 | #15

    Hello!
    I’ve activated the “Contact_Me” and got this fatall error

    Fatal error: Class wp_contactme_html_1215843600_dc_html_1_1_0: Cannot inherit from undefined class dc_base_2_4_0 in MyWebsitePath/wp-content/plugins/wp-contactme/library/classes/base.php(139) : eval()’d code on line 2

    How to fix it? Because I don’t have an access to the Dashboard anymore?

  16. July 12th, 2008 at 10:06 | #16

    If you delete the contact plugin from plugins directory, this will disable the plugin.
    I’m not sure what could cause the error, I’ll look into it.

  17. July 25th, 2008 at 10:29 | #17

    What’s news in 1.4.0 ?

  18. July 25th, 2008 at 10:47 | #18

    @titi: There are no real plans to add to the functionality of the plugin as such.
    One new feature intheworks is to add an options screen to aid with the creation of the PHP and BBCode inserts making it easier to configure.
    Also at some later datea possible merger with other form plugins such as WP_Survey and WP_Submition, allowing all features to be used across the whole plug-in. Making one big customisable form collection plug-in.
    Are there any new features you wish to see?

  19. titi
    July 26th, 2008 at 21:10 | #19

    ?? But 1.4.0 is already out on wordpress.org, so that’s the reason I ask what the news in this version? lol :)

  20. July 26th, 2008 at 21:18 | #20

    @titi: My mistake, I Updated a lot of plugins that day and fogor to update the documentation for this plugin.

    There was no new functionality in version 1.4.0.
    All plugins where recoded to use the same shared library meaning all and fixes to one plugin would be applied to others.
    There were a few minor tweaks to get it looking goot in 2.6

  21. titi
    July 27th, 2008 at 08:01 | #21

    Thank you for the quick answer :) The 1.4.0 doesn’t work on my blog, or it beugs… I have just installed and put the embed code in a page, and the form. is totally freak.
    example.html in “pages” folder, contains just this code :

    <p>Enter Your Name</p>
    <p><input name=’yourname’></p>

    Plus, I tried to translate the .po files with Poedit, but the language doesn’t change on the blog. I saved as wp_contactme-fr_FR.po / wp_contactme-fr_FR.mo

  22. July 27th, 2008 at 11:09 | #22

    @titi: The template attribute is optional, it was supplied as an example of all possible attributes. The example.oho is and example of how to make your own template.
    If you remove the attribute it will use the default template.
    I take it you have set the language for the blog?
    I’ll look into the language problem.

  23. titi
    July 27th, 2008 at 11:41 | #23

    mhh, I think it’s bugged a lot :s When I put my template in pages folder, and set template =”mytemp” in the embed code, it doesn’t work, it says to me “Set the template”.
    So, I tried to put it in classes/contact/templates, and it works !! But it works in half part… By examples, the changes I made in captcha.html.php doesn’t work.
    I would to change this file beacause the colors don’t appear.

    <div class=’cbox’ style=”background-color:@@bgcolor0@@”></div>
    Maybe the “;” is missing?

    I have also in each folder deleteme.txt, what is it for?

    thanks for help

  24. titi
    July 27th, 2008 at 11:43 | #24

    And for the translation, my blog is set in FRENCH.

  25. July 27th, 2008 at 11:57 | #25

    @titi:
    The “set template” message means you have selected to use a template but have not supplied a forms.html file in you template directory.
    make sure you have a forms.html file in pages/mytemp
    if you are using a linux based server this will be case sensitive.

    As for modifying files in classes this is unsupported.

    The deleteme.txt files there are there because empty files are not created in zip files. They were added to allow the directory structure to be maintained. They are safe to delete if you wish.

  26. titi
    July 27th, 2008 at 12:41 | #26

    I have form.html.php is not good?

  27. titi
    July 27th, 2008 at 12:42 | #27

    I’ve just copy/paste the files from default, and modify then…

  28. July 27th, 2008 at 12:49 | #28

    form.html.php should work as well.

    If you set the template to example did this work?

    It is not necessary to copy the files from default. If a particular template file is not found it will use the one in default instead.

  29. titi
    July 27th, 2008 at 13:00 | #29

    If I set to example it works, but not well, the form.html is almost empty.
    If i don’t set a template, then it use the default, it’s better but the forms looks ugly.

    Anyway, i’ll stay with the 1.0.2 french version. available here : http://www.cnimp.net/wp-contactme-fr
    It works, but not the latest version… :/

  30. July 27th, 2008 at 14:40 | #30

    @tifi: If you take the example as a stating point and work from there.

    If the form looks ugly either you don’t like the original design :) , or there is something in you selected theme that causes the form not to display as I would expect. Try adjusting the style to see what you get.

  31. July 27th, 2008 at 14:42 | #31

    btw. I’m currently working on the next release, and depending on my ‘real’ work load it will be available soon.
    I will make sure that the localisation is a priority.

  32. August 5th, 2008 at 06:54 | #32

    I am trying to get your WP_ContactMe to work correctly. I first wanted it to appear in the footer, but with the human response, it was too big, so I created a separate “contact us” page. However, whether I used the php or the BB code, all I got was either a blank or the code itself. I never got the form itself.

    I then tried adding it to the sidebar using the widget function. It does show up there, but I cannot customize it. For instance, I cannot get rid of the “check if you want to include your address” when using a widget, and I cannot change the subject line of the email - instead of “From HWLF website,” it only shows the name of the page. I edited the template.html.php to try to use “From HWLF website” for all submissions, but it does not work.

    So:
    (1) I’d really like to have a separate contact page. How can I make that work, given that adding the php or BB code does not work?
    (2) If that can’t work, how can I edit the widget settings to modify the subject line and get rid of the “send myself a copy” checkbox?

    Thanks. The “blank” contact page is at:

    http://www.katya.info/wordpress/?p=68

    The sidebar that I tried to modfiy but couldn’t is on that page, as well as every other.

  33. August 5th, 2008 at 09:56 | #33

    @susan - When I visit the “blank” contact page it see a contact form in mode the main page and the side bar?

  34. August 5th, 2008 at 10:46 | #34

    Aloha–

    Ok, I guess it took a little bit for the website to connect to the changes I made, but while there’s something on the main page now, but there’s no place on the main page for a message - it’s only name, email, website, subject, and then it goes into the human response.

    I’m going to remove the sidebar conact (because I don’t need two) and I’ll see if the message box appears on the main page.

    Thanks for looking.

  35. August 5th, 2008 at 10:54 | #35

    @Susan- I take it you copied the example exactly. This was only meant as an exaple. If you remove the template =”example” it will use the default contact for which is what you want.
    in fact it is best if you just start with
    [contactme]

  36. August 5th, 2008 at 11:08 | #36

    Ok, I deactivated the widget so that there’s no contact info in the sidebar, and I removed the “contact” info from the first page and created its own contact page, which can be found at:
    http://www.katya.info/wordpress/?page_id=73
    However, it still is lacking the place where a user would add a message (which was present when I used the widget). Is the “message” box only available when this plug-in was used as a widget and not through BB?

  37. August 5th, 2008 at 11:30 | #37

    @susan- did you remove the template like i suggested, it looks like it is still using the example template, not the default template.

  38. Susan
    August 10th, 2008 at 05:52 | #38

    Thanks; I think our posts crossed. I deleted the “example” and now everything works. Thanks for this tool!

  39. Susan
    August 10th, 2008 at 05:54 | #39

    I gave you a great rating at wordpress.org

  40. August 10th, 2008 at 11:55 | #40

    @susan- thank you. The next incarnation of the plugin will have an options screen to help with the setting of the attributes. This should make configuring it a little easier.

  41. michelle
    August 30th, 2008 at 20:21 | #41

    I will sit tight for the next version then, because this looks quite useful. I just can’t seem to wrap my head around how you have your folder hierarchies structured…they’re not matching the instructions above so I am just totally lost in regards to making this work on a page.

    Will keep checking back! :)

  42. August 30th, 2008 at 20:44 | #42

    @michelle-
    Hi,I’m not sure what you in that they don’t match. The instructions refer to the pages folder. All other folders should be left alone. Just place you own files in a subfolder of pages and name them as above and this will give you your own template.

  43. michelle
    August 30th, 2008 at 21:13 | #43

    I’m to have empty pages? That doesn’t make sense though. If that’s the case, why do the instructions reference so much other stuff?

    I dunno, maybe this works better as a widget, which isn’t an option I’m using on my site…

  44. Anna
    September 11th, 2008 at 01:39 | #44

    I just downloaded your contact form and followed the instruction. I would like to have the contact page in its own page and not installed in the sidebar. Could you kindly tell me how to do it? I would like to use your template and not modify it. I just want the contact page to be separate within my wordpress blog.

    Thanks

  45. Anna
    September 11th, 2008 at 02:31 | #45

    I used the BBCode in my page and got the contact form to work. Now, I have to figure out how to customize it.

    Thank you

  46. September 11th, 2008 at 15:34 | #46

    How do you configure the contact form to receive incoming emails from senders? I tested it and only receive what I sent to myself as a copy with the same emails for both to and from.

  47. September 11th, 2008 at 22:14 | #47

    @Anna:
    by default the email is sent to the email address in the profile of the post author.
    you can override this with the email attribute in the bbcode.

Comment pages
  1. May 12th, 2008 at 12:58 | #1
  2. May 16th, 2008 at 05:04 | #2
  3. June 1st, 2008 at 04:17 | #3
  4. June 8th, 2008 at 13:43 | #4
  5. June 10th, 2008 at 01:57 | #5
  6. June 19th, 2008 at 14:33 | #6
  7. July 1st, 2008 at 13:23 | #7
  8. July 2nd, 2008 at 10:10 | #8
  9. July 2nd, 2008 at 10:15 | #9