Hello!
I've just updated CKEditor for Wordpress to 1.0.4 and I'd like to offer 2 suggestions to improve it.
They are both in ckeditor_wordpress.php. First of all, since activate() and deactivate() functions aren't in use, you should remove/comment those register_activation_hook() and register_deactivation_hook() calls.
The other one is to avoid run codes when the plugin is loaded. WP environment isn't setup yet and it becomes hard for another plugin to tweak yours.
You could load CKEditor class in 'plugins_loaded' action, but in this case I belive 'init' is enough. And there are some actions that are only used in backend, so they should be hooked only when is_admin() is true.
The final code is as follows:
add_action('init', 'ckeditor_init'); function ckeditor_init(){ require_once 'ckeditor_class.php'; if(is_admin()){ add_action('admin_menu', array(&$ckeditor_wordpress, 'add_option_page')); add_action('admin_head', array(&$ckeditor_wordpress, 'add_admin_head')); add_action('personal_options_update', array(&$ckeditor_wordpress, 'user_personalopts_update')); add_action('admin_print_scripts', array(&$ckeditor_wordpress, 'add_post_js')); } add_action('wp_print_scripts', array(&$ckeditor_wordpress, 'add_comment_js')); add_filter( 'ckeditor_external_plugins', array(&$ckeditor_wordpress, 'ckeditor_wpmore_plugin') ); add_filter( 'ckeditor_buttons', array(&$ckeditor_wordpress, 'ckeditor_wpmore_button') ); /** temporary for vvq **/ add_filter( 'ckeditor_external_plugins', array(&$ckeditor_wordpress, 'ckeditor_externalvvq_plugin') ); add_filter( 'ckeditor_buttons', array(&$ckeditor_wordpress, 'ckeditor_vvqbuttons') ); /** temporary for wppoll **/ add_filter( 'ckeditor_external_plugins', array(&$ckeditor_wordpress, 'wppoll_external') ); add_filter( 'ckeditor_buttons', array(&$ckeditor_wordpress, 'wppoll_buttons') ); /** temporary for ngggallery **/ include_once(dirname(__FILE__) . '/plugins/nggallery/ckeditor.php'); /** temporary for gd-star-rating **/ add_filter( 'ckeditor_external_plugins', array(&$ckeditor_wordpress, 'starrating_external_plugin') ); add_filter( 'ckeditor_buttons', array(&$ckeditor_wordpress, 'starrating_buttons') ); }
I've been using it in my site and working fine. You can live test it at http://hikari.ws/email-url-obfuscator/#leave-a-comment
Re: Suggestions for Wordpress
I commit it to SVN and it will be released with the next version of CKEditor plugin for Wordpress.
Greetings