get('act') ; $page = $request->get('page'); if($act === 'img_alt'): $result = $this->altImageCheck($page); elseif($act === 'keyphrase-in-subheading'): $result = $this->keyInSubheading($page); elseif($act === 'internal-link'): $result = $this->internalLink($page); elseif($act === 'outbond-link'): $result = $this->outbondLink($page); elseif($act === 'text-length'): $result = $this->textLength($page); elseif($act === 'keyphrase-density'): $result = $this->keyphraseDensity($page); elseif($act == 'img_alt_id'): $result = $this->altImageCheckWithId($page ,$request -> id); elseif($act === 'keyphrase-in-subheading-with-id'): $result = $this->keyInSubheadingWithId($page, $request -> id); elseif($act === 'internal-link-with-id'): $result = $this->internalLinkWithId($page, $request -> id); elseif($act === 'outbond-link-with-id'): $result = $this->outbondLinkWithId($page, $request -> id); elseif($act === 'text-length-with-id'): $result = $this->textLengthWithId($page, $request -> id); elseif($act === 'keyphrase-density-with-id'): $result = $this->keyphraseDensityWithId($page, $request -> id); elseif($act === 'keyphrase-with-id'): $result = $this->keyphraseCheckAjaxWithId($page, $request -> id, $request -> keyphr); return $result ? 'true' : 'false'; endif; return $result; } public function keyphraseCheck($page) { $keyphrase = []; // home page $home = HomePage::first(); $home_keyphrase = strtolower($home->keyphrase); // push home kepyhrase to keyprahse array if page that checked is not home page if($page !== 'home'): $keyphrase[] = $home_keyphrase; endif; // home page $about = AboutPage::first(); $about_keyphrase = strtolower($about->keyphrase); // push home kepyhrase to keyprahse array if page that checked is not home page if($page !== 'about'): $keyphrase[] = $about_keyphrase; endif; // home page $site = SitePage::first(); $site_keyphrase = strtolower($site->keyphrase); // push home kepyhrase to keyprahse array if page that checked is not home page if($page !== 'site'): $keyphrase[] = $site_keyphrase; endif; // home page $apps = AppsPage::first(); $apps_keyphrase = strtolower($apps->keyphrase); // push home kepyhrase to keyprahse array if page that checked is not home page if($page !== 'apps'): $keyphrase[] = $apps_keyphrase; endif; $android = AndroidPage::first(); $android_keyphrase = strtolower($android->keyphrase); // push home kepyhrase to keyprahse array if page that checked is not home page if($page !== 'android'): $keyphrase[] = $android_keyphrase; endif; $team = TeamPage::first(); $team_keyphrase = strtolower($team->keyphrase); // push home kepyhrase to keyprahse array if page that checked is not home page if($page !== 'team'): $keyphrase[] = $team_keyphrase; endif; $blog = BlogPage::first(); $blog_keyphrase = strtolower($blog->keyphrase); // push home kepyhrase to keyprahse array if page that checked is not home page if($page !== 'blog'): $keyphrase[] = $blog_keyphrase; endif; $contact = ContactUsPage::first(); $contact_keyphrase = strtolower($contact->keyphrase); // push home kepyhrase to keyprahse array if page that checked is not home page if($page !== 'contact'): $keyphrase[] = $contact_keyphrase; endif; $aset = AsetPage::first(); $aset_keyphrase = strtolower($aset->keyphrase); // push home kepyhrase to keyprahse array if page that checked is not home page if($page !== 'aset'): $keyphrase[] = $aset_keyphrase; endif; $emka = EmkaPage::first(); $emka_keyphrase = strtolower($emka->keyphrase); // push home kepyhrase to keyprahse array if page that checked is not home page if($page !== 'emka'): $keyphrase[] = $emka_keyphrase; endif; // seo blog $other_blog_detail_keyphrase = Blog::all(); if(!empty($other_blog_detail_keyphrase)) { foreach($other_blog_detail_keyphrase as $ot) { if($ot->keyphrase) { $keyphrase[] = $ot->keyphrase; } } } // check if keyphrase is include inside the array, to check if there some duplicate keyphrase if($page === 'home'): $result = in_array($home_keyphrase, $keyphrase); endif; // check if keyphrase is include inside the array, to check if there some duplicate keyphrase if($page === 'about'): $result = in_array($about_keyphrase, $keyphrase); endif; // check if keyphrase is include inside the array, to check if there some duplicate keyphrase if($page === 'site'): $result = in_array($site_keyphrase, $keyphrase); endif; // check if keyphrase is include inside the array, to check if there some duplicate keyphrase if($page === 'apps'): $result = in_array($apps_keyphrase, $keyphrase); endif; // check if keyphrase is include inside the array, to check if there some duplicate keyphrase if($page === 'android'): $result = in_array($android_keyphrase, $keyphrase); endif; // check if keyphrase is include inside the array, to check if there some duplicate keyphrase if($page === 'team'): $result = in_array($team_keyphrase, $keyphrase); endif; // check if keyphrase is include inside the array, to check if there some duplicate keyphrase if($page === 'blog'): $result = in_array($blog_keyphrase, $keyphrase); endif; if($page === 'contact'): $result = in_array($contact_keyphrase, $keyphrase); endif; if($page === 'aset'): $result = in_array($aset_keyphrase, $keyphrase); endif; if($page === 'emka'): $result = in_array($emka_keyphrase, $keyphrase); endif; if($page === 'home'): $result = in_array($home_keyphrase, $keyphrase); elseif($page === 'about'): $result = in_array($about_keyphrase, $keyphrase); elseif($page === 'site'): $result = in_array($site_keyphrase, $keyphrase); elseif($page === 'apps'): $result = in_array($apps_keyphrase, $keyphrase); elseif($page === 'android'): $result = in_array($android_keyphrase, $keyphrase); elseif($page === 'team'): $result = in_array($team_keyphrase, $keyphrase); elseif($page === 'contact'): $result = in_array($team_keyphrase, $keyphrase); elseif($page === 'aset'): $result = in_array($aset_keyphrase, $keyphrase); elseif($page === 'emka'): $result = in_array($emka_keyphrase, $keyphrase); endif; return $result; } public function keyphraseCheckWithId($page, $id) { $keyphrase = []; if ($page == 'blog') { // seo blog $blog_detail_keyphrase = strtolower(Blog::findOrFail($id)->keyphrase); $other_blog_detail_keyphrase = Blog::where('id', '!=', $id)->get(); if(!empty($other_blog_detail_keyphrase)) { foreach($other_blog_detail_keyphrase as $ot) { if($ot->keyphrase) { $keyphrase[] = $ot->keyphrase; } } } // home page $home = HomePage::first(); $home_keyphrase = strtolower($home->home_page_keyphrase); $keyphrase[] = $home_keyphrase; // about page $about = AboutPage::first(); $about_keyphrase = strtolower($about->keyphrase); $keyphrase[] = $about_keyphrase; // contact page $contact = ContactUsPage::first(); $contact_keyphrase = strtolower($contact->keyphrase); $keyphrase[] = $contact_keyphrase; // home page $site = SitePage::first(); $site_keyphrase = strtolower($site->keyphrase); $keyphrase[] = $site_keyphrase; // home page $apps = AppsPage::first(); $apps_keyphrase = strtolower($apps->keyphrase); $keyphrase[] = $apps_keyphrase; $android = AndroidPage::first(); $android_keyphrase = strtolower($android->keyphrase); $keyphrase[] = $android_keyphrase; $team = TeamPage::first(); $team_keyphrase = strtolower($team->keyphrase); $keyphrase[] = $team_keyphrase; $blog = BlogPage::first(); $blog_keyphrase = strtolower($blog->keyphrase); $keyphrase[] = $blog_keyphrase; $result = in_array($blog_detail_keyphrase, $keyphrase); return $result; } } public function altImageCheck($page) { $score = 0; $total = 0; $db_home = HomePage::first(); if($page === 'home'): $home = $db_home; $h = HomePage::first(); $one = $h->section_1_image; $two = $h->section_2_image; $four = $h->section_4_image; $media_alt_1 = Media::where('name', $one)->first(); if($media_alt_1->alt): $score++; endif; $total++; $media_alt_2 = Media::where('name', $two)->first(); if($media_alt_2->alt): $score++; endif; $total++; $media_alt_4 = Media::where('name', $four)->first(); if($media_alt_4->alt): $score++; endif; $total++; $final_score = ($score/$total) * 100; if(($final_score > 30) and ($final_score < 70)): return 'green'; else: return $final_score . '%'; endif; elseif($page === 'about'): $db_about = AboutPage::first(); $about = $db_about; $h = AboutPage::first(); $three = $h->section_3_image; $four_one = $h->section_4_1_image; $four_two = $h->section_4_2_image; $four_three = $h->section_4_3_image; $four_four = $h->section_4_4_image; $media_alt_1 = Media::where('name', $three)->first(); $media_alt_2 = Media::where('name', $four_one)->first(); $media_alt_3 = Media::where('name', $four_two)->first(); $media_alt_4 = Media::where('name', $four_three)->first(); $media_alt_5 = Media::where('name', $four_four)->first(); if($media_alt_1): $score++; endif; $total++; if($media_alt_2): $score++; endif; $total++; if($media_alt_3): $score++; endif; $total++; if($media_alt_4): $score++; endif; $total++; if($media_alt_5): $score++; endif; $total++; $final_score = ($score/$total) * 100; if(($final_score > 30) and ($final_score < 70)): return 'green'; else: return $final_score . '%'; endif; elseif($page === 'site'): $db_site = SitePage::first(); $site = $db_site; $s = SitePage::first(); $one = $s->section_1_image; $two = $s->section_3_image; $three = $s->section_4_1_image; $four = $s->section_4_2_image; $five = $s->section_4_3_image; $six = $s->section_4_4_image; $seven = $s->section_4_5_image; $eight = $s->section_4_6_image; $nine = $s->section_5_image; $media_alt_1 = Media::where('name', $one)->first(); $media_alt_2 = Media::where('name', $two)->first(); $media_alt_3 = Media::where('name', $three)->first(); $media_alt_4 = Media::where('name', $four)->first(); $media_alt_5 = Media::where('name', $five)->first(); $media_alt_6 = Media::where('name', $six)->first(); $media_alt_7 = Media::where('name', $seven)->first(); $media_alt_8 = Media::where('name', $eight)->first(); $media_alt_9 = Media::where('name', $nine)->first(); if($media_alt_1): $score++; endif; $total++; if($media_alt_2): $score++; endif; $total++; if($media_alt_3): $score++; endif; $total++; if($media_alt_4): $score++; endif; $total++; if($media_alt_5): $score++; endif; $total++; if($media_alt_6): $score++; endif; $total++; if($media_alt_7): $score++; endif; $total++; if($media_alt_8): $score++; endif; $total++; if($media_alt_9): $score++; endif; $total++; $final_score = ($score/$total) * 100; if(($final_score > 30) and ($final_score < 70)): return 'green'; else: return $final_score . '%'; endif; elseif($page === 'apps'): $db_apps = AppsPage::first(); $apps = $db_apps; $a = AppsPage::first(); $one = $a->section_1_image; $media_alt_1 = Media::where('name', $one)->first(); $two = $a->section_2_image; $media_alt_2 = Media::where('name', $two)->first(); $three = $a->section_3_image; $media_alt_3 = Media::where('name', $three)->first(); $four = $a->section_4_1_image; $media_alt_4 = Media::where('name', $four)->first(); $five = $a->section_4_2_image; $media_alt_5 = Media::where('name', $five)->first(); $six = $a->section_4_3_image; $media_alt_6 = Media::where('name', $six)->first(); $seven = $a->section_5_image; $media_alt_7 = Media::where('name', $seven)->first(); if($media_alt_1): $score++; endif; $total++; if($media_alt_2): $score++; endif; $total++; if($media_alt_3): $score++; endif; $total++; if($media_alt_4): $score++; endif; $total++; if($media_alt_5): $score++; endif; $total++; if($media_alt_6): $score++; endif; $total++; if($media_alt_7): $score++; endif; $final_score = ($score/$total) * 100; if(($final_score > 30) and ($final_score < 70)): return 'green'; else: return $final_score . '%'; endif; elseif($page === 'android'): $db_android = AndroidPage::first(); $android = $db_android; $a = AndroidPage::first(); $one = $a->section_1_image; $media_alt_1 = Media::where('name', $one)->first(); $two = $a->section_2_image; $media_alt_2 = Media::where('name', $two)->first(); $three = $a->section_3_image; $media_alt_3 = Media::where('name', $three)->first(); $four = $a->section_4_1_image; $media_alt_4 = Media::where('name', $four)->first(); $five = $a->section_4_2_image; $media_alt_5 = Media::where('name', $five)->first(); $six = $a->section_4_3_image; $media_alt_6 = Media::where('name', $six)->first(); $seven = $a->section_5_image; $media_alt_7 = Media::where('name', $seven)->first(); if($media_alt_1): $score++; endif; $total++; if($media_alt_2): $score++; endif; $total++; if($media_alt_3): $score++; endif; $total++; if($media_alt_4): $score++; endif; $total++; if($media_alt_5): $score++; endif; $total++; if($media_alt_6): $score++; endif; $total++; if($media_alt_7): $score++; endif; $total++; $final_score = ($score/$total) * 100; if(($final_score > 30) and ($final_score < 70)): return 'green'; else: return $final_score . '%'; endif; elseif($page === 'team'): $db_team = Team::first(); $team = $db_team; $t = Team::first(); $one = $t->image; $media_alt_1 = Media::where('name', $one)->first(); if($media_alt_1): $score++; endif; $total++; $final_score = ($score/$total) * 100; if(($final_score > 30) and ($final_score < 70)): return 'green'; else: return $final_score . '%'; endif; elseif($page === 'blog'): $db_blog = BlogPage::first(); $blog = $db_blog; $b = BlogPage::first(); $one = $b->image; $media_alt_1 = Media::where('name', $one)->first(); if($media_alt_1): $score++; endif; $total++; $final_score = ($score/$total) * 100; if(($final_score > 30) and ($final_score < 70)): return 'green'; else: return $final_score . '%'; endif; elseif($page === 'contact'): $db_contact = ContactUsPage::first(); $contact = $db_contact; $c = ContactUsPage::first(); $one = $c->image; $media_alt_1 = Media::where('name', $one)->first(); if($media_alt_1): $score++; endif; $total++; $final_score = ($score/$total) * 100; if(($final_score > 30) and ($final_score < 70)): return 'green'; else: return $final_score . '%'; endif; elseif($page === 'aset'): $db_aset = AsetPage::first(); $aset = $db_aset; $a = AsetPage::first(); $one = $a->section_1_image; $media_alt_1 = Media::where('name', $one)->first(); $two = $a->section_2_image; $media_alt_2 = Media::where('name', $two)->first(); $three = $a->section__3image; $media_alt_3 = Media::where('name', $three)->first(); $four = $a->section_4_1_image; $media_alt_4 = Media::where('name', $four)->first(); $five = $a->section_4_2_image; $media_alt_5 = Media::where('name', $five)->first(); $six = $a->section_4_3_image; $media_alt_6 = Media::where('name', $six)->first(); $seven = $a->section_5_image; $media_alt_7 = Media::where('name', $seven)->first(); if($media_alt_1): $score++; endif; $total++; if($media_alt_2): $score++; endif; $total++; if($media_alt_3): $score++; endif; $total++; if($media_alt_4): $score++; endif; $total++; if($media_alt_5): $score++; endif; $total++; if($media_alt_6): $score++; endif; $total++; if($media_alt_7): $score++; endif; $total++; $final_score = ($score/$total) * 100; if(($final_score > 30) and ($final_score < 70)): return 'green'; else: return $final_score . '%'; endif; elseif($page === 'emka'): $db_emka = EmkaPage::first(); $emka = $db_emka; $a = EmkaPage::first(); $one = $a->section_1_image; $media_alt_1 = Media::where('name', $one)->first(); $two = $a->section_2_image; $media_alt_2 = Media::where('name', $two)->first(); $three = $a->section_3_image; $media_alt_3 = Media::where('name', $three)->first(); $four = $a->section_4_1_image; $media_alt_4 = Media::where('name', $four)->first(); $five = $a->section_4_2_image; $media_alt_5 = Media::where('name', $five)->first(); $six = $a->section_4_3_image; $media_alt_6 = Media::where('name', $six)->first(); $seven = $a->section_5_image; $media_alt_7 = Media::where('name', $seven)->first(); if($media_alt_1): $score++; endif; $total++; if($media_alt_2): $score++; endif; $total++; if($media_alt_3): $score++; endif; $total++; if($media_alt_4): $score++; endif; $total++; if($media_alt_5): $score++; endif; $total++; if($media_alt_6): $score++; endif; $total++; if($media_alt_7): $score++; endif; $total++; $final_score = ($score/$total) * 100; if(($final_score > 30) and ($final_score < 70)): return 'green'; else: return $final_score . '%'; endif; endif; } public function altImageCheckWithId($page, $id) { $score = 0; $total = 0; $blog_detail = Blog::findOrFail($id); $b = Blog::findOrFail($id); if($b->image): $score++; endif; $total++; $final_score = ($score/$total) * 100; if(($final_score > 30) and ($final_score < 70)): return 'green'; else: return $final_score . '%'; endif; } public function keyInSubheading($page) { $key = 0; $db_home = HomePage::first(); if($page === 'home'): $home = $db_home; $home_data = HomePage::first(); if(strpos(strtolower($home_data->section_1_big_title), strtolower($home_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($home_data->section_1_small_title), strtolower($home_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($home_data->section_2_big_title), strtolower($home_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($home_data->section_2_small_title), strtolower($home_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($home_data->section_3_big_title), strtolower($home_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($home_data->section_3_small_title), strtolower($home_data->keyphrase)) !== false): $key++; endif; if($key > 0) { return 'green'; } else { return 'red'; } elseif($page === 'about'): $db_about = AboutPage::first(); $about = $db_about; $about_data = AboutPage::first(); if(strpos(strtolower($about_data->section_2_big_title), strtolower($about_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($about_data->section_2_small_title), strtolower($about_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($about_data->section_3_small_title), strtolower($about_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($about_data->section_3_big_title), strtolower($about_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($about_data->section_5_small_title), strtolower($about_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($about_data->section_5_big_title), strtolower($about_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($about_data->section_6_small_title), strtolower($about_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($about_data->section_6_big_title), strtolower($about_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($about_data->section_7_small_title), strtolower($about_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($about_data->section_7_big_title), strtolower($about_data->keyphrase)) !== false): $key++; endif; if($key > 0) { return 'green'; } else { return 'red'; } elseif($page === 'site'): $db_site = SitePage::first(); $site = $db_site; $site_data = SitePage::first(); if(strpos(strtolower($site_data->section_1_big_title), strtolower($site_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($site_data->section_1_small_title), strtolower($site_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($site_data->section_2_big_title), strtolower($site_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($site_data->section_3_big_title), strtolower($site_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($site_data->section_3_small_title), strtolower($site_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($site_data->section_4_big_title), strtolower($site_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($site_data->section_6_big_title), strtolower($site_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($site_data->section_9_big_title), strtolower($site_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($site_data->section_9_small_title), strtolower($site_data->keyphrase)) !== false): $key++; endif; if($key > 0) { return 'green'; } else { return 'red'; } elseif($page === 'apps'): $db_apps = AppsPage::first(); $apps = $db_apps; $apps_data = AppsPage::first(); if(strpos(strtolower($apps_data->section_1_big_title), strtolower($apps_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($apps_data->section_1_small_title), strtolower($apps_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($apps_data->section_2_big_title), strtolower($apps_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($apps_data->section_2_small_title), strtolower($apps_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($apps_data->section_3_big_title), strtolower($apps_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($apps_data->section_3_small_title), strtolower($apps_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($apps_data->section_4_big_title), strtolower($apps_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($apps_data->section_4_small_title), strtolower($apps_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($apps_data->section_6_big_title), strtolower($apps_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($apps_data->section_6_small_title), strtolower($apps_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($apps_data->section_9_big_title), strtolower($apps_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($apps_data->section_9_small_title), strtolower($apps_data->keyphrase)) !== false): $key++; endif; if($key > 0) { return 'green'; } else { return 'red'; } elseif($page === 'android'): $db_android = AndroidPage::first(); $android = $db_android; $android_data = AndroidPage::first(); if(strpos(strtolower($android_data->section_1_big_title), strtolower($android_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($android_data->section_1_small_title), strtolower($android_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($android_data->section_2_big_title), strtolower($android_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($android_data->section_2_small_title), strtolower($android_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($android_data->section_3_big_title), strtolower($android_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($android_data->section_3_small_title), strtolower($android_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($android_data->section_4_big_title), strtolower($android_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($android_data->section_4_small_title), strtolower($android_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($android_data->section_6_big_title), strtolower($android_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($android_data->section_6_small_title), strtolower($android_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($android_data->section_9_big_title), strtolower($android_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($android_data->section_9_small_title), strtolower($android_data->keyphrase)) !== false): $key++; endif; if($key > 0) { return 'green'; } else { return 'red'; } elseif($page === 'team'): $db_team = TeamPage::first(); $team = $db_team; $team_data = TeamPage::first(); if(strpos(strtolower($team_data->section_1_desc), strtolower($team_data->keyphrase)) !== false): $key++; endif; if($key > 0) { return 'green'; } else { return 'red'; } elseif($page === 'blog'): $db_blog = BlogPage::first(); $blog = $db_blog; $blog_data = BlogPage::first(); if(strpos(strtolower($blog_data->section_1_desc), strtolower($blog_data->keyphrase)) !== false): $key++; endif; if($key > 0) { return 'green'; } else { return 'red'; } elseif($page === 'contact'): $db_contact = ContactUsPage::first(); $contact = $db_contact; $contact_data = ContactUsPage::first(); if(strpos(strtolower($contact_data->section_2_big_title), strtolower($contact_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($contact_data->section_2_small_title), strtolower($contact_data->keyphrase)) !== false): $key++; endif; if($key > 0) { return 'green'; } else { return 'red'; } elseif($page === 'aset'): $db_aset = AsetPage::first(); $aset = $db_aset; $aset_data = AsetPage::first(); if(strpos(strtolower($aset_data->section_1_big_title), strtolower($aset_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($aset_data->section_1_small_title), strtolower($aset_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($aset_data->section_2_big_title), strtolower($aset_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($aset_data->section_2_small_title), strtolower($aset_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($aset_data->section_3_big_title), strtolower($aset_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($aset_data->section_3_small_title), strtolower($aset_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($aset_data->section_4_big_title), strtolower($aset_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($aset_data->section_4_small_title), strtolower($aset_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($aset_data->section_6_big_title), strtolower($aset_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($aset_data->section_6_small_title), strtolower($aset_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($aset_data->section_9_big_title), strtolower($aset_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($aset_data->section_9_small_title), strtolower($aset_data->keyphrase)) !== false): $key++; endif; if($key > 0) { return 'green'; } else { return 'red'; } elseif($page === 'emka'): $db_emka = EmkaPage::first(); $emka = $db_emka; $emka_data = EmkaPage::first(); if(strpos(strtolower($emka_data->section_1_big_title), strtolower($emka_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($emka_data->section_1_small_title), strtolower($emka_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($emka_data->section_2_big_title), strtolower($emka_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($emka_data->section_2_small_title), strtolower($emka_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($emka_data->section_3_big_title), strtolower($emka_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($emka_data->section_3_small_title), strtolower($emka_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($emka_data->section_4_big_title), strtolower($emka_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($emka_data->section_4_small_title), strtolower($emka_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($emka_data->section_6_big_title), strtolower($emka_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($emka_data->section_6_small_title), strtolower($emka_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($emka_data->section_9_big_title), strtolower($emka_data->keyphrase)) !== false): $key++; endif; if(strpos(strtolower($emka_data->section_9_small_title), strtolower($emka_data->keyphrase)) !== false): $key++; endif; if($key > 0) { return 'green'; } else { return 'red'; } endif; } public function keyInSubheadingWithId($page, $id) { $key = 0; $blog_detail = Blog::findOrFail($id); $blog_detail_data = Blog::findOrFail($id); if(strpos(strtolower($blog_detail_data->content), strtolower($blog_detail_data->keyphrase)) !== false): $key++; endif; if($key > 0) { return 'green'; } else { return 'red'; } } public function internalLink($page) { $total = 0; $db_home = HomePage::first(); if($page === 'home'): $button = $db_home; $button_link = HomePage::first()->section_1_2_btn_link; if(filter_var($button_link, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_2 = HomePage::first()->section_2_1_btn_link; if(filter_var($button_link_2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_3 = HomePage::first()->section_2_2_btn_link; if(filter_var($button_link_3, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'about'): $db_about = AboutPage::first(); $button_about = $db_about; $button_link_about = AboutPage::first()->section_3_link; if(filter_var($button_link_about, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_about, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'site'): $db_site = SitePage::first(); $button_site = $db_site; $button_link_site = SitePage::first()->section_2_link; if(filter_var($button_link_site, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_site, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'apps'): $db_apps = AppsPage::first(); $button_apps = $db_apps; $button_link_apps = AppsPage::first()->section_1_1_link; if(filter_var($button_link_apps, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_apps, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_apps_2 = AppsPage::first()->section_1_2_link; if(filter_var($button_link_apps_2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_apps_2, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_apps_3 = AppsPage::first()->section_2_1_link; if(filter_var($button_link_apps_3, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_apps_2, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_apps_4 = AppsPage::first()->section_2_2_link; if(filter_var($button_link_apps_4, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_apps_4, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'android'): $db_android = AndroidPage::first(); $button_android = $db_android; $button_link_android = AndroidPage::first()->section_1_1_link; if(filter_var($button_link_android, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_android, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_android_2 = AndroidPage::first()->section_1_2_link; if(filter_var($button_link_android_2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_android_2, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_android_3 = AndroidPage::first()->section_2_1_link; if(filter_var($button_link_android_3, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_android_2, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_android_4 = AndroidPage::first()->section_2_2_link; if(filter_var($button_link_android_4, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_android_4, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'team'): $db_apps = Team::first(); $button_team = $db_apps; $button_link_team = Team::first()->slug; if(filter_var($button_link_team, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_team, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'blog'): $db_blog = Blog::first(); $button_blog = $db_blog; $button_link_blog = Blog::first()->slug; if(filter_var($button_link_blog, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_blog, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'contact'): $db_contact = ContactUsPage::first(); $button_contact = $db_contact; $button_link_contact = ContactUsPage::first()->section_2_btn; if(filter_var($button_link_contact, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_contact, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'aset'): $db_aset = AsetPage::first(); $button_aset = $db_aset; $button_link_aset = AsetPage::first()->section_1_1_link; if(filter_var($button_link_aset, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_aset, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_aset_2 = AsetPage::first()->section_1_2_link; if(filter_var($button_link_aset_2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_aset_2, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_aset_3 = AsetPage::first()->section_2_1_link; if(filter_var($button_link_aset_3, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_aset_2, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_aset_4 = AsetPage::first()->section_2_2_link; if(filter_var($button_link_aset_4, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_aset_4, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'emka'): $db_emka = EmkaPage::first(); $button_emka = $db_emka; $button_link_emka = EmkaPage::first()->section_1_1_link; if(filter_var($button_link_emka, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_emka, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_emka_2 = EmkaPage::first()->section_1_2_link; if(filter_var($button_link_emka_2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_emka_2, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_emka_3 = EmkaPage::first()->section_2_1_link; if(filter_var($button_link_emka_3, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_emka_2, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; $button_link_emka_4 = EmkaPage::first()->section_2_2_link; if(filter_var($button_link_emka_4, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($button_link_emka_4, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; endif; } public function internalLinkWithId($page, $id) { $total = 0; $blog_detail = Blog::findOrFail($id); $link_1 = $blog_detail->content; if(filter_var($link_1, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($link_1, FILTER_VALIDATE_URL), 'internal')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; } public function outbondLink($page) { $total = 0; $db_home = HomePage::first(); if($page === 'home'): $home = $db_home; $small_title = HomePage::first()->section_1_small_title; if(filter_var($small_title, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($small_title, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $small_title_2 = HomePage::first()->section_2_small_title; if(filter_var($small_title_2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($small_title_2, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $small_title_3 = HomePage::first()->section_3_small_title; if(filter_var($small_title_3, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($small_title_3, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'about'): $db_about = AboutPage::first(); $about = $db_about; $desc = AboutPage::first()->section_1_desc; if(filter_var($desc, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_2 = AboutPage::first()->section_2_1_desc; if(filter_var($desc_2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_2, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_3 = AboutPage::first()->section_2_2_desc; if(filter_var($desc_3, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_3, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_4 = AboutPage::first()->section_2_3_desc; if(filter_var($desc_4, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_4, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_5 = AboutPage::first()->section_4_1_desc; if(filter_var($desc_5, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_5, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_6 = AboutPage::first()->section_4_2_desc; if(filter_var($desc_6, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_6, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_7 = AboutPage::first()->section_4_3_desc; if(filter_var($desc_7, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_7, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_8 = AboutPage::first()->section_4_4_desc; if(filter_var($desc_8, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_8, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_9 = AboutPage::first()->section_7_desc; if(filter_var($desc_9, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_9, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'site'): $db_site = SitePage::first(); $site = $db_site; $desc = SitePage::first()->section_4_1_desc; if(filter_var($desc, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc2 = SitePage::first()->section_4_2_desc; if(filter_var($desc2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc2, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc3 = SitePage::first()->section_4_3_desc; if(filter_var($desc2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc3, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc4 = SitePage::first()->section_4_4_desc; if(filter_var($desc2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc4, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc5 = SitePage::first()->section_4_5_desc; if(filter_var($desc5, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc5, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc6 = SitePage::first()->section_4_6_desc; if(filter_var($desc6, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc6, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc7 = SitePage::first()->section_5_1_desc; if(filter_var($desc7, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc7, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc8 = SitePage::first()->section_5_2_desc; if(filter_var($desc8, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc8, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc9 = SitePage::first()->section_5_3_desc; if(filter_var($desc9, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc9, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc10 = SitePage::first()->section_6_desc; if(filter_var($desc10, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc10, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc11 = SitePage::first()->section_template_desc; if(filter_var($desc11, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc11, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc12 = SitePage::first()->section_pricing_desc; if(filter_var($desc12, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc12, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc13 = SitePage::first()->section_feature_desc; if(filter_var($desc12, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc13, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'apps'): $db_apps = AppsPage::first(); $apps = $db_apps; $desc = AppsPage::first()->section_1_1_text; if(filter_var($desc, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_2 = AppsPage::first()->section_1_2_text; if(filter_var($desc_2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_2, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_3 = AppsPage::first()->section_2_1_text; if(filter_var($desc_3, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_3, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_4 = AppsPage::first()->section_2_2_text; if(filter_var($desc_4, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_4, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_5 = AppsPage::first()->section_4_1_desc; if(filter_var($desc_5, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_5, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_6 = AppsPage::first()->section_4_2_desc; if(filter_var($desc_6, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_6, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_7 = AppsPage::first()->section_4_3_desc; if(filter_var($desc_7, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_7, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_8 = AppsPage::first()->section_5_1_desc; if(filter_var($desc_8, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_8, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_9 = AppsPage::first()->section_5_2_desc; if(filter_var($desc_9, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_9, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_10 = AppsPage::first()->section_5_3_desc; if(filter_var($desc_10, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_10, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_11 = AppsPage::first()->section_feature_desc; if(filter_var($desc_11, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_11, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'android'): $db_android = AndroidPage::first(); $android = $db_android; $desc = AndroidPage::first()->section_1_1_text; if(filter_var($desc, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_2 = AndroidPage::first()->section_1_2_text; if(filter_var($desc_2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_2, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_3 = AndroidPage::first()->section_2_1_text; if(filter_var($desc_3, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_3, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_4 = AndroidPage::first()->section_2_2_text; if(filter_var($desc_4, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_4, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_5 = AndroidPage::first()->section_4_1_desc; if(filter_var($desc_5, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_5, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_6 = AndroidPage::first()->section_4_2_desc; if(filter_var($desc_6, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_6, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_7 = AndroidPage::first()->section_4_3_desc; if(filter_var($desc_7, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_7, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_8 = AndroidPage::first()->section_5_1_desc; if(filter_var($desc_8, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_8, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_9 = AndroidPage::first()->section_5_2_desc; if(filter_var($desc_9, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_9, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_10 = AndroidPage::first()->section_5_3_desc; if(filter_var($desc_10, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_10, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_11 = AndroidPage::first()->section_feature_desc; if(filter_var($desc_11, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_11, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'team'): $db_team = TeamPage::first(); $team = $db_team; $desc = TeamPage::first()->section_1_desc; if(filter_var($desc, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'blog'): $db_blog = BlogPage::first(); $blog = $db_blog; $desc = BlogPage::first()->section_1_desc; if(filter_var($desc, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'contact'): $db_contact = ContactUsPage::first(); $contact = $db_contact; $desc = ContactUsPage::first()->section_1_desc; if(filter_var($desc, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_2 = ContactUsPage::first()->section_2_desc; if(filter_var($desc_2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_2, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'aset'): $db_aset = AsetPage::first(); $aset = $db_aset; $desc = AsetPage::first()->section_1_1_text; if(filter_var($desc, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_2 = AsetPage::first()->section_1_2_text; if(filter_var($desc_2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_2, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_3 = AsetPage::first()->section_2_1_text; if(filter_var($desc_3, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_3, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_4 = AsetPage::first()->section_2_2_text; if(filter_var($desc_4, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_4, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_5 = AsetPage::first()->section_4_1_desc; if(filter_var($desc_5, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_5, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_6 = AsetPage::first()->section_4_2_desc; if(filter_var($desc_6, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_6, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_7 = AsetPage::first()->section_4_3_desc; if(filter_var($desc_7, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_7, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_8 = AsetPage::first()->section_5_1_desc; if(filter_var($desc_8, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_8, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_9 = AsetPage::first()->section_5_2_desc; if(filter_var($desc_9, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_9, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_10 = AsetPage::first()->section_5_3_desc; if(filter_var($desc_10, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_10, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_11 = AsetPage::first()->section_feature_desc; if(filter_var($desc_11, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_11, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; elseif($page === 'emka'): $db_emka = EmkaPage::first(); $emka = $db_emka; $desc = EmkaPage::first()->section_1_1_text; if(filter_var($desc, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_2 = EmkaPage::first()->section_1_2_text; if(filter_var($desc_2, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_2, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_3 = EmkaPage::first()->section_2_1_text; if(filter_var($desc_3, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_3, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_4 = EmkaPage::first()->section_2_2_text; if(filter_var($desc_4, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_4, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_5 = EmkaPage::first()->section_4_1_desc; if(filter_var($desc_5, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_5, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_6 = EmkaPage::first()->section_4_2_desc; if(filter_var($desc_6, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_6, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_7 = EmkaPage::first()->section_4_3_desc; if(filter_var($desc_7, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_7, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_8 = EmkaPage::first()->section_5_1_desc; if(filter_var($desc_8, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_8, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_9 = EmkaPage::first()->section_5_2_desc; if(filter_var($desc_9, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_9, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_10 = EmkaPage::first()->section_5_3_desc; if(filter_var($desc_10, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_10, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; $desc_11 = EmkaPage::first()->section_feature_desc; if(filter_var($desc_11, FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var($desc_11, FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; endif; } public function outbondLinkWithId($page, $id) { if ($page == 'blog') { $total = 0; $blog_detail = Blog::findOrFail($id); $bd = Blog::findOrFail($id); if($this->string_between_two_string($bd->content . ' ', 'http', ' ')): if(filter_var('http' . $this->string_between_two_string($bd->content . ' ', 'http', ' '), FILTER_VALIDATE_URL)): if($this->_checkRootDomain(filter_var('http' . $this->string_between_two_string($bd->content . ' ', 'http', ' '), FILTER_VALIDATE_URL), 'outbond')): $total++; endif; endif; endif; if($total > 0): return 'green'; else: return 'red'; endif; if($total > 0): return 'green'; else: return 'red'; endif; } } public function textLength($page) { $url_binggo = 'https://binggo.co.id'; $url_about = 'https://binggo.co.id/about-us'; $url_site = 'https://binggo.co.id/site'; $url_apps = 'https://binggo.co.id/jasa-pembuatan-aplikasi'; $url_android = 'https://binggo.co.id/jasa-pembuatan-aplikasi-android'; $url_team = 'https://binggo.co.id/team'; $url_blog = 'https://binggo.co.id/blog'; $url_contact = 'https://binggo.co.id/contact-us'; $url_aset = 'https://binggo.co.id/manajemen-aset'; $url_emka = 'https://binggo.co.id/emka'; if($page === 'home'): $ch = curl_init($url_binggo); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); if($total >= 900): return 'green'; else: return $total; endif; elseif($page === 'about'): $ch = curl_init($url_about); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); if($total >= 900): return 'green'; else: return $total; endif; elseif($page === 'site'): $ch = curl_init($url_site); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); if($total >= 900): return 'green'; else: return $total; endif; elseif($page === 'apps'): $ch = curl_init($url_apps); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); if($total >= 900): return 'green'; else: return $total; endif; elseif($page === 'android'): $ch = curl_init($url_android); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); if($total >= 900): return 'green'; else: return $total; endif; elseif($page === 'team'): $ch = curl_init($url_team); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); if($total >= 900): return 'green'; else: return $total; endif; elseif($page === 'blog'): $ch = curl_init($url_blog); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); if($total >= 900): return 'green'; else: return $total; endif; elseif($page === 'contact'): $ch = curl_init($url_contact); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); if($total >= 900): return 'green'; else: return $total; endif; elseif($page === 'aset'): $ch = curl_init($url_aset); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); if($total >= 900): return 'green'; else: return $total; endif; elseif($page === 'emka'): $ch = curl_init($url_emka); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); if($total >= 900): return 'green'; else: return $total; endif; endif; } public function textLengthWithId($page, $id) { $url_binggo = 'https://binggo.co.id/'; $blog = Blog::findOrFail($id); $slug = $blog->slug; $ch = curl_init($url_binggo . $slug); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); if($total >= 900): return 'green'; else: return 'red'; endif; } public function keyphraseDensity($page) { $url_binggo = 'https://binggo.co.id/'; if($page === 'home'): $db_home = HomePage::first(); $keyphrase = $db_home; $ch = curl_init($url_binggo); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); $keyphrase_count = substr_count(strip_tags(strtolower(preg_replace('!\s+!', ' ', $trim_content))), strtolower($keyphrase->keyphrase)); $persen = ($keyphrase_count/$total) * 100; if(($persen >= 0.5) && ($persen <= 3)): return 'green'; // return $persen.' % suitable'; //green else: return $persen.' % suitable'; //red endif; elseif($page === 'about'): $db_about = AboutPage::first(); $keyphrase = $db_about; $ch = curl_init($url_binggo); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); $keyphrase_count = substr_count(strip_tags(strtolower(preg_replace('!\s+!', ' ', $trim_content))), strtolower($keyphrase->keyphrase)); $persen = ($keyphrase_count/$total) * 100; if(($persen >= 0.5) && ($persen <= 3)): return 'green'; // return $persen.' % suitable'; //green else: return $persen.' % suitable'; //red endif; elseif($page === 'site'): $db_site = SitePage::first(); $keyphrase = $db_site; $ch = curl_init($url_binggo); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); $keyphrase_count = substr_count(strip_tags(strtolower(preg_replace('!\s+!', ' ', $trim_content))), strtolower($keyphrase->keyphrase)); $persen = ($keyphrase_count/$total) * 100; if(($persen >= 0.5) && ($persen <= 3)): return 'green'; // return $persen.' % suitable'; //green else: return $persen.' % suitable'; //red endif; elseif($page === 'apps'): $db_apps = AppsPage::first(); $keyphrase = $db_apps; $ch = curl_init($url_binggo); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); $keyphrase_count = substr_count(strip_tags(strtolower(preg_replace('!\s+!', ' ', $trim_content))), strtolower($keyphrase->keyphrase)); $persen = ($keyphrase_count/$total) * 100; if(($persen >= 0.5) && ($persen <= 3)): return 'green'; // return $persen.' % suitable'; //green else: return $persen.' % suitable'; //red endif; elseif($page === 'android'): $db_android = AndroidPage::first(); $keyphrase = $db_android; $ch = curl_init($url_binggo); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); $keyphrase_count = substr_count(strip_tags(strtolower(preg_replace('!\s+!', ' ', $trim_content))), strtolower($keyphrase->keyphrase)); $persen = ($keyphrase_count/$total) * 100; if(($persen >= 0.5) && ($persen <= 3)): return 'green'; // return $persen.' % suitable'; //green else: return $persen.' % suitable'; //red endif; elseif($page === 'team'): $db_team = TeamPage::first(); $keyphrase = $db_team; $ch = curl_init($url_binggo); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); $keyphrase_count = substr_count(strip_tags(strtolower(preg_replace('!\s+!', ' ', $trim_content))), strtolower($keyphrase->keyphrase)); $persen = ($keyphrase_count/$total) * 100; if(($persen >= 0.5) && ($persen <= 3)): return 'green'; // return $persen.' % suitable'; //green else: return $persen.' % suitable'; //red endif; elseif($page === 'blog'): $db_blog = BlogPage::first(); $keyphrase = $db_blog; $ch = curl_init($url_binggo); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); $keyphrase_count = substr_count(strip_tags(strtolower(preg_replace('!\s+!', ' ', $trim_content))), strtolower($keyphrase->keyphrase)); $persen = ($keyphrase_count/$total) * 100; if(($persen >= 0.5) && ($persen <= 3)): return 'green'; // return $persen.' % suitable'; //green else: return $persen.' % suitable'; //red endif; elseif($page === 'contact'): $db_contact = ContactUsPage::first(); $keyphrase = $db_contact; $ch = curl_init($url_binggo); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); $keyphrase_count = substr_count(strip_tags(strtolower(preg_replace('!\s+!', ' ', $trim_content))), strtolower($keyphrase->keyphrase)); $persen = ($keyphrase_count/$total) * 100; if(($persen >= 0.5) && ($persen <= 3)): return 'green'; // return $persen.' % suitable'; //green else: return $persen.' % suitable'; //red endif; elseif($page === 'aset'): $db_aset = AsetPage::first(); $keyphrase = $db_aset; $ch = curl_init($url_binggo); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); $keyphrase_count = substr_count(strip_tags(strtolower(preg_replace('!\s+!', ' ', $trim_content))), strtolower($keyphrase->keyphrase)); $persen = ($keyphrase_count/$total) * 100; if(($persen >= 0.5) && ($persen <= 3)): return 'green'; // return $persen.' % suitable'; //green else: return $persen.' % suitable'; //red endif; elseif($page === 'emka'): $db_emka = EmkaPage::first(); $keyphrase = $db_emka; $ch = curl_init($url_binggo); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); $keyphrase_count = substr_count(strip_tags(strtolower(preg_replace('!\s+!', ' ', $trim_content))), strtolower($keyphrase->keyphrase)); $persen = ($keyphrase_count/$total) * 100; if(($persen >= 0.5) && ($persen <= 3)): return 'green'; // return $persen.' % suitable'; //green else: return $persen.' % suitable'; //red endif; endif; } public function keyphraseDensityWithId($page, $id) { $url_binggo = 'https://binggo.co.id/'; $keyphrase = Blog::findOrFail($id); $slug = $keyphrase->slug; $ch = curl_init($url_binggo . $slug); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_AUTOREFERER, TRUE); $result = curl_exec($ch); $trim_content = $this->string_between_two_string($result, '', ''); $total = str_word_count(strip_tags(preg_replace('!\s+!', ' ', $trim_content))); $keyphrase_count = substr_count(strip_tags(strtolower(preg_replace('!\s+!', ' ', $trim_content))), strtolower($keyphrase->keyphrase)); $persen = ($keyphrase_count/$total) * 100; if(($persen >= 0.5) && ($persen <= 3)): return 'green'; else: // return 'red'; return $persen.' % suitable'; endif; } private function string_between_two_string($str, $starting_word, $ending_word) { $subtring_start = strpos($str, $starting_word); //Adding the strating index of the strating word to //its length would give its ending index $subtring_start += strlen($starting_word); //Length of our required sub string $size = strpos($str, $ending_word, $subtring_start) - $subtring_start; // Return the substring from the index substring_start of length size return substr($str, $subtring_start, $size); } private function _checkRootDomain($url, $type) { $url_binggo = 'https://binggo.co.id/'; if (!preg_match("~^(?:f|ht)tps?://~i", $url)) { $url = "http://" . $url; } $main_domain = implode('.', array_slice(explode('.', parse_url($url_binggo, PHP_URL_HOST)), -2)); $domain = implode('.', array_slice(explode('.', parse_url($url, PHP_URL_HOST)), -2)); if ($domain == $main_domain) { return $type === 'internal' ? True : False; } else { return $type === 'internal' ? False : True; } } }