';
printf(
/* translators: %s: is referring to the plugin's name. */
esc_html__( 'The %1$s plugin has been deactivated as the latest improvements are now included with the %2$s plugin.', 'woocommerce' ),
'' . esc_html( $plugin_data['Name'] ) . '
',
'WooCommerce
'
);
echo '
';
}
);
}
}
/**
* Prevent plugins already merged into WooCommerce core from getting activated as standalone plugins.
*
* @param string $plugin Plugin name.
*/
public static function deactivate_merged_plugins( $plugin ) {
$plugin_dir = basename( dirname( $plugin ) );
if ( self::is_package_enabled( $plugin_dir ) ) {
$plugins_url = esc_url( admin_url( 'plugins.php' ) );
wp_die(
esc_html__( 'This plugin cannot be activated because its functionality is now included in WooCommerce core.', 'woocommerce' ),
esc_html__( 'Plugin Activation Error', 'woocommerce' ),
array(
'link_url' => esc_url( $plugins_url ),
'link_text' => esc_html__( 'Return to the Plugins page', 'woocommerce' ),
),
);
}
}
/**
* Mark merged plugins as pending update.
* This is required for correctly displaying maintenance notices.
*
* @param array $plugins Plugins list.
*/
public static function mark_merged_plugins_as_pending_update( $plugins ) {
foreach ( $plugins as $plugin_name => $plugin_data ) {
$plugin_dir = basename( dirname( $plugin_name ) );
if ( self::is_package_enabled( $plugin_dir ) ) {
// Necessary to properly display notice within row.
$plugins[ $plugin_name ]['update'] = 1;
}
}
return $plugins;
}
/**
* Displays a maintenance notice next to merged plugins, to inform users
* that the plugin functionality is now offered by WooCommerce core.
*
* Requires 'mark_merged_plugins_as_pending_update' to properly display this notice.
*
* @param string $plugin_file Plugin file.
*/
public static function display_notice_for_merged_plugins( $plugin_file ) {
global $wp_list_table;
$plugin_dir = basename( dirname( $plugin_file ) );
$columns_count = $wp_list_table->get_column_count();
$notice = __( 'This plugin can no longer be activated because its functionality is now included in