@@ -26,7 +26,7 @@ function wp_version_check() {
2626 global $ wp_version , $ wpdb , $ wp_local_package ;
2727 $ php_version = phpversion ();
2828
29- $ current = get_option ( 'update_core ' );
29+ $ current = get_transient ( 'update_core ' );
3030 if ( ! is_object ($ current ) )
3131 $ current = new stdClass ;
3232
@@ -40,7 +40,7 @@ function wp_version_check() {
4040
4141 // Update last_checked for current to prevent multiple blocking requests if request hangs
4242 $ current ->last_checked = time ();
43- update_option ( 'update_core ' , $ current );
43+ set_transient ( 'update_core ' , $ current );
4444
4545 if ( method_exists ( $ wpdb , 'db_version ' ) )
4646 $ mysql_version = preg_replace ('/[^0-9.].*/ ' , '' , $ wpdb ->db_version ($ wpdb ->users ));
@@ -84,7 +84,7 @@ function wp_version_check() {
8484 $ updates ->updates = $ new_options ;
8585 $ updates ->last_checked = time ();
8686 $ updates ->version_checked = $ wp_version ;
87- update_option ( 'update_core ' , $ updates );
87+ set_transient ( 'update_core ' , $ updates );
8888}
8989add_action ( 'init ' , 'wp_version_check ' );
9090
@@ -113,7 +113,7 @@ function wp_update_plugins() {
113113
114114 $ plugins = get_plugins ();
115115 $ active = get_option ( 'active_plugins ' );
116- $ current = get_option ( 'update_plugins ' );
116+ $ current = get_transient ( 'update_plugins ' );
117117 if ( ! is_object ($ current ) )
118118 $ current = new stdClass ;
119119
@@ -145,7 +145,7 @@ function wp_update_plugins() {
145145
146146 // Update last_checked for current to prevent multiple blocking requests if request hangs
147147 $ current ->last_checked = time ();
148- update_option ( 'update_plugins ' , $ current );
148+ set_transient ( 'update_plugins ' , $ current );
149149
150150 $ to_send = (object )compact ('plugins ' , 'active ' );
151151
@@ -170,7 +170,7 @@ function wp_update_plugins() {
170170 else
171171 $ new_option ->response = array ();
172172
173- update_option ( 'update_plugins ' , $ new_option );
173+ set_transient ( 'update_plugins ' , $ new_option );
174174}
175175
176176/**
@@ -196,7 +196,7 @@ function wp_update_themes( ) {
196196 require_once ( ABSPATH . 'wp-includes/theme.php ' );
197197
198198 $ installed_themes = get_themes ( );
199- $ current_theme = get_option ( 'update_themes ' );
199+ $ current_theme = get_transient ( 'update_themes ' );
200200 if ( ! is_object ($ current_theme ) )
201201 $ current_theme = new stdClass ;
202202
@@ -210,7 +210,7 @@ function wp_update_themes( ) {
210210
211211 // Update last_checked for current to prevent multiple blocking requests if request hangs
212212 $ current_theme ->last_checked = time ();
213- update_option ( 'update_themes ' , $ current_theme );
213+ set_transient ( 'update_themes ' , $ current_theme );
214214
215215 $ themes = array ( );
216216 $ themes ['current_theme ' ] = $ current_theme ;
@@ -240,7 +240,7 @@ function wp_update_themes( ) {
240240 if ( $ response )
241241 $ new_option ->response = $ response ;
242242
243- update_option ( 'update_themes ' , $ new_option );
243+ set_transient ( 'update_themes ' , $ new_option );
244244}
245245
246246/**
@@ -254,7 +254,7 @@ function wp_update_themes( ) {
254254 * @access private
255255 */
256256function _maybe_update_plugins () {
257- $ current = get_option ( 'update_plugins ' );
257+ $ current = get_transient ( 'update_plugins ' );
258258 if ( isset ( $ current ->last_checked ) && 43200 > ( time () - $ current ->last_checked ) )
259259 return ;
260260 wp_update_plugins ();
@@ -270,7 +270,7 @@ function _maybe_update_plugins() {
270270 * @access private
271271 */
272272function _maybe_update_themes ( ) {
273- $ current = get_option ( 'update_themes ' );
273+ $ current = get_transient ( 'update_themes ' );
274274 if ( isset ( $ current ->last_checked ) && 43200 > ( time ( ) - $ current ->last_checked ) )
275275 return ;
276276
0 commit comments