function client_status_update_all_clients() { global $post, $client_status_options, $wpdb, $blog_id, $current_user; query_posts(array('post_type' => 'client_status_client', 'orderby' => 'title', 'order' => 'ASC', 'posts_per_page' => -1)); if (have_posts()) { while (have_posts()) { the_post(); $custom = get_post_custom($post->ID); $client_url = $custom['_client_url'][0]; if ($client_url != "") { $ret = wp_remote_post($client_url . CLIENT_STATUS_DATA_URL . "?security_key=" . md5($client_status_options['security_key'])); $updated = time(); client_status_update_client($post->ID, &$custom, &$ret, $updated); } } } }
$client_url = $custom['_client_url'][0]; $terms = wp_get_post_terms($post->ID, 'client_status_client_type'); $term_classes = ""; foreach ($terms as $key => $term) { $term_classes .= " client_status_tab_" . $term->term_id; } echo "<li class='wp-has-submenu menu-top wp-menu-open client_status_client client_status_tab_all" . $term_classes . "'>"; $data_url = ""; if ($client_url != "") { $data_url = $client_url . CLIENT_STATUS_DATA_URL . "?security_key=" . md5($client_status_options['security_key']); echo "<span class='wp-has-submenu menu-top'><div class='client_status_client_title'>" . get_the_title(); $data = ""; if (!empty($update_clients) && array_key_exists($post->ID, $update_clients)) { $ret = wp_remote_post($data_url); $updated = time(); client_status_update_client($post->ID, &$custom, $ret, $updated); } $data = simplexml_load_string($custom['_client_data'][0]); if (!empty($data)) { $last_update = $custom['_client_last_update'][0]; $last_update = date_i18n($date_format, $last_update + $timezone_offset * 3600); if (!property_exists($data, 'error')) { $plugin_update_count = count($data->updates->plugins->plugin); $theme_update_count = count($data->updates->themes->theme); $strikes = 0; $update_count = 0; if ($data->is_public == 0) { $strikes++; } if ($data->updates->core->response == "upgrade") { $strikes++;