/var/www/wordpress/wp-admin/includes/admin.php
/var/www/wordpress/wp-admin/includes/bookmark.php
/var/www/wordpress/wp-admin/includes/class-ftp-pure.php
/var/www/wordpress/wp-admin/includes/class-ftp-sockets.php
/var/www/wordpress/wp-admin/includes/class-ftp.php
/var/www/wordpress/wp-admin/includes/class-pclzip.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-base.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-direct.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ftpext.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ftpsockets.php
/var/www/wordpress/wp-admin/includes/class-wp-filesystem-ssh2.php
/var/www/wordpress/wp-admin/includes/class-wp-importer.php
/var/www/wordpress/wp-admin/includes/class-wp-upgrader.php
/var/www/wordpress/wp-admin/includes/comment.php
/var/www/wordpress/wp-admin/includes/continents-cities.php
/var/www/wordpress/wp-admin/includes/dashboard.php
/var/www/wordpress/wp-admin/includes/deprecated.php
/var/www/wordpress/wp-admin/includes/export.php
/var/www/wordpress/wp-admin/includes/file.php
/var/www/wordpress/wp-admin/includes/image-edit.php
/var/www/wordpress/wp-admin/includes/image.php
/var/www/wordpress/wp-admin/includes/import.php
/var/www/wordpress/wp-admin/includes/manifest.php
/var/www/wordpress/wp-admin/includes/media.php
/var/www/wordpress/wp-admin/includes/meta-boxes.php
/var/www/wordpress/wp-admin/includes/misc.php
/var/www/wordpress/wp-admin/includes/ms-deprecated.php
/var/www/wordpress/wp-admin/includes/ms.php
/var/www/wordpress/wp-admin/includes/nav-menu.php
/var/www/wordpress/wp-admin/includes/plugin-install.php
/var/www/wordpress/wp-admin/includes/plugin.php
/var/www/wordpress/wp-admin/includes/post.php
/var/www/wordpress/wp-admin/includes/schema.php
/var/www/wordpress/wp-admin/includes/taxonomy.php
/var/www/wordpress/wp-admin/includes/template.php
/var/www/wordpress/wp-admin/includes/theme-install.php
/var/www/wordpress/wp-admin/includes/theme.php
/var/www/wordpress/wp-admin/includes/update-core.php
/var/www/wordpress/wp-admin/includes/update.php
/var/www/wordpress/wp-admin/includes/upgrade.php
/var/www/wordpress/wp-admin/includes/user.php
/var/www/wordpress/wp-admin/includes/widgets.php
/var/www/wordpress/wp-admin/js/revisions-js.php
/var/www/wordpress/wp-admin/maint/repair.php
/var/www/wordpress/wp-admin/admin-ajax.php
/var/www/wordpress/wp-admin/admin-footer.php
/var/www/wordpress/wp-admin/admin-functions.php
/var/www/wordpress/wp-admin/admin-header.php
/var/www/wordpress/wp-admin/admin-post.php
/var/www/wordpress/wp-admin/admin.php
/var/www/wordpress/wp-admin/async-upload.php
/var/www/wordpress/wp-admin/comment.php
/var/www/wordpress/wp-admin/custom-background.php
/var/www/wordpress/wp-admin/custom-header.php
/var/www/wordpress/wp-admin/edit-attachment-rows.php
/var/www/wordpress/wp-admin/edit-comments.php
/var/www/wordpress/wp-admin/edit-form-advanced.php
/var/www/wordpress/wp-admin/edit-form-comment.php
/var/www/wordpress/wp-admin/edit-link-categories.php
/var/www/wordpress/wp-admin/edit-link-category-form.php
/var/www/wordpress/wp-admin/edit-link-form.php
/var/www/wordpress/wp-admin/edit-post-rows.php
/var/www/wordpress/wp-admin/edit-tag-form.php
/var/www/wordpress/wp-admin/edit-tags.php
/var/www/wordpress/wp-admin/edit.php
/var/www/wordpress/wp-admin/export.php
/var/www/wordpress/wp-admin/gears-manifest.php
/var/www/wordpress/wp-admin/import.php
/var/www/wordpress/wp-admin/index-extra.php
/var/www/wordpress/wp-admin/index.php
/var/www/wordpress/wp-admin/install-helper.php
/var/www/wordpress/wp-admin/install.php
/var/www/wordpress/wp-admin/link-add.php
/var/www/wordpress/wp-admin/link-category.php
/var/www/wordpress/wp-admin/link-manager.php
/var/www/wordpress/wp-admin/link-parse-opml.php
/var/www/wordpress/wp-admin/link.php
/var/www/wordpress/wp-admin/load-scripts.php
/var/www/wordpress/wp-admin/load-styles.php
/var/www/wordpress/wp-admin/media-new.php
/var/www/wordpress/wp-admin/media-upload.php
/var/www/wordpress/wp-admin/media.php
/var/www/wordpress/wp-admin/menu-header.php
/var/www/wordpress/wp-admin/menu.php
/var/www/wordpress/wp-admin/moderation.php
/var/www/wordpress/wp-admin/ms-admin.php
/var/www/wordpress/wp-admin/ms-delete-site.php
/var/www/wordpress/wp-admin/ms-edit.php
/var/www/wordpress/wp-admin/ms-options.php
/var/www/wordpress/wp-admin/ms-sites.php
/var/www/wordpress/wp-admin/ms-themes.php
/var/www/wordpress/wp-admin/ms-upgrade-network.php
/var/www/wordpress/wp-admin/ms-users.php
/var/www/wordpress/wp-admin/my-sites.php
/var/www/wordpress/wp-admin/nav-menus.php
/var/www/wordpress/wp-admin/network.php
/var/www/wordpress/wp-admin/options-discussion.php
/var/www/wordpress/wp-admin/options-general.php
/var/www/wordpress/wp-admin/options-head.php
/var/www/wordpress/wp-admin/options-media.php
/var/www/wordpress/wp-admin/options-permalink.php
/var/www/wordpress/wp-admin/options-privacy.php
/var/www/wordpress/wp-admin/options-reading.php
/var/www/wordpress/wp-admin/options-writing.php
/var/www/wordpress/wp-admin/options.php
/var/www/wordpress/wp-admin/plugin-editor.php
/var/www/wordpress/wp-admin/plugin-install.php
/var/www/wordpress/wp-admin/plugins.php
/var/www/wordpress/wp-admin/post-new.php
/var/www/wordpress/wp-admin/post.php
/var/www/wordpress/wp-admin/press-this.php
/var/www/wordpress/wp-admin/profile.php
/var/www/wordpress/wp-admin/revision.php
/var/www/wordpress/wp-admin/setup-config.php
/var/www/wordpress/wp-admin/sidebar.php
/var/www/wordpress/wp-admin/theme-editor.php
/var/www/wordpress/wp-admin/theme-install.php
/var/www/wordpress/wp-admin/themes.php
/var/www/wordpress/wp-admin/tools.php
/var/www/wordpress/wp-admin/update-core.php
#CodeDescriptions
1<?php
2/**
3 * Update Core administration panel.
4 *
5 * @package WordPress
6 * @subpackage Administration
7 */
8
9/** WordPress Administration Bootstrap */
10require_once('./admin.php');
11
12if ( ! current_user_can('update_plugins') )
13 wp_die(__('You do not have sufficient permissions to update plugins for this site.'));
14
15function list_core_update( $update ) {
16 global $wp_local_package, $wpdb;
17 $version_string = ('en_US' == $update->locale && 'en_US' == get_locale() ) ?
18 $update->current : sprintf("%s–<strong>%s</strong>", $update->current, $update->locale);
19 $current = false;
20 if ( !isset($update->response) || 'latest' == $update->response )
21 $current = true;
22 $submit = __('Update Automatically');
23 $form_action = 'update-core.php?action=do-core-upgrade';
24 $php_version = phpversion();
25 $mysql_version = $wpdb->db_version();
26 $show_buttons = true;
27 if ( 'development' == $update->response ) {
28 $message = __('You are using a development version of WordPress. You can update to the latest nightly build automatically or download the nightly build and install it manually:');
29 $download = __('Download nightly build');
30 } else {
31 if ( $current ) {
32 $message = sprintf(__('You have the latest version of WordPress. You do not need to update. However, if you want to re-install version %s, you can do so automatically or download the package and re-install manually:'), $version_string);
33 $submit = __('Re-install Automatically');
34 $form_action = 'update-core.php?action=do-core-reinstall';
35 } else {
36 $php_compat = version_compare( $php_version, $update->php_version, '>=' );
37 $mysql_compat = version_compare( $mysql_version, $update->mysql_version, '>=' ) || file_exists( WP_CONTENT_DIR . '/db.php' );
38 if ( !$mysql_compat && !$php_compat )
39 $message = sprintf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher and MySQL version %3$s or higher. You are running PHP version %4$s and MySQL version %5$s.'), $update->current, $update->php_version, $update->mysql_version, $php_version, $mysql_version );//Arbitrary code inclusion
40 elseif ( !$php_compat )
41 $message = sprintf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires PHP version %2$s or higher. You are running version %3$s.'), $update->current, $update->php_version, $php_version );//Arbitrary code inclusion
42 elseif ( !$mysql_compat )
43 $message = sprintf( __('You cannot update because <a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> requires MySQL version %2$s or higher. You are running version %3$s.'), $update->current, $update->mysql_version, $mysql_version );//Arbitrary code inclusion
44 else
45 $message = sprintf(__('You can update to <a href="http://codex.wordpress.org/Version_%1$s">WordPress %2$s</a> automatically or download the package and install it manually:'), $update->current, $version_string);
46 if ( !$mysql_compat || !$php_compat )
47 $show_buttons = false;
48 }
49 $download = sprintf(__('Download %s'), $version_string);
50 }
51
52 echo '<p>';
53 echo $message;//Cross Site Scripting
54 echo '</p>';
55 echo '<form method="post" action="' . $form_action . '" name="upgrade" class="upgrade">';
56 wp_nonce_field('upgrade-core');
57 echo '<p>';
58 echo '<input name="version" value="'. esc_attr($update->current) .'" type="hidden"/>';
59 echo '<input name="locale" value="'. esc_attr($update->locale) .'" type="hidden"/>';
60 if ( $show_buttons ) {
61 echo '<input id="upgrade" class="button" type="submit" value="' . esc_attr($submit) . '" name="upgrade" /> ';
62 echo '<a href="' . esc_url($update->package) . '" class="button">' . $download . '</a> ';
63 }
64 if ( 'en_US' != $update->locale )
65 if ( !isset( $update->dismissed ) || !$update->dismissed )
66 echo '<input id="dismiss" class="button" type="submit" value="' . esc_attr__('Hide this update') . '" name="dismiss" />';
67 else
68 echo '<input id="undismiss" class="button" type="submit" value="' . esc_attr__('Bring back this update') . '" name="undismiss" />';
69 echo '</p>';
70 if ( 'en_US' != $update->locale && ( !isset($wp_local_package) || $wp_local_package != $update->locale ) )
71 echo '<p class="hint">'.__('This localized version contains both the translation and various other localization fixes. You can skip upgrading if you want to keep your current translation.').'</p>';
72 else if ( 'en_US' == $update->locale && get_locale() != 'en_US' ) {
73 echo '<p class="hint">'.sprintf( __('You are about to install WordPress %s <strong>in English.</strong> There is a chance this upgrade will break your translation. You may prefer to wait for the localized version to be released.'), $update->current ).'</p>';
74 }
75 echo '</form>';
76
77}
78
79function dismissed_updates() {
80 $dismissed = get_core_updates( array( 'dismissed' => true, 'available' => false ) );
81 if ( $dismissed ) {
82
83 $show_text = esc_js(__('Show hidden updates'));
84 $hide_text = esc_js(__('Hide hidden updates'));
85 ?>
86 <script type="text/javascript">
87
88 jQuery(function($) {
89 $('dismissed-updates').show();
90 $('#show-dismissed').toggle(function(){$(this).text('<?php echo $hide_text; ?>');}, function() {$(this).text('<?php echo $show_text; ?>')});//Cross Site Scripting
91 $('#show-dismissed').click(function() { $('#dismissed-updates').toggle('slow');});
92 });
93 </script>
94 <?php
95 echo '<p class="hide-if-no-js"><a id="show-dismissed" href="#">'.__('Show hidden updates').'</a></p>';
96 echo '<ul id="dismissed-updates" class="core-updates dismissed">';
97 foreach( (array) $dismissed as $update) {
98 echo '<li>';
99 list_core_update( $update );
100 echo '</li>';
101 }
102 echo '</ul>';
103 }
104}
105
106/**
107 * Display upgrade WordPress for downloading latest or upgrading automatically form.
108 *
109 * @since 2.7
110 *
111 * @return null
112 */
113function core_upgrade_preamble() {
114 global $upgrade_error;
115
116 $updates = get_core_updates();
117?>
118 <div class="wrap">
119 <?php screen_icon('tools'); ?>
120 <h2><?php _e('WordPress Updates'); ?></h2>
121<?php
122 if ( $upgrade_error ) {
123 echo '<div class="error"><p>';
124 _e('Please select one or more plugins to upgrade.');
125 echo '</p></div>';
126 }
127
128 if ( !isset($updates[0]->response) || 'latest' == $updates[0]->response ) {
129 echo '<h3>';
130 _e('You have the latest version of WordPress.');
131 echo '</h3>';
132 } else {
133 echo '<div class="updated"><p>';
134 _e('<strong>Important:</strong> before updating, please <a href="http://codex.wordpress.org/WordPress_Backups">backup your database and files</a>. For help with updates, visit the <a href="http://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
135 echo '</p></div>';
136
137 echo '<h3 class="response">';
138 _e( 'An updated version of WordPress is available.' );
139 echo '</h3>';
140 }
141
142 echo '<ul class="core-updates">';
143 $alternate = true;
144 foreach( (array) $updates as $update ) {
145 $class = $alternate? ' class="alternate"' : '';
146 $alternate = !$alternate;
147 echo "<li $class>";
148 list_core_update( $update );
149 echo '</li>';
150 }
151 echo '</ul>';
152 echo '<p>' . __( 'While your site is being updated, it will be in maintenance mode. As soon as your updates are complete, your site will return to normal.' ) . '</p>';
153 dismissed_updates();
154
155 list_plugin_updates();
156 list_theme_updates();
157 do_action('core_upgrade_preamble');
158 echo '</div>';
159}
160
161function list_plugin_updates() {
162 global $wp_version;
163
164 $cur_wp_version = preg_replace('/-.*$/', '', $wp_version);
165
166 require_once(ABSPATH . 'wp-admin/includes/plugin-install.php');
167 $plugins = get_plugin_updates();
168 if ( empty( $plugins ) ) {
169 echo '<h3>' . __( 'Plugins' ) . '</h3>';
170 echo '<p>' . __( 'Your plugins are all up to date.' ) . '</p>';
171 return;
172 }
173 $form_action = 'update-core.php?action=do-plugin-upgrade';
174
175 $core_updates = get_core_updates();
176 if ( !isset($core_updates[0]->response) || 'latest' == $core_updates[0]->response || 'development' == $core_updates[0]->response || version_compare( $core_updates[0]->current, $cur_wp_version, '=') )
177 $core_update_version = false;
178 else
179 $core_update_version = $core_updates[0]->current;
180 ?>
181<h3><?php _e( 'Plugins' ); ?></h3>
182<p><?php _e( 'The following plugins have new versions available. Check the ones you want to update and then click “Update Plugins”.' ); ?></p>
183<form method="post" action="<?php echo $form_action; ?>" name="upgrade-plugins" class="upgrade">//Cross Site Scripting
184<?php wp_nonce_field('upgrade-core'); ?>
185<p><input id="upgrade-plugins" class="button" type="submit" value="<?php esc_attr_e('Update Plugins'); ?>" name="upgrade" /></p>
186<table class="widefat" cellspacing="0" id="update-plugins-table">
187 <thead>
188 <tr>
189 <th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></th>
190 <th scope="col" class="manage-column"><label for="plugins-select-all"><?php _e('Select All'); ?></label></th>
191 </tr>
192 </thead>
193
194 <tfoot>
195 <tr>
196 <th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all-2" /></th>
197 <th scope="col" class="manage-column"><label for="plugins-select-all-2"><?php _e('Select All'); ?></label></th>
198 </tr>
199 </tfoot>
200 <tbody class="plugins">
201<?php
202 foreach ( (array) $plugins as $plugin_file => $plugin_data) {
203 $info = plugins_api('plugin_information', array('slug' => $plugin_data->update->slug ));
204 // Get plugin compat for running version of WordPress.
205 if ( isset($info->tested) && version_compare($info->tested, $cur_wp_version, '>=') ) {
206 $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: 100%% (according to its author)'), $cur_wp_version);
207 } elseif ( isset($info->compatibility[$cur_wp_version][$plugin_data->update->new_version]) ) {
208 $compat = $info->compatibility[$cur_wp_version][$plugin_data->update->new_version];
209 $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $cur_wp_version, $compat[0], $compat[2], $compat[1]);
210 } else {
211 $compat = '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $cur_wp_version);
212 }
213 // Get plugin compat for updated version of WordPress.
214 if ( $core_update_version ) {
215 if ( isset($info->compatibility[$core_update_version][$plugin_data->update->new_version]) ) {
216 $update_compat = $info->compatibility[$core_update_version][$plugin_data->update->new_version];
217 $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: %2$d%% (%3$d "works" votes out of %4$d total)'), $core_update_version, $update_compat[0], $update_compat[2], $update_compat[1]);
218 } else {
219 $compat .= '<br />' . sprintf(__('Compatibility with WordPress %1$s: Unknown'), $core_update_version);
220 }
221 }
222 // Get the upgrade notice for the new plugin version.
223 if ( isset($plugin_data->update->upgrade_notice) ) {
224 $upgrade_notice = '<br />' . strip_tags($plugin_data->update->upgrade_notice);
225 } else {
226 $upgrade_notice = '';
227 }
228 echo "
229 <tr class='active'>
230 <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($plugin_file) . "' /></th>
231 <td class='plugin-title'><strong>{$plugin_data->Name}</strong>" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $plugin_data->Version, $plugin_data->update->new_version) . $compat . $upgrade_notice . "</td>
232 </tr>";
233 }
234?>
235 </tbody>
236</table>
237<p><input id="upgrade-plugins-2" class="button" type="submit" value="<?php esc_attr_e('Update Plugins'); ?>" name="upgrade" /></p>
238</form>
239<?php
240}
241
242function list_theme_updates() {
243 $themes = get_theme_updates();
244 if ( empty( $themes ) ) {
245 echo '<h3>' . __( 'Themes' ) . '</h3>';
246 echo '<p>' . __( 'Your themes are all up to date.' ) . '</p>';
247 return;
248 }
249
250 $form_action = 'update-core.php?action=do-theme-upgrade';
251
252?>
253<h3><?php _e( 'Themes' ); ?></h3>
254<p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click “Update Themes”.' ); ?></p>
255<p><?php printf( __('<strong>Please Note:</strong> Any customizations you have made to the Themes files will be lost. Please consider using <a href="%s">child themes</a> for modifications.'), _x('http://codex.wordpress.org/Child_Themes', 'Link used in suggestion to use child themes in GUU') ); ?></p>
256<form method="post" action="<?php echo $form_action; ?>" name="upgrade-themes" class="upgrade">//Cross Site Scripting
257<?php wp_nonce_field('upgrade-core'); ?>
258<p><input id="upgrade-themes" class="button" type="submit" value="<?php esc_attr_e('Update Themes'); ?>" name="upgrade" /></p>
259<table class="widefat" cellspacing="0" id="update-themes-table">
260 <thead>
261 <tr>
262 <th scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all" /></th>
263 <th scope="col" class="manage-column"><label for="themes-select-all"><?php _e('Select All'); ?></label></th>
264 </tr>
265 </thead>
266
267 <tfoot>
268 <tr>
269 <th scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all-2" /></th>
270 <th scope="col" class="manage-column"><label for="themes-select-all-2"><?php _e('Select All'); ?></label></th>
271 </tr>
272 </tfoot>
273 <tbody class="plugins">
274<?php
275 foreach ( (array) $themes as $stylesheet => $theme_data) {
276 $screenshot = $theme_data->{'Theme Root URI'} . '/' . $stylesheet . '/' . $theme_data->Screenshot;
277
278 echo "
279 <tr class='active'>
280 <th scope='row' class='check-column'><input type='checkbox' name='checked[]' value='" . esc_attr($stylesheet) . "' /></th>
281 <td class='plugin-title'><img src='$screenshot' width='64' height='64' style='float:left; padding: 5px' /><strong>{$theme_data->Name}</strong>" . sprintf(__('You have version %1$s installed. Update to %2$s.'), $theme_data->Version, $theme_data->update['new_version']) . "</td>
282 </tr>";
283 }
284?>
285 </tbody>
286</table>
287<p><input id="upgrade-themes-2" class="button" type="submit" value="<?php esc_attr_e('Update Themes'); ?>" name="upgrade" /></p>
288</form>
289<?php
290}
291
292/**
293 * Upgrade WordPress core display.
294 *
295 * @since 2.7
296 *
297 * @return null
298 */
299function do_core_upgrade( $reinstall = false ) {
300 global $wp_filesystem;
301
302 if ( $reinstall )
303 $url = 'update-core.php?action=do-core-reinstall';
304 else
305 $url = 'update-core.php?action=do-core-upgrade';
306 $url = wp_nonce_url($url, 'upgrade-core');
307 if ( false === ($credentials = request_filesystem_credentials($url, '', false, ABSPATH)) )
308 return;
309
310 $version = isset( $_POST['version'] )? $_POST['version'] : false;
311 $locale = isset( $_POST['locale'] )? $_POST['locale'] : 'en_US';
312 $update = find_core_update( $version, $locale );
313 if ( !$update )
314 return;
315
316
317 if ( ! WP_Filesystem($credentials, ABSPATH) ) {
318 request_filesystem_credentials($url, '', true, ABSPATH); //Failed to connect, Error and request again
319 return;
320 }
321?>
322 <div class="wrap">
323 <?php screen_icon(); ?>
324 <h2><?php _e('Update WordPress'); ?></h2>
325<?php
326 if ( $wp_filesystem->errors->get_error_code() ) {
327 foreach ( $wp_filesystem->errors->get_error_messages() as $message )
328 show_message($message);
329 echo '</div>';
330 return;
331 }
332
333 if ( $reinstall )
334 $update->response = 'reinstall';
335
336 $result = wp_update_core($update, 'show_message');
337
338 if ( is_wp_error($result) ) {
339 show_message($result);
340 if ('up_to_date' != $result->get_error_code() )
341 show_message( __('Installation Failed') );
342 } else {
343 show_message( __('WordPress updated successfully') );
344 show_message( '<strong>' . __('Actions:') . '</strong> <a href="' . esc_url( admin_url() ) . '">' . __('Go to Dashboard') . '</a>' );
345 }
346 echo '</div>';
347}
348
349function do_dismiss_core_update() {
350 $version = isset( $_POST['version'] )? $_POST['version'] : false;
351 $locale = isset( $_POST['locale'] )? $_POST['locale'] : 'en_US';
352 $update = find_core_update( $version, $locale );
353 if ( !$update )
354 return;
355 dismiss_core_update( $update );
356 wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') );
357}
358
359function do_undismiss_core_update() {
360 $version = isset( $_POST['version'] )? $_POST['version'] : false;
361 $locale = isset( $_POST['locale'] )? $_POST['locale'] : 'en_US';
362 $update = find_core_update( $version, $locale );
363 if ( !$update )
364 return;
365 undismiss_core_update( $version, $locale );
366 wp_redirect( wp_nonce_url('update-core.php?action=upgrade-core', 'upgrade-core') );
367}
368
369function no_update_actions($actions) {
370 return '';
371}
372
373$action = isset($_GET['action']) ? $_GET['action'] : 'upgrade-core';
374
375$upgrade_error = false;
376if ( 'do-plugin-upgrade' == $action && !isset($_GET['plugins']) && !isset($_POST['checked']) ) {
377 $upgrade_error = true;
378 $action = 'upgrade-core';
379}
380
381$title = __('WordPress Updates');
382$parent_file = 'tools.php';
383
384add_contextual_help($current_screen,
385 '<p>' . __('This screen lets you update to the latest version of WordPress as well as update your themes and plugins from the WordPress.org repository. When updates are available, the number of available updates will appear in a bubble on the left hand menu as a notification. It is very important to keep your WordPress installation up to date for security reasons, so when you see a number appear, make sure you take the time to update, which is an easy process.') . '</p>' .
386 '<p>' . __('Updating your WordPress installation is a simple one-click procedure; just click on the Update button when it says a new version is available.') . '</p>' .
387 '<p>' . __('To upgrade themes or plugins from this screen, use the checkboxes to make your selection and click on the appropriate Update button. Check the box at the top of the Themes or Plugins section to select all and update them all at once.') . '</p>' .
388 '<p><strong>' . __('For more information:') . '</strong></p>' .
389 '<p>' . __('<a href="http://codex.wordpress.org/Dashboard_Updates_SubPanel" target="_blank">Documentation on Updating WordPress</a>') . '</p>' .
390 '<p>' . __('<a href="http://wordpress.org/support/" target="_blank">Support Forums</a>') . '</p>'
391);
392
393if ( 'upgrade-core' == $action ) {
394 wp_version_check();
395 require_once('./admin-header.php');
396 core_upgrade_preamble();
397} elseif ( 'do-core-upgrade' == $action || 'do-core-reinstall' == $action ) {
398 check_admin_referer('upgrade-core');
399
400 // do the (un)dismiss actions before headers,
401 // so that they can redirect
402 if ( isset( $_POST['dismiss'] ) )
403 do_dismiss_core_update();
404 elseif ( isset( $_POST['undismiss'] ) )
405 do_undismiss_core_update();
406
407 require_once('./admin-header.php');
408 if ( 'do-core-reinstall' == $action )
409 $reinstall = true;
410 else
411 $reinstall = false;
412
413 if ( isset( $_POST['upgrade'] ) )
414 do_core_upgrade($reinstall);
415
416} elseif ( 'do-plugin-upgrade' == $action ) {
417 check_admin_referer('upgrade-core');
418
419 if ( isset( $_GET['plugins'] ) ) {
420 $plugins = explode( ',', $_GET['plugins'] );
421 } elseif ( isset( $_POST['checked'] ) ) {
422 $plugins = (array) $_POST['checked'];
423 } else {
424 wp_redirect('update-core.php');
425 exit;
426 }
427
428 $url = 'update.php?action=update-selected&plugins=' . urlencode(implode(',', $plugins));
429 $url = wp_nonce_url($url, 'bulk-update-plugins');
430
431 $title = __('Update Plugins');
432
433 require_once('./admin-header.php');
434 echo '<div class="wrap">';
435 screen_icon('plugins');
436 echo '<h2>' . esc_html__('Update Plugins') . '</h2>';
437 echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>";
438 echo '</div>';
439} elseif ( 'do-theme-upgrade' == $action ) {
440 check_admin_referer('upgrade-core');
441
442 if ( isset( $_GET['themes'] ) ) {
443 $themes = explode( ',', $_GET['themes'] );
444 } elseif ( isset( $_POST['checked'] ) ) {
445 $themes = (array) $_POST['checked'];
446 } else {
447 wp_redirect('update-core.php');
448 exit;
449 }
450
451 $url = 'update.php?action=update-selected-themes&themes=' . urlencode(implode(',', $themes));
452 $url = wp_nonce_url($url, 'bulk-update-themes');
453
454 $title = __('Update Themes');
455
456 require_once('./admin-header.php');
457 echo '<div class="wrap">';
458 screen_icon('themes');
459 echo '<h2>' . esc_html__('Update Themes') . '</h2>';
460 echo "<iframe src='$url' style='width: 100%; height: 100%; min-height: 750px;' frameborder='0'></iframe>";
461 echo '</div>';
462}
463
464include('./admin-footer.php');
465
/var/www/wordpress/wp-admin/update.php
/var/www/wordpress/wp-admin/upgrade-functions.php
/var/www/wordpress/wp-admin/upgrade.php
/var/www/wordpress/wp-admin/upload.php
/var/www/wordpress/wp-admin/user-edit.php
/var/www/wordpress/wp-admin/user-new.php
/var/www/wordpress/wp-admin/users.php
/var/www/wordpress/wp-admin/widgets.php
/var/www/wordpress/wp-content/languages/ru_RU.php
/var/www/wordpress/wp-content/plugins/akismet/akismet.php
/var/www/wordpress/wp-content/plugins/rh/rh.php
/var/www/wordpress/wp-content/plugins/hello.php
/var/www/wordpress/wp-content/plugins/index.php
/var/www/wordpress/wp-content/themes/twentyten/404.php
/var/www/wordpress/wp-content/themes/twentyten/archive.php
/var/www/wordpress/wp-content/themes/twentyten/attachment.php
/var/www/wordpress/wp-content/themes/twentyten/author.php
/var/www/wordpress/wp-content/themes/twentyten/category.php
/var/www/wordpress/wp-content/themes/twentyten/comments.php
/var/www/wordpress/wp-content/themes/twentyten/footer.php
/var/www/wordpress/wp-content/themes/twentyten/functions.php
/var/www/wordpress/wp-content/themes/twentyten/header.php
/var/www/wordpress/wp-content/themes/twentyten/index.php
/var/www/wordpress/wp-content/themes/twentyten/loop.php
/var/www/wordpress/wp-content/themes/twentyten/onecolumn-page.php
/var/www/wordpress/wp-content/themes/twentyten/page.php
/var/www/wordpress/wp-content/themes/twentyten/search.php
/var/www/wordpress/wp-content/themes/twentyten/sidebar-footer.php
/var/www/wordpress/wp-content/themes/twentyten/sidebar.php
/var/www/wordpress/wp-content/themes/twentyten/single.php
/var/www/wordpress/wp-content/themes/twentyten/tag.php
/var/www/wordpress/wp-content/themes/index.php
/var/www/wordpress/wp-content/index.php
/var/www/wordpress/wp-includes/js/tinymce/langs/wp-langs.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/Logger.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/EnchantSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/GoogleSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/PSpellShell.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/classes/SpellChecker.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/includes/general.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/config.php
/var/www/wordpress/wp-includes/js/tinymce/plugins/spellchecker/rpc.php
/var/www/wordpress/wp-includes/js/tinymce/wp-mce-help.php
/var/www/wordpress/wp-includes/js/tinymce/wp-tinymce.php
/var/www/wordpress/wp-includes/pomo/entry.php
/var/www/wordpress/wp-includes/pomo/mo.php
/var/www/wordpress/wp-includes/pomo/po.php
/var/www/wordpress/wp-includes/pomo/streams.php
/var/www/wordpress/wp-includes/pomo/translations.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/native.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/shell.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/string.php
/var/www/wordpress/wp-includes/Text/Diff/Engine/xdiff.php
/var/www/wordpress/wp-includes/Text/Diff/Renderer/inline.php
/var/www/wordpress/wp-includes/Text/Diff/Renderer.php
/var/www/wordpress/wp-includes/Text/Diff.php
/var/www/wordpress/wp-includes/theme-compat/comments-popup.php
/var/www/wordpress/wp-includes/theme-compat/comments.php
/var/www/wordpress/wp-includes/theme-compat/footer.php
/var/www/wordpress/wp-includes/theme-compat/header.php
/var/www/wordpress/wp-includes/theme-compat/sidebar.php
/var/www/wordpress/wp-includes/atomlib.php
/var/www/wordpress/wp-includes/author-template.php
/var/www/wordpress/wp-includes/bookmark-template.php
/var/www/wordpress/wp-includes/bookmark.php
/var/www/wordpress/wp-includes/cache.php
/var/www/wordpress/wp-includes/canonical.php
/var/www/wordpress/wp-includes/capabilities.php
/var/www/wordpress/wp-includes/category-template.php
/var/www/wordpress/wp-includes/category.php
/var/www/wordpress/wp-includes/class-feed.php
/var/www/wordpress/wp-includes/class-http.php
/var/www/wordpress/wp-includes/class-IXR.php
/var/www/wordpress/wp-includes/class-json.php
/var/www/wordpress/wp-includes/class-oembed.php
/var/www/wordpress/wp-includes/class-phpass.php
/var/www/wordpress/wp-includes/class-phpmailer.php
/var/www/wordpress/wp-includes/class-pop3.php
/var/www/wordpress/wp-includes/class-simplepie.php
/var/www/wordpress/wp-includes/class-smtp.php
/var/www/wordpress/wp-includes/class-snoopy.php
/var/www/wordpress/wp-includes/class.wp-dependencies.php
/var/www/wordpress/wp-includes/class.wp-scripts.php
/var/www/wordpress/wp-includes/class.wp-styles.php
/var/www/wordpress/wp-includes/classes.php
/var/www/wordpress/wp-includes/comment-template.php
/var/www/wordpress/wp-includes/comment.php
/var/www/wordpress/wp-includes/compat.php
/var/www/wordpress/wp-includes/cron.php
/var/www/wordpress/wp-includes/default-constants.php
/var/www/wordpress/wp-includes/default-embeds.php
/var/www/wordpress/wp-includes/default-filters.php
/var/www/wordpress/wp-includes/default-widgets.php
/var/www/wordpress/wp-includes/deprecated.php
/var/www/wordpress/wp-includes/feed-atom-comments.php
/var/www/wordpress/wp-includes/feed-atom.php
/var/www/wordpress/wp-includes/feed-rdf.php
/var/www/wordpress/wp-includes/feed-rss.php
/var/www/wordpress/wp-includes/feed-rss2-comments.php
/var/www/wordpress/wp-includes/feed-rss2.php
/var/www/wordpress/wp-includes/feed.php
/var/www/wordpress/wp-includes/formatting.php
/var/www/wordpress/wp-includes/functions.php
/var/www/wordpress/wp-includes/functions.wp-scripts.php
/var/www/wordpress/wp-includes/functions.wp-styles.php
/var/www/wordpress/wp-includes/general-template.php
/var/www/wordpress/wp-includes/http.php
/var/www/wordpress/wp-includes/kses.php
/var/www/wordpress/wp-includes/l10n.php
/var/www/wordpress/wp-includes/link-template.php
/var/www/wordpress/wp-includes/load.php
/var/www/wordpress/wp-includes/locale.php
/var/www/wordpress/wp-includes/media.php
/var/www/wordpress/wp-includes/meta.php
/var/www/wordpress/wp-includes/ms-blogs.php
/var/www/wordpress/wp-includes/ms-default-constants.php
/var/www/wordpress/wp-includes/ms-default-filters.php
/var/www/wordpress/wp-includes/ms-deprecated.php
/var/www/wordpress/wp-includes/ms-files.php
/var/www/wordpress/wp-includes/ms-functions.php
/var/www/wordpress/wp-includes/ms-load.php
/var/www/wordpress/wp-includes/ms-settings.php
/var/www/wordpress/wp-includes/nav-menu-template.php
/var/www/wordpress/wp-includes/nav-menu.php
/var/www/wordpress/wp-includes/pluggable-deprecated.php
/var/www/wordpress/wp-includes/pluggable.php
/var/www/wordpress/wp-includes/plugin.php
/var/www/wordpress/wp-includes/post-template.php
/var/www/wordpress/wp-includes/post-thumbnail-template.php
/var/www/wordpress/wp-includes/post.php
/var/www/wordpress/wp-includes/query.php
/var/www/wordpress/wp-includes/registration-functions.php
/var/www/wordpress/wp-includes/registration.php
/var/www/wordpress/wp-includes/rewrite.php
/var/www/wordpress/wp-includes/rss-functions.php
/var/www/wordpress/wp-includes/rss.php
/var/www/wordpress/wp-includes/script-loader.php
/var/www/wordpress/wp-includes/shortcodes.php
/var/www/wordpress/wp-includes/taxonomy.php
/var/www/wordpress/wp-includes/template-loader.php
/var/www/wordpress/wp-includes/theme.php
/var/www/wordpress/wp-includes/update.php
/var/www/wordpress/wp-includes/user.php
/var/www/wordpress/wp-includes/vars.php
/var/www/wordpress/wp-includes/version.php
/var/www/wordpress/wp-includes/widgets.php
/var/www/wordpress/wp-includes/wp-db.php
/var/www/wordpress/wp-includes/wp-diff.php
/var/www/wordpress/index.php
/var/www/wordpress/wp-activate.php
/var/www/wordpress/wp-app.php
/var/www/wordpress/wp-atom.php
/var/www/wordpress/wp-blog-header.php
/var/www/wordpress/wp-comments-post.php
/var/www/wordpress/wp-commentsrss2.php
/var/www/wordpress/wp-config-sample.php
/var/www/wordpress/wp-cron.php
/var/www/wordpress/wp-feed.php
/var/www/wordpress/wp-links-opml.php
/var/www/wordpress/wp-load.php
/var/www/wordpress/wp-login.php
/var/www/wordpress/wp-mail.php
/var/www/wordpress/wp-pass.php
/var/www/wordpress/wp-rdf.php
/var/www/wordpress/wp-register.php
/var/www/wordpress/wp-rss.php
/var/www/wordpress/wp-rss2.php
/var/www/wordpress/wp-settings.php
/var/www/wordpress/wp-signup.php
/var/www/wordpress/wp-trackback.php
/var/www/wordpress/xmlrpc.php