42 | | $result = activate_plugin($plugin, self_admin_url('plugins.php?error=true&plugin=' . $plugin), is_network_admin() ); |
| 42 | $redirect_to = self_admin_url( 'plugins.php' ); |
| 43 | if ( isset( $_REQUEST['redirect_to'] ) ) { |
| 44 | $redirect_to = wp_validate_redirect( wp_unslash( $_REQUEST['redirect_to'] ), $redirect_to ); |
| 45 | } |
| 46 | |
| 47 | $error_redirect = add_query_arg( array( 'error' => 'true', 'plugin' => urlencode( $plugin ) ), $redirect_to ); |
| 48 | $result = activate_plugin( $plugin, $error_redirect, is_network_admin() ); |
| 49 | |
45 | | $redirect = self_admin_url('plugins.php?error=true&charsout=' . strlen($result->get_error_data()) . '&plugin=' . $plugin . "&plugin_status=$status&paged=$page&s=$s"); |
46 | | wp_redirect(add_query_arg('_error_nonce', wp_create_nonce('plugin-activation-error_' . $plugin), $redirect)); |
| 52 | $redirect_args = array( |
| 53 | 'error' => 'true', |
| 54 | 'charsout' => strlen( $result->get_error_data() ), |
| 55 | 'plugin' => $plugin, |
| 56 | 'plugin_status' => $status, |
| 57 | 'paged' => $page, |
| 58 | 's' => $s, |
| 59 | '_error_nonce' => wp_create_nonce( 'plugin-activation-error_' . $plugin ) |
| 60 | ); |
| 61 | $redirect = add_query_arg( urlencode_deep( $redirect_args ), $redirect_to ); |
| 62 | wp_redirect( $redirect ); |
63 | | if ( isset($_GET['from']) && 'import' == $_GET['from'] ) { |
64 | | wp_redirect( self_admin_url("import.php?import=" . str_replace('-importer', '', dirname($plugin))) ); // overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix |
65 | | } else { |
66 | | wp_redirect( self_admin_url("plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s") ); // overrides the ?error=true one above |
| 79 | $redirect_args = array( |
| 80 | 'activate' => 'true', |
| 81 | 'plugin_status' => $status, |
| 82 | 'paged' => $page, |
| 83 | 's' => $s, |
| 84 | ); |
| 85 | $redirect = add_query_arg( urlencode_deep( $redirect_args ), $redirect_to ); |
| 86 | |
| 87 | if ( isset( $_GET['from'] ) && 'import' == $_GET['from'] ) { |
| 88 | // overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix |
| 89 | $redirect = self_admin_url( "import.php?import=" . str_replace( '-importer', '', dirname( $plugin ) ) ); |