Making plugin unique to not conflict with plugins with the same name

I have plugin that has the same name as other plugin uploaded to wordpress.org
How can i make it unique so it doesn’t share “View Detais” link and auto-update with other plugin uploaded to wordpress.org? Considering that name of my plugin has to be exactly name it already has and cannot be changed.
I’ve already tried adding this code to myplugin.php:

add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' );
function filter_plugin_updates( $value ) {
if (!empty($value)) {
    unset( $value->response['myplugin/myplugin.php'] );
    return $value;
   }
}

And that removes update notification for this plugin but only when it’s active, and i need to remove it completely with “View Detais” link.
Also my plugin is private and will not ever be in the wordpress repository and will not ever need auto-updation.
Any suggestions? Thanks

2 Answers
2

Do you need the “View Details” link? It shouldn’t show up unless it’s a WP hosted plugin. Could you just name the plugin whatever you want, but change it with JS in the admin

function my_enqueue($hook) {
if ( 'plugins.php' != $hook ) {
    return;
}

wp_enqueue_script( 'my_custom_script', plugin_dir_url( __FILE__ ) . 'changeName.js', array( 'jquery' ), '1', true );
}
add_action( 'admin_enqueue_scripts', 'my_enqueue' );

Your changeName.js could look like this:

jQuery("#pluginId").html("Plugin Name the PM Likes");

Leave a Comment