array( 'valid' => false, 'warning' => __("Could not verify the frontend", _SQ_PLUGIN_NAME_), 'message' => __("To be able to check your website, you need to allow local crawling in your .htaccess file", _SQ_PLUGIN_NAME_), 'solution' => sprintf(__("Run the test again. If you get the same error, check if you have added 'Deny %s' into your config file (e.g. htaccess)", _SQ_PLUGIN_NAME_), $local_ip), ), 'getSeoSquirrlyTitle' => array( 'valid' => false, 'warning' => __("Squirrly SEO Title is not active for your website", _SQ_PLUGIN_NAME_), 'message' => __("It's important to activate Squirrly SEO Title for your website if you don't use other SEO plugins", _SQ_PLUGIN_NAME_), 'solution' => sprintf(__("Go to %sSquirrly > SEO Settings > Metas%s and switch on Meta Title", _SQ_PLUGIN_NAME_), '', ''), ), 'getDuplicateOG' => array( 'valid' => false, 'warning' => __("You have duplicate Open Graph Meta tags", _SQ_PLUGIN_NAME_), 'message' => sprintf(__('If you have duplicate OG tags, it means that some crawlers like %sFacebook Open Graph Object Debugger%s will raise an error and may not proceed with your request until you fix it.', _SQ_PLUGIN_NAME_), '', ''), 'solution' => __("If you are using multiple SEO plugins, then try to remove some of them and check again.", _SQ_PLUGIN_NAME_), ), 'getDuplicateTC' => array( 'valid' => false, 'warning' => __("You have duplicate Twitter Card tags", _SQ_PLUGIN_NAME_), 'message' => sprintf(__('If you have duplicate Twitter Card tags, it means that some crawlers like %sTwitter Validator%s will raise an error and may not proceed with your request until you fix it.', _SQ_PLUGIN_NAME_), '', ''), 'solution' => __("If you are using multiple SEO plugins, then try to remove some of them and check again.", _SQ_PLUGIN_NAME_), ), 'getNoTitle' => array( 'valid' => false, 'warning' => __("The Title meta tag is missing in frontend", _SQ_PLUGIN_NAME_), 'message' => __("If you don't have Title meta tag in your website, it means that your website is not going to perform well on search engines.", _SQ_PLUGIN_NAME_), 'solution' => sprintf(__("Go to %sSquirrly > SEO Settings > Metas%s and switch on Meta Title. If it's already switched on, check if another plugin is stopping Squirrly from showing the Title meta.", _SQ_PLUGIN_NAME_), '', ''), ), 'getDuplicateTitle' => array( 'valid' => false, 'warning' => __("You have duplicate Title meta tags", _SQ_PLUGIN_NAME_), 'message' => __('If you have duplicate meta tags, it means that some crawlers may raise an error or process wrong data from your website until you fix it.', _SQ_PLUGIN_NAME_), 'solution' => __("If you are using multiple SEO plugins, then try to remove some of them and check again.", _SQ_PLUGIN_NAME_), ), 'getDuplicateDescription' => array( 'valid' => false, 'warning' => __("You have duplicate Description meta tags", _SQ_PLUGIN_NAME_), 'message' => __('If you have duplicate meta tags, it means that some crawlers may raise an error or process wrong data from your website until you fix it.', _SQ_PLUGIN_NAME_), 'solution' => __("If you are using multiple SEO plugins, then try to remove some of them and check again.", _SQ_PLUGIN_NAME_), ), 'getPrivateBlog' => array( 'valid' => false, 'warning' => __("Your website is not public", _SQ_PLUGIN_NAME_), 'message' => sprintf(__("You selected '%s' in Settings > Reading. It's important to uncheck that option.", _SQ_PLUGIN_NAME_), __('Discourage search engines from indexing this site')), 'solution' => sprintf(__("Go to %sGeneral > Reading%s and uncheck %s.", _SQ_PLUGIN_NAME_), '', '', '' . __('Discourage search engines from indexing this site') . ''), ), 'getBadLinkStructure' => array( 'valid' => false, 'warning' => __("Permalink structure is not good", _SQ_PLUGIN_NAME_), 'message' => __("Your URLs (the links from your site) should be super easy to read. This makes your site Human-friendly as well.", _SQ_PLUGIN_NAME_), 'solution' => sprintf(__("Make your LINKS SEO-Friendly. %s Settings > Permalinks %s That is where WordPress allows you to change the permalink structure.", _SQ_PLUGIN_NAME_), '', ''), ), 'getDefaultTagline' => array( 'valid' => false, 'warning' => __("The default Tagline is still on", _SQ_PLUGIN_NAME_), 'message' => __("Most of the pages will use the WordPress Tagline in Title and Description. Squirrly SEO uses the Tagline on {{sitedesc}} pattern for automation.", _SQ_PLUGIN_NAME_), 'solution' => sprintf(__("Change the Tagline with your Brand or the Store name from %s", _SQ_PLUGIN_NAME_), '' . __('Settings') . ' > ' . __('General') . ''), ), 'getAMPWebsite' => array( 'valid' => false, 'warning' => __("AMP site detected and Squirrly AMP is off", _SQ_PLUGIN_NAME_), 'message' => __("If this website is an AMP website you need to make sure that you activate Squirrly AMP Tracking for it. Squirrly will load Google Analytics and Facebook Pixel for AMP and avoid AMP script errors.", _SQ_PLUGIN_NAME_), 'solution' => sprintf(__("Activate AMP tracking in %s Squirrly > SEO Settings > Tracking Tools%s ", _SQ_PLUGIN_NAME_), '', ''), ), ); } /** * Get the crawled HTML * @return bool */ public function getHtml() { return $this->html; } /** * Process all the tasks and save the report * return void */ public function checkSEO() { $report = array(); if (!function_exists('preg_match_all')) { return false; } if (!$tasks_ignored = get_option('sq_seoreport_ignore')) { $tasks_ignored = array(); } $tasks = $this->getTasks(); foreach ($tasks as $function => $task) { if (!in_array($function, $tasks_ignored)) { if (method_exists($this, $function)) { if ($result = @call_user_func(array($this, $function))) { if (!$result['valid']) { $report[$function] = $result; } } } } } update_option('sq_seoreport', $report); update_option('sq_seoreport_time', array('timestamp' => current_time('timestamp', 1))); } /** * Get the homepage source code * @return array */ public function getSourceCode() { $url = home_url('?rnd=' . rand()); $json = SQ_Classes_ObjController::getClass('SQ_Classes_RemoteController')->crawlURL(array('url' => $url)); if (!is_wp_error($json)) { if (isset($json->content) && $json->content <> '') { $this->html = $json->content; } else { $this->html = false; } } return array( 'warning' => __("Could not verify the frontend.", _SQ_PLUGIN_NAME_), 'valid' => true ); } /** * Check the common metas * @return array|bool */ public function checkMetas() { $metas = array( 'title' => false, 'description' => false, 'og' => false, 'tc' => false, 'viewport' => false, 'canonical' => false ); //check if the crawl was made with success if (!$this->html) return false; //check open graph preg_match_all("/]*)[\"|\'][^>]*>/i", $this->html, $out); if (!empty($out) && isset($out[0]) && is_array($out[0])) { if ((sizeof($out[0]) >= 1)) { $metas['og'] = true; } } //check twitter card preg_match_all("/]*)[\"|\'][^>]*>/i", $this->html, $out); if (!empty($out) && isset($out[0]) && is_array($out[0])) { if ((sizeof($out[0]) >= 1)) { $metas['tc'] = true; } } //check title preg_match_all("/