您可以使用detect\\u plugin\\u deactivation,
function detect_plugin_deactivation( $plugin, $network_activation ) {
if ($plugin=="parentplugin/parentplugin.php")
{
deactivate_plugins(plugin_basename(__FILE__));
}
}
add_action( \'deactivated_plugin\', \'detect_plugin_deactivation\', 10, 2 );
将此代码段添加到插件的主文件中。