author | ymh <ymh.work@gmail.com> |
Fri, 05 Sep 2025 18:52:52 +0200 | |
changeset 22 | 8c2e4d02f4ef |
parent 21 | 48c4eec2b7e6 |
permissions | -rw-r--r-- |
0 | 1 |
<?php |
2 |
/** |
|
3 |
* Plugins administration panel. |
|
4 |
* |
|
5 |
* @package WordPress |
|
6 |
* @subpackage Administration |
|
7 |
*/ |
|
8 |
||
9 |
/** WordPress Administration Bootstrap */ |
|
16 | 10 |
require_once __DIR__ . '/admin.php'; |
0 | 11 |
|
9 | 12 |
if ( ! current_user_can( 'activate_plugins' ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
13 |
wp_die( __( 'Sorry, you are not allowed to manage plugins for this site.' ) ); |
9 | 14 |
} |
0 | 15 |
|
9 | 16 |
$wp_list_table = _get_list_table( 'WP_Plugins_List_Table' ); |
17 |
$pagenum = $wp_list_table->get_pagenum(); |
|
0 | 18 |
|
19 |
$action = $wp_list_table->current_action(); |
|
20 |
||
9 | 21 |
$plugin = isset( $_REQUEST['plugin'] ) ? wp_unslash( $_REQUEST['plugin'] ) : ''; |
22 |
$s = isset( $_REQUEST['s'] ) ? urlencode( wp_unslash( $_REQUEST['s'] ) ) : ''; |
|
0 | 23 |
|
24 |
// Clean up request URI from temporary args for screen options/paging uri's to work as expected. |
|
16 | 25 |
$query_args_to_remove = array( |
26 |
'error', |
|
27 |
'deleted', |
|
28 |
'activate', |
|
29 |
'activate-multi', |
|
30 |
'deactivate', |
|
31 |
'deactivate-multi', |
|
32 |
'enabled-auto-update', |
|
33 |
'disabled-auto-update', |
|
34 |
'enabled-auto-update-multi', |
|
35 |
'disabled-auto-update-multi', |
|
36 |
'_error_nonce', |
|
37 |
); |
|
38 |
||
39 |
$_SERVER['REQUEST_URI'] = remove_query_arg( $query_args_to_remove, $_SERVER['REQUEST_URI'] ); |
|
0 | 40 |
|
5 | 41 |
wp_enqueue_script( 'updates' ); |
42 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
43 |
WP_Plugin_Dependencies::initialize(); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
44 |
|
0 | 45 |
if ( $action ) { |
46 |
||
47 |
switch ( $action ) { |
|
48 |
case 'activate': |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
49 |
if ( ! current_user_can( 'activate_plugin', $plugin ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
50 |
wp_die( __( 'Sorry, you are not allowed to activate this plugin.' ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
51 |
} |
0 | 52 |
|
53 |
if ( is_multisite() && ! is_network_admin() && is_network_only_plugin( $plugin ) ) { |
|
9 | 54 |
wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ); |
0 | 55 |
exit; |
56 |
} |
|
57 |
||
9 | 58 |
check_admin_referer( 'activate-plugin_' . $plugin ); |
0 | 59 |
|
9 | 60 |
$result = activate_plugin( $plugin, self_admin_url( 'plugins.php?error=true&plugin=' . urlencode( $plugin ) ), is_network_admin() ); |
0 | 61 |
if ( is_wp_error( $result ) ) { |
16 | 62 |
if ( 'unexpected_output' === $result->get_error_code() ) { |
9 | 63 |
$redirect = self_admin_url( 'plugins.php?error=true&charsout=' . strlen( $result->get_error_data() ) . '&plugin=' . urlencode( $plugin ) . "&plugin_status=$status&paged=$page&s=$s" ); |
64 |
wp_redirect( add_query_arg( '_error_nonce', wp_create_nonce( 'plugin-activation-error_' . $plugin ), $redirect ) ); |
|
0 | 65 |
exit; |
66 |
} else { |
|
9 | 67 |
wp_die( $result ); |
0 | 68 |
} |
69 |
} |
|
70 |
||
71 |
if ( ! is_network_admin() ) { |
|
72 |
$recent = (array) get_option( 'recently_activated' ); |
|
73 |
unset( $recent[ $plugin ] ); |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
74 |
update_option( 'recently_activated', $recent, false ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
75 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
76 |
$recent = (array) get_site_option( 'recently_activated' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
77 |
unset( $recent[ $plugin ] ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
78 |
update_site_option( 'recently_activated', $recent ); |
0 | 79 |
} |
80 |
||
16 | 81 |
if ( isset( $_GET['from'] ) && 'import' === $_GET['from'] ) { |
82 |
// Overrides the ?error=true one above and redirects to the Imports page, stripping the -importer suffix. |
|
83 |
wp_redirect( self_admin_url( 'import.php?import=' . str_replace( '-importer', '', dirname( $plugin ) ) ) ); |
|
84 |
} elseif ( isset( $_GET['from'] ) && 'press-this' === $_GET['from'] ) { |
|
9 | 85 |
wp_redirect( self_admin_url( 'press-this.php' ) ); |
0 | 86 |
} else { |
16 | 87 |
// Overrides the ?error=true one above. |
88 |
wp_redirect( self_admin_url( "plugins.php?activate=true&plugin_status=$status&paged=$page&s=$s" ) ); |
|
0 | 89 |
} |
90 |
exit; |
|
5 | 91 |
|
0 | 92 |
case 'activate-selected': |
9 | 93 |
if ( ! current_user_can( 'activate_plugins' ) ) { |
94 |
wp_die( __( 'Sorry, you are not allowed to activate plugins for this site.' ) ); |
|
95 |
} |
|
0 | 96 |
|
9 | 97 |
check_admin_referer( 'bulk-plugins' ); |
0 | 98 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
99 |
$plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array(); |
0 | 100 |
|
101 |
if ( is_network_admin() ) { |
|
102 |
foreach ( $plugins as $i => $plugin ) { |
|
5 | 103 |
// Only activate plugins which are not already network activated. |
104 |
if ( is_plugin_active_for_network( $plugin ) ) { |
|
0 | 105 |
unset( $plugins[ $i ] ); |
5 | 106 |
} |
0 | 107 |
} |
108 |
} else { |
|
109 |
foreach ( $plugins as $i => $plugin ) { |
|
5 | 110 |
// Only activate plugins which are not already active and are not network-only when on Multisite. |
111 |
if ( is_plugin_active( $plugin ) || ( is_multisite() && is_network_only_plugin( $plugin ) ) ) { |
|
0 | 112 |
unset( $plugins[ $i ] ); |
5 | 113 |
} |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
114 |
// Only activate plugins which the user can activate. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
115 |
if ( ! current_user_can( 'activate_plugin', $plugin ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
116 |
unset( $plugins[ $i ] ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
117 |
} |
0 | 118 |
} |
119 |
} |
|
120 |
||
9 | 121 |
if ( empty( $plugins ) ) { |
122 |
wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ); |
|
0 | 123 |
exit; |
124 |
} |
|
125 |
||
9 | 126 |
activate_plugins( $plugins, self_admin_url( 'plugins.php?error=true' ), is_network_admin() ); |
0 | 127 |
|
128 |
if ( ! is_network_admin() ) { |
|
9 | 129 |
$recent = (array) get_option( 'recently_activated' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
130 |
} else { |
9 | 131 |
$recent = (array) get_site_option( 'recently_activated' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
132 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
133 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
134 |
foreach ( $plugins as $plugin ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
135 |
unset( $recent[ $plugin ] ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
136 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
137 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
138 |
if ( ! is_network_admin() ) { |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
139 |
update_option( 'recently_activated', $recent, false ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
140 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
141 |
update_site_option( 'recently_activated', $recent ); |
0 | 142 |
} |
143 |
||
9 | 144 |
wp_redirect( self_admin_url( "plugins.php?activate-multi=true&plugin_status=$status&paged=$page&s=$s" ) ); |
0 | 145 |
exit; |
5 | 146 |
|
9 | 147 |
case 'update-selected': |
0 | 148 |
check_admin_referer( 'bulk-plugins' ); |
149 |
||
9 | 150 |
if ( isset( $_GET['plugins'] ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
151 |
$plugins = explode( ',', wp_unslash( $_GET['plugins'] ) ); |
9 | 152 |
} elseif ( isset( $_POST['checked'] ) ) { |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
153 |
$plugins = (array) wp_unslash( $_POST['checked'] ); |
9 | 154 |
} else { |
0 | 155 |
$plugins = array(); |
9 | 156 |
} |
0 | 157 |
|
19 | 158 |
// Used in the HTML title tag. |
9 | 159 |
$title = __( 'Update Plugins' ); |
0 | 160 |
$parent_file = 'plugins.php'; |
161 |
||
5 | 162 |
wp_enqueue_script( 'updates' ); |
16 | 163 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 164 |
|
165 |
echo '<div class="wrap">'; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
166 |
echo '<h1>' . esc_html( $title ) . '</h1>'; |
0 | 167 |
|
18 | 168 |
$url = self_admin_url( 'update.php?action=update-selected&plugins=' . urlencode( implode( ',', $plugins ) ) ); |
9 | 169 |
$url = wp_nonce_url( $url, 'bulk-update-plugins' ); |
0 | 170 |
|
171 |
echo "<iframe src='$url' style='width: 100%; height:100%; min-height:850px;'></iframe>"; |
|
172 |
echo '</div>'; |
|
16 | 173 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |
0 | 174 |
exit; |
5 | 175 |
|
0 | 176 |
case 'error_scrape': |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
177 |
if ( ! current_user_can( 'activate_plugin', $plugin ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
178 |
wp_die( __( 'Sorry, you are not allowed to activate this plugin.' ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
179 |
} |
0 | 180 |
|
9 | 181 |
check_admin_referer( 'plugin-activation-error_' . $plugin ); |
0 | 182 |
|
9 | 183 |
$valid = validate_plugin( $plugin ); |
184 |
if ( is_wp_error( $valid ) ) { |
|
185 |
wp_die( $valid ); |
|
186 |
} |
|
0 | 187 |
|
188 |
if ( ! WP_DEBUG ) { |
|
189 |
error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); |
|
190 |
} |
|
191 |
||
16 | 192 |
ini_set( 'display_errors', true ); // Ensure that fatal errors are displayed. |
193 |
// Go back to "sandbox" scope so we get the same errors as before. |
|
0 | 194 |
plugin_sandbox_scrape( $plugin ); |
5 | 195 |
/** This action is documented in wp-admin/includes/plugin.php */ |
196 |
do_action( "activate_{$plugin}" ); |
|
0 | 197 |
exit; |
5 | 198 |
|
0 | 199 |
case 'deactivate': |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
200 |
if ( ! current_user_can( 'deactivate_plugin', $plugin ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
201 |
wp_die( __( 'Sorry, you are not allowed to deactivate this plugin.' ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
202 |
} |
0 | 203 |
|
9 | 204 |
check_admin_referer( 'deactivate-plugin_' . $plugin ); |
0 | 205 |
|
206 |
if ( ! is_network_admin() && is_plugin_active_for_network( $plugin ) ) { |
|
9 | 207 |
wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ); |
0 | 208 |
exit; |
209 |
} |
|
210 |
||
211 |
deactivate_plugins( $plugin, false, is_network_admin() ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
212 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
213 |
if ( ! is_network_admin() ) { |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
214 |
update_option( 'recently_activated', array( $plugin => time() ) + (array) get_option( 'recently_activated' ), false ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
215 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
216 |
update_site_option( 'recently_activated', array( $plugin => time() ) + (array) get_site_option( 'recently_activated' ) ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
217 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
218 |
|
9 | 219 |
if ( headers_sent() ) { |
0 | 220 |
echo "<meta http-equiv='refresh' content='" . esc_attr( "0;url=plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) . "' />"; |
9 | 221 |
} else { |
222 |
wp_redirect( self_admin_url( "plugins.php?deactivate=true&plugin_status=$status&paged=$page&s=$s" ) ); |
|
223 |
} |
|
0 | 224 |
exit; |
5 | 225 |
|
0 | 226 |
case 'deactivate-selected': |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
227 |
if ( ! current_user_can( 'deactivate_plugins' ) ) { |
9 | 228 |
wp_die( __( 'Sorry, you are not allowed to deactivate plugins for this site.' ) ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
229 |
} |
0 | 230 |
|
9 | 231 |
check_admin_referer( 'bulk-plugins' ); |
0 | 232 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
233 |
$plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array(); |
0 | 234 |
// Do not deactivate plugins which are already deactivated. |
235 |
if ( is_network_admin() ) { |
|
236 |
$plugins = array_filter( $plugins, 'is_plugin_active_for_network' ); |
|
237 |
} else { |
|
238 |
$plugins = array_filter( $plugins, 'is_plugin_active' ); |
|
239 |
$plugins = array_diff( $plugins, array_filter( $plugins, 'is_plugin_active_for_network' ) ); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
240 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
241 |
foreach ( $plugins as $i => $plugin ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
242 |
// Only deactivate plugins which the user can deactivate. |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
243 |
if ( ! current_user_can( 'deactivate_plugin', $plugin ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
244 |
unset( $plugins[ $i ] ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
245 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
246 |
} |
0 | 247 |
} |
9 | 248 |
if ( empty( $plugins ) ) { |
249 |
wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ); |
|
0 | 250 |
exit; |
251 |
} |
|
252 |
||
253 |
deactivate_plugins( $plugins, false, is_network_admin() ); |
|
254 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
255 |
$deactivated = array(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
256 |
foreach ( $plugins as $plugin ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
257 |
$deactivated[ $plugin ] = time(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
258 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
259 |
|
0 | 260 |
if ( ! is_network_admin() ) { |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
261 |
update_option( 'recently_activated', $deactivated + (array) get_option( 'recently_activated' ), false ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
262 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
263 |
update_site_option( 'recently_activated', $deactivated + (array) get_site_option( 'recently_activated' ) ); |
0 | 264 |
} |
265 |
||
9 | 266 |
wp_redirect( self_admin_url( "plugins.php?deactivate-multi=true&plugin_status=$status&paged=$page&s=$s" ) ); |
0 | 267 |
exit; |
5 | 268 |
|
0 | 269 |
case 'delete-selected': |
9 | 270 |
if ( ! current_user_can( 'delete_plugins' ) ) { |
271 |
wp_die( __( 'Sorry, you are not allowed to delete plugins for this site.' ) ); |
|
5 | 272 |
} |
0 | 273 |
|
9 | 274 |
check_admin_referer( 'bulk-plugins' ); |
0 | 275 |
|
16 | 276 |
// $_POST = from the plugin form; $_GET = from the FTP details screen. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
277 |
$plugins = isset( $_REQUEST['checked'] ) ? (array) wp_unslash( $_REQUEST['checked'] ) : array(); |
0 | 278 |
if ( empty( $plugins ) ) { |
9 | 279 |
wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ); |
0 | 280 |
exit; |
281 |
} |
|
282 |
||
16 | 283 |
$plugins = array_filter( $plugins, 'is_plugin_inactive' ); // Do not allow to delete activated plugins. |
0 | 284 |
if ( empty( $plugins ) ) { |
285 |
wp_redirect( self_admin_url( "plugins.php?error=true&main=true&plugin_status=$status&paged=$page&s=$s" ) ); |
|
286 |
exit; |
|
287 |
} |
|
288 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
289 |
// Bail on all if any paths are invalid. |
16 | 290 |
// validate_file() returns truthy for invalid files. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
291 |
$invalid_plugin_files = array_filter( $plugins, 'validate_file' ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
292 |
if ( $invalid_plugin_files ) { |
9 | 293 |
wp_redirect( self_admin_url( "plugins.php?plugin_status=$status&paged=$page&s=$s" ) ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
294 |
exit; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
295 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
296 |
|
16 | 297 |
require ABSPATH . 'wp-admin/update.php'; |
0 | 298 |
|
299 |
$parent_file = 'plugins.php'; |
|
300 |
||
9 | 301 |
if ( ! isset( $_REQUEST['verify-delete'] ) ) { |
302 |
wp_enqueue_script( 'jquery' ); |
|
16 | 303 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
304 |
||
0 | 305 |
?> |
16 | 306 |
<div class="wrap"> |
0 | 307 |
<?php |
16 | 308 |
|
309 |
$plugin_info = array(); |
|
310 |
$have_non_network_plugins = false; |
|
311 |
||
9 | 312 |
foreach ( (array) $plugins as $plugin ) { |
313 |
$plugin_slug = dirname( $plugin ); |
|
5 | 314 |
|
16 | 315 |
if ( '.' === $plugin_slug ) { |
316 |
$data = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin ); |
|
317 |
if ( $data ) { |
|
9 | 318 |
$plugin_info[ $plugin ] = $data; |
319 |
$plugin_info[ $plugin ]['is_uninstallable'] = is_uninstallable_plugin( $plugin ); |
|
320 |
if ( ! $plugin_info[ $plugin ]['Network'] ) { |
|
321 |
$have_non_network_plugins = true; |
|
322 |
} |
|
323 |
} |
|
324 |
} else { |
|
325 |
// Get plugins list from that folder. |
|
16 | 326 |
$folder_plugins = get_plugins( '/' . $plugin_slug ); |
327 |
if ( $folder_plugins ) { |
|
9 | 328 |
foreach ( $folder_plugins as $plugin_file => $data ) { |
329 |
$plugin_info[ $plugin_file ] = _get_plugin_data_markup_translate( $plugin_file, $data ); |
|
330 |
$plugin_info[ $plugin_file ]['is_uninstallable'] = is_uninstallable_plugin( $plugin ); |
|
331 |
if ( ! $plugin_info[ $plugin_file ]['Network'] ) { |
|
0 | 332 |
$have_non_network_plugins = true; |
5 | 333 |
} |
0 | 334 |
} |
335 |
} |
|
336 |
} |
|
9 | 337 |
} |
16 | 338 |
|
339 |
$plugins_to_delete = count( $plugin_info ); |
|
340 |
||
0 | 341 |
?> |
16 | 342 |
<?php if ( 1 === $plugins_to_delete ) : ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
343 |
<h1><?php _e( 'Delete Plugin' ); ?></h1> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
344 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
345 |
if ( $have_non_network_plugins && is_network_admin() ) : |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
346 |
$maybe_active_plugin = '<strong>' . __( 'Caution:' ) . '</strong> ' . __( 'This plugin may be active on other sites in the network.' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
347 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
348 |
$maybe_active_plugin, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
349 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
350 |
'additional_classes' => array( 'error' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
351 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
352 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
353 |
endif; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
354 |
?> |
5 | 355 |
<p><?php _e( 'You are about to remove the following plugin:' ); ?></p> |
9 | 356 |
<?php else : ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
357 |
<h1><?php _e( 'Delete Plugins' ); ?></h1> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
358 |
<?php |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
359 |
if ( $have_non_network_plugins && is_network_admin() ) : |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
360 |
$maybe_active_plugins = '<strong>' . __( 'Caution:' ) . '</strong> ' . __( 'These plugins may be active on other sites in the network.' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
361 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
362 |
$maybe_active_plugins, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
363 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
364 |
'additional_classes' => array( 'error' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
365 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
366 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
367 |
endif; |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
368 |
?> |
5 | 369 |
<p><?php _e( 'You are about to remove the following plugins:' ); ?></p> |
0 | 370 |
<?php endif; ?> |
371 |
<ul class="ul-disc"> |
|
372 |
<?php |
|
16 | 373 |
|
0 | 374 |
$data_to_delete = false; |
16 | 375 |
|
0 | 376 |
foreach ( $plugin_info as $plugin ) { |
377 |
if ( $plugin['is_uninstallable'] ) { |
|
16 | 378 |
/* translators: 1: Plugin name, 2: Plugin author. */ |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
379 |
echo '<li>', sprintf( __( '%1$s by %2$s (will also <strong>delete its data</strong>)' ), '<strong>' . $plugin['Name'] . '</strong>', '<em>' . $plugin['AuthorName'] . '</em>' ), '</li>'; |
0 | 380 |
$data_to_delete = true; |
381 |
} else { |
|
16 | 382 |
/* translators: 1: Plugin name, 2: Plugin author. */ |
9 | 383 |
echo '<li>', sprintf( _x( '%1$s by %2$s', 'plugin' ), '<strong>' . $plugin['Name'] . '</strong>', '<em>' . $plugin['AuthorName'] ) . '</em>', '</li>'; |
0 | 384 |
} |
385 |
} |
|
16 | 386 |
|
0 | 387 |
?> |
388 |
</ul> |
|
9 | 389 |
<p> |
390 |
<?php |
|
16 | 391 |
|
9 | 392 |
if ( $data_to_delete ) { |
16 | 393 |
_e( 'Are you sure you want to delete these files and data?' ); |
9 | 394 |
} else { |
16 | 395 |
_e( 'Are you sure you want to delete these files?' ); |
9 | 396 |
} |
16 | 397 |
|
9 | 398 |
?> |
399 |
</p> |
|
400 |
<form method="post" action="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>" style="display:inline;"> |
|
0 | 401 |
<input type="hidden" name="verify-delete" value="1" /> |
402 |
<input type="hidden" name="action" value="delete-selected" /> |
|
403 |
<?php |
|
16 | 404 |
|
9 | 405 |
foreach ( (array) $plugins as $plugin ) { |
406 |
echo '<input type="hidden" name="checked[]" value="' . esc_attr( $plugin ) . '" />'; |
|
407 |
} |
|
16 | 408 |
|
0 | 409 |
?> |
9 | 410 |
<?php wp_nonce_field( 'bulk-plugins' ); ?> |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
411 |
<?php submit_button( $data_to_delete ? __( 'Yes, delete these files and data' ) : __( 'Yes, delete these files' ), '', 'submit', false ); ?> |
0 | 412 |
</form> |
5 | 413 |
<?php |
16 | 414 |
|
5 | 415 |
$referer = wp_get_referer(); |
16 | 416 |
|
5 | 417 |
?> |
418 |
<form method="post" action="<?php echo $referer ? esc_url( $referer ) : ''; ?>" style="display:inline;"> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
419 |
<?php submit_button( __( 'No, return me to the plugin list' ), '', 'submit', false ); ?> |
0 | 420 |
</form> |
16 | 421 |
</div> |
0 | 422 |
<?php |
16 | 423 |
|
424 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |
|
0 | 425 |
exit; |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
426 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
427 |
$plugins_to_delete = count( $plugins ); |
16 | 428 |
} // End if verify-delete. |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
429 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
430 |
$delete_result = delete_plugins( $plugins ); |
0 | 431 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
432 |
// Store the result in an option rather than a URL param due to object type & length. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
433 |
// Cannot use transient/cache, as that could get flushed if any plugin flushes data on uninstall/delete. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
434 |
update_option( 'plugins_delete_result_' . $user_ID, $delete_result, false ); |
9 | 435 |
wp_redirect( self_admin_url( "plugins.php?deleted=$plugins_to_delete&plugin_status=$status&paged=$page&s=$s" ) ); |
0 | 436 |
exit; |
437 |
case 'clear-recent-list': |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
438 |
if ( ! is_network_admin() ) { |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
439 |
update_option( 'recently_activated', array(), false ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
440 |
} else { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
441 |
update_site_option( 'recently_activated', array() ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
442 |
} |
16 | 443 |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
444 |
break; |
9 | 445 |
case 'resume': |
446 |
if ( is_multisite() ) { |
|
447 |
return; |
|
448 |
} |
|
449 |
||
450 |
if ( ! current_user_can( 'resume_plugin', $plugin ) ) { |
|
451 |
wp_die( __( 'Sorry, you are not allowed to resume this plugin.' ) ); |
|
452 |
} |
|
453 |
||
454 |
check_admin_referer( 'resume-plugin_' . $plugin ); |
|
455 |
||
456 |
$result = resume_plugin( $plugin, self_admin_url( "plugins.php?error=resuming&plugin_status=$status&paged=$page&s=$s" ) ); |
|
457 |
||
458 |
if ( is_wp_error( $result ) ) { |
|
459 |
wp_die( $result ); |
|
460 |
} |
|
461 |
||
462 |
wp_redirect( self_admin_url( "plugins.php?resume=true&plugin_status=$status&paged=$page&s=$s" ) ); |
|
463 |
exit; |
|
16 | 464 |
case 'enable-auto-update': |
465 |
case 'disable-auto-update': |
|
466 |
case 'enable-auto-update-selected': |
|
467 |
case 'disable-auto-update-selected': |
|
468 |
if ( ! current_user_can( 'update_plugins' ) || ! wp_is_auto_update_enabled_for_type( 'plugin' ) ) { |
|
469 |
wp_die( __( 'Sorry, you are not allowed to manage plugins automatic updates.' ) ); |
|
470 |
} |
|
9 | 471 |
|
16 | 472 |
if ( is_multisite() && ! is_network_admin() ) { |
473 |
wp_die( __( 'Please connect to your network admin to manage plugins automatic updates.' ) ); |
|
474 |
} |
|
475 |
||
476 |
$redirect = self_admin_url( "plugins.php?plugin_status={$status}&paged={$page}&s={$s}" ); |
|
477 |
||
478 |
if ( 'enable-auto-update' === $action || 'disable-auto-update' === $action ) { |
|
479 |
if ( empty( $plugin ) ) { |
|
480 |
wp_redirect( $redirect ); |
|
481 |
exit; |
|
482 |
} |
|
483 |
||
484 |
check_admin_referer( 'updates' ); |
|
485 |
} else { |
|
486 |
if ( empty( $_POST['checked'] ) ) { |
|
487 |
wp_redirect( $redirect ); |
|
488 |
exit; |
|
489 |
} |
|
490 |
||
491 |
check_admin_referer( 'bulk-plugins' ); |
|
492 |
} |
|
493 |
||
494 |
$auto_updates = (array) get_site_option( 'auto_update_plugins', array() ); |
|
495 |
||
496 |
if ( 'enable-auto-update' === $action ) { |
|
497 |
$auto_updates[] = $plugin; |
|
498 |
$auto_updates = array_unique( $auto_updates ); |
|
499 |
$redirect = add_query_arg( array( 'enabled-auto-update' => 'true' ), $redirect ); |
|
500 |
} elseif ( 'disable-auto-update' === $action ) { |
|
501 |
$auto_updates = array_diff( $auto_updates, array( $plugin ) ); |
|
502 |
$redirect = add_query_arg( array( 'disabled-auto-update' => 'true' ), $redirect ); |
|
503 |
} else { |
|
504 |
$plugins = (array) wp_unslash( $_POST['checked'] ); |
|
505 |
||
506 |
if ( 'enable-auto-update-selected' === $action ) { |
|
507 |
$new_auto_updates = array_merge( $auto_updates, $plugins ); |
|
508 |
$new_auto_updates = array_unique( $new_auto_updates ); |
|
509 |
$query_args = array( 'enabled-auto-update-multi' => 'true' ); |
|
510 |
} else { |
|
511 |
$new_auto_updates = array_diff( $auto_updates, $plugins ); |
|
512 |
$query_args = array( 'disabled-auto-update-multi' => 'true' ); |
|
513 |
} |
|
514 |
||
515 |
// Return early if all selected plugins already have auto-updates enabled or disabled. |
|
516 |
// Must use non-strict comparison, so that array order is not treated as significant. |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
517 |
if ( $new_auto_updates == $auto_updates ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual |
16 | 518 |
wp_redirect( $redirect ); |
519 |
exit; |
|
520 |
} |
|
521 |
||
522 |
$auto_updates = $new_auto_updates; |
|
523 |
$redirect = add_query_arg( $query_args, $redirect ); |
|
524 |
} |
|
525 |
||
526 |
/** This filter is documented in wp-admin/includes/class-wp-plugins-list-table.php */ |
|
527 |
$all_items = apply_filters( 'all_plugins', get_plugins() ); |
|
528 |
||
529 |
// Remove plugins that don't exist or have been deleted since the option was last updated. |
|
530 |
$auto_updates = array_intersect( $auto_updates, array_keys( $all_items ) ); |
|
531 |
||
532 |
update_site_option( 'auto_update_plugins', $auto_updates ); |
|
533 |
||
534 |
wp_redirect( $redirect ); |
|
535 |
exit; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
536 |
default: |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
537 |
if ( isset( $_POST['checked'] ) ) { |
9 | 538 |
check_admin_referer( 'bulk-plugins' ); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
539 |
|
16 | 540 |
$screen = get_current_screen()->id; |
541 |
$sendback = wp_get_referer(); |
|
542 |
$plugins = isset( $_POST['checked'] ) ? (array) wp_unslash( $_POST['checked'] ) : array(); |
|
543 |
||
544 |
/** This action is documented in wp-admin/edit.php */ |
|
545 |
$sendback = apply_filters( "handle_bulk_actions-{$screen}", $sendback, $action, $plugins ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
546 |
wp_safe_redirect( $sendback ); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
547 |
exit; |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
548 |
} |
0 | 549 |
break; |
550 |
} |
|
551 |
} |
|
552 |
||
553 |
$wp_list_table->prepare_items(); |
|
554 |
||
9 | 555 |
wp_enqueue_script( 'plugin-install' ); |
0 | 556 |
add_thickbox(); |
557 |
||
5 | 558 |
add_screen_option( 'per_page', array( 'default' => 999 ) ); |
0 | 559 |
|
9 | 560 |
get_current_screen()->add_help_tab( |
561 |
array( |
|
562 |
'id' => 'overview', |
|
563 |
'title' => __( 'Overview' ), |
|
564 |
'content' => |
|
16 | 565 |
'<p>' . __( 'Plugins extend and expand the functionality of WordPress. Once a plugin is installed, you may activate it or deactivate it here.' ) . '</p>' . |
566 |
'<p>' . __( 'The search for installed plugins will search for terms in their name, description, or author.' ) . ' <span id="live-search-desc" class="hide-if-no-js">' . __( 'The search results will be updated as you type.' ) . '</span></p>' . |
|
9 | 567 |
'<p>' . sprintf( |
16 | 568 |
/* translators: %s: WordPress Plugin Directory URL. */ |
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
569 |
__( 'If you would like to see more plugins to choose from, click on the “Add Plugin” button and you will be able to browse or search for additional plugins from the <a href="%s">WordPress Plugin Directory</a>. Plugins in the WordPress Plugin Directory are designed and developed by third parties, and are compatible with the license WordPress uses. Oh, and they are free!' ), |
9 | 570 |
__( 'https://wordpress.org/plugins/' ) |
571 |
) . '</p>', |
|
572 |
) |
|
573 |
); |
|
574 |
get_current_screen()->add_help_tab( |
|
575 |
array( |
|
576 |
'id' => 'compatibility-problems', |
|
577 |
'title' => __( 'Troubleshooting' ), |
|
578 |
'content' => |
|
16 | 579 |
'<p>' . __( 'Most of the time, plugins play nicely with the core of WordPress and with other plugins. Sometimes, though, a plugin’s code will get in the way of another plugin, causing compatibility issues. If your site starts doing strange things, this may be the problem. Try deactivating all your plugins and re-activating them in various combinations until you isolate which one(s) caused the issue.' ) . '</p>' . |
9 | 580 |
'<p>' . sprintf( |
16 | 581 |
/* translators: %s: WP_PLUGIN_DIR constant value. */ |
19 | 582 |
__( 'If something goes wrong with a plugin and you cannot use WordPress, delete or rename that file in the %s directory and it will be automatically deactivated.' ), |
9 | 583 |
'<code>' . WP_PLUGIN_DIR . '</code>' |
584 |
) . '</p>', |
|
585 |
) |
|
586 |
); |
|
0 | 587 |
|
16 | 588 |
$help_sidebar_autoupdates = ''; |
589 |
||
590 |
if ( current_user_can( 'update_plugins' ) && wp_is_auto_update_enabled_for_type( 'plugin' ) ) { |
|
591 |
get_current_screen()->add_help_tab( |
|
592 |
array( |
|
593 |
'id' => 'plugins-themes-auto-updates', |
|
594 |
'title' => __( 'Auto-updates' ), |
|
595 |
'content' => |
|
596 |
'<p>' . __( 'Auto-updates can be enabled or disabled for each individual plugin. Plugins with auto-updates enabled will display the estimated date of the next auto-update. Auto-updates depends on the WP-Cron task scheduling system.' ) . '</p>' . |
|
597 |
'<p>' . __( 'Auto-updates are only available for plugins recognized by WordPress.org, or that include a compatible update system.' ) . '</p>' . |
|
598 |
'<p>' . __( 'Please note: Third-party themes and plugins, or custom code, may override WordPress scheduling.' ) . '</p>', |
|
599 |
) |
|
600 |
); |
|
601 |
||
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
602 |
$help_sidebar_autoupdates = '<p>' . __( '<a href="https://wordpress.org/documentation/article/plugins-themes-auto-updates/">Documentation on Auto-updates</a>' ) . '</p>'; |
16 | 603 |
} |
604 |
||
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
605 |
if ( current_user_can( 'install_plugins' ) ) { |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
606 |
get_current_screen()->add_help_tab( |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
607 |
array( |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
608 |
'id' => 'plugins-dependencies', |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
609 |
'title' => __( 'Dependencies' ), |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
610 |
'content' => |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
611 |
'<p>' . __( 'Plugin Dependencies aims to make the process of installing and activating add-ons (dependents) and the plugins they rely on (dependencies) consistent and easy.' ) . '</p>' . |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
612 |
'<p>' . __( 'If a required plugin is deleted, a notice will be displayed on the Plugin administration screen informing the user that there is some missing dependencies to install and/or activate. Additionally, each plugin whose dependencies are not met will have an error notice on their plugin row.' ) . '</p>' . |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
613 |
'<p>' . __( 'If a dependent plugin is missing some dependencies, its activation button will be disabled until the required dependencies are activated.' ) . '</p>', |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
614 |
) |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
615 |
); |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
616 |
} |
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
617 |
|
0 | 618 |
get_current_screen()->set_help_sidebar( |
9 | 619 |
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' . |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
620 |
'<p>' . __( '<a href="https://wordpress.org/documentation/article/manage-plugins/">Documentation on Managing Plugins</a>' ) . '</p>' . |
16 | 621 |
$help_sidebar_autoupdates . |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
622 |
'<p>' . __( '<a href="https://wordpress.org/support/forums/">Support forums</a>' ) . '</p>' |
0 | 623 |
); |
624 |
||
9 | 625 |
get_current_screen()->set_screen_reader_content( |
626 |
array( |
|
627 |
'heading_views' => __( 'Filter plugins list' ), |
|
628 |
'heading_pagination' => __( 'Plugins list navigation' ), |
|
629 |
'heading_list' => __( 'Plugins list' ), |
|
630 |
) |
|
631 |
); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
632 |
|
19 | 633 |
// Used in the HTML title tag. |
9 | 634 |
$title = __( 'Plugins' ); |
0 | 635 |
$parent_file = 'plugins.php'; |
636 |
||
16 | 637 |
require_once ABSPATH . 'wp-admin/admin-header.php'; |
0 | 638 |
|
639 |
$invalid = validate_active_plugins(); |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
640 |
if ( ! empty( $invalid ) ) { |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
641 |
foreach ( $invalid as $plugin_file => $error ) { |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
642 |
$deactivated_message = sprintf( |
16 | 643 |
/* translators: 1: Plugin file, 2: Error message. */ |
644 |
__( 'The plugin %1$s has been deactivated due to an error: %2$s' ), |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
645 |
'<code>' . esc_html( $plugin_file ) . '</code>', |
19 | 646 |
esc_html( $error->get_error_message() ) |
9 | 647 |
); |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
648 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
649 |
$deactivated_message, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
650 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
651 |
'id' => 'message', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
652 |
'additional_classes' => array( 'error' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
653 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
654 |
); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
655 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
656 |
} |
0 | 657 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
658 |
// Used by wp_admin_notice() updated notices. |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
659 |
$updated_notice_args = array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
660 |
'id' => 'message', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
661 |
'additional_classes' => array( 'updated' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
662 |
'dismissible' => true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
663 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
664 |
if ( isset( $_GET['error'] ) ) { |
0 | 665 |
|
9 | 666 |
if ( isset( $_GET['main'] ) ) { |
0 | 667 |
$errmsg = __( 'You cannot delete a plugin while it is active on the main site.' ); |
9 | 668 |
} elseif ( isset( $_GET['charsout'] ) ) { |
16 | 669 |
$errmsg = sprintf( |
670 |
/* translators: %d: Number of characters. */ |
|
9 | 671 |
_n( |
672 |
'The plugin generated %d character of <strong>unexpected output</strong> during activation.', |
|
673 |
'The plugin generated %d characters of <strong>unexpected output</strong> during activation.', |
|
674 |
$_GET['charsout'] |
|
675 |
), |
|
676 |
$_GET['charsout'] |
|
677 |
); |
|
678 |
$errmsg .= ' ' . __( 'If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.' ); |
|
679 |
} elseif ( 'resuming' === $_GET['error'] ) { |
|
680 |
$errmsg = __( 'Plugin could not be resumed because it triggered a <strong>fatal error</strong>.' ); |
|
681 |
} else { |
|
682 |
$errmsg = __( 'Plugin could not be activated because it triggered a <strong>fatal error</strong>.' ); |
|
683 |
} |
|
16 | 684 |
|
18 | 685 |
if ( ! isset( $_GET['main'] ) && ! isset( $_GET['charsout'] ) |
686 |
&& isset( $_GET['_error_nonce'] ) && wp_verify_nonce( $_GET['_error_nonce'], 'plugin-activation-error_' . $plugin ) |
|
687 |
) { |
|
9 | 688 |
$iframe_url = add_query_arg( |
689 |
array( |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
690 |
'action' => 'error_scrape', |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
691 |
'plugin' => urlencode( $plugin ), |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
692 |
'_wpnonce' => urlencode( $_GET['_error_nonce'] ), |
9 | 693 |
), |
694 |
admin_url( 'plugins.php' ) |
|
695 |
); |
|
16 | 696 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
697 |
$errmsg .= '<iframe style="border:0" width="100%" height="70px" src="' . esc_url( $iframe_url ) . '"></iframe>'; |
9 | 698 |
} |
16 | 699 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
700 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
701 |
$errmsg, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
702 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
703 |
'id' => 'message', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
704 |
'additional_classes' => array( 'error' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
705 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
706 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
707 |
|
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
708 |
} elseif ( isset( $_GET['deleted'] ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
709 |
$delete_result = get_option( 'plugins_delete_result_' . $user_ID ); |
16 | 710 |
// Delete it once we're done. |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
711 |
delete_option( 'plugins_delete_result_' . $user_ID ); |
0 | 712 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
713 |
if ( is_wp_error( $delete_result ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
714 |
$plugin_not_deleted_message = sprintf( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
715 |
/* translators: %s: Error message. */ |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
716 |
__( 'Plugin could not be deleted due to an error: %s' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
717 |
esc_html( $delete_result->get_error_message() ) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
718 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
719 |
wp_admin_notice( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
720 |
$plugin_not_deleted_message, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
721 |
array( |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
722 |
'id' => 'message', |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
723 |
'additional_classes' => array( 'error' ), |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
724 |
'dismissible' => true, |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
725 |
) |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
726 |
); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
727 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
728 |
if ( 1 === (int) $_GET['deleted'] ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
729 |
$plugins_deleted_message = __( 'The selected plugin has been deleted.' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
730 |
} else { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
731 |
$plugins_deleted_message = __( 'The selected plugins have been deleted.' ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
732 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
733 |
wp_admin_notice( $plugins_deleted_message, $updated_notice_args ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
734 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
735 |
} elseif ( isset( $_GET['activate'] ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
736 |
wp_admin_notice( __( 'Plugin activated.' ), $updated_notice_args ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
737 |
} elseif ( isset( $_GET['activate-multi'] ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
738 |
wp_admin_notice( __( 'Selected plugins activated.' ), $updated_notice_args ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
739 |
} elseif ( isset( $_GET['deactivate'] ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
740 |
wp_admin_notice( __( 'Plugin deactivated.' ), $updated_notice_args ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
741 |
} elseif ( isset( $_GET['deactivate-multi'] ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
742 |
wp_admin_notice( __( 'Selected plugins deactivated.' ), $updated_notice_args ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
743 |
} elseif ( 'update-selected' === $action ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
744 |
wp_admin_notice( __( 'All selected plugins are up to date.' ), $updated_notice_args ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
745 |
} elseif ( isset( $_GET['resume'] ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
746 |
wp_admin_notice( __( 'Plugin resumed.' ), $updated_notice_args ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
747 |
} elseif ( isset( $_GET['enabled-auto-update'] ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
748 |
wp_admin_notice( __( 'Plugin will be auto-updated.' ), $updated_notice_args ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
749 |
} elseif ( isset( $_GET['disabled-auto-update'] ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
750 |
wp_admin_notice( __( 'Plugin will no longer be auto-updated.' ), $updated_notice_args ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
751 |
} elseif ( isset( $_GET['enabled-auto-update-multi'] ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
752 |
wp_admin_notice( __( 'Selected plugins will be auto-updated.' ), $updated_notice_args ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
753 |
} elseif ( isset( $_GET['disabled-auto-update-multi'] ) ) { |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
754 |
wp_admin_notice( __( 'Selected plugins will no longer be auto-updated.' ), $updated_notice_args ); |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
755 |
} |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
756 |
?> |
0 | 757 |
|
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
758 |
<?php WP_Plugin_Dependencies::display_admin_notice_for_unmet_dependencies(); ?> |
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
759 |
<?php WP_Plugin_Dependencies::display_admin_notice_for_circular_dependencies(); ?> |
0 | 760 |
<div class="wrap"> |
9 | 761 |
<h1 class="wp-heading-inline"> |
762 |
<?php |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
763 |
echo esc_html( $title ); |
9 | 764 |
?> |
765 |
</h1> |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
766 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
767 |
<?php |
9 | 768 |
if ( ( ! is_multisite() || is_network_admin() ) && current_user_can( 'install_plugins' ) ) { |
769 |
?> |
|
22
8c2e4d02f4ef
Update WordPress to latest version (6.7)
ymh <ymh.work@gmail.com>
parents:
21
diff
changeset
|
770 |
<a href="<?php echo esc_url( self_admin_url( 'plugin-install.php' ) ); ?>" class="page-title-action"><?php echo esc_html__( 'Add Plugin' ); ?></a> |
9 | 771 |
<?php |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
772 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
773 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
774 |
if ( strlen( $s ) ) { |
18 | 775 |
echo '<span class="subtitle">'; |
776 |
printf( |
|
777 |
/* translators: %s: Search query. */ |
|
778 |
__( 'Search results for: %s' ), |
|
779 |
'<strong>' . esc_html( urldecode( $s ) ) . '</strong>' |
|
780 |
); |
|
781 |
echo '</span>'; |
|
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
782 |
} |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
783 |
?> |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
784 |
|
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
785 |
<hr class="wp-header-end"> |
0 | 786 |
|
5 | 787 |
<?php |
788 |
/** |
|
789 |
* Fires before the plugins list table is rendered. |
|
790 |
* |
|
791 |
* This hook also fires before the plugins list table is rendered in the Network Admin. |
|
792 |
* |
|
793 |
* Please note: The 'active' portion of the hook name does not refer to whether the current |
|
794 |
* view is for active plugins, but rather all plugins actively-installed. |
|
795 |
* |
|
796 |
* @since 3.0.0 |
|
797 |
* |
|
9 | 798 |
* @param array[] $plugins_all An array of arrays containing information on all installed plugins. |
5 | 799 |
*/ |
800 |
do_action( 'pre_current_active_plugins', $plugins['all'] ); |
|
801 |
?> |
|
0 | 802 |
|
803 |
<?php $wp_list_table->views(); ?> |
|
804 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
805 |
<form class="search-form search-plugins" method="get"> |
21
48c4eec2b7e6
Add CLAUDE.md documentation and sync WordPress core files
ymh <ymh.work@gmail.com>
parents:
19
diff
changeset
|
806 |
<?php $wp_list_table->search_box( __( 'Search installed plugins' ), 'plugin' ); ?> |
0 | 807 |
</form> |
808 |
||
5 | 809 |
<form method="post" id="bulk-action-form"> |
0 | 810 |
|
9 | 811 |
<input type="hidden" name="plugin_status" value="<?php echo esc_attr( $status ); ?>" /> |
812 |
<input type="hidden" name="paged" value="<?php echo esc_attr( $page ); ?>" /> |
|
0 | 813 |
|
814 |
<?php $wp_list_table->display(); ?> |
|
815 |
</form> |
|
816 |
||
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
817 |
<span class="spinner"></span> |
0 | 818 |
</div> |
819 |
||
820 |
<?php |
|
5 | 821 |
wp_print_request_filesystem_credentials_modal(); |
7
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
822 |
wp_print_admin_notice_templates(); |
cf61fcea0001
resynchronize code repo with production
ymh <ymh.work@gmail.com>
parents:
5
diff
changeset
|
823 |
wp_print_update_row_templates(); |
5 | 824 |
|
16 | 825 |
require_once ABSPATH . 'wp-admin/admin-footer.php'; |