What is the easiest way to implement cascading database upgrade for my plugin?

Ok, to resolve these issues, let’s implement the cascading upgrade process which will handle both use cases. First of all lets implement our plugin activation hook, which will be our entry point: // define current plugin version define( ‘WPSE8170_PLUGIN_VERSION’, ‘2.0.0’ ); // define our database table name define( ‘WPSE8170_DB_TABLE’, $GLOBALS[‘wpdb’]->prefix . ‘wpse8170_test_table’ ); add_action( ‘init’, … Read more

Display All Non-Used Plugins

I think you can use this plugin: http://wordpress.org/extend/plugins/wpmu-plugin-stats/screenshots/ Provides info to site admins as to which plugins are activated sitewide, and which blogs plugins are activated on. This plugin is using get_plugins() http://codex.wordpress.org/Function_Reference/get_plugins and fetches get_option(‘active_plugins’) for each blog to compare. It uses switch_to_blog() on each blog so it might be slower on large multisites, … Read more

wp_specialchars and wp_specialchars_decode in a shortcode plugin

The Codex description of these two functions: wp_specialchars: Converts a number of special characters into their HTML entities. Specifically deals with: &, <, >, “, and ‘. wp_specialchars_decode: Converts a number of HTML entities into their special characters. According to http://codex.wordpress.org/Function_Reference/wp_specialchars This function is deprecated as of WordPress 2.8.0. Please use esc_html instead. You don’t … Read more

nonces in custom oop plugin

check_admin_referer is a pluggable function which means it is defined after plugins are loaded so call your constructor or instantiate the object after or using plugins_loaded action hook. ex: class MyClass{ function __construct(){ if( isset($_POST[‘my_nonce_field’]) && check_admin_referer(‘my_nonce_action’, ‘my_nonce_field’)) $this->update_item(); } } add_action(‘plugins_loaded’,’newobj’); function newobj(){ $myclass = new MyClass; }

Adding a custom line of text to php code

In the insert_posts function, before the line $post_id = wp_insert_post( $post ); add the following (and suit to your needs): Link to Twitter User Page $post[‘post_content’] .= ‘<a href=”http://twitter.com/__USERNAME__”>’ .’Follow me on Twitter’ .'</a>’; and/or Link to Twitter Status $post[‘post_content’] .= ‘<a href=”‘.$post[‘twitter_permalink’].'”>’ .’View this post on Twitter’ .'</a>’;