| | 199 | $plugin_needs_update = maybe_unserialize( get_site_transient('update_plugins')); |
| | 200 | foreach( $plugin_needs_update->response as $plugins => $plugin_slugs ) { |
| | 201 | $plugin_slug = $plugin_slugs->slug; |
| | 202 | $url = $http_url = 'http://api.wordpress.org/plugins/info/1.0/'; |
| | 203 | if ( $ssl = wp_http_supports( array( 'ssl' ) ) ) |
| | 204 | $url = set_url_scheme( $url, 'https' ); |
| | 205 | // Check the Plugin repo for plugin information |
| | 206 | $request = wp_remote_post( $url . $plugin_slug ); |
| | 207 | $res = maybe_unserialize( wp_remote_retrieve_body( $request ) ); |
| | 208 | // Check for the "security-update" tag on the .org repo |
| | 209 | if( isset( $res->tags['security-update'] ) ) { |
| | 210 | $plugin_security_update = $res->tags['security-update']; |
| | 211 | } |
| | 212 | } |
| | 213 | |
| 204 | | if ( ! isset( $cur->response ) || $cur->response != 'upgrade' ) |
| 205 | | return false; |
| 206 | | |
| 207 | | if ( current_user_can('update_core') ) { |
| 208 | | $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, network_admin_url( 'update-core.php' ) ); |
| | 219 | if ( isset( $cur->response ) || $cur->response == 'upgrade' ) { |
| | 220 | if ( current_user_can('update_core') ) { |
| | 221 | $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! <a href="%2$s">Please update now</a>.'), $cur->current, network_admin_url( 'update-core.php' ) ); |
| | 222 | } else { |
| | 223 | $msg = sprintf( __('<a href="http://codex.wordpress.org/Version_%1$s">WordPress %1$s</a> is available! Please notify the site administrator.'), $cur->current ); |
| | 224 | echo "<div class='update-nag'>$msg</div>"; |
| | 225 | } |