2) { $tmp_msg_msg = str_replace('<>',$box_suggestions_item[2],$tmp_msg_msg); if ($box_suggestions_item[2]>1) { $tmp_msg_msg = str_replace('<<(s)>>','s',$tmp_msg_msg); } else { $tmp_msg_msg = str_replace('<<(s)>>','',$tmp_msg_msg); } } if (in_array($box_suggestions_item[1],$suggestions_per_sections['decoration'])) { $suggestions_section_decoration[] = array($box_suggestions_item[0],$tmp_msg_msg,$tmp_msg_tooltip); } elseif (in_array($box_suggestions_item[1],$suggestions_per_sections['url'])) { $suggestions_section_url[] = array($box_suggestions_item[0],$tmp_msg_msg,$tmp_msg_tooltip); } elseif (in_array($box_suggestions_item[1],$suggestions_per_sections['content'])) { $suggestions_section_content[] = array($box_suggestions_item[0],$tmp_msg_msg,$tmp_msg_tooltip); } } $suggestions_box['box_suggestions_arr'] = array($suggestions_section_decoration ,$suggestions_section_url ,$suggestions_section_content); $score_less_than_100 = array(); $score_more_than_100 = array(); $score_over_optimization = array(); if (isset($special_suggestions_arr) &&isset($special_suggestions_arr['score_less_than_100'])) { foreach ($special_suggestions_arr['score_less_than_100'] as $tmp_msg) { $score_less_than_100[] = $messages_texts[$tmp_msg]; } foreach ($special_suggestions_arr['score_more_than_100'] as $tmp_msg) { $score_more_than_100[] = $messages_texts[$tmp_msg]; } if (isset($special_suggestions_arr['score_over_optimization'][1])) { foreach ($special_suggestions_arr['score_over_optimization'][1] as $tmp_msg) { $score_over_optimization[] = $messages_texts[$tmp_msg]; } } } if (!isset($special_suggestions_arr['score_over_optimization'][0])) { $special_suggestions_arr['score_over_optimization'][0] = ''; } $suggestions_box['special_suggestions_arr'] = array($score_less_than_100 ,$score_more_than_100 ,array('type'=>$special_suggestions_arr['score_over_optimization'][0],'list'=>$score_over_optimization) ); return $suggestions_box; } static function get_specific_data_from_server($info_to_request) { return 'ACTIVE'; } static public function make_last_version_plugin_request() { $response = wp_remote_get(self::$url_check_last_version,array('timeout'=>WPPostsRateKeys::$timeout)); if (!is_wp_error($response)) { $body = $response['body']; WPPostsRateKeys_Settings::update_last_version($body); return TRUE; } else { WPPostsRateKeys_Logs::add_error('373',"make_last_version_plugin_request, Url: ".self::$url_check_last_version); return FALSE; } } static public function send_visits() { $all = WPPostsRateKeys_Visits::get_all(); $all_arr = array(); foreach ($all as $all_item) { $visit_date = date('Y-m-d',strtotime($all_item->visit_dt)); if (key_exists($visit_date,$all_arr)) { $all_arr[$visit_date] = $all_arr[$visit_date] +1; } else { $all_arr[$visit_date] = 1; } } $list_to_send_arr = array(); foreach ($all_arr as $all_arr_key=>$all_arr_counter) { $list_to_send_arr[] = $all_arr_key .' '.$all_arr_counter; } $list_to_send = urlencode(implode(',',$list_to_send_arr)); if (true) { foreach ($all as $all_item) { WPPostsRateKeys_Visits::delete($all_item->id); } return TRUE; } else { WPPostsRateKeys_Logs::add_error('375',"send_visits, Url: ".self::$url_check_last_version); return FALSE; } } static function get_content_cache_current_md5($post_id,$settings=array(),$keywords=array(),$post_content='') { if (count($keywords)==0) { $post_keyword = WPPostsRateKeys_WPPosts::get_keyword($post_id); $post_keyword2 = WPPostsRateKeys_WPPosts::get_keyword2($post_id); $post_keyword3 = WPPostsRateKeys_WPPosts::get_keyword3($post_id); } else { $post_keyword = $keywords[0]; if (count($keywords)>1) { $post_keyword2 = $keywords[1]; } else { $post_keyword2 = ''; } if (count($keywords)>2) { $post_keyword3 = $keywords[2]; } else { $post_keyword3 = ''; } } if ($post_content=='') { $data_arr = WPPostsRateKeys_WPPosts::get_wp_post_title_content($post_id); $post_content = WPPostsRateKeys::get_content_to_edit($data_arr[1],$post_id); } if (count($settings)==0) { $settings = self::get_md5_settings_for_filter_content(TRUE); } $settings_str = implode('',$settings); $current_md5 = md5($post_keyword .$post_keyword2 .$post_keyword3 .$post_content.$settings_str ); return $current_md5; } static function get_update_content_cache($post_id,$current_content) { $post_keyword = WPPostsRateKeys_WPPosts::get_keyword($post_id); $post_keyword2 = WPPostsRateKeys_WPPosts::get_keyword2($post_id); $post_keyword3 = WPPostsRateKeys_WPPosts::get_keyword3($post_id); $settings = self::get_md5_settings_for_filter_content(TRUE); $data_arr = WPPostsRateKeys_WPPosts::get_wp_post_title_content($post_id); $post_content = WPPostsRateKeys::get_content_to_edit($data_arr[1],$post_id); $current_md5 = self::get_content_cache_current_md5($post_id,$settings,array($post_keyword,$post_keyword2,$post_keyword3),$post_content); $invalid_ext_or_int_links = FALSE; $last_dt_cache_mod = get_post_meta($post_id,self::$cache_md5_filter_content_last_mod_time,TRUE); if (WPPostsRateKeys_Settings::get_last_external_links_modification_time()>=$last_dt_cache_mod ||WPPostsRateKeys_Settings::get_last_internal_links_modification_time()>=$last_dt_cache_mod ) { $invalid_ext_or_int_links = TRUE; } if ($current_md5==get_post_meta($post_id,self::$cache_md5_for_filter_content,TRUE) &&!$invalid_ext_or_int_links) { return $current_content; } else { $keyword_arr = array($post_keyword); if ($post_keyword2!='') $keyword_arr[] = $post_keyword2; if ($post_keyword3!='') $keyword_arr[] = $post_keyword3; $filtered_content = WPPostsRateKeys_Filters::filter_post_content($keyword_arr,$post_content,$settings,$post_id,$current_md5); return $filtered_content; } } static function send_url() { } static function get_current_domain() { if (WPPostsRateKeys_Settings::support_multibyte()) { $current_domain = mb_strtolower(get_bloginfo('wpurl'),'UTF-8'); } else { $current_domain = strtolower(get_bloginfo('wpurl')); } $current_domain_arr = parse_url($current_domain); $current_domain_no_dir = $current_domain_arr['host']; return $current_domain_no_dir; } static public function add_current_domain() { } } } What are the Benefits of Lemon Water Detox?