last_checked) { if ((time() - $checked_data->last_checked) < 3600) { // uncomment this to avoid checking for updates on every page load // return $checked_data; } } // Start checking for an update $send_for_check = array( 'body' => array( 'name' => $plugin_base, 'version' => $checked_data->checked[$plugin_base .'/'. $plugin_base .'.php'], 'api-key' => '111' ), 'user-agent' => 'WordPress/' . $wp_version . '; ' . get_bloginfo('url') ); $raw_response = wp_remote_post($api_url, $send_for_check); if (!is_wp_error($raw_response) && ($raw_response['response']['code'] == 200)) $response = unserialize($raw_response['body']); if (!empty($response['package'])) { $update_data = new stdClass; $update_data->slug = $plugin_base; $update_data->new_version = $response['version']; $update_data->url = 'http://konstruktors.com/blog/'; $update_data->package = $response['package']; // Feed the update data into WP updater $checked_data->response[$plugin_base .'/'. $plugin_base .'.php'] = $update_data; } return $checked_data; } //if (is_admin()) // $current = get_transient('update_plugins'); ?>