I see from the activation link, wordpress is using the plugin’s dir. Also, when many plugins use add_action to hook on activation, they use
add_action('activate_' . plugin_basename(), 'name_activation');
If the plugin dir is word/ , the plugin name is Press, then, this will be:
add_action('activate_word', 'press_activation'');
So, WP identify the plugin as “word” or “press” ?
I know that by using ‘activate_word’, WP gets to know which file to activate. I also tested that the “Press” got activated and running. But, is there any potential trouble to consider?
Plugins are identified by the path to the file containing the plugin headers. For instance the debug bar plugin would be identified as:
debug-bar/debug-bar.php
See
activate_plugin
To add an action on activation you need to register the hook using
register_activation_hook( $file, $function )
example:
register_activation_hook( __FILE__, 'activation_function' );