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

Topic wordpress.org php plugin-development automatic-updates plugins Wordpress

Category Web


If your plugin is not in the official wp plugin repository, than add a small function in your plugin, that exclude it from the update routine. It is not helpful that WordPress search for a update or this plugin.

The source below helps you. Include it in your plugin to deactivate the update check for your custom plugin, in topic performance and redundancy with other plugins.

add_filter( 'site_transient_update_plugins', 'fb_remove_update_notifications' );
// Remove update notice for forked plugins.
function fb_remove_update_notifications($value) {

    if ( isset( $value ) && is_object( $value ) ) {
        unset( $value->response[ plugin_basename( __FILE__ ) ] );
    }

    return $value;
}

But you have right, it works only, if the source is active. For inactive plugins can you not help via source. The only way is a string for the plugin name and file name, there is with a prefix, there very seldom, now and in the feature. If you can't include source, then it is not possible to change the core functionality.


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");

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.