MCEComments

Why the need of a preview box if you have the What You See Is What You Get Editor in the same place as your visitors type in the comments?

This plugin turns the comment field from a primitive <textfield> into a WYSIWYG editor, using the internal TinyMCE library bundled with WordPress 2.0 or up, without the need of another separate installation. Functions that only available to writers like adding images were removed and will not show up in the toolbar.

Consider a donation :) .


Current Version

0.4.5 – Download

Version History
0.4.5 – Compatible with WordPress 2.6.x; Fix a bug that cause JS regeneration doesn’t work

0.4.4 – Read here (Thanks ioannis!). Also the tooltips should be displaying correctly, and should support K2/AJAX Commenting.

0.4.3 – Support for WordPress 2.5. (gzip/cache for the script will be in 0.4.4)

0.4.2 – Support for K2 and other themes that uses AJAX Comment field, finally! (JQuery is time wasting, and it just doesn’t work for me) (And given that they are using onsubmit() to submit comments, not onclick() of the submit button!)

0.4.1 – Store comments in UTF-8 instead of HTML entities; Load TinyMCE only when there’s a comment form (Thanks José!)

0.4.0 – User supplied custom CSS; Modify interface a bit. Plugins of TinyMCE are now auto detected and can be added by clicking on the hyperlinks.

0.3.5 – Allow to change interface language; Subscript/superscript options; Allow user to add own plugins and buttons to the editor

0.3.0 – Increase loading speed; Fix IE7 disappearance of linebreaks

0.2.5 – Enable Firefox spell checking in the editor

0.2.0 – Newlines are correctly displayed and added a JavaScript function help adding text into TinyMCE editor

0.1.5 – RTL Text Support and allow to view HTML source

0.1.0 – Initial release

Instructions

The usual steps for installing and running a WordPress plugin:

  1. Download.
  2. Rename the extension from phps to php.
  3. Upload.
  4. Activate.

Known Issues

  1. Unwanted carriage return/newline/enter key were put into comment in older versions of Firefox. (Unconfirmed)
  2. Content inserted not within tags (for instance, WP Grins) are not removable by backspace. (Workaround: encapsulate in <span> tags, see updated instructions for WP Grins below)
  3. Message disappeared in submission using IE 6. (Unconfirmed)
  4. Compatibility with various comment-related plugins and customized themes. Please make sure the comment field is named “comment” and there are no other scripts that will interfere with it.

Working with WP Grins

Open wp-grins.php from the WordPress admin interface. Find

myField = $('comment');

Replace with

myField = document.getElementById('comment');
insertHTML('<span>'+tag+'</span>');
return;

Making TinyMCEComments works with other plugins

TinyMCEComments provides a JavaScript function insertHTML(text) which could be used by other plugins on the same page. It is used for inserting customized content generated by other plugins into the TinyMCE editor.

Compatibility with Akismet

Since there are some users receive complaints that the plugin increase the number of false positives of Akismet anti-spam, I sent a support request to Automattic recently. Here’s the conversation.

mk dot is dot here at gmail dot com wrote:
> Hello,
>
> I am the author of the plugin – TinymceComments for WordPress. My plugin
> just turns the comment area of the blog into a WYSIWYG editor, just like
> the one in the write page of the admin interface. Some users complains
> that if my plugin is turned on, many normal and healthy comments (without
> using special tags I suppose) were considered as spam by Akismet. I’m no
> anti-spam expert, so the only thing I can do is to ask for an advice. My
> plugin doesn’t have any server-side elements (except the admin interface)
> but purely rely on JavaScript. Mya you provide ideas so I could further
> investigate and solve the problem? Thanks in advance and I am looking
> forward to your reply.
>
> Yours,
> Thomas Au

Hi,
If this were all users then I think there would be a clear relationship somewhere.
As it is only some, and as it could therefore be any factor in their comment which causes this I don’t see that Akismet and your plugin are causing problems.


Mark

Though they claimed there are no clear relationships, I’ll continue test on this. And, if your blog is okay with both plugins activated, leave me a message :) .

Update: Seems I’m getting less comments eaten by the Akismet filter on my test blog (Here I use SK2). Either it could be Akismet getting used to it, or some other unknown factors acting behind the scene. Tell me your case if it’s different.

P.S.: This plugin is NOT designed to work with Live Comment Preview. Stop complaining about it.

P.P.S.: Please stop using this page as your testing ground, as the intention of the thread is for support request only. Set up a WordPress yourself, install the plugin, and enjoy yourself there. If you wish to report a bug or provide insightful and valuable comments, file your request here or e-mail me directly.

118 Comments

  1. Ploupi says:

    What a great plugin !!!
    Unfortnately, it doesn't work with the plugin "AJAX Comments"
    Can you resolve that ?

    Thanks

  2. mk says:

    Ploupl,
    Unfortunately AJAX Comments is not designed to work with plugins that do visual modifications on the comment field (due to scriptaculous effects). And you have to modify it manually, but I can't come up with any guides at the moment. Sorry.

  3. mk says:

    Scott,

    Thanks for your suggesting, I've put your idea into the new version, but instead of modifying the PHP source code, I try to make it a little bit more user-friendly by putting that into the admin interface. Hope you like it :) .

  4. Ploupi says:

    Thanks for the answer.

    But with my new theme glossyblue, it works (i have uninstalled tinyMCEComments and reinstall it AFTER installing Ajax Comments )

    But now, it seems it doesnt work with The theme switcher : only my theme by default works, the others haven't toolbars and smilies are useless

  5. Laura says:

    This is the only one that causes this problem.  I do have two other plugins that work with the comments.  Both were installed before this one and were working fine.

  6. mk says:

    Ploupi,
    Maybe the theme you are using does not has the default name for the textarea, i.e. "comment"?

  7. mk says:

    Laura,
    Would you mind telling me what plugin you installed with your blog? Thanks.

  8. greg says:

    mk – any word on the plugin conflict with Akismet? I've had to disable yours for the time being, but I'm really excited to use it… Thanks!!!!

  9. mk says:

    Greg,
    No… Even if there exists a problem, this is one I could not control. The message different from plain comment and sending from this plugin, maybe is just a few more HTML tags the visitor uses.

  10. Hi.

    I just discovered that you added the language-option to the plugin. Nice.
    An other feature that could be really nice, were if you could select your own style sheet, so the comment field could be styles as the theme. Maybe the plugin could look for a specific file (eg. comments.css) in the active theme-folder, and use it for the content_css parameter. If the file doesn't exist, of course it could use the default wordpress.css file.

    Just an idea.

  11. mk says:

    Martin,
    Thanks for your comment.
    I'll incorporate the function to the next release.

    Cheers

  12. Hi
    I've had a problem for some time: It's impossible to add comments to my blog. After some back and forth (activating and deactivating plugins) it seems that probably your Tiny plugin is not compatible with the K2 theme.
    Tried to upgrade to latest Tiny version, but no luck. Even the formatting buttons above the comment field didn't show up – so my guess is that Tiny/ K2 works badly together.
    Just liked to let you know
    Kjetil

    Running WP 2.2 and K2 0.95 with these plugins active:
    – Akismet 2.0
    – Disable WordPress Widgets 1.0
    – E-mail users 2.3
    – Page links to 1.4
    – RS-discuss 0.5.2
    – SEO title tag 2.0beta8
    – Subscribe to comments 2.1
    – Target Blank In Posts And Comments r1.0.1
    – TinyMCEComments 0.1
    – Ultimate Tag Warrior 3.14159265
    – WordPress.com Stats 1.0
    – WordPress Database Backup 2.1.2
    – WP-EMail 2.10
    – WP-SlimStat 0.9.2

  13. mk says:

    Kjetil,
    Thanks for notifying. I'll try to make it compatible with K2 in the next version of the plugin. :)

  14. Sproke :0) says:

    Hey there, just letting you know that I’m having trouble implementing this plugin with Brians Threaded Comments http://meidell.dk/archives/2004/09/04/nested-comments/ It works fine if I don’t want to reply to a particular comment, but if I reply to one in a thread, it looks fine, but I cannot type in the comment box. I have also pasted this bug on Brian’s threaded comments page. I would love to be able to use these two plugins in conjunction! Please help! And Thanks in advance

    Sproke :0)

  15. Lucas says:

    Hi there!,

    Just wanted to inform you that this plugin does not seem to work with Firefox 2.x.
    Also in IE this plugin breaks the WP-Grins plugin. If I apply the fix above (working with wp-grins) grins start to work with IE but stop working with Firefox.

    Will drop by once in a whil ehoping for a fix :)

    Cheers,

    Lucas

  16. mk says:

    Sproke,
    Please read the Making TinyMCEComments works with other plugins above. The modification is easy and should help.

  17. mk says:

    Lucas,
    What version of Firefox are you using exactly? My Firefox 2.0.0.4 on Windows is working perfectly with the plugin.
    And for the WP-Grins fix… I'm not sure if <span> really work wells. Maybe you could replace that with other tags with no effects on the layout (How about a css-ed <div>?).

  18. Lucas says:

    Hi MK,

    I am also using version 2.0.0.4.
    Did you also try it on my website? Would be strange if it is working for you :)
    About the fix, if I apply it I am no longer able to add smilies using firefox (so it does not affect the layout). I will experiement using different tags though and let you know if I succeed to fix it.

    Thanks for your support.

  19. mk says:

    Lucas,
    Just checked out your web page. I discovered that one of the variable of the TinyMCE script(one called realTinyMCE) real does not load properly. Posts here suggests that some other plugins may interfere TinyMCE editor and preventing it working properly. Check it out and see if that helps :)

  20. Bobblehead says:

    fery very nice plugin!
    using it on my site as well.

    greetings!

  21. Laurel says:

    I met the same prob as Lucas, and finally I found it was caused by lightbox. I changed

    <script type="text/javascript" src="http://…/lightbox2.03.3/js/scriptaculous.js?load=effects"></script>

    to

    <script type="text/javascript" src="http://…/lightbox2.03.3/js/effects.js"></script>

    in the head section, then both works!

    But I found another prob now, when I click the "Insert/ edit link", I got "Error: inst has no properties
    Source File: http://www.guiguan.net/wp-includes/js/tinymce/tiny_mce_gzip.php?ver=20070326&theme=advanced&language=en&plugins=&lang=en&index=0
    Line: 90
    ". Even in ur site, also exist this prob~ hum, really trouble some to play with WYSIWYG in wordpress.

  22. José Luís says:

    Since TinyMCE is downloaded as a PHP file (tiny_mce_gzip.php) it does not get cached…

    How do I enable TinyMCEComments to use Apache caching?

  23. José Luís says:

    Hi, I found kind of a workaround: I changed line 220, associating your plugin to comment_form hook. This way, only pages with comment forms download TinyMCE…
        add_action('comment_form', 'addTinyMCESupport'); // JLCarneiro

  24. andy says:

    There is certainly something going on with WP marking many comments as spam. I have installed this great and simple plugin on a small, private site restricted to a small number of registered users. I am NOT using Akismet or any other third party spam tools.
    Yet something like 15-20% of perfectly safe and short comments are getting marked as spam by the built in WP spam filters. The problem here is, of course, is that WP never shows these on the comments admin pages so to the novice user they appear to have just been lost. But there they are in the database all the samne with an approved marking of 'spam'.
    I don't believe this is a problem with your plugin. This is quite clearly a problem with WP even if they wont consider it.
    If my investigations get anywhere I'll come back here and let you know.

  25. mk says:

    José,
    Thanks for your suggestion. I will move it to the source when I am free from my daytime work.

  26. mk says:

    Andy,
    Thanks for your help. I am looking forward to see the result.

  27. andy says:

    OK – here is what is happening. First leaving Akismet out of the equation.
    TinyMCE encodes characters (such as an apostrophie) into XML/HTML entities. So for example, an apostrophie is encoded to ampersand + hash + 39 + semi-colon before beng presented to the back end for saving.
    Wordpress checks the comment for validity and as part of that checking it runs a function called wp_blacklist_check. This function explicitly looks for any string that starts ampersand+hash, is followed by a number and closes with a semi-colon. If it finds such a string in the comment text (or the author name, email or url) then it marks it as spam.
    Using standard WordPress, this means the comment is saved, the approved flag is set to spam and it is never seen – not even appearing in the comments for moderation list.
    My guess is that if you use Akismet, it accepts that spam flag without question but at least puts the comment in the Akismet list.
    Having traced this I can see that the 22 recent comments since installing this plugin that are invisible as such all have an apostrophie. All the comments that were passed as valid did not have one.
    The next task is to work out what to do about this of course…

  28. mk says:

    Alex,
    I think of two ways, where 1 is modifying the wp_blacklist_check() function, but I think it's a bit hard without compromising WordPress security…
    So the second option is to modify the entity list that TinyMCE is keeping, but I don't know what side-effects this mod would bring…

  29. andy says:

    Yes I am coming to the same conclusion. The odd thing is that the default entity-encoding for TinyMCE is suposed to be named yet for some reason on this plugin it is numeric. I have just added a specific entity-encoding named to the plugin TineMCE init and of course, it works fine. But I am unsure as to the implications of this is terms of trapping genuine spam.
    Does anyone have any knowledge on this aspect?

  30. andy says:

    Sorry – take back that last comment. It IS running as named it's just that an apostrophie 39 does not have an entry in the entities list.

  31. Mates says:

    I tried run WP Grins and TinyMCEComments together. I had problem with posting two similar smilies. When I used standard solution I had ":lol::lol" instead of smilies. So I replaced
    <code>
    myField = document.getElementById('comment');
    insertHTML('<span>'+tag+'</span>');
    return;
    </code>
    by
    <code>
    myField = document.getElementById('comment');
    insertHTML('<span> '+tag+' </span>');
    return;
    </code>
    and in line 120
    <code>
    '&nbsp;' +tag+ '&nbsp;'
    </code>
    by
    <code>
    '<span> '+tag+' <span>'
    </code>
    Now everything works fine.
    (WP 2.2.1, WP Grins 1.5, tinyMCEComments 0.4.0, theme TerraFirma 3.3.1)

  32. Mates says:

    I tested tinyMCEComments with my others plugin however myGallery 1.4b10 is incompatible (imposible to insert smile from WP Grins, tinyMCEComments button bar is hidden).

  33. Tal Galili says:

    Great plugin, thanks !

  34. Jennia says:

    image test
    <img src="http://farm2.static.flickr.com/1207/558954654_6deacb8408.jpg?v=0">

    Thanks!

  35. Jennia says:

    img test
    [img]http://farm2.static.flickr.com/1207/558954654_6deacb8408.jpg?v=0[/img]

  36. Malaga says:

    Hello, please make it work with wp ajax edit comments…and better work with loghtbox, since even with your tips, i cant use it(i use thumbnail preview).
    Im so bored to disable 2 or more plugins every new plugin installed…

  37. Malaga says:

    I have an update to write…it works with wp ajax edit comments, BUT NOT with IE7….with firefox and opera works well…there's a bug somewhere(maybe)…please check it out.

  38. Alex says:

    Excellent!  My only wish, as sickeningly redundant as it might be: compatibility with Ajax comment preview – then folks would see exactly how things will appear (this editor presents different formatting from what a final page does).

    But thank you.  This is great.

  39. Ken Gagne says:

    I agree: if it is within your ability (and not Michael Adams'), compatibility with
    http://blogwaffe.com/ajax-comment-preview/
    would make your plug-in a must-have!  For now, though, I must choose between the two… :-(

  40. Xi says:

    和这个插件不兼容http://www.mybrand.com.cn/news_wp/2007/07/14/16
    报告完毕

  41. Gombo says:

    Very nice and helpful, thank you. Saves a lot of trouble. 

  42. david says:

    Great plug, is there anyway to get the embed video icon from the "embedded-video-with-link" plug  in the comments, I know you took some icons out how hard would it be to put one in. also any way to make it customizable?
    Thanks,
    Dave

  43. iNULL says:

    Hi….

    First of all, thanks alot for this plugin. I used it in wordpress 2.2.2 but unfortunately its work only on Opera v9.23 and  IE6/7, NOT on Firefox 2.0.0.6 on Windows. You can see <a href="http://aufklarung.org/?p=141">here</a>. TinyMCEComments is NOT only doesn't work on my blog, but on  <a href="http://mk.netgenes.org/my-plugins/mcecomments/">netgenes</a>  blog too. I'm viewing this site/blog using these browser above and I'm not see the TinyMCEComments in comment area, once again its only on Firefox 2.0.0.6 on Windows! So, please give solution !

    Blessing,
    iNULL

  44. mk says:

    David,
    You could load the plugin using the interface directly, but I'm not sure if WordPress itself will filter the video tag (possibly <embed>) it made.

  45. mk says:

    iNull,
    First of all thanks for your report. But after checking it( I mostly work on Linux), both IE 6/7 and Firefox 2.0.0.6 on Windows works well with the plugin (at least on my site). Unfortunately it doesn't work on yours. possibly conflicted with other JavaScripts? Also if you could not see anything using these browsers, consider if there are any javasscript blocking plugins like NoScript activated.

  46. 7 says:

    It's a greatest plugin! Thanks!

  47. canarkadaş says:

    Thanks..
    […] <a href="http://worldarchivetr.com/wp/100-wordpress-eklentisi/" rel="nofollow"> Açıklamalı 232 WordPress eklentisi (Agu. 15, 2007 !!) (WordPress plugin list),</a>[…]

  48. Karat says:

    Hello!
    Can you tell me, how can i use Brian’s Threaded Comments and TinyMCEComments? Than i use answer in a thread, comment form don’t give me write.

  49. Karat says:

    I mean, It works fine if I don’t want to reply to a particular comment, but if I reply to one in a thread, it looks fine, but I cannot type in the comment box.

  50. Chuck says:

    plug in doesn’t work with WordPress 2.3 fix the thing.

single