How to check uniqueness of plugin prefix?

You can use the WordPres Plugin Directory Slurper shell script by Mark Jaquith to download the the most recent version of all plugins from the WordPress.org repo. Once the plugins have been downloaded, you can grep for the plugin/hook prefix you want to check, e.g.: grep -r –include=*.php ‘wpseo_’ ./ Unzip the WordPres Plugin Directory … Read more

Does the number of downloads displayed for a plug-in in the WordPress.org plug-in directory include automatic updates?

That’s the total number of downloads. It includes direct downloads in the Repository and installs/updates done in the dashboard. Quotes from Otto comments in this 2010 article about the stats charts in every plugin’s page. […] the download count includes direct downloads as well […] There is no “raw count” anywhere on that version number … Read more

Get a path to a different plugin

My best guess would be: if ( ! is_file( $dir = WPMU_PLUGIN_DIR . ‘/pluginb/pluginb.php’ ) ) { if ( ! is_file( $dir = WP_PLUGIN_DIR . ‘/pluginb/pluginb.php’ ) ) $dir = null; } return $dir; However, the danger here is still the assumption of the plugin’s “basename” – a well written plugin will still function even … Read more

How to Add an Index to Plugin Database table

You can execute arbitrary SQL statements with wpdb::query(), including Data Definition Statements, e.g. function create_index () { global $wpdb ; $sql = “CREATE INDEX my_index ON {$wpdb->prefix}my_table (my_column)” ; $wpdb->query ($sql) ; return ; } Note: Because $wpdb->query() can execute arbitrary SQL, if the statement you pass to it contains ANY user input, then you … Read more

How to Add a Third Level Sub Menu to the WordPress Admin Menu

No, it is not possible to create third level menu in admin panel. If you look at the definition of add_submenu_page, you need to mention the parent slug name. For eg: add_menu_page ( ‘Test Menu’, ‘Test Menu’, ‘read’, ‘testmainmenu’, ”, ” ); add_submenu_page ( ‘testmainmenu’, ‘Test Menu’, ‘Child1’, ‘read’, ‘child1’, ”); The first parameter of … Read more

Add self-closing shortcode button to TinyMCE in WP 4.6

We start by adding the custom TinyMCE Button: function add_mce_button_custom_em() { // check user permissions if ( !current_user_can( ‘edit_posts’ ) && !current_user_can( ‘edit_pages’ ) ) { return; } // check if WYSIWYG is enabled if ( ‘true’ == get_user_option( ‘rich_editing’ ) ) { add_filter( ‘mce_external_plugins’, ‘add_tinymce_plugin_custom_em’ ); add_filter( ‘mce_buttons’, ‘register_mce_button_custom_em’ ); } } add_action(‘admin_head’, ‘add_mce_button_custom_em’); … Read more

File not found.