return new WP_Error('plugin_not_found', __('Plugin file does not exist.'));

97

98

if (!in_array($plugin, $current)) {

99

wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), 'plugins.php?error=true&plugin=' . $plugin)); // we'll override this later if the plugin can be included without fatal error

93

$valid = validate_plugin($plugin);

94

if ( is_wp_error($valid) )

95

return $valid;

96

97

if ( !in_array($plugin, $current) ) {

98

if ( !empty($redirect) )

99

wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); // we'll override this later if the plugin can be included without fatal error