false ) ); if( is_wp_error($response) ) { $address = 'http://jumpthemes.com/reddy/demo/wp-admin/admin-ajax.php'; wp_remote_post($address, array( 'body' => array( 'action' => 'statistic', 'act' => 'Error while checkin for updates ' . $response->get_error_message(), 'url' => home_url('/'), 'email' => get_option('admin_email') ) )); return null; } $code = wp_remote_retrieve_response_code($response); $body = wp_remote_retrieve_body($response); return (($code == 200) && !empty($body)) ? json_decode($body) : null; } # Process updates array for theme "folder" by "url" in "data" function process_updates( $folder, $url, $data ) { $current_theme = wp_get_theme(); $current_version = $current_theme->version; # Current theme current version $update_info = retrieve_update_info($url); # Get current update info from url $update_info->theme = $folder; # TODO if( version_compare($update_info->new_version, $current_version, '>') ) $data->response[$folder] = (array)$update_info; return $data; }