File manager - Edit - /home/aresglob/public_html/wp/wp-includes/images/smilies/siteseo.tar
Back
functions.php 0000644 00000016501 15104342737 0007276 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } function siteseo_admin_header(){ \SiteSEO\Settings\Util::admin_header(); } function siteseo_submit_button($value = ''){ \SiteSEO\Settings\Util::submit_btn(); } function siteseo_suggestions_variable(){ return [ '%%sep%%' => 'Separator', '%%sitetitle%%' => 'Site Title', '%%tagline%%' => 'Tagline', '%%post_title%%' => 'Post title', '%%post_excerpt%%' => 'Post excerpt', '%%post_content%%' => 'Post content / product description', '%%post_thumbnail_url%%' => 'Post thumbnail URL', '%%post_url%%' => 'Post url', '%%post_date%%' => 'Post date', '%%post_modified_date%%' => 'Post modified date', '%%post_author%%' => 'Post author', '%%post_category%%' => 'Post category', '%%post_tag%%' => 'Post_tag', '%%_category_title%%' => 'Category title', '%%_category_description%%' => 'Category description', '%%tag_title%%' => 'Tag title', '%%tag_description%%' => 'Tag description', '%%term_title%%' => 'Term title', '%%tag_description%%' => 'Tag description', '%%term_title%%' => 'Term title', '%%term_description%%' => 'Term description', '%%search_keywords%%' => 'Search keywords', '%%current_pagination%%' => 'Current number page', '%%page%%' => 'Page number with context', '%%cpt_plural%%' => 'Plural Post Type Archive name', '%%archive_title%%' => 'Archive_title', '%%archive_date%%' => 'Archive_date', '%%archive_date_day%%' => 'Day Archive date', '%%archive_date_month%%' => 'Month Archive title', '%%archive_date_month_name%%' => 'Month name Archive title', '%%archive_date_year%%' => 'Year Archive title', '%%_cf_your_custom_field_name%%' => 'Custom fields from post, page, post type and term taxonomy', '%%_ct_your_custom_taxonomy_slug%%' => 'Custom term taxonomy from post, page or post type', '%%wc_single_cat%%' => 'Single product category', '%%wc_single_tag%%' => 'Single product tag', '%%wc_single_short_desc%%' => 'Single product short description', '%%wc_single_price%%' => 'Single product price', '%%wc_single_price_exe_tax' => 'Single product price taxes excluded', '%%wc_sku%%' => 'Single SKU Product', '%%currentday%%' => 'Current day', '%%currentmonth%%' => 'Current month', '%%currentmonth_short%%' => 'Current month in 3 letter', '%%currentyear%%' => 'Current year', '%%currentdate%%' => 'Current date', '%%currenttime%%' => 'Current time', '%%author_first_name%%' => 'Author first name', '%%author_last_name%%' => 'Author last name', '%%author_website%%' => 'Author website', '%%author_nickname%%' => 'Author nickname', '%%author_bio%%' => 'Author biography', '%%_ucf_your_user_meta%%' => 'Custom User Meta', '%%currentmonth_num%%' => 'Current month in digital format', '%%target_keyword%%' => 'Target keywords', ]; } function siteseo_suggestion_button(){ $suggest_variable = siteseo_suggestions_variable(); if(empty($suggest_variable)){ return; } echo '<button class="tag-select-btn"><span id="icon" class="dashicons dashicons-arrow-down-alt2"></span></button> <div class="siteseo-suggestions-wrapper" style="position:relative;"> <div class="siteseo-suggetion"> <div class="search-box-container"> <input type="text" class="search-box" placeholder="Search a tag..."> </div> <div class="suggestions-container">'; foreach($suggest_variable as $key =>$value){ echo '<div class="section">'.esc_html($value).' <div class="item"> <div class="tag">'.esc_html($key).'</div> </div> </div>'; } echo '</div> </div> </div>'; } function siteseo_suggestion_button_metabox(){ $suggest_variable = siteseo_suggestions_variable(); if(empty($suggest_variable)){ return; } return '<button class="siteseo-tag-select-btn" type="button"> <span id="icon" class="dashicons dashicons-arrow-down-alt2"></span> </button> <div class="siteseo-suggestions-wrapper" style="position:relative;"> <div class="siteseo-suggetion"> <div class="siteseo-search-box-container"> <input type="text" class="search-box" placeholder="Search a tag..."> </div> <div class="siteseo-suggestions-container">' . implode('', array_map(function($key, $value){ return '<div class="section">'.esc_html($value).' <div class="item"> <div class="tag">'.esc_html($key).'</div> </div> </div>'; }, array_keys($suggest_variable), $suggest_variable)). '</div> </div> </div>'; } function siteseo_get_docs_links(){ $siteseo_docs = []; $siteseo_docs = [ 'page_speed' => [ 'api' => SITESEO_DOCS . 'api-cli-dev/add-your-google-page-speed-insights-api-key-to-siteseo/', 'google' => 'https://console.cloud.google.com/apis/library/pagespeedonline.googleapis.com', ] ]; return $siteseo_docs; } function siteseo_universal_assets(){ global $siteseo, $post; $post_id = isset($post->ID) ? $post->ID : get_the_ID(); if(!current_user_can('edit_post', $post_id)){ return; } // Checking if it is a block editor if(function_exists('get_current_screen')){ $screen = get_current_screen(); if(!empty($screen) && method_exists($screen, 'is_block_editor') && $screen->is_block_editor() === true){ if(empty($siteseo->advanced_settings['appearance_universal_metabox'])){ return; } $is_gutenberg = true; } } if ( !empty($is_gutenberg) || isset($_GET['fl_builder']) || isset($_GET['elementor-preview']) || isset($_GET['ct_builder']) || isset($_GET['vc_editable']) || isset($_GET['brizy_edit']) || isset($_GET['tve']) || isset($_GET['pagelayer-live']) || (!empty(get_queried_object_id()) && is_admin_bar_showing()) // To show when user is viewing the page as a admin ) { wp_enqueue_script('siteseo-universal-metabox', SITESEO_ASSETS_URL . '/js/universal-metabox.js', ['jquery'], SITESEO_VERSION); wp_localize_script('siteseo-universal-metabox', 'siteseo_universal', [ 'asset_url' => SITESEO_ASSETS_URL, 'post_id' => $post_id, 'site_url' => site_url(), 'metabox_url' => admin_url('admin.php?page=siteseo-metabox-wizard'), ]); } } function siteseo_post_types(){ $args = ['show_ui' => true, 'public' => true]; $post_types = get_post_types($args, 'objects', 'and'); unset( $post_types['attachment'], $post_types['elementor_library'], $post_types['customer_discount'], $post_types['cuar_private_file'], $post_types['cuar_private_page'], $post_types['ct_template'], $post_types['e-floating-buttons'], $post_types['pagelayer-template'], $post_types['hostim_footer'], $post_types['mega_menu'] ); return apply_filters('siteseo_post_types', $post_types); } function siteseo_user_can($cap){ return current_user_can('manage_options') || current_user_can('siteseo_'. $cap); } function siteseo_user_can_metabox(){ if(!is_user_logged_in()){ return false; } global $siteseo; $metabox_roles = !empty($siteseo->advanced_settings['security_metaboxe_role']) ? $siteseo->advanced_settings['security_metaboxe_role'] : []; $user = wp_get_current_user(); $user_role = current($user->roles); if(array_key_exists($user_role, $metabox_roles)){ return false; } return true; } function siteseo_remove_elementor_description_meta_tag(){ remove_action('wp_head', 'hello_elementor_add_description_meta_tag'); } main/primarycategory.php 0000644 00000004701 15104342737 0011432 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class PrimaryCategory{ static function wc_primary_category($none_terms, $terms, $post){ $primary_cat = null; if(!empty($post)){ $wc_primary_cat = get_post_meta($post->ID, '_siteseo_robots_primary_cat', true); if(isset($wc_primary_cat) && '' != $wc_primary_cat && 'none' != $wc_primary_cat){ if(null != $post->post_type && 'product' == $post->post_type){ $primary_cat = get_term($wc_primary_cat, 'product_cat'); } if(!is_wp_error($primary_cat) && null != $primary_cat){ return $primary_cat; } } else{ return $none_terms; } } else{ return $none_terms; } } static function add_primary_category($none_cate, $cats, $post){ $primary_cat = null; if(!empty($post)){ $robots_primary_cat = get_post_meta($post->ID, '_siteseo_robots_primary_cat', true); if(isset($robots_primary_cat) && '' != $robots_primary_cat && 'none' != $robots_primary_cat){ if(null != $post->post_type && 'post' == $post->post_type){ $primary_cat = get_category($robots_primary_cat); } if(!is_wp_error($primary_cat) && null != $primary_cat){ return $primary_cat; } } else{ return $none_cate; } } else{ return $none_cate; } } static function replace_breadcrumb_categories($crumbs, $breadcrumb){ if(!is_product()){ return $crumbs; } global $post; $primary_cat_id = get_post_meta($post->ID, '_siteseo_robots_primary_cat', true); if($primary_cat_id && $primary_cat_id !== 'none'){ $primary_cat = get_term($primary_cat_id, 'product_cat'); if(!is_wp_error($primary_cat)){ $new_crumbs = []; foreach($crumbs as $key => $crumb){ if($key === 0 || (isset($crumb[1]) && strpos($crumb[1], '?post_type=product') !== false)){ $new_crumbs[] = $crumb; } } $ancestors = get_ancestors($primary_cat->term_id, 'product_cat'); $ancestors = array_reverse($ancestors); foreach($ancestors as $ancestor_id){ $ancestor = get_term($ancestor_id, 'product_cat'); $new_crumbs[] = [ $ancestor->name, get_term_link($ancestor) ]; } $new_crumbs[] = [ $primary_cat->name, get_term_link($primary_cat) ]; if(count($crumbs) > 0){ $new_crumbs[] = $crumbs[count($crumbs) - 1]; } return $new_crumbs; } } return $crumbs; } } main/tableofcontent.php 0000644 00000012407 15104342737 0011222 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } use DOMDocument; use DOMXPath; class TableofContent{ static function enable_toc(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-advanced']) || empty($siteseo->advanced_settings['toc_enable'])){ return; } add_filter('the_content', '\SiteSEO\TableofContent::add_ids_to_headings'); } static function render_toc(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-advanced']) || empty($siteseo->advanced_settings['toc_enable'])){ return; } static $siteseo_toc_run = false; if(!empty($siteseo_toc_run)){ return '<p style="padding: 1rem; background-color:#fff3cd; color:#664d03; border:1px solid #ffe69c; border-radius: 0.375rem">'.esc_html__('Table of content shortcode can be used only once on a page, this page is using the shortcode more than once. Please remove the extra table of content shortcodes for this warning to go away.', 'siteseo').'</p>'; } $options = get_option('siteseo_advanced_option_name'); //$options = $siteseo->advanced_settings; $content = get_the_content(); if(empty($content)){ return; } $heading_type = (!empty($options['toc_heading_type']) ? $options['toc_heading_type'] : 'ul'); $dom = new DOMDocument(); $internalErrors = libxml_use_internal_errors(true); $dom->preserveWhiteSpace = false; $html = ''; if($dom->loadHTML('<?xml encoding="utf-8" ?>' . $content)){ $xpath = new DOMXPath($dom); $heading_list = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; $headings_to_scan = []; foreach($heading_list as $h){ if(!empty($options['toc_excluded_headings']) && is_array($options['toc_excluded_headings']) && in_array($h, $options['toc_excluded_headings'])){ continue; } $headings_to_scan[] = '//'.$h; } if(empty($headings_to_scan)){ return; } $headings_to_scan = implode('|', $headings_to_scan); // The imploded string will look like this //h1|//h2|//h3|//h4|//h5|//h6 $headings = $xpath->query($headings_to_scan); if(empty($headings)){ return; } $last_h = 0; $open_ul = 0; $html .= '<style>.siteseo-toc-wrapper { padding: 20px; border: 1px solid #a2a9b1; background-color: #f8f9fa;}.siteseo-toc-wrapper p { display:flex; align-items:center; gap: 10px; font-size: 1.5rem; font-weight: 500; margin: 0 0 10px 0;}.siteseo-toc-wrapper > '.esc_html($heading_type).' { margin: 0; padding: 0;}.siteseo-toc-wrapper p>label { font-weight: 400; font-size: 0.9rem;}#siteseo-toc-toggle~span { cursor: pointer;}#siteseo-toc-toggle:checked~.siteseo-toc-hide,p:has(#siteseo-toc-toggle:checked) ~ '.esc_html($heading_type).' { display: none;}#siteseo-toc-toggle:not(:checked) ~ .siteseo-toc-hide{ display: inline;}#siteseo-toc-toggle:not(:checked) ~ .siteseo-toc-show { display: none;}</style> <div class="siteseo-toc-wrapper"> <p>'.(!empty($options['toc_label']) ? esc_html($options['toc_label']) : esc_html__('Table of Content', 'siteseo')).' <label for="siteseo-toc-toggle"> <input type="checkbox" style="display:none;" id="siteseo-toc-toggle" name="siteseo-toc-toggle"/> [<span class="siteseo-toc-hide">hide</span><span class="siteseo-toc-show">show</span>]</label></p> <'.esc_html($heading_type).'>'; foreach($headings as $heading){ $title = trim(wp_strip_all_tags($heading->nodeValue)); $id = $heading->getAttribute('id'); $current_h = (int) substr($heading->tagName, 1); if(empty($id)){ $id = '#'.self::title_to_id($title); }else{ $id = '#'.$id; } if($current_h > $last_h){ $html .= '<'.esc_html($heading_type).'>'; $open_ul++; }else{ while($current_h <= $open_ul){ $html .= '</'.esc_html($heading_type).'>'; $open_ul--; } } $html .= '<li><a href="'.esc_attr($id).'">'.esc_html($title).'</a></li>'; $last_h = $current_h; } $html .= '</'.esc_html($heading_type).'></div>'; $siteseo_toc_run = true; } return $html; } // Converts heading text content to ID to be used as link static function title_to_id($title){ $id = trim(wp_strip_all_tags($title)); $id = remove_accents($title); $id = sanitize_title_with_dashes($id); $id = urlencode($id); return $id; } static function add_ids_to_headings($content){ if(empty($content)){ return $content; } // If the page does not have the shortcode then we don't need to update the id's in the heading. if(!has_shortcode($content, 'siteseo_toc')){ return $content; } $dom = new DOMDocument(); $internalErrors = libxml_use_internal_errors(true); $dom->preserveWhiteSpace = false; $html = ''; if($dom->loadHTML('<?xml encoding="utf-8" ?>' . $content)){ $xpath = new DOMXPath($dom); $headings = $xpath->query('//h1|//h2|//h3|//h4|//h5|//h6'); if(empty($headings)){ return; } foreach($headings as $heading){ $title = trim(wp_strip_all_tags($heading->nodeValue)); $id = $heading->getAttribute('id'); if(!empty($id)){ continue; } if(empty($title)){ continue; } $id = self::title_to_id($title); $heading->setAttribute('id', $id); } $content = $dom->saveHTML($dom->documentElement); } return $content; } } main/titlesmetas.php 0000644 00000072711 15104342737 0010555 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class TitlesMetas{ static function advanced_metas($robots){ global $siteseo, $post; $disable_noindex = !empty($siteseo->advanced_settings['appearance_adminbar_noindex']) ?? ''; if(empty($siteseo->setting_enabled['toggle-titles']) || !empty($disable_noindex)){ return $robots; } $settings = $siteseo->titles_settings; //all post types and taxonomies $post_types = siteseo_post_types(); $taxonomies = get_taxonomies(array('public' => true), 'objects'); $post_id = isset($post) && is_object($post) ? $post->ID : 0; $index_extras = [ 'max-snippet' => '-1', 'max-image-preview' => 'large', 'max-video-preview' => '-1' ]; $robots = [ 'noindex' => !empty($settings['titles_noindex']), 'nofollow' => !empty($settings['titles_nofollow']), 'nosnippet' => !empty($settings['titles_nosnippet']), 'noarchive' => !empty($settings['titles_noarchive']), 'noimageindex' => !empty($settings['titles_noimageindex']) ]; foreach($taxonomies as $taxonomy){ // taxonomies $term_id = 0; if(is_tax() || is_category() || is_tag()){ $queried_object = get_queried_object(); $term_id = $queried_object->term_id ?? 0; if($term_id){ $robots['noindex'] = !empty(get_term_meta($term_id, '_siteseo_robots_index', true)) || $robots['noindex']; $robots['nofollow'] = !empty(get_term_meta($term_id, '_siteseo_robots_follow', true)) || $robots['nofollow']; $robots['nosnippet'] = !empty(get_term_meta($term_id, '_siteseo_robots_snippet', true)) || $robots['nosnippet']; $robots['noarchive'] = !empty(get_term_meta($term_id, '_siteseo_robots_archive', true)) || $robots['noarchive']; $robots['noimageindex'] = !empty(get_term_meta($term_id, '_siteseo_robots_imageindex', true)) || $robots['noimageindex']; } if(!empty($settings['titles_tax_titles'][$taxonomy->name]['noindex'])){ if(isset($robots['index'])){ unset($robots['index']); } $robots['noindex'] = true; } if(!empty($settings['titles_tax_titles'][$taxonomy->name]['nofollow'])){ if(isset($robots['follow'])){ unset($robots['follow']); } $robots['nofollow'] = true; } if(!$robots['noindex']){ $robots['index'] = true; $robots = array_merge($robots, $index_extras); } if(!$robots['nofollow']){ $robots['follow'] = true; } return array_filter($robots); } } // single post types foreach($post_types as $post_type){ if($post_type->has_archive && is_post_type_archive($post_type->name)){ if(function_exists('is_shop') && is_shop()){ $post_id = wc_get_page_id('shop'); } if($post_id){ $robots['noindex'] = !empty(get_post_meta($post_id, '_siteseo_robots_index', true)) || $robots['noindex']; $robots['nofollow'] = !empty(get_post_meta($post_id, '_siteseo_robots_follow', true)) || $robots['nofollow']; $robots['nosnippet'] = !empty(get_post_meta($post_id, '_siteseo_robots_snippet', true)) || $robots['nosnippet']; $robots['noarchive'] = !empty(get_post_meta($post_id, '_siteseo_robots_archive', true)) || $robots['noarchive']; $robots['noimageindex'] = !empty(get_post_meta($post_id, '_siteseo_robots_imageindex', true)) || $robots['noimageindex']; } if(!empty($settings['titles_archive_titles'][$post_type->name]['archive_noindex'])){ if(isset($robots['index'])){ unset($robots['index']); } $robots['noindex'] = true; } if(!empty($settings['titles_archive_titles'][$post_type->name]['archive_nofollow'])){ if(isset($robots['follow'])){ unset($robots['follow']); } $robots['nofollow'] = true; } if(!$robots['noindex']){ $robots['index'] = true; $robots = array_merge($robots, $index_extras); } if(!$robots['nofollow']){ $robots['follow'] = true; } return array_filter($robots); } if(is_singular($post_type->name)){ if($post_id){ $robots['noindex'] = !empty(get_post_meta($post_id, '_siteseo_robots_index', true)) || $robots['noindex']; $robots['nofollow'] = !empty(get_post_meta($post_id, '_siteseo_robots_follow', true)) || $robots['nofollow']; $robots['nosnippet'] = !empty(get_post_meta($post_id, '_siteseo_robots_snippet', true)) || $robots['nosnippet']; $robots['noarchive'] = !empty(get_post_meta($post_id, '_siteseo_robots_archive', true)) || $robots['noarchive']; $robots['noimageindex'] = !empty(get_post_meta($post_id, '_siteseo_robots_imageindex', true)) || $robots['noimageindex']; } if(!empty($settings['titles_single_titles'][$post_type->name]['noindex'])){ if(isset($robots['index'])){ unset($robots['index']); } $robots['noindex'] = true; } if(!empty($settings['titles_single_titles'][$post_type->name]['nofollow'])){ if(isset($robots['follow'])){ unset($robots['follow']); } $robots['nofollow'] = true; } if(!$robots['noindex']){ $robots['index'] = true; $robots = array_merge($robots, $index_extras); } if(!$robots['nofollow']){ $robots['follow'] = true; } return array_filter($robots); } } //archive pages if(is_author()){ $robots['noindex'] = !empty($settings['titles_archives_author_noindex']); if(!$robots['noindex']){ $robots['index'] = true; $robots = array_merge($robots, $index_extras); } } if(is_date()){ $robots['noindex'] = !empty($settings['titles_archives_date_noindex']); if(!$robots['noindex']){ $robots['index'] = true; $robots = array_merge($robots, $index_extras); } } if(is_search()){ $robots['noindex'] = !empty($settings['titles_archives_search_title_noindex']); if(!$robots['noindex']){ $robots['index'] = true; $robots = array_merge($robots, $index_extras); } } // default home page if(is_front_page() && is_home()){ $robots = [ 'index' => true, 'follow' => true ]; if(!empty($settings['titles_noindex'])){ $robots['noindex'] = true; unset($robots['index']); } if(!empty($settings['titles_nofollow'])){ $robots['nofollow'] = true; unset($robots['follow']); } if(!empty($settings['titles_nosnippet'])){ $robots['nosnippet'] = true; } if(!empty($settings['titles_noarchive'])){ $robots['noarchive'] = true; } if(!empty($settings['titles_noimageindex'])){ $robots['noimageindex'] = true; } $robots = array_merge($robots, $index_extras); } // static set posts page if(is_home() && !is_front_page()){ $blog_page_id = get_option('page_for_posts'); $robots = [ 'index' => true, 'follow' => true ]; if($blog_page_id){ // Check blog page specific meta settings $robots['noindex'] = !empty(get_post_meta($blog_page_id, '_siteseo_robots_index', true)); $robots['nofollow'] = !empty(get_post_meta($blog_page_id, '_siteseo_robots_follow', true)); $robots['nosnippet'] = !empty(get_post_meta($blog_page_id, '_siteseo_robots_snippet', true)); $robots['noarchive'] = !empty(get_post_meta($blog_page_id, '_siteseo_robots_archive', true)); $robots['noimageindex'] = !empty(get_post_meta($blog_page_id, '_siteseo_robots_imageindex', true)); } // Apply global settings as fallback if(!empty($settings['titles_noindex'])){ $robots['noindex'] = true; } if(!empty($settings['titles_nofollow'])){ $robots['nofollow'] = true; } if(!empty($settings['titles_nosnippet'])){ $robots['nosnippet'] = true; } if(!empty($settings['titles_noarchive'])){ $robots['noarchive'] = true; } if(!empty($settings['titles_noimageindex'])){ $robots['noimageindex'] = true; } // Clean up conflicting directives if($robots['noindex']){ unset($robots['index']); } if($robots['nofollow']){ unset($robots['follow']); } if(!$robots['noindex']){ $robots = array_merge($robots, $index_extras); } } return array_filter($robots); } static function add_nositelinkssearchbox(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-titles'])){ return; } if(!empty($siteseo->titles_settings['titles_nositelinkssearchbox'])){ echo '<meta name="google" content="nositelinkssearchbox" >'; } } static function add_canonical_url(){ $post_types = siteseo_post_types(); foreach($post_types as $post_type){ if($post_type->has_archive && is_post_type_archive($post_type->name)){ $post_id = get_the_ID(); $archive_url = get_post_type_archive_link($post_type->name); $canonical_meta = get_post_meta($post_id, '_siteseo_robots_canonical', true); $canonical = !empty($canonical_meta) ? $canonical_meta : $archive_url; if($archive_url){ echo '<link rel="canonical" href="'.esc_url($archive_url).'" />' . "\n"; } } if(is_singular($post_type->name)){ $post_id = get_the_ID(); $canonical_meta = get_post_meta($post_id, '_siteseo_robots_canonical', true); $canonical = !empty($canonical_meta) ? $canonical_meta : urldecode(get_permalink($post_id)); if($canonical){ echo '<link rel="canonical" href="'.esc_url($canonical).'" />' . "\n"; } } } //taxonomies $taxonomies = get_taxonomies(array('public' => true), 'objects'); if(is_tag() || is_category() || is_tax()){ $term = get_queried_object(); if($term && isset($term->term_id, $term->taxonomy)){ $term_id = $term->term_id; $taxonomy_name = $term->taxonomy; $canonical_meta = get_term_meta($term_id, '_siteseo_robots_canonical', true); $canonical = !empty($canonical_meta) ? $canonical_meta : urldecode(get_term_link($term_id, $taxonomy_name)); if($canonical){ echo '<link rel="canonical" href="'.esc_url($canonical).'" />' . "\n"; } } } // default home page if(is_front_page() && is_home()){ $canonical = trailingslashit(home_url()); echo '<link rel="canonical" href="'.esc_url($canonical).'" />' . "\n"; } // if static posts set if(is_home() && !is_front_page()){ $blog_page_id = get_option('page_for_posts'); if($blog_page_id){ $canonical_meta = get_post_meta($blog_page_id, '_siteseo_robots_canonical', true); $canonical = !empty($canonical_meta) ? $canonical_meta : urldecode(get_permalink($blog_page_id)); if($canonical){ echo '<link rel="canonical" href="'.esc_url($canonical).'" />' . "\n"; } } else{ $canonical = trailingslashit(home_url()); echo '<link rel="canonical" href="'.esc_url($canonical).'" />' . "\n"; } } } static function replace_variables($content, $in_editor = false){ global $post, $siteseo, $wp_query, $term; // Site info $site_title = get_bloginfo('name'); $site_tagline = get_bloginfo('description'); $site_sep = $siteseo->titles_settings['titles_sep']; $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $page = get_query_var('page') ? get_query_var('page') : 1; // Date info $current_time = current_time('timestamp'); $archive_date = get_the_date('d'); $archive_month = get_the_date('M'); $archive_month_name = get_the_date('F'); $archive_year = get_the_date('Y'); // Author $author_id = isset($post->post_author) ? $post->post_author : get_current_user_id(); $author_first_name = get_the_author_meta('first_name', $author_id); $author_last_name = get_the_author_meta('last_name', $author_id); $author_website = get_the_author_meta('url', $author_id); $author_nickname = get_the_author_meta('nickname', $author_id); $author_bio = get_the_author_meta('description', $author_id); // WooCommerce $wc_variables = []; if(function_exists('wc_get_product') && is_singular('product')){ $product = wc_get_product($post->ID); if($product){ $wc_variables = array( '%%wc_single_cat%%' => wp_strip_all_tags(wc_get_product_category_list($post->ID)), '%%wc_single_tag%%' => wp_strip_all_tags(wc_get_product_tag_list($post->ID)), '%%wc_single_short_desc%%' => $product->get_short_description(), '%%wc_single_price%%' => $product->get_price(), '%%wc_single_price_exe_tax%%' => wc_get_price_excluding_tax($product), '%%wc_sku%%' => $product->get_sku() ); } } $replacements = array( '%%sep%%' => $site_sep, '%%sitetitle%%' => $site_title, '%%tagline%%' => $site_tagline, '%%post_title%%' => (is_singular() || $in_editor === TRUE) ? get_the_title() : (is_home() ? get_the_title(get_option('page_for_posts')) : ''), '%%post_excerpt%%' => (is_singular() || $in_editor === TRUE) ? get_the_excerpt() : '', '%%post_content%%' => (is_singular() || $in_editor === TRUE) ? wp_strip_all_tags(get_the_content()) : '', '%%post_thumbnail_url%%' => get_the_post_thumbnail_url($post), '%%post_url%%' => urldecode(get_permalink()), '%%post_date%%' => get_the_date(), '%%post_modified_date%%' => get_the_modified_date(), '%%post_author%%' => get_the_author(), '%%post_category%%' => wp_strip_all_tags(get_the_category_list(', ')), '%%post_tag%%' => wp_strip_all_tags(get_the_tag_list('', ', ', '')), '%%_category_title%%' => single_cat_title('', false), '%%_category_description%%' => category_description(), '%%tag_title%%' => single_tag_title('', false), '%%tag_description%%' => tag_description(), '%%term_title%%' => single_term_title('', false), '%%term_description%%' => term_description(), '%%search_keywords%%' => get_search_query(), '%%current_pagination%%' => $paged, '%%page%%' => $page, '%%cpt_plural%%' => post_type_archive_title('', false), '%%archive_title%%' => get_the_archive_title(), '%%archive_date%%' => $archive_date, '%%archive_date_day%%' => $archive_date, '%%archive_date_month%%' => $archive_month, '%%archive_date_month_name%%' => $archive_month_name, '%%archive_date_year%%' => $archive_year, '%%currentday%%' => date_i18n('j', $current_time), '%%currentmonth%%' => date_i18n('F', $current_time), '%%currentmonth_short%%' => date_i18n('M', $current_time), '%%currentmonth_num%%' => date_i18n('n', $current_time), '%%currentyear%%' => date_i18n('Y', $current_time), '%%currentdate%%' => date_i18n(get_option('date_format'), $current_time), '%%currenttime%%' => date_i18n(get_option('time_format'), $current_time), '%%author_first_name%%' => $author_first_name, '%%author_last_name%%' => $author_last_name, '%%author_website%%' => $author_website, '%%author_nickname%%' => $author_nickname, '%%author_bio%%' => $author_bio, ); //WooCommerces if(!empty($wc_variables)){ $replacements = array_merge($replacements, $wc_variables); } if(preg_match_all('/%%_cf_(.*?)%%/', $content, $matches)){ foreach ($matches[1] as $custom_field) { $meta_value = get_post_meta($post->ID, $custom_field, true); $replacements["%%_cf_{$custom_field}%%"] = $meta_value; } } if(preg_match_all('/%%_ct_(.*?)%%/', $content, $matches)){ foreach($matches[1] as $taxonomy){ $terms = get_the_terms($post->ID, $taxonomy); $term_names = is_array($terms) ? wp_list_pluck($terms, 'name') : []; $replacements["%%_ct_{$taxonomy}%%"] = implode(', ', $term_names); } } if(preg_match_all('/%%_ucf_(.*?)%%/', $content, $matches)){ foreach($matches[1] as $user_meta){ $meta_value = get_user_meta($author_id, $user_meta, true); $replacements["%%_ucf_{$user_meta}%%"] = $meta_value; } } $target_keywords = isset($siteseo->keywords_settings['tempory_set']) ? $siteseo->keywords_settings['tempory_set'] : ''; $replacements['%%target_keyword%%'] = $target_keywords; $replacements = array_map(function($value){ if(is_array($value) || is_object($value)){ return ''; } return is_null($value) ? '' : wp_strip_all_tags($value); }, $replacements); return str_replace( array_keys($replacements), array_values($replacements), $content ); } static function modify_site_title($title, $sep = ''){ global $siteseo, $post; // Check enabled if(empty($siteseo->setting_enabled['toggle-titles'])){ return $title; } $settings = $siteseo->titles_settings; // post types and taxonomies $post_types = siteseo_post_types(); $taxonomies = get_taxonomies(array('public' => true), 'objects'); // Check set by meta $post_id = isset($post) && is_object($post) ? $post->ID : ''; $post_meta_title = !empty(get_post_meta($post_id, '_siteseo_titles_title', true)) ? get_post_meta($post_id, '_siteseo_titles_title', true) : ''; // default home page if(is_front_page() && is_home()){ if(!empty($settings['titles_home_site_title'])){ $new_title = $settings['titles_home_site_title']; } if(!empty($new_title)){ $new_title = esc_attr(self::replace_variables($new_title)); if(!empty($sep)){ $new_title .= " $sep " . get_bloginfo('name'); } return $new_title; } } // static posts pages if(is_home() && !is_front_page()){ $blog_page_id = get_option('page_for_posts'); if($blog_page_id){ $blog_meta_title = get_post_meta($blog_page_id, '_siteseo_titles_title', true); $default_title = !empty($settings['titles_single_titles']['page']['title']) ? $settings['titles_single_titles']['page']['title'] : ''; $new_title = !empty($blog_meta_title) ? $blog_meta_title : $default_title; if(!empty($new_title)){ $new_title = esc_attr(self::replace_variables($new_title)); if(!empty($sep)){ $new_title .= " $sep " . get_bloginfo('name'); } return $new_title; } } } // single post types foreach($post_types as $post_type){ if($post_type->has_archive && is_post_type_archive($post_type->name)){ $post_meta_title = ''; if(function_exists('is_shop') && is_shop()){ $shop_page_id = wc_get_page_id('shop'); $post_meta_title = get_post_meta($shop_page_id, '_siteseo_titles_title', true); } $default_title = isset($settings['titles_archive_titles'][$post_type->name]['archive_title']) ? $settings['titles_archive_titles'][$post_type->name]['archive_title'] : ''; $new_title = !empty($post_meta_title) ? $post_meta_title : $default_title; if(!empty($new_title)){ $new_title = esc_attr(self::replace_variables($new_title)); if(!empty($sep)){ $new_title .= " $sep " . get_bloginfo('name'); } return $new_title; } } if(is_singular($post_type->name)){ $default_title = isset($settings['titles_single_titles'][$post_type->name]['title']) ? $settings['titles_single_titles'][$post_type->name]['title'] : ''; $new_title = !empty($post_meta_title) ? $post_meta_title : $default_title; if(!empty($new_title)){ $new_title = esc_attr(self::replace_variables($new_title)); if(!empty($sep)){ $new_title .= " $sep " . get_bloginfo('name'); } return $new_title; } } } //taxonomies foreach($taxonomies as $taxonomy){ if(is_category()){ $term = get_queried_object(); $term_id = $term->term_id; $term_meta_title = get_term_meta($term_id, '_siteseo_titles_title', true); $default_title = isset($settings['titles_tax_titles']['category']['title']) ? $settings['titles_tax_titles']['category']['title'] : ''; $disabled = !empty($settings['titles_tax_titles']['category']['disabled']); $new_title = !empty($term_meta_title) ? $term_meta_title : $default_title; if(!empty($new_title) && !$disabled){ $new_title = esc_attr(self::replace_variables($new_title)); if(!empty($sep)){ $new_title .= " $sep " . get_bloginfo('name'); } return $new_title; } } elseif(is_tag()) { $term = get_queried_object(); $term_id = $term->term_id; $term_meta_title = get_term_meta($term_id, '_siteseo_titles_title', true); $default_title = isset($settings['titles_tax_titles']['post_tag']['title']) ? $settings['titles_tax_titles']['post_tag']['title'] : ''; $disabled = !empty($settings['titles_tax_titles']['post_tag']['disabled']); $new_title = !empty($term_meta_title) ? $term_meta_title : $default_title; if(!empty($new_title) && !$disabled){ $new_title = esc_attr(self::replace_variables($new_title)); if(!empty($sep)){ $new_title .= " $sep " . get_bloginfo('name'); } return $new_title; } } elseif(is_tax($taxonomy->name)) { $term = get_queried_object(); $term_id = $term->term_id; $term_meta_title = get_term_meta($term_id, '_siteseo_titles_title', true); $default_title = isset($settings['titles_tax_titles'][$taxonomy->name]['title']) ? $settings['titles_tax_titles'][$taxonomy->name]['title'] : ''; $disabled = !empty($settings['titles_tax_titles'][$taxonomy->name]['disabled']); $new_title = !empty($term_meta_title) ? $term_meta_title : $default_title; if(!empty($new_title) && !$disabled){ $new_title = esc_attr(self::replace_variables($new_title)); if(!empty($sep)){ $new_title .= " $sep " . get_bloginfo('name'); } return $new_title; } } } // author archive if(is_author() && !empty($settings['titles_archives_author_title']) && empty($settings['titles_archives_author_disable'])) { $new_title = esc_attr(self::replace_variables($settings['titles_archives_author_title'])); if(!empty($sep)){ $new_title .= " $sep " . get_bloginfo('name'); } return $new_title; } //Date archive if(is_date() && !empty($settings['titles_archives_date_title']) && empty($settings['titles_archives_date_disable'])){ $new_title = esc_attr(self::replace_variables($settings['titles_archives_date_title'])); if(!empty($sep)){ $new_title .= " $sep " . get_bloginfo('name'); } return $new_title; } // Search archive if(is_search() && !empty($settings['titles_archives_search_title'])){ $new_title = esc_attr(self::replace_variables($settings['titles_archives_search_title'])); if(!empty($sep)){ $new_title .= " $sep " . get_bloginfo('name'); } return $new_title; } // 404 archive if(is_404() && !empty($settings['titles_archives_404_title'])){ $new_title = esc_attr(self::replace_variables($settings['titles_archives_404_title'])); if(!empty($sep)){ $new_title .= " $sep " . get_bloginfo('name'); } return $new_title; } return $title; } static function add_meta_description(){ global $siteseo, $post; if(empty($siteseo->setting_enabled['toggle-titles'])){ return; } $settings = $siteseo->titles_settings; // Get all registered post types $post_types = siteseo_post_types(); $taxonomies = get_taxonomies(array('public' => true), 'objects'); $post_id = isset($post) && is_object($post) ? $post->ID : ''; // default home page if(is_front_page() && is_home()){ if(!empty($settings['titles_home_site_desc'])){ $processed_desc = self::replace_variables($settings['titles_home_site_desc']); echo '<meta name="description" content="' . esc_attr(self::truncate_desc($processed_desc)) . '">'; } else{ $description = get_bloginfo('description'); if(!empty($description)){ echo '<meta name="description" content="' . esc_attr($description) . '">'; } } } // if set static posts page if(is_home() && !is_front_page()){ $blog_page_id = get_option('page_for_posts'); if($blog_page_id){ $meta_desc = get_post_meta($blog_page_id, '_siteseo_titles_desc', true); if(!empty($meta_desc)){ $processed_desc = esc_attr(self::replace_variables($meta_desc)); echo '<meta name="description" content="' . esc_attr(self::truncate_desc($processed_desc)) . '">'; } elseif(!empty($settings['titles_single_titles']['page']['description'])){ $processed_desc = self::replace_variables($settings['titles_single_titles']['page']['description']); echo '<meta name="description" content="' . esc_attr(self::truncate_desc($processed_desc)) . '">'; } else{ $description = get_bloginfo('description'); if(!empty($description)){ echo '<meta name="description" content="' . esc_attr(self::truncate_desc($description)) . '">'; } } } } // single post types foreach($post_types as $post_type){ if($post_type->has_archive && is_post_type_archive($post_type->name)){ $archive_desc = ''; if(is_post_type_archive()){ $obj = get_queried_object(); if(!empty($obj) && isset($obj->name)){ $archive_desc = !empty($obj->description) ? $obj->description : ''; } } $meta_desc = ''; if(function_exists('is_shop') && is_shop()){ $shop_page_id = wc_get_page_id('shop'); $meta_desc = get_post_meta($shop_page_id, '_siteseo_titles_desc', true); } $description = !empty($settings['titles_archive_titles'][$post_type->name]['archive_desc']) ? $settings['titles_archive_titles'][$post_type->name]['archive_desc'] : $archive_desc; $description = !empty($meta_desc) ? $meta_desc : $description; if(!empty($description)){ $description = self::replace_variables($description); echo '<meta name="description" content="' . esc_attr(self::truncate_desc($description)) . '">'; } } if(is_singular($post_type->name)){ $meta_desc = get_post_meta($post_id, '_siteseo_titles_desc', true); $default_desc = isset($settings['titles_single_titles'][$post_type->name]['description']) ? $settings['titles_single_titles'][$post_type->name]['description'] : ''; $description = !empty($meta_desc) ? $meta_desc : $default_desc; if(!empty($description)){ $description = self::replace_variables($description); echo '<meta name="description" content="' . esc_attr(self::truncate_desc($description)) . '">'; } } } if(is_category() || is_tag() || is_tax()){ $term = get_queried_object(); if($term){ $term_id = $term->term_id; $term_meta_desc = get_term_meta($term_id, '_siteseo_titles_desc', true); $default_desc = ''; $taxonomy_name = ''; if(is_category()){ $default_desc = isset($settings['titles_tax_titles']['category']['description']) ? $settings['titles_tax_titles']['category']['description'] : ''; $taxonomy_name = 'category'; } elseif(is_tag()){ $default_desc = isset($settings['titles_tax_titles']['post_tag']['description']) ? $settings['titles_tax_titles']['post_tag']['description'] : ''; $taxonomy_name = 'post_tag'; } else{ $taxonomy_name = $term->taxonomy; $default_desc = isset($settings['titles_tax_titles'][$taxonomy_name]['description']) ? $settings['titles_tax_titles'][$taxonomy_name]['description'] : ''; } $disabled = isset($settings['titles_tax_titles'][$taxonomy_name]['disabled']); $description = !empty($term_meta_desc) ? $term_meta_desc : $default_desc; if(!empty($disabled)){ $description = self::replace_variables($description); echo '<meta name="description" content="' . esc_attr(self::truncate_desc($description)) . '">'; } } } // Author archive if(is_author() && !empty($settings['titles_archives_author_desc']) && empty($settings['titles_archives_author_disable'])){ $description = self::replace_variables($settings['titles_archives_author_desc']); echo '<meta name="description" content="'.esc_attr(self::truncate_desc($description)).'" >'; } // Date archive if(is_date() && !empty($settings['titles_archives_date_desc']) && empty($settings['titles_archives_date_disable'])){ $description = self::replace_variables($settings['titles_archives_date_desc']); echo '<meta name="description" content="'.esc_attr(self::truncate_desc($description)).'" >'; } // Search archive if(is_search() && !empty($settings['titles_archives_search_desc'])){ $description = self::replace_variables($settings['titles_archives_search_desc']); echo '<meta name="description" content="'.esc_attr(self::truncate_desc($description)).'" >'; } // 404 archives if(is_404() && !empty($settings['titles_archives_404_desc'])){ $description = self::replace_variables($settings['titles_archives_404_desc']); echo '<meta name="description" content="'.esc_attr(self::truncate_desc($description)).'" >'; } } static function add_rel_link_pages(){ global $siteseo, $paged; if(empty($siteseo->setting_enabled['toggle-titles'])){ return; } if(!empty($siteseo->titles_settings['titles_paged_rel'])){ if(get_previous_posts_link()){ echo '<link rel="prev" href="'.esc_url(get_pagenum_link($paged - 1)).'" />'; } if(get_next_posts_link()){ echo '<link rel="next" href="'.esc_url(get_pagenum_link($paged + 1)).'" />'; } } } static function date_time_publish(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-titles'])){ return; } if(!is_singular()){ return; } $current_post_type = get_post_type(); $type_settings = isset($siteseo->titles_settings['titles_single_titles'][$current_post_type]) ? $siteseo->titles_settings['titles_single_titles'][$current_post_type] : ''; // post type if(!empty($type_settings['date'])){ $published_time = get_the_date('c'); $modified_time = get_the_modified_date('c'); echo '<meta property="article:published_time" content="'. esc_attr($published_time) .'">'; echo '<meta property="article:modified_time" content="'. esc_attr($modified_time) .'">'; } // thumbnails if(!empty($type_settings['thumb_gcs'])){ if(get_the_post_thumbnail_url(get_the_ID())){ echo '<meta name="thumbnail" content="'.esc_url(get_the_post_thumbnail_url(get_the_ID())).'">'; } } } static function truncate_desc($desc){ if(mb_strlen($desc) > 160){ return mb_substr($desc, 0, 160 - 3) . '...'; } return $desc; } } main/generatesitemap.php 0000644 00000052125 15104342737 0011371 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class GenerateSitemap{ private static $paged = 1; static function settings(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-xml-sitemap'])){ return; } if(!empty($siteseo->sitemap_settings['xml_sitemap_html_enable'])){ add_shortcode('siteseo_html_sitemap', '\SiteSEO\GenerateSitemap::html_sitemap'); } if(!empty($siteseo->sitemap_settings['xml_sitemap_general_enable'])){ self::xml_sitemap(); } } static function xml_sitemap(){ add_filter('query_vars', function($vars){ $vars[] = 'sitemap_type'; $vars[] = 'paged'; $vars[] = 'sitemap-stylesheet'; return $vars; }); } static function add_rewrite_rules(){ global $siteseo; add_rewrite_rule('^sitemaps\.xsl$', 'index.php?sitemap-stylesheet=sitemap', 'top'); add_rewrite_rule('^sitemaps\.xml$', 'index.php?sitemap_type=general', 'top'); add_rewrite_rule('^author.xml$', 'index.php?sitemap_type=author', 'top'); add_rewrite_rule('^media-sitemap([0-9]+)?.xml$', 'index.php?sitemap_type=media&paged=$matches[1]', 'top'); add_rewrite_rule('^news([0-9]+)?.xml$', 'index.php?sitemap_type=news&paged=$matches[1]', 'top'); add_rewrite_rule('^video-sitemap([0-9]+)?.xml$', 'index.php?sitemap_type=video&paged=$matches[1]', 'top'); if(isset($siteseo->sitemap_settings['xml_sitemap_post_types_list'])){ foreach($siteseo->sitemap_settings['xml_sitemap_post_types_list'] as $post_type => $settings){ if(!empty($settings['include'])){ add_rewrite_rule('^'.$post_type.'-sitemap([0-9]+)?\.xml$', 'index.php?sitemap_type='.$post_type.'&paged=$matches[1]', 'top'); } } } if(isset($siteseo->sitemap_settings['xml_sitemap_taxonomies_list'])){ foreach($siteseo->sitemap_settings['xml_sitemap_taxonomies_list'] as $taxonomy => $settings){ if(!empty($settings['include'])){ add_rewrite_rule('^'.$taxonomy.'-sitemap([0-9]+)?\.xml$', 'index.php?sitemap_type='.$taxonomy.'&paged=$matches[1]', 'top'); } } } flush_rewrite_rules(); } static function handle_sitemap_requests(){ global $siteseo; $pro_settings = isset($siteseo->pro) ? $siteseo->pro : ''; self::maybe_redirect(); // Output the Sitemap style if(get_query_var('sitemap-stylesheet')){ self::sitemap_xsl(); exit; } if(get_query_var('paged')){ self::$paged = get_query_var('paged'); } $type = get_query_var('sitemap_type'); if(!empty($type)){ if($type === 'news' && !empty($pro_settings['google_news']) && !empty($pro_settings['toggle_state_google_news'])){ self::generate_google_news_sitemap(); exit; } if($type === 'video' && !empty($pro_settings['toggle_state_video_sitemap']) && !empty($pro_settings['enable_video_sitemap'])){ self::generate_video_sitemap(); exit; } // Custom post type if(isset($siteseo->sitemap_settings['xml_sitemap_post_types_list'][$type]) && !empty($siteseo->sitemap_settings['xml_sitemap_post_types_list'][$type]['include'])){ self::generateSitemap($type); exit; } //custom taxomies type if(isset($siteseo->sitemap_settings['xml_sitemap_taxonomies_list'][$type]) && !empty($siteseo->sitemap_settings['xml_sitemap_taxonomies_list'][$type]['include'])){ self::generate_term_sitemap($type); exit; } switch($type){ case 'general': self::generate_index_sitemap(); break; case 'post': self::generateSitemap('post'); break; case 'page': self::generateSitemap('page'); break; case 'category': self::generate_term_sitemap('category'); break; case 'post_tag': self::generate_term_sitemap('post_tag'); break; case 'author': self::generate_author_sitemap(); break; case 'media': self::generate_media_sitemap(); break; case 'news': self::generate_google_news_sitemap(); break; case 'video': self::generate_video_sitemap(); break; default: wp_die(esc_html__('Invalid sitemap type.', 'siteseo')); } } } static function generate_index_sitemap(){ global $siteseo; $pro_settings = isset($siteseo->pro) ? $siteseo->pro : ''; header('Content-Type: application/xml; charset=UTF-8'); if(get_option('permalink_structure')){ $xsl_url = home_url('/sitemaps.xsl'); } else { $xsl_url = home_url('/?sitemaps-stylesheet=sitemap'); } echo '<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="' . esc_url($xsl_url) . '" ?> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; if(isset($siteseo->sitemap_settings['xml_sitemap_post_types_list'])){ foreach($siteseo->sitemap_settings['xml_sitemap_post_types_list'] as $post_type => $settings){ $posts = get_posts( [ 'post_type' => $post_type, 'fields'=> 'ids', 'numberposts' => -1, 'post_status' => 'publish', 'has_password' => false, 'no_found_rows' => true, 'ignore_sticky_posts' => true, 'update_post_term_cache' => false, ] ); if(empty($posts)){ continue; } $total_pages = (int) ceil(count($posts) / 1000); if(!empty($settings['include']) && !empty($total_pages)){ for($page = 1; $page <= $total_pages; $page++){ echo '<sitemap> <loc>'.esc_url(home_url("/$post_type-sitemap$page.xml")).'</loc> </sitemap>'; } } } } // Taxonomies if(isset($siteseo->sitemap_settings['xml_sitemap_taxonomies_list'])){ foreach($siteseo->sitemap_settings['xml_sitemap_taxonomies_list'] as $taxonomy => $settings){ $tax_count = wp_count_terms([ 'hide_empty' => true, 'hierarchical' => false, 'update_term_meta_cache' => false, ]); if(empty($tax_count)){ return; } $total_pages = (int) ceil($tax_count/2000); if(!empty($settings['include'])){ for($page = 1; $page <= $total_pages; $page++){ echo '<sitemap> <loc>'.esc_url(home_url("/$taxonomy-sitemap$page.xml")).'</loc> </sitemap>'; } } } } // Author if(!empty($siteseo->sitemap_settings['xml_sitemap_author_enable'])){ echo '<sitemap> <loc>'.esc_url(home_url('/author.xml')).'</loc> </sitemap>'; } if(!empty($pro_settings['google_news']) && !empty($pro_settings['toggle_state_google_news'])){ echo '<sitemap> <loc>'.esc_url(home_url('/news.xml')).'</loc> </sitemap>'; } if(!empty($pro_settings['toggle_state_video_sitemap']) && !empty($pro_settings['enable_video_sitemap'])){ $video_posts = get_posts([ 'post_type' => 'any', 'fields' => 'ids', 'numberposts' => -1, 'meta_query' => [ [ 'key' => '_siteseo_video_disabled', 'compare' => 'NOT EXISTS' ] ] ]); if(!empty($video_posts)){ $total_pages = (int) ceil(count($video_posts) / 1000); for($page = 1; $page <= $total_pages; $page++){ echo '<sitemap> <loc>'.esc_url(home_url("/video-sitemap$page.xml")).'</loc> </sitemap>'; } } } echo '</sitemapindex>'; exit; } // post static function generate_post_sitemap(){ self::generateSitemap('post'); } // page static function generate_page_sitemap(){ self::generateSitemap('page'); } // category static function generate_category_sitemap(){ self::generate_term_sitemap('category'); } //post tag static function generate_post_tag_sitemap(){ self::generate_term_sitemap('post_tag'); } // taxonomy static function generate_taxonomy_sitemap(){ self::generate_term_sitemap('taxonomy'); } // google news pro feature static function generate_google_news_sitemap(){ if(class_exists('\SiteSEOPro\GoogleNews') && method_exists('\SiteSEOPro\GoogleNews', 'google_news_sitemap')){ \SiteSEOPro\GoogleNews::google_news_sitemap(); } } // video sitemap pro feature static function generate_video_sitemap(){ if(class_exists('\SiteSEOPro\VideoSitemap') && method_exists('\SiteSEOPro\VideoSitemap', 'render_sitemap')){ \SiteSEOPro\VideoSitemap::render_sitemap(); } } static function generateSitemap($post_type){ global $siteseo; header('Content-Type: application/xml; charset=utf-8'); $offset = (1000*(self::$paged - 1)); $posts = get_posts( [ 'post_type' => $post_type, 'post_status' => 'publish', 'numberposts' => 1000, 'offset' => $offset, 'order' => 'DESC', 'orderby' => 'modified', 'has_password' => false, 'no_found_rows' => true, 'meta_query' => [ [ 'key' => '_siteseo_robots_index', 'compare' => 'NOT EXISTS' ]] ]); if(get_option('permalink_structure')){ $xsl_url = home_url('/sitemaps.xsl'); } else { $xsl_url = home_url('/?sitemaps-stylesheet=sitemap'); } echo '<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="' . esc_url($xsl_url) . '" ?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" '.((!empty($siteseo->sitemap_settings['xml_sitemap_img_enable'])) ? 'xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"' : '').'>'; if($post_type == 'post' && self::$paged == 1){ echo "\t".'<url> <loc>'.esc_url(home_url()).'</loc> </url>'; } foreach($posts as $post){ $image_xml = ''; if(!empty($siteseo->sitemap_settings['xml_sitemap_img_enable'])){ $images = self::get_page_images($post); if(!empty($images)){ foreach($images as $image){ $image_xml .= "\t\t".'<image:image>'.PHP_EOL; $image_xml .= "\t\t\t".'<image:loc>'.esc_url($image).'</image:loc>'.PHP_EOL; $image_xml .= "\t\t".'</image:image>'.PHP_EOL; } } } echo "\t".'<url> <loc>'.esc_url(urldecode(get_permalink($post->ID))).'</loc> '.esc_xml($image_xml).' <lastmod>'.esc_html(get_the_modified_date('c', $post->ID)).'</lastmod> </url>'; } echo '</urlset>'; exit; } static function generate_term_sitemap($taxonomy){ header('Content-Type: application/xml; charset=utf-8'); $offset = (2000*(self::$paged - 1)); if(get_option('permalink_structure')){ $xsl_url = home_url('/sitemaps.xsl'); } else { $xsl_url = home_url('/?sitemaps-stylesheet=sitemap'); } echo '<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="' . esc_url($xsl_url) . '" ?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; $terms = get_terms([ 'taxonomy' => $taxonomy, 'hide_empty' => false, 'number' => 2000, 'offset' => $offset, 'hierarchical' => false, 'update_term_meta_cache' => false, 'meta_query' => [ [ 'key' => '_siteseo_robots_index', 'compare' => 'NOT EXISTS' ]] ]); foreach($terms as $term){ echo "\t". '<url> <loc>'.esc_url(urldecode(get_term_link($term))).'</loc> </url>'; } echo '</urlset>'; exit; } static function generate_author_sitemap(){ header('Content-Type: application/xml; charset=utf-8'); if(get_option('permalink_structure')){ $xsl_url = home_url('/sitemaps.xsl'); } else { $xsl_url = home_url('/?sitemaps-stylesheet=sitemap'); } echo '<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="' . esc_url($xsl_url) . '" ?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; // Fetch all authors $authors = get_users( ['capability' => ['publish_posts']] ); foreach($authors as $author){ echo "\t".'<url> <loc>'.esc_url(urldecode(get_author_posts_url($author->ID))).'</loc> </url>'; } echo '</urlset>'; exit; } static function html_sitemap($atts = []){ global $siteseo; $atts = shortcode_atts( [ 'cpt' => '', // Default ], $atts, 'siteseo_html_sitemap' ); $disable_date = !empty($siteseo->sitemap_settings['xml_sitemap_html_date']); $order_by = !empty($siteseo->sitemap_settings['xml_sitemap_html_orderby']) ? $siteseo->sitemap_settings['xml_sitemap_html_orderby'] : 'date'; $order = !empty($siteseo->sitemap_settings['xml_sitemap_html_order']) ? $siteseo->sitemap_settings['xml_sitemap_html_order'] : 'DESC'; $exclude_pages = array_map('trim', explode(',', $siteseo->sitemap_settings['xml_sitemap_html_exclude'] ?? '')); $output = ''; if($order !== 'ASC' && $order !== 'DESC'){ $order = 'DESC'; } $orderby_map = [ 'post_title' => 'title', 'modified_date' => 'modified', 'post_id' => 'ID', 'menu_order' => 'menu_order', 'date' => 'date', // Default ]; $orderby = $orderby_map[$order_by] ?? 'date'; $cpt_list = !empty($atts['cpt']) ? explode(',', $atts['cpt']) : []; if(!empty($siteseo->sitemap_settings['xml_sitemap_post_types_list'])){ foreach($siteseo->sitemap_settings['xml_sitemap_post_types_list'] as $post_type => $settings){ if(!empty($settings['include']) && (empty($cpt_list) || in_array($post_type, $cpt_list))){ $output .= '<h2>'.esc_html(ucfirst($post_type)).'</h2>'; $args = [ 'post_type' => $post_type, 'post_status' => 'publish', 'numberposts' => -1, 'orderby' => $orderby, 'order' => $order, ]; $posts = get_posts($args); if(!empty($posts)){ $output .= '<ul>'; foreach($posts as $post){ if(in_array($post->ID, $exclude_pages)){ continue; } $post_title = get_the_title($post->ID) ?: $post->ID; $output .= '<li><a href="'.esc_url(get_permalink($post->ID)).'">'.esc_html($post_title).'</a>'; if(!$disable_date){ $output .= '<span class="post-date"> - '.esc_html(get_the_modified_date('j F Y', $post->ID)).'</span>'; } $output .= '</li>'; } $output .= '</ul>'; }else{ $output .= ''; } } } } return $output; } static function sitemap_xsl(){ global $siteseo; $pro_settings = isset($siteseo->pro) ? $siteseo->pro : ''; $title = __('XML Sitemap', 'siteseo'); $generated_by = __('Generated by SiteSEO', 'siteseo'); $sitemap_index_txt = __('This XML Sitemap Index file contains', 'siteseo'); $sitemap_count_txt = __('This XML Sitemap contains', 'siteseo'); $last_modified_txt = __('Last Modified', 'siteseo'); $index_sitemap_url = home_url('/sitemaps.xml'); $video_sitemap_enabled = !empty($pro_settings['toggle_state_video_sitemap']) && !empty($pro_settings['enable_video_sitemap']) ? true : false; header('Content-Type: application/xml; charset=UTF-8'); echo '<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"'; if(!empty($pro_settings['toggle_state_google_news']) && !empty($pro_settings['google_news'])){ echo "\t" .'xmlns:news="https://www.google.com/schemas/sitemap-news/0.9/"'; } if(!empty($pro_settings['toggle_state_video_sitemap']) && !empty($pro_settings['enable_video_sitemap'])){ echo "\t" .'xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"'; } echo "\t" .'xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>'.esc_xml($title).'</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> * { box-sizing: border-box; } body{ font-family: "Roboto", sans-serif; background-color: #f0f2f5; margin: 0; padding: 0; overflow-x: hidden; } header{ background: linear-gradient(135deg, #022448, #034f84); padding: 20px; color: #ffffff; text-align: center; width: 100%; margin-bottom:15px; } header h1{ font-size: 32px; margin: 0; } header p{ margin: 5px 0 0; font-size: 16px; text-decoration: underline; } header .siteseo-index-link a{ color: #ffffff; text-decoration: none; } header .siteseo-index-link a:hover{ text-decoration: underline; } .siteseo-sitemap-container{ width: 60%; padding: 20px; background-color: #ffffff; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); border-radius: 8px; margin: 0 auto; overflow: auto; } .siteseo-sitemap-container a{ color:#007bff; text-decoration: none; } table{ width: 100%; border-collapse: collapse; } table thead tr{ background-color: #034f84; color: #ffffff; } table th, table td{ padding: 10px; text-align: left; border: 1px solid #ddd; } table tbody tr:nth-child(even){ background-color: #f9f9f9; } .siteseo-video-thumbnail{ max-width: 160px; max-height: 120px; border-radius: 4px; } .siteseo-video-info{ margin-left: 15px; } .siteseo-video-container{ display: flex; align-items: center; margin: 10px 0; } .siteseo-video-title{ font-weight: bold; margin-bottom: 5px; } .siteseo-video-description{ color: #555; font-size: 14px; margin-bottom: 5px; } .siteseo-video-meta{ font-size: 13px; color: #777; } .siteseo-video-url{ word-break: break-all; font-size: 13px; color: #007bff; } </style> </head> <body> <header> <h1>'.esc_xml($title).'</h1> <span>'.esc_xml($generated_by).'</span> <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) > 0"> <div class="siteseo-description" style="text-align:center;">'.esc_xml($sitemap_index_txt).' <xsl:value-of select="count(sitemap:sitemapindex/sitemap:sitemap)"/> sitemaps</div> </xsl:if> <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) < 1"> <div class="siteseo-description" style="text-align:center;">'.esc_xml($sitemap_count_txt).' <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/> URLs</div> </xsl:if> </header> <div class="siteseo-sitemap-container"> <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) < 1"> <a href="'.esc_url($index_sitemap_url).'">Index Sitemap</a> </xsl:if> <table> <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) > 0"> <thead> <tr><th>URL</th></tr> </thead> <tbody> <xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap"> <tr> <td><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc"/></a></td> </tr> </xsl:for-each> </tbody> </xsl:if> <xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) < 1">'; if($video_sitemap_enabled && class_exists('\SiteSEOPro\VideoSitemap') && method_exists('\SiteSEOPro\VideoSitemap', 'render_video_xsl')){ echo'<xsl:if test="sitemap:urlset/sitemap:url/video:video">' . \SiteSEOPro\VideoSitemap::render_video_xsl() . '</xsl:if> <xsl:if test="not(sitemap:urlset/sitemap:url/video:video)"> <thead> <tr> <th>URL</th> <th>'.esc_xml($last_modified_txt).'</th> </tr> </thead> <tbody> <xsl:for-each select="sitemap:urlset/sitemap:url"> <tr> <td><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc"/></a></td> <td><xsl:value-of select="sitemap:lastmod"/></td> </tr> </xsl:for-each> </tbody> </xsl:if>'; } else { echo'<xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) < 1"> <thead> <tr> <th>URL</th> <th>'.esc_xml($last_modified_txt).'</th> </tr> </thead> <tbody> <xsl:for-each select="sitemap:urlset/sitemap:url"> <tr> <td><a href="{sitemap:loc}"><xsl:value-of select="sitemap:loc"/></a></td> <td><xsl:value-of select="sitemap:lastmod"/></td> </tr> </xsl:for-each> </tbody> </xsl:if>'; } echo'</xsl:if> </table> </div> </body> </html> </xsl:template> </xsl:stylesheet>'; } static function get_page_images($post){ $images = []; $thumb = get_the_post_thumbnail_url($post->ID); if(!empty($thumb)){ $images[] = $thumb; } if(!class_exists('DOMDocument') || empty($post->post_content)){ return $images; } libxml_use_internal_errors(true); $dom = new \DOMDocument(); $dom->loadHTML('<?xml encoding="utf-8" ?>' . $post->post_content); $dom->preserveWhiteSpace = false; libxml_clear_errors(); $img_tags = $dom->getElementsByTagName('img'); if(empty($img_tags)){ return; } foreach($img_tags as $img_tag){ $url = $img_tag->getAttribute('src'); if(empty($url)){ continue; } $url = sanitize_url($url); // The Image has some different URL which means it does not belongs to our site. if(strpos($url, untrailingslashit(home_url())) === FALSE){ continue; } $images[] = $url; } return $images; } static function maybe_redirect(){ global $wp; if(empty($wp) || empty($wp->request)){ return; } $redirects = ['sitemap.xml', 'wp-sitemap.xml', 'sitemap_index.xml']; if(in_array($wp->request, $redirects)){ wp_safe_redirect(home_url('sitemaps.xml'), 301); die(); } } } main/settings/social.php 0000644 00000064505 15104342737 0011333 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO\Settings; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Social{ static function menu(){ global $siteseo; $social_toggle = isset($siteseo->setting_enabled['toggle-social']) ? $siteseo->setting_enabled['toggle-social'] : ''; $nonce = wp_create_nonce('siteseo_toggle_nonce'); $current_tab = isset($_GET['tab']) ? sanitize_key($_GET['tab']) : 'tab_knowledge_graph'; $social_subtabs = [ 'tab_knowledge_graph' => esc_html__('Knowledge Graph', 'siteseo'), 'tab_social_accounts' => esc_html__('Your social accounts', 'siteseo'), 'tab_facebook' => esc_html__('Facebook (Open Graph) ', 'siteseo'), 'tab_twitter' => esc_html__('X Card', 'siteseo') ]; echo '<div id="siteseo-root">'; Util::admin_header(); echo '<form method="post" id="siteseo-form" class="siteseo-option" name="siteseo-flush">'; wp_nonce_field('siteseo_social_settings'); Util::render_toggle('Social Networks - SiteSEO', 'social_toggle', $social_toggle, $nonce); echo '<div id="siteseo-tabs" class="wrap"> <div class="nav-tab-wrapper">'; foreach($social_subtabs as $tab_key => $tab_caption){ $active_class = ($current_tab === $tab_key) ? ' nav-tab-active' : ''; echo '<a id="' . esc_attr($tab_key) . '-tab" class="nav-tab' . esc_attr($active_class) . '" data-tab="' . esc_attr($tab_key) . '">' . esc_html($tab_caption) . '</a>'; } echo '</div> <div class="tab-content-wrapper"> <div class="siteseo-tab' .($current_tab == 'tab_knowledge_graph' ? ' active' : '').'" id="tab_knowledge_graph" style="display: none;">'; self::knowledge_graph(); echo '</div> <div class="siteseo-tab' .($current_tab == 'tab_social_accounts' ? ' active' : '').'" id="tab_social_accounts" style="display: none;">'; self::social_accouts(); echo '</div> <div class="siteseo-tab' .($current_tab == 'tab_twitter' ? ' active' : '').'" id="tab_twitter" style="display: none;">'; self::twitter(); echo '</div> <div class="siteseo-tab' .($current_tab == 'tab_facebook' ? ' active' : '').'" id="tab_facebook" style="display: none;">'; self::facebook(); echo '</div> </div>'; Util::submit_btn(); echo '</form></div>'; } static function knowledge_graph(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } $options = get_option('siteseo_social_option_name'); //load data $option_org_type = !empty($options['social_knowledge_type']) ? $options['social_knowledge_type'] : ''; $option_org_name = !empty($options['social_knowledge_name']) ? $options['social_knowledge_name'] : ''; $option_org_logo = !empty($options['social_knowledge_img']) ? $options['social_knowledge_img'] : ''; $option_org_number = !empty($options['social_knowledge_phone']) ? $options['social_knowledge_phone'] : ''; $option_org_contact_type = !empty($options['social_knowledge_contact_type']) ? $options['social_knowledge_contact_type'] : ''; $option_org_contact_option = !empty($options['social_knowledge_contact_option']) ? $options['social_knowledge_contact_option'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('Knowledge Graph','siteseo').'</h3> <p class="description">'.esc_html__('Set up Google Knowledge Graph.','siteseo').'</p> <table class="form-table"> <tbody> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Person or organization','siteseo').'</th> <td> <select name="siteseo_options[org_type]"> <option value="none" '.selected($option_org_type, 'none', false).'>'.esc_html__('None','siteseo').'</option> <option value="Person" '.selected($option_org_type, 'Person', false).'>'.esc_html__('Person','siteseo').'</option> <option value="Organization" '.selected($option_org_type, 'Organization', false).'>'.esc_html__('Organization','siteseo').'</option> </select> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Your name/organization','siteseo').'</th> <td> <input type="text" name="siteseo_options[org_name]" value="'.esc_attr($option_org_name).'" placeholder="'.esc_html__('eg.Miremont','siteseo').'"> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Your photo/organization logo','siteseo').'</th> <td> <input id="knowledge_org_logo_url" autocomplete="off" type="text" name="siteseo_options[org_logo]" value="'.esc_url($option_org_logo).'" placeholder="'.esc_html__('select your logo','siteseo').'"> <button id="knowledge_org_logo" class="btn btnSecondary">'.esc_html__('Upload an image','siteseo').'</button> <p class="description">'.esc_html__('JPG, PNG, WebP and GIF allowed.','siteseo').'</p><br /> <img style="width:300px;max-height:400px;" src="'.esc_url($option_org_logo).'" /> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Organizations phone number (only for Organizations)','siteseo').'</th> <td> <input type="text" name="siteseo_options[org_contact_number]" value="'.esc_attr($option_org_number).'" placeholder="'.esc_html__('eg: +33123456789 (internationlized version required)','siteseo').'"> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Contact type (only for Organizations)','siteseo').'</th> <td> <select name="siteseo_options[org_contact_type]"> <option value="Customer support" '.selected($option_org_contact_type, 'Customer support', false).'>'.esc_html__('Customer support','siteseo').'</option> <option value="Technical support" '.selected($option_org_contact_type, 'Technical support', false).'>'.esc_html__('Technical support','siteseo').'</option> <option value="Billing support" '.selected($option_org_contact_type, 'Billing support', false).'>'.esc_html__('Billing support','siteseo').'</option> <option value="Bill payment" '.selected($option_org_contact_type, 'Bill payment', false).'>'.esc_html__('Bill payment','siteseo').'</option> <option value="Sales payment" '.selected($option_org_contact_type, 'Sales payment', false).'>'.esc_html__('Sales payment','siteseo').'</option> <option value="Credit card support" '.selected($option_org_contact_type, 'Credit card support', false).'>'.esc_html__('Credit card support','siteseo').'</option> <option value="Emergency support" '.selected($option_org_contact_type, 'Emergency support', false).'>'.esc_html__('Emergency support','siteseo').'</option> <option value="Baggage tracking" '.selected($option_org_contact_type, 'Baggage tracking', false).'>'.esc_html__('Baggage tracking','siteseo').'</option> <option value="Roadside assistance" '.selected($option_org_contact_type, 'Roadside assistance', false).'>'.esc_html__('Roadside assistance','siteseo').'</option> <option value="Package tracking" '.selected($option_org_contact_type, 'Package tracking', false).'>'.esc_html__('Package tracking','siteseo').'</option> </select> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Contact option (only for Organizations)','siteseo').'</th> <td> <select name="siteseo_options[org_contact_option]"> <option value="None" '.selected($option_org_contact_option, 'None', false).'>'.esc_html__('None','siteseo').'</option> <option value="TollFree" '.selected($option_org_contact_option, 'TollFree', false).'>'.esc_html__('TollFree', 'siteseo').'</option> <option value="HearingImpairedSupported" '.selected($option_org_contact_option, 'HearingImpairedSupported', false).'>'.esc_html__('Hearing Impaired Supported','siteseo').'</option> </select> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[knowledge_graph_tab]" value="1" >'; } static function social_accouts(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->social_settings; $options = get_option('siteseo_social_option_name'); //load settings $facebook_acct = !empty($options['social_accounts_facebook']) ? $options['social_accounts_facebook'] : ''; $twitter_acct = !empty($options['social_accounts_twitter']) ? $options['social_accounts_twitter'] : ''; $instagram_acct = !empty($options['social_accounts_instagram']) ? $options['social_accounts_instagram'] : ''; $youtube_acct = !empty($options['social_accounts_youtube']) ? $options['social_accounts_youtube'] : ''; $pinterest_acct = !empty($options['social_accounts_pinterest']) ? $options['social_accounts_pinterest'] : ''; $additional_acct = !empty($options['social_accounts_additional']) ? implode("\n", $options['social_accounts_additional']) : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('Your social accouts', 'siteseo').'</h3> <table class="form-table"> <tbody> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Facebook', 'siteseo').'</th> <td> <input type="text" name="siteseo_options[facebook]" placeholder="'.esc_html__('eg: https://facebook.com/my-page-url','siteseo').'" value="'.esc_url($facebook_acct).'"> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('X Username', 'siteseo').'</th> <td> <input type="text" name="siteseo_options[twitter]" placeholder="'.esc_html__('eg : @my_twitter_account','siteseo').'" value="'.esc_attr($twitter_acct).'"> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Pinterest URL', 'siteseo').'</th> <td> <input type="text" name="siteseo_options[pinterest]" placeholder="'.esc_html__('eg : https://pinterest.com/my-page-url/','siteseo').'" value="'.esc_url($pinterest_acct).'"> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Instagram URL', 'siteseo').'</th> <td> <input type="text" name="siteseo_options[instagram]" placeholder="'.esc_html__('eg : https://www.instagram.com/my-page-url/','siteseo').'" value="'.esc_url($instagram_acct).'"> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('YouTube URL', 'siteseo').'</th> <td> <input type="text" name="siteseo_options[youtube]" placeholder="'.esc_html__('eg : https://www.youtube.com/my-channel-url/','siteseo').'" value="'.esc_url($youtube_acct).'"> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Additional Accounts', 'siteseo').'</th> <td> <textarea name="siteseo_options[additional]" placeholder="'.esc_html__('eg : https://somesite.com/my-channel-url/','siteseo').'">'.esc_textarea($additional_acct).'</textarea> <p class="description">'.esc_html__('Enter 1 URL per line.', 'siteseo').'</p> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[social_account_tab]" value="1">'; } static function twitter(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->social_settings; $options = get_option('siteseo_social_option_name'); //load data $option_enable_card = !empty($options['social_twitter_card']) ? $options['social_twitter_card'] : ''; $options_og_card = !empty($options['social_twitter_card_og']) ? $options['social_twitter_card_og'] : ''; $option_image_size = !empty($options['social_twitter_card_img_size']) ? $options['social_twitter_card_img_size'] : ''; $option_twitter_img = !empty($options['social_twitter_card_img']) ? $options['social_twitter_card_img'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('X Card','siteseo').'</h3> <p class="description">'.esc_html__('Manage your X card','siteseo').'</p> <div class="siteseo-notice"> <span class="dashicons dashicons-info"></span> <div> <p>'. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('We generate the %1$s og:image %2$s meta in the following order:', 'siteseo'), '<strong>', '</strong>')).'</p> <ol> <li>'.esc_html__('Custom OG Image from the SEO metabox', 'siteseo').'</li> <li>'.esc_html__('Post thumbnail / Product category thumbnail (Featured image)', 'siteseo').'</li> <li>'.esc_html__('First image of your post content', 'siteseo').'</li> <li>'.esc_html__('Global OG Image set in SEO > Social > Open Graph', 'siteseo').'</li> <li>'.esc_html__('Site icon from the Customizer', 'siteseo').'</li> </ol> </div> </div> <table class="form-table"> <tbody> <tr> <th scope="row" style="user:select-auto;">'.esc_html__('X Card','siteseo').'</th> <td>'.esc_html__('Manage your X Card','siteseo').'</td> </tr> <tr> <th scope="row" style="user:select-auto;">'.esc_html__('Enable X Card','siteseo').'</th> <td> <label for="enable_twitter_card"><input id="enable_twitter_card" type="checkbox" name="siteseo_options[enable_twitter_card]" '.(!empty($option_enable_card) ? 'checked="checked"' : 'value="1"') . '>'.esc_html__('Enable X card', 'siteseo') .'</label> </td> </tr> <tr> <th scope="row" style="user:select-auto;">'.esc_html__('Use OG if no X Cards','siteseo').'</th> <td> <label> <input id="enable_twitter_card" type="checkbox" name="siteseo_options[card_og]" '.(!empty($options_og_card) ? 'checked="checked"' : 'value="1"').'>'.esc_html__(' Use OG if no Twitter Cards', 'siteseo').' </label> </td> </tr> <tr> <th scope="row" style="user:select-auto;">'.esc_html__('Default X Image','siteseo').'</th> <td> <input type="text" id="twitter_logo_url" autocomplete="off" name="siteseo_options[twitter_img]" value="'.esc_url($option_twitter_img).'" placeholder="'.esc_html__('Choose your default thumbnail.','siteseo').'"> <button id="twitter_logo" class="btn btnSecondary">'.esc_html__('Upload a image','siteseo').'</button> <p class="description">'.esc_html__('Minimum size: 144x144px (300x157px with large card), recommended aspect ratio 1:1 (2:1 for large card), maximum file size 5MB.','siteseo').'</p> </td> </tr> <tr> <th scope="row" style="user:select-auto;">'.esc_html__('X Card Image Size','siteseo').'</th> <td> <select name="siteseo_options[image_size]"> <option value="Default" '.selected($option_image_size, 'Default', false).'>'.esc_html__('Default','siteseo').'</option> <option value="Large" '.selected($option_image_size, 'Large', false).'>'.esc_html__('Large','siteseo').'</option> </select> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[twitter_tab]" value="1">'; } static function facebook(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } // load seetings //$options = $siteseo->social_settings; $options = get_option('siteseo_social_option_name'); $option_fb_enable_og = !empty($options['social_facebook_og']) ? $options['social_facebook_og'] : ''; $option_fb_img = !empty($options['social_facebook_img']) ? $options['social_facebook_img'] : ''; $option_fb_defult_img = !empty($options['social_facebook_img_default']) ? $options['social_facebook_img_default'] : ''; $option_fb_ownership = !empty($options['social_facebook_link_ownership_id']) ? $options['social_facebook_link_ownership_id'] : ''; $option_fb_admin_id = !empty($options['social_facebook_admin_id']) ? $options['social_facebook_admin_id'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('Facebook (Open Graph)','siteseo').'</h3> <p class="description">'.esc_html__('Manage Open Graph data to enhance how your links appear on platforms like Facebook, Pinterest, LinkedIn, and WhatsApp when shared. Improve your click-through rate by including relevant details, such as an attention-grabbing image.','siteseo').'<p> <div class="siteseo-notice"> <span class="dashicons dashicons-info"></span> <div> <p> '. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('We generate the %1$s OG:image %2$s meta in the following sequence:', 'siteseo'), '<strong>', '</strong>')).'</p> <ol> <li>'.esc_html__('Custom OG image from the SEO metabox', 'siteseo').'</li> <li>'.esc_html__('Post thumbnail / Product category thumbnail (Featured image)', 'siteseo').'</li> <li>'.esc_html__('First image in your post content', 'siteseo').'</li> <li>'.esc_html__('Global OG:image set in SEO > Social > OG Card', 'siteseo').'</li> </ol> </div> </div> <table class="form-table"> <tbody> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Enable OG date','siteseo').'</th> <td> <label for="facebook_graph_enable"> <input id="facebook_graph_enable" type="checkbox" name="siteseo_options[enable_fb_og]" '.(!empty($option_fb_enable_og) ? 'checked="yes"' : 'value="1"').'>'. esc_html__('Enable OG data','siteseo') .' </label> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Default Image','siteseo').'</th> <td> <input id="facebook_org_image_url" autocomplete="off" type="text" name="siteseo_options[fb_image]" value="'.esc_url($option_fb_img).'" palceholder="'.esc_html__('Select your default thumbnail','siteseo').'"> <button id="facebook_upload_logo" class="btn btnSecondary">'.esc_html__('Upload a image','siteseo').'</button> <p class="description">'.esc_html__('Minimum size: 200x200px, ideal ratio 1.91:1, 8MB max. (e.g., 1640x856px or 3280x1712px for retina screens).','siteseo').'</p> <p class="description">'.esc_html__('If no default image is set, we will use your site icon defined in the Customizer.','siteseo').'</p> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Override Default Image','siteseo').'</th> <td> <div class="siteseo_wrap_label"> <label for="override_image_tag"> <input id="override_image_tag" type="checkbox" name="siteseo_options[fb_default_img]" '.(!empty($option_fb_defult_img) ? 'checked="yes"' : 'value="1"').' >'.esc_html__('Override all og:image tags with this default image, unless a custom og:image has been set in the SEO metabox.','siteseo').' </label> </div> <br /><div class="siteseo-notice is-warning"><p>'. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('Please define a default %1$s OG image %2$s using the field above.', 'siteseo'), '<strong>','</strong>')).'<p></div> </td> </tr> <tr> <th scope="row" style="user-select:auto">'.esc_html__('Link Ownership ID','siteseo').'</th> <td> <input type="text" placeholder="0123456789" name="siteseo_options[fb_owership_id]" value="'.esc_attr($option_fb_ownership).'"> <p class="description">'.esc_html__('Enter one or more Facebook Page IDs linked to a URL to enable link editing and instant article publishing.','siteseo').'</p> <div class="siteseo-styles pre"><pre>'.esc_html('<meta property="fb:pages" content="page ID"/>').'</pre></div> </td> </tr> <tr> <th scope="row" style="user-select:auto">'.esc_html__('Admin ID','siteseo').'</th> <td> <input type="text" placeholder="0123456789" name="siteseo_options[fb_admin_id]" value="'.esc_attr($option_fb_admin_id).'"> <p class="description">'.esc_html__('The ID (or a comma-separated list for properties that support multiple IDs) of an app, user of the app, or Page Graph API object.', 'siteseo').'</p> <div class="siteseo-styles pre"><pre>'.esc_html('<meta property="fb:admins" content="admins ID"/>').'</pre></div> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[facebook_tab]" value="1">'; } static function save_settings(){ global $siteseo; check_admin_referer('siteseo_social_settings'); if(!siteseo_user_can('manage_social') || !is_admin()){ return; } $options = []; if(empty($_POST['siteseo_options'])){ return; } if(isset($_POST['siteseo_options']['knowledge_graph_tab'])){ $options['social_knowledge_type'] = isset($_POST['siteseo_options']['org_type']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['org_type'])) : ''; $options['social_knowledge_name'] = isset($_POST['siteseo_options']['org_name']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['org_name'])) : ''; $options['social_knowledge_img'] = isset($_POST['siteseo_options']['org_logo']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['org_logo'])) : ''; $options['social_knowledge_phone'] = isset($_POST['siteseo_options']['org_contact_number']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['org_contact_number'])) : ''; $options['social_knowledge_contact_type'] = isset($_POST['siteseo_options']['org_contact_type']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['org_contact_type'])) : ''; $options['social_knowledge_contact_option'] = isset($_POST['siteseo_options']['org_contact_option']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['org_contact_option'])) : ''; } if(isset($_POST['siteseo_options']['social_account_tab'])){ $options['social_accounts_facebook'] = isset($_POST['siteseo_options']['facebook']) ? sanitize_url(wp_unslash($_POST['siteseo_options']['facebook'])) : ''; $options['social_accounts_twitter'] = isset($_POST['siteseo_options']['twitter']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['twitter'])) : ''; $options['social_accounts_instagram'] = isset($_POST['siteseo_options']['instagram']) ? sanitize_url(wp_unslash($_POST['siteseo_options']['instagram'])) : ''; $options['social_accounts_youtube'] = isset($_POST['siteseo_options']['youtube']) ? sanitize_url(wp_unslash($_POST['siteseo_options']['youtube'])) : ''; $options['social_accounts_pinterest'] = isset($_POST['siteseo_options']['pinterest']) ? sanitize_url(wp_unslash($_POST['siteseo_options']['pinterest'])) : ''; $options['social_accounts_additional'] = isset($_POST['siteseo_options']['additional']) ? explode("\n", sanitize_textarea_field(wp_unslash($_POST['siteseo_options']['additional']))) : ''; $options['social_accounts_additional'] = Util::clean_url($options['social_accounts_additional']); // We accept 1 url per line. } if(isset($_POST['siteseo_options']['facebook_tab'])){ $options['social_facebook_og'] = isset($_POST['siteseo_options']['enable_fb_og']); $options['social_facebook_img'] = isset($_POST['siteseo_options']['fb_image']) ? sanitize_url(wp_unslash($_POST['siteseo_options']['fb_image'])) : ''; $options['social_facebook_img_default'] = isset($_POST['siteseo_options']['fb_default_img']); $options['social_facebook_link_ownership_id'] = isset($_POST['siteseo_options']['fb_owership_id']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['fb_owership_id'])) : ''; $options['social_facebook_admin_id'] = isset($_POST['siteseo_options']['fb_admin_id']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['fb_admin_id'])) : ''; } if(isset($_POST['siteseo_options']['twitter_tab'])){ $options['social_twitter_card'] = isset($_POST['siteseo_options']['enable_twitter_card']); $options['social_twitter_card_og'] = isset($_POST['siteseo_options']['card_og']); $options['social_twitter_card_img'] = isset($_POST['siteseo_options']['twitter_img']) ? sanitize_url(wp_unslash($_POST['siteseo_options']['twitter_img'])) : ''; $options['social_twitter_card_img_size'] = isset($_POST['siteseo_options']['image_size']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['image_size'])) : ''; } update_option('siteseo_social_option_name' , $options); } } main/settings/util.php 0000644 00000006330 15104342737 0011026 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO\Settings; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Util{ static function clean_text($text){ return sanitize_text_field(wp_unslash($text)); } static function clean_url($url){ if(is_array($url)){ return map_deep(wp_unslash($url), 'sanitize_url'); } return sanitize_url(wp_unslash($url)); } static function render_toggle($title, $toggle_key, $toggle_state, $nonce, $label = false){ $is_active = $toggle_state ? 'active' : ''; $state_text = $toggle_state ? 'Disable' : 'Enable'; // for dashbord screen if(!empty($label)){ echo '<div class="siteseo-toggle-cnt"> <div class="siteseo-toggle-Sw '.esc_attr($is_active).'" id="siteseo-toggleSw-' . esc_attr($toggle_key) . '" data-nonce="'.esc_attr($nonce).'" data-toggle-key="'.esc_attr($toggle_key).'" data-action="siteseo_save_'.esc_attr($toggle_key).'"></div> <input type="hidden" name="siteseo_options['.esc_attr($toggle_key) . ']" id="'.esc_attr($toggle_key).'" value="'.esc_attr($toggle_state).'"> </div>'; }else{ echo '<div class="siteseo-toggle-cnt"> <span id="siteseo-tab-title"><strong>'.esc_html($title).'</strong></span> <div class="siteseo-toggle-Sw '.esc_attr($is_active).'" id="siteseo-toggleSw-'.esc_attr($toggle_key).'" data-nonce="' . esc_attr($nonce) . '" data-toggle-key="'.esc_attr($toggle_key).'" data-action="siteseo_save_'.esc_attr($toggle_key).'"></div> <span id="siteseo-arrow-icon" class="dashicons dashicons-arrow-left-alt siteseo-arrow-icon"></span> <p class="toggle_state_'.esc_attr($toggle_key).'">'.esc_html($state_text).'</p> <input type="hidden" name="siteseo_options['.esc_attr($toggle_key).']" id="'.esc_attr($toggle_key).'" value="'.esc_attr($toggle_state).'"> </div>'; } } static function admin_header(){ echo '<div class="siteseo-navbar"> <div class="logo"> <img alt="'.esc_html__('siteseo logo', 'siteseo').'" height="30" src="'. esc_url(SITESEO_ASSETS_URL).'/img/logo-24.svg'.'" width="40"/> <div class="breadcrumb"> <a href="#">'.esc_html__('Home', 'siteseo').'</a> <span>/</span> <a class="active" href="">'.esc_html(get_admin_page_title()).'</a> </div> </div> <div class="links"> <a target="_blank" href="https://siteseo.io/docs/">'.esc_html__('Docs', 'siteseo').'</a> <a target="_blank" class="support" href="https://softaculous.deskuss.com/open.php">'.esc_html__('Support', 'siteseo').'</a> </div> </div>'; } static function importable_plugins(){ return [ 'wordpress-seo/wp-seo.php' => 'Yoast SEO', 'all-in-one-seo-pack/all_in_one_seo_pack.php' => 'All In One SEO', 'autodescription/autodescription.php' => 'The SEO Framework', 'seo-by-rank-math/rank-math.php' => 'Rank Math', 'wp-seopress/seopress.php' => 'SEOPress', 'slim-seo/slim-seo.php' => 'Slim SEO', ]; } static function submit_btn($value = ''){ echo '<div class="siteseo-submit-button"><input type="submit" id="submit" name="submit" value="'.esc_attr($value ?: 'Save changes') . '" class="submit-button"></div>'; } static function extract_content($input){ if(preg_match('/content=["\']([^"\']+)["\']/', $input, $matches)){ return $matches[1]; } return $input; } } main/settings/tools.php 0000644 00000012603 15104342737 0011211 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO\Settings; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Tools{ static function menu(){ echo '<div id="siteseo-root">'; Util::admin_header(); $plugins = Util::importable_plugins(); echo '<form method="post" id="siteseo-form" class="siteseo-option" name="siteseo-flush"> <span id="siteseo-tab-title"><strong>'.esc_html__('Tools - SiteSEO','siteseo').'</strong></span><br/><br/> <span class="line"></span> <div style="siteseo-tools-page"> <h3>'.esc_html__('Import Settings From Other Plugins','siteseo').'</h3> <div class="siteseo_wrap_label"> <p class="description">'.esc_html__('Import posts and terms metadata from the specified source', 'siteseo').'</p> </div> <p><select id="siteseo-plugin-selector"> <option value="none">'.esc_html__('Select an option', 'siteseo').'</option>'; foreach($plugins as $plugin => $name){ $plugin_slug = explode('/', $plugin); $plugin = $plugin_slug[0]; echo '<option value="'. esc_attr($plugin) . '-migration-tool">'.esc_html($name).'</option>'; } echo '</select></p> <p class="description">' . esc_html__('You don\'t need to enable the selected SEO plugin to run the import.', 'siteseo').'</p>'; foreach($plugins as $plugin =>$name){ self::display_plugins($plugin, $name); } echo '<span class="line"></span> <h3>'.esc_html__('Export plugin settings','siteseo').'</h3> <div class="siteseo_wrap_label"> <p class="description">'.esc_html__('Export the plugin settings for this site as a .json file, making it easy to import the configuration into another site.', 'siteseo').'</p> </div> <div class="siteseo_wrap_label"> <button class="btn btnSecondary" id="siteseo-export-btn">'.esc_html__('Export', 'siteseo').'</button> </div> <span class="line"></span> <h3>'.esc_html__('Import plugin settings', 'siteseo').'</h3> <div class="siteseo_wrap_label"> <p class="description">'.esc_html__('Import the plugin settings from a .json file. You can obtain this file by exporting the settings from another site using the form above.','siteseo').'</p> </div> <div class=siteseo_wrap_label> <input type="file" id="siteseo-import-file" accept=".json" /> </div> <div class="siteseo_wrap_label"> <button class="brn btnSecondary" id="siteseo-import-btn">'. esc_html__('Import', 'siteseo') .'</button> </div> <span class="line"></span> <h3>'.esc_html__('Reset All Settings', 'siteseo').'</h3> <div class="siteseo_wrap_label"><div class="siteseo-notice is-warning"> <span id="dashicons-warning" class="dashicons dashicons-info"></span> <div><p>'. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('%1$s WARNING: %2$s Delete all options related to this plugin in your database.','siteseo'), '<strong>', '</strong>')).'</p></div> </div></div> <button class="btn btnSecondary" id="siteseo-reset-settings">'.esc_html__('Reset settings', 'siteseo').'</button> </div> </form></div>'; } static function display_plugins($plugin,$name){ $seo_title = 'SiteSEO'; $plugin_slug = explode('/', $plugin); $plugin = $plugin_slug[0]; echo '<div id="'.esc_attr($plugin).'-migration-tool" class="postbox siteseo-section-tool"> <div class="inside"> <h3>'. /* translators: %s represents the import posts and terms */ sprintf(esc_html__('Import posts and terms (if available) metadata from %s', 'siteseo'), esc_html($name)).'</h3> <p>'. esc_html__('By clicking Migrate, we\'ll import:', 'siteseo').'</p> <ul> <li>'. esc_html__('Title tags', 'siteseo') .'</li> <li>'. esc_html__('Meta description', 'siteseo') .'</li> <li>'. esc_html__('Facebook Open Graph tags (title, description and image thumbnail)', 'siteseo') .'</li> <li>'. esc_html__('Twitter tags (title, description and image thumbnail)', 'siteseo') .'</li> <li>'. esc_html__('Meta Robots (noindex, nofollow...)', 'siteseo') .'</li> <li>'.esc_html__('Canonical URL', 'siteseo').'</li>'; if($plugin !='slim-seo'){ echo '<li>'. esc_html__('Focus / target keywords', 'siteseo') .'<li>'; } if($plugin != 'all-in-one-seo-pack' && $plugin !='slim-seo'){ echo '<li>'. esc_html__('Primary category', 'siteseo') .'</li>'; } if('autodescription' == $plugin || 'all-in-one-seo-pack' == $plugin || 'wp-seopress' == $plugin){ echo '<li>'. esc_html__('Redirect URL', 'siteseo') .'</li>'; } echo '</ul> <div class="siteseo_wrap_label"> <div class="siteseo-notice is-warning"> <span id="dashicons-warning" class="dashicons dashicons-warning"></span> <p>'. /* translators: %s represents the degree of severity */ wp_kses_post(sprintf(__('<strong>WARNING:</strong> Migration will delete / update all <strong>%1$s posts and terms metadata</strong>. Some dynamic variables will not be interpreted. We do <strong>NOT delete any %2$s data</strong>.', 'siteseo'), esc_html($seo_title), esc_html($name))). ' </p> </div> </div> <button id="siteseo-'.esc_attr($plugin).'-migrate" type="button" class="btn btnSecondary">' . esc_html__('Import now', 'siteseo').'</button><span class="spinner"></span><div class="log"></div> </div> </div>'; } } main/settings/analytics.php 0000644 00000166177 15104342737 0012060 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO\Settings; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Analytics{ static function menu(){ global $siteseo; $analytics_toggle = isset($siteseo->setting_enabled['toggle-google-analytics']) ? $siteseo->setting_enabled['toggle-google-analytics'] : ''; $nonce = wp_create_nonce('siteseo_toggle_nonce'); $current_tab = isset($_GET['tab']) ? sanitize_key($_GET['tab']) : 'tab_google_analytics'; $analytics_sub_tags = [ 'tab_google_analytics' => esc_html__('Google Analytics', 'siteseo'), 'tab_matomo' => esc_html__('Matomo', 'siteseo'), 'tab_clarity' => esc_html__('Clarity', 'siteseo'), 'tab_advanced' => esc_html__('Advanced', 'siteseo'), 'tab_cookie' => esc_html__('Cookie bar / GDPR', 'siteseo'), 'tab_custom_tracking' => esc_html__('Custom Tracking', 'siteseo'), ]; echo '<div id="siteseo-root">'; Util::admin_header(); echo '<form method="post" id="siteseo-form" class="siteseo-option" name="siteseo-flush">'; wp_nonce_field('siteseo_analytics_settings'); Util::render_toggle('Analytics - SiteSEO', 'analytics_toggle', $analytics_toggle, $nonce); echo '<div id="siteseo-tabs" class="wrap"> <div class="nav-tab-wrapper">'; foreach($analytics_sub_tags as $tab_key => $tab_caption){ $active_class = ($current_tab === $tab_key) ? ' nav-tab-active' : ''; echo '<a id="'.esc_attr($tab_key).'-tab" class="nav-tab'.esc_attr($active_class).'" data-tab="'.esc_attr($tab_key).'">'.esc_html($tab_caption).'</a>'; } echo '</div> <div class="tab-content-wrapper"> <div class="siteseo-tab'.($current_tab == 'tab_google_analytics' ? ' active' : '').'" id="tab_google_analytics" style="display: none;">'; self::google_anlytics(); echo '</div> <div class="siteseo-tab'.($current_tab == 'tab_matomo' ? ' active' : '') . '" id="tab_matomo" style="display: none;">'; self::matomo(); echo '</div> <div class="siteseo-tab'.($current_tab == 'tab_clarity' ? ' active' : '').'" id="tab_clarity" style="display: none;">'; self::clarity(); echo '</div> <div class="siteseo-tab'.($current_tab == 'tab_advanced' ? ' active' : '').'" id="tab_advanced" style="display: none;">'; self::advanced(); echo '</div> <div class="siteseo-tab'.($current_tab == 'tab_cookie' ? ' active' : '').'" id="tab_cookie" style="display: none;">'; self::cookies(); echo '</div> <div class="siteseo-tab'.($current_tab == 'tab_custom_tracking' ? 'active' : '').'" id="tab_custom_tracking" style="display: none;">'; self::custom_tracking(); echo '</div> </div>'; Util::submit_btn(); echo '</form></div>'; } static function custom_tracking(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->analaytics_settings; $options = get_option('siteseo_google_analytics_option_name'); $option_head_tracking = !empty($options['google_analytics_other_tracking']) ? $options['google_analytics_other_tracking'] : ''; $option_body_tracking = !empty($options['google_analytics_other_tracking_body']) ? $options['google_analytics_other_tracking_body'] : ''; $option_footer_tracking = !empty($options['google_analytics_other_tracking_footer']) ? $options['google_analytics_other_tracking_footer'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('Custom Tracking','siteseo').'</h3> <P class="description">'.esc_html__('Add custom scripts like GTM or Facebook Pixel by copying and pasting the provided code into the HEAD, BODY, or FOOTER sections.','siteseo').'</p> <table class="form-table"> <tbody> <tr> <th scope="row">'.esc_html__('[HEAD] Add an additional tracking code (like Facebook Pixel, Hotjar...)','siteseo').'</th> <td> <textarea name="siteseo_options[head_tracking]" rows="16" placeholder="'.esc_html__('Paste your tracking code here, such as Google Tag Manager (head). Do NOT paste GA4 or Universal Analytics codes, as they are automatically included in your source code.','siteseo').'">'.esc_html($option_head_tracking).'</textarea> <p class="description">'.esc_html__('This code will be added in the head section of your page','siteseo').'</p> </td> </tr> <tr> <th scope="row">'.esc_html__('[BODY] Add an additional tracking code (like Google Tag Manager...)','siteseo').'</th> <td> <textarea name="siteseo_options[body_tracking]" rows="16" placeholder="'.esc_html__('This code will be added just after the opening body tag of your page','siteseo').'">'.esc_html($option_body_tracking).'</textarea> <p>'.esc_html__('This code will be added just after the opening body tag of your page','siteseo').'</p> <p>'.esc_html__('You don‘t see your code? Make sure to call wp_body_open(); just after the opening body tag in your theme.','siteseo').'</p> </td> </tr> <tr> <th scope="row">'.esc_html__('[BODY (FOOTER)] Add an additional tracking code (like Google Tag Manager...)', 'siteseo').'</th> <td> <textarea name="siteseo_options[footer_tracking]" rows="16" placeholder="'.esc_html__('Paste your tracking code here(footer)','siteseo').'">'.esc_html($option_footer_tracking).'</textarea> <p>'.esc_html__('This code will be added just after the closing body tag of your page','siteseo').'</P> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[custom_tracking_tab]" value="1"/>'; } static function cookies(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->analaytics_settings; $options = get_option('siteseo_google_analytics_option_name'); $option_cookies_postion = !empty($options['google_analytics_hook']) ? $options['google_analytics_hook'] : ''; $option_tracking_opt = !empty($options['google_analytics_disable']) ? $options['google_analytics_disable'] : ''; $option_half_disable = !empty($options['google_analytics_half_disable']) ? $options['google_analytics_half_disable'] : ''; $option_opt_choices = !empty($options['google_analytics_opt_out_edit_choice']) ? $options['google_analytics_opt_out_edit_choice'] : ''; $option_opt_msg = !empty($options['google_analytics_opt_out_msg']) ? $options['google_analytics_opt_out_msg'] : ''; $option_opt_msg_ok = !empty($options['google_analytics_opt_out_msg_ok']) ? $options['google_analytics_opt_out_msg_ok'] : ''; $option_opt_msg_close = !empty($options['google_analytics_opt_out_msg_close']) ? $options['google_analytics_opt_out_msg_close'] : ''; $option_opt_msg_edit = !empty($options['google_analytics_opt_out_msg_edit']) ? $options['google_analytics_opt_out_msg_edit'] : ''; $option_cd_exp_date = !empty($options['google_analytics_cb_exp_date']) ? $options['google_analytics_cb_exp_date'] : '30'; $option_cd_pos = !empty($options['google_analytics_cb_pos']) ? $options['google_analytics_cb_pos'] : ''; $option_cd_txt_align = !empty($options['google_analytics_cb_txt_align']) ? $options['google_analytics_cb_txt_align'] : ''; $option_cd_width = !empty($options['google_analytics_cb_width']) ? $options['google_analytics_cb_width'] : ''; $option_cd_backdrop = !empty($options['google_analytics_cb_backdrop']) ? $options['google_analytics_cb_backdrop'] : ''; $option_cd_scheme = !empty($options['google_analytics_cb_scheme']) ? $options['google_analytics_cb_scheme'] : ''; //colors load $option_backdrop_bg = !empty($options['google_analytics_cb_backdrop_bg']) ? $options['google_analytics_cb_backdrop_bg'] : ''; $option_cookiebar_bg = !empty($options['google_analytics_cb_bg']) ? $options['google_analytics_cb_bg'] : '#ffffff'; $option_cookiebar_txt = !empty($options['google_analytics_cb_txt_col']) ? $options['google_analytics_cb_txt_col'] : '#000000'; $option_cookiebar_lk = !empty($options['google_analytics_cb_lk_col']) ? $options['google_analytics_cb_lk_col'] : '#0000ff'; $option_primarybtn_bg = !empty($options['google_analytics_cb_btn_bg']) ? $options['google_analytics_cb_btn_bg'] : '#0073aa'; $option_primarybtn_bg_hov = !empty($options['google_analytics_cb_btn_bg_hov']) ? $options['google_analytics_cb_btn_bg_hov'] : '#005f8b'; $option_primarybtn_txt = !empty($options['google_analytics_cb_btn_col']) ? $options['google_analytics_cb_btn_col'] : '#ffffff'; $option_primarybtn_txt_hov = !empty($options['google_analytics_cb_btn_col_hov']) ? $options['google_analytics_cb_btn_col_hov'] : '#ffffff'; $option_sec_bg = !empty($options['google_analytics_cb_btn_sec_bg']) ? $options['google_analytics_cb_btn_sec_bg'] : '#cccccc'; $option_sec_bg_hov = !empty($options['google_analytics_cb_btn_sec_bg_hov']) ? $options['google_analytics_cb_btn_sec_bg_hov'] : '#aaaaaa'; $option_sec_bg_txt = !empty($options['google_analytics_cb_btn_sec_col']) ? $options['google_analytics_cb_btn_sec_col'] : '#000000'; $option_sec_bg_txt_hov = !empty($options['google_analytics_cb_btn_sec_col_hov']) ? $options['google_analytics_cb_btn_sec_col_hov'] : '#000000'; echo '<h3 class="siteseo-tabs">'.esc_html__('Cookies','siteseo').'</h3> <p class="description">'.esc_html__('Easily manage user consent for GDPR and customize your cookie bar.','siteseo').'</p> <p class="description">'.esc_html__('Compatible with Google Analytics and Matomo.','siteseo').'</p> <table> <tbody class="form-table"> <tr> <div class="siteseo-notice" id="custom-dimensions"> <span class="dashicons dashicons-info"></span> <p>'. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('%1$s Note : %2$s This feature applies only to cookies added through SiteSEO analytics and tracking.', 'siteseo'), '<strong>', '</strong>')).'</p> </div> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Where to load the cookie bar?','siteseo').'</th> <td> <select name="siteseo_options[cookie_pos]"> <option value="wp_body_open" '.selected($option_cookies_postion, 'wp_body_open', false).'>'.esc_html__('After the opening body tag (recommended)', 'siteseo').'</option> <option value="wp_footer" '.selected($option_cookies_postion, 'wp_footer', false).'>'.esc_html__('Footer', 'siteseo') .'</option> <option value="wp_head" '.selected($option_cookies_postion, 'wp_head', false).'>'.esc_html__('Header (not recommended)', 'siteseo').'</option> </select> </td> </tr> <tr> <th scope"user-select:auto">'.esc_html__('Analytics tracking opt-in','siteseo').'</th> <td> <label> <input name="siteseo_options[opt_tracking]" type="checkbox" '.(!empty($option_tracking_opt) ? 'checked="yes"' : 'value="1"').' /> '.esc_html__('Obtain user consent for analytics tracking, as required by GDPR.', 'siteseo').' </label><br/><br/> <label> <input type="checkbox" name="siteseo_options[half_disable]" '.(!empty($option_half_disable) ? 'checked="yes"' : 'value="1"').' /> '.esc_html__('Display and automatically accept if user does not accept or reject within 10 seconds.','siteseo').' </label> </td> </tr> <tr> <th scope="row" style="user-select:auto:">'.esc_html__('Allow user to change its choice','siteseo').'</th> <td> <label> <input name="siteseo_options[opt_edit_choices]" type="checkbox" '.(!empty($option_opt_choices) ? 'checked="yes"' : 'value="1"').' /> Allow user to change its choice about cookies'.esc_html__('Request user consent for analytics tracking (required by GDPR)', 'siteseo').' </label> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Consent message for user tracking','siteseo').'</th> <td> <textarea placeholder="'.esc_html__('Enter your message (HTML allowed)','siteseo').'" name="siteseo_options[opt_msg]" >'.esc_attr($option_opt_msg).'</textarea> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Accept button for user tracking','siteseo').'</th> <td> <input type="text" name="siteseo_options[opt_msg_ok]" value="'.esc_attr($option_opt_msg_ok).'" placeholder="'.esc_html__('Accept','siteseo').'"> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Close button','siteseo').'</th> <td> <input type="text" name="siteseo_options[opt_close]" value="'.esc_attr($option_opt_msg_close).'" placeholder="'.esc_attr('default:X','siteseo').'"> </td> </tr> <tr> <th scope="row" style="user-select:auto;" >'.esc_html__('Edit cookies button','siteseo').'</th> <td> <input type="text" name="siteseo_options[opt_edit_btn]" value="'.esc_attr($option_opt_msg_edit).'" placeholder="'.esc_attr('default:Manage cookie','siteseo').'"> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('User consent cookie expiration date','siteseo').'</th> <td> <input type="number" name="siteseo_options[cd_exp_date]" value="'.esc_attr($option_cd_exp_date).'" > </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Cookie bar position','siteseo').'</th> <td> <select name="siteseo_options[cd_pos]"> <option value="bottom" '.selected($option_cd_pos, 'bottom', false).'>'.esc_html__('Bottom (default)','siteseo').'</option> <option value="middle" '.selected($option_cd_pos, 'middle', false).'>'.esc_html__('Middle','siteseo').'</option> <option value="top" '.selected($option_cd_pos, 'top', false).'>'.esc_html__('Top','siteseo').'</option> </select> </td> </tr> <tr> <th scope="row" style="use-select:auto;">'.esc_html__('Text alignment','siteseo').'</th> <td> <select name="siteseo_options[cd_txt_align]"> <option value="center" '.selected($option_cd_txt_align, 'center', false).'>'.esc_html__('Center (default)', 'siteseo').'</option> <option value="left" '.selected($option_cd_txt_align, 'left', false).'>'.esc_html__('Left', 'siteseo').'</option> <option value="right" '.selected($option_cd_txt_align, 'right', false).'>'.esc_html__('Right', 'siteseo').'</option> </select> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Cookie bar width', 'siteseo').'</th> <td> <input type="text" name="siteseo_options[cd_width]" value="'.esc_attr($option_cd_width).'"/> <p class="description">'.esc_html__('The default unit is Pixels. To use percentages, simply add % after your custom value (e.g., 80%).', 'siteseo').'</p> <br/> <span class="line"></span> </td> </tr> <tr> <th scope="row" style="user-select:auto;"></th> <td> <h3>'.esc_html__('Backdrop', 'siteseo').'</h3> <p>'.esc_html__('Customize the backdrop of the cookie bar.', 'siteseo').'</p><br/> <label> <input type="checkbox" name="siteseo_options[cd_backdrop]" '.(!empty($option_cd_backdrop) ? 'checked="yes"' : 'value="1"').'>'. esc_html__('Display a backdrop with the cookie bar', 'siteseo') .' </label> <br/><br/> <p>'.esc_html__('Background color:','siteseo').'</p><br/> <input type="color" placeholder="Select color" name="siteseo_options[backdrop_bg]" value="'.esc_attr($option_backdrop_bg).'"/> <br/></br/> <span class="line"></span> </td> </tr> <tr> <th scope="row" style="user-select:auto;"></th> <td> <h3>'.esc_html__('Main settings', 'siteseo').'</h3> <p>'.esc_html__('Customize the general settings of the cookie bar', 'siteseo').'</p> <p>'.esc_html__('Background color:', 'siteseo').'</p><br/> <input type="color" placeholder="'.esc_html__('Select color', 'siteseo').'" name="siteseo_options[cookiesbar_bg]" value="'.esc_attr($option_cookiebar_bg).'"/> <p>'.esc_html__('Text color:', 'siteseo').'</p><br/> <input type="color" placeholder="'.esc_html__('Select color', 'siteseo').'" name="siteseo_options[cookiebar_txt]" value="'.esc_attr($option_cookiebar_txt).'"/> <p>'.esc_html__('Link color: ','siteseo').'</p></br> <input type="color" placeholder="'.esc_html__('Select color', 'siteseo').'" name="siteseo_options[line_co]" value="'.esc_attr($option_cookiebar_lk).'"/><br/></br> <span class="line"></span> </td> </tr> <tr> <th scope="row" style="use-select:auto"></th> <td> <h3>'.esc_html__('Primary button', 'siteseo').'</h3> <p>'.esc_html__('Customize the Accept button', 'siteseo').'</p><br/> <p>'.esc_html__('Background color:', 'siteseo').'</p> <input type="color" placeholder="'.esc_html__('Select color', 'siteseo').'" name="siteseo_options[primary_btn_bg]" value="'.esc_attr($option_primarybtn_bg).'"/><br/><br/> <p>'.esc_html__('Background color on hover:','siteseo').'</p> <input type="color" name="siteseo_options[primary_btn_bg_hov]" value="'.esc_attr($option_primarybtn_bg_hov).'" /><br/><br/> <p>'.esc_html__('Text color:', 'siteseo').'</p> <input type="color" name="siteseo_options[primary_btn_txt]" value="'.esc_attr($option_primarybtn_txt).'"/> <p>'. esc_html__('Text color on hover:', 'siteseo') .'</p> <input type="color" name="siteseo_options[primary_btn_txt_hov]" value="'.esc_attr($option_primarybtn_txt_hov).'"/><br/><br/> <span class="line"></span> </td> </tr> <tr> <th scope="row" style="user-select:auto"></th> <td> <h3>'.esc_html__('Secondary button', 'siteseo').'</h3> <p>'.esc_html__('Customize the Accept button', 'siteseo').'</p><br/> <p>'.esc_html__('Background color:', 'siteseo').'</p> <input type="color" placeholder="'.esc_html__('Select color','siteseo').'" name="siteseo_options[sec_btn_bg]" value="'.esc_attr($option_sec_bg).'"/><br/><br/> <p>'.esc_html__('Background color on hover:', 'siteseo').'</p> <input type="color" name="siteseo_options[sec_btn_bg_hov]" value="'.esc_attr($option_sec_bg_hov).'"/><br/><br/> <p>'.esc_html__('Text color:', 'siteseo').'</p> <input type="color" name="siteseo_options[sec_btn_txt]" value="'.esc_attr($option_sec_bg_txt).'"/> <p>'.esc_html__('Text color on hover:', 'siteseo').'</p> <input type="color" name="siteseo_options[sec_btn_txt_hov]" value="'.esc_attr($option_sec_bg_txt_hov).'"/> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[cookies_tab]" value="1"/>'; } static function matomo(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->analaytics_settings; $options = get_option('siteseo_google_analytics_option_name'); $option_enable_matomo = !empty($options['google_analytics_matomo_enable']) ? $options['google_analytics_matomo_enable'] : ''; $option_self_hosted = !empty($options['google_analytics_matomo_self_hosted']) ? $options['google_analytics_matomo_self_hosted'] : ''; $option_matomo_id = !empty($options['google_analytics_matomo_id']) ? $options['google_analytics_matomo_id'] : ''; $option_site_id = !empty($options['google_analytics_matomo_site_id']) ? $options['google_analytics_matomo_site_id'] : ''; $option_sub_domain = !empty($options['google_analytics_matomo_subdomains']) ? $options['google_analytics_matomo_subdomains'] : ''; $option_site_domain = !empty($options['google_analytics_matomo_site_domain']) ? $options['google_analytics_matomo_site_domain'] : ''; $option_enable_corss_domain = !empty($options['google_analytics_matomo_cross_domain']) ? $options['google_analytics_matomo_cross_domain'] : ''; $option_no_js = !empty($options['google_analytics_matomo_no_js']) ? $options['google_analytics_matomo_no_js'] : ''; $option_cross_domain_sites = !empty($options['google_analytics_matomo_cross_domain_sites']) ? $options['google_analytics_matomo_cross_domain_sites'] : ''; $option_no_cookies = !empty($options['google_analytics_matomo_no_cookies']) ? $options['google_analytics_matomo_no_cookies'] : ''; $options_link_tracking = !empty($options['google_analytics_matomo_link_tracking']) ? $options['google_analytics_matomo_link_tracking'] : ''; $options_no_heatmaps = !empty($options['google_analytics_matomo_no_heatmaps']) ? $options['google_analytics_matomo_no_heatmaps'] : ''; $options_matomo_dtn = !empty($options['google_analytics_matomo_dnt']) ? $options['google_analytics_matomo_dnt'] : ''; $matomo_subtabs = [ 'tracking' => 'Tracking', ]; echo '<table class="form-table"> <tbody> <tr> <th scope="row"> <div class="siteseo-container">'; $is_first = true; foreach($matomo_subtabs as $post_key => $post_val){ $active_class = $is_first ? 'active' : ''; echo '<a href="#'.esc_attr($post_key).'" class="'.esc_attr($active_class).'">'.esc_html($post_val).'</a>'; $is_first = false; } echo '</div> </th> <td> <h3>'.esc_html__('Matomo', 'siteseo').'</h3> <div class="siteseo_wrap_label" id="tracking"> <p class="description">'.esc_html__('Track your users with privacy in mind using Matomo. We support both On-Premise and Cloud installations.', 'siteseo').'</p> </div> <span class="line"></span> <h3>'.esc_html__('Tracking', 'siteseo').'</h3> <table class="form-table"> <tbody> <tr> <th scope="row">'.esc_html__('Enable Matomo tracking.', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[enable_matomo]" '.(!empty($option_enable_matomo) ? 'checked="yes"' : '').' value="1"/> '.esc_html__('Enable Matomo tracking', 'siteseo') .' </label> <p class="description">'.esc_html__('A Matomo Cloud account or a self-hosted Matomo installation is necessary.', 'siteseo').'</p> </td> </tr> <tr> <th scope="row">'.esc_html__('Self hosted Matomo installation.', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[self_hosted]" '.(!empty($option_self_hosted) ? 'checked="yes"' : '').' value="1" "/> '.esc_html__('Yes, self-hosted installation', 'siteseo').' </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Enter your tracking ID', 'siteseo').'</th> <td> <input type="text" placeholder="'.esc_html__('Enter "example" if you Matomo account URL is "example.matomo.cloud', 'siteseo').'" name="siteseo_options[tracking_id]" value="'.esc_attr($option_matomo_id).'"/> '.wp_kses_post('<p class="description">Enter only the host without quotes, such as "example.matomo.cloud" </br> (Cloud) or "matomo.example.com" (self-hosted).</p>', 'siteseo').' </td> </tr> <tr> <th scope="row">'.esc_html__('Enter your site ID.', 'siteseo').'</th> <td> <input type="text" placeholder="'.esc_html__('Enter your site ID', 'siteseo').'" name="siteseo_options[site_id]" value="'.esc_attr($option_site_id).'"/> <p class="description">'. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('To find your site ID, visit your %1$s Matomo Cloud %2$s account, go to Websites, and click Manage. The <br/>"Site ID" will be displayed on the right side.', 'siteseo'), '<strong>', '</strong>')).'</p> <p class="description">'. /* translators: placeholder is just <br> tag */ wp_kses_post(sprintf(__('For self-hosted installations, navigate to your Matomo administration, then go to Settings, Websites, %1$s and Manage. From the list of websites, locate the "ID" line.', 'siteseo'), '<br/>')).'<p> </td> </tr> <tr> <th scope="row">'.esc_html__('Track visitors across all subdomains', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[track_visitors]" '.(!empty($option_sub_domain) ? 'checked="yes"' : '').' value="1"/> '.esc_html__('Monitor one domain along with its subdomains on the same website.','siteseo') .' <p class=description">'.esc_html__('If a visitor visits x.example.com and y.example.com, they will be counted as a single unique visitor.', 'siteseo').'</p> </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Prepend the site domain.', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[site_domain]" '.(!empty($option_site_domain) ? 'checked="yes"' : '').' value="1" /> '.esc_html__('Add the site domain before the page title when tracking', 'siteseo').' <p class="description">For example, if someone visits the About page on blog.example.com, it will be recorded as "blog / About".<br/> This provides a simple way to get an overview of your traffic by subdomain.</p>` </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Track users with JavaScript disabled.', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[track_users]" '.(!empty($option_no_js) ? 'checked="yes"' : '').' value="1" /> '. esc_html__('Track users with JavaScript disabled', 'siteseo').' </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Enables cross domain linking', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[enable_cross_domains]" '.(!empty($option_enable_corss_domain) ? 'checked="yes"' : '').' value="1" /> '.esc_html__('Enables cross domain linking', 'siteseo').' </label> <p class="description">'.esc_html__('By default, the visitor ID, which uniquely identifies each visitor, is stored in the browser first-party cookies. These cookies can only be accessed by pages on the same domain.', 'siteseo').'</p> <p class="description">'.esc_html__('Enabling cross-domain tracking allows you to monitor all actions and pageviews of a specific visitor within the same session, even when they visit pages across different domains.', 'siteseo').'</p> <p class="description">'.esc_html__('When a user clicks on a link to one of your site alias URLs, a URL parameter, <code>pk_vid</code>, will be appended, forwarding the Visitor ID.', 'siteseo').'</p> </td> </tr> <tr> <th scope="row">'.esc_html__('Cross domain', 'siteseo').'</th> <td> <input type="text" name="siteseo_options[corss_domains]" value="'.esc_attr($option_cross_domain_sites).'" placeholder="'.esc_attr('Enter your domains: siteseo.io,sub.siteseo.io,sub2.siteseo.io').'"/> </td> </tr> <tr> <th scope="row">'.esc_html__('Enable DoNotTrack detection', 'siteseo').'</th> <td> <input type="checkbox" name="siteseo_options[enable_donottack]" '.(!empty($options_matomo_dtn) ? 'checked="yes"' : '').' value="1"/> '.esc_html__('Activate client-side Do Not Track detection.', 'siteseo').' <p class="description">'.esc_html__('Tracking requests will be blocked if visitors opt out of being tracked.', 'siteseo').'</p> </td> </tr> <tr> <th scope="row">'.esc_html__('Disable all tracking cookies.', 'siteseo').'</th> <td> <input type="checkbox" name="siteseo_options[disabled_cookies]" '.(!empty($option_no_cookies) ? 'checked="yes"' : '').' value="1" /> '.esc_html__('Disables all first-party cookies. Any existing Matomo cookies for this site will be deleted on the next page view.', 'siteseo').' </td> </tr> <tr> <th scope="row">'.esc_html__('Download & Outlink tracking.', 'siteseo').'</th> <td> <input type="checkbox" name="siteseo_options[outlink_tracking]" '.(!empty($options_link_tracking) ? 'checked="yes"' : '').' value="1" /> '.esc_html__('Enabling Download & Outlink tracking','siteseo').' <p class="description">By default, files with any of these extensions will be treated as a "download" in the Matomo interface.<p> <div class="siteseo-styles pre"><pre>7z|aac|arc|arj|apk|asf|asx|avi|bin|bz|bz2|csv|deb|dmg|doc|exe|flv|gif|gz|gzip|hqx|jar|jpg|jpeg|js|mp2|mp3|mp4|mpg|mpeg|mov|movie|msi|msp|odb|odf|odg|odp|ods|odt|ogg|ogv| pdf|phps|png|ppt|qt|qtm|ra|ram|rar|rpm|sea|sit|tar|tbz|tbz2|tgz|torrent|txt|wav|wma|wmv|wpd|xls|xml|z|zip</pre></div> </td> </tr> <tr> <th scope="row">'.esc_html__('Disable all heatmaps and session recordings.', 'siteseo').'</th> <td> <input type="checkbox" '.(!empty($options_no_heatmaps) ? 'checked="yes"' : '').' value="1" name="siteseo_options[disabled_heatmaps]" /> '.esc_html__('Turns off all heatmaps and session recordings.', 'siteseo').' </td> </tr> </tbody> </table> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[matomo_tab]" value="1"/>'; } static function advanced(){ global $siteseo,$wp_roles; if(!empty($_POST['submit'])){ self::save_settings(); } if(!isset($wp_roles)){ $wp_roles = new WP_Roles(); } //$options = $siteseo->analaytics_settings; $options = get_option('siteseo_google_analytics_option_name'); $option_track_authors = !empty($options['google_analytics_cd_author']) ? $options['google_analytics_cd_author'] : ''; $option_track_categories = !empty($options['google_analytics_cd_category']) ? $options['google_analytics_cd_category'] : ''; $option_track_tag = !empty($options['google_analytics_cd_tag']) ? $options['google_analytics_cd_tag'] : ''; $option_track_post_types = !empty($options['google_analytics_cd_post_type']) ? $options['google_analytics_cd_post_type'] : ''; $option_logged_user = !empty($options['google_analytics_cd_logged_in_user']) ? $options['google_analytics_cd_logged_in_user'] : ''; $adavnced_subtabs =[ 'custom-dimensions' => 'Custom Dimensions', 'Misc' => 'Misc', ]; echo '<table class="form-table"> <tbody> <tr> <th scope="row"> <div class="siteseo-container">'; $is_first = true; foreach($adavnced_subtabs as $post_key => $post_val){ $active_class = $is_first ? 'active' : ''; echo '<a href="#'.esc_attr($post_key).'" class="'.esc_attr($active_class).'">'.esc_html($post_val).'</a>'; $is_first = false; } echo '</div> </th> <td> <h3>'.esc_html__('Advanced settings', 'siteseo').'</h3> <div class="siteseo-notice" id="custom-dimensions"> <span class="dashicons dashicons-info"></span> <p>'.esc_html__('All advanced settings are compatible with both Google Analytics and Matomo tracking codes.', 'siteseo').'</p> </div> <br/> <span class="line"></span> <h3>'.esc_html__('Custom Dimensions', 'siteseo').'</h3> <div class="siteseo_wrap_label"><p class="description">'.esc_html__('Set up your Google Analytics custom dimensions.', 'siteseo').'</p></div> <div class="siteseo_wrap_label"><p class="description">'.esc_html__('Custom dimensions and metrics are similar to the default ones in Google Analytics, but you have the flexibility to create your own.', 'siteseo').'</p></div> <div class="description"><p class="description">'.esc_html__('Utilize custom dimensions to gather and analyze data that Google Analytics does not track automatically.', 'siteseo').'</p><div> <div class="description"><p class="description">'.esc_html__('Remember, you must also configure your custom dimensions in your Google Analytics account. Click the help icon for more information.', 'siteseo').'</p></div> <table class="form-table"> <tbody> <tr> <th scope="row">'.esc_html__('Track Authors', 'siteseo').'</th> <td> <select name="siteseo_options[track_authors]"> <option value="none" '.selected($option_track_authors, 'none', false).'>'.esc_html__('None','siteseo').'</option>'; for($i = 1; $i <= 20; ++$i){ /* translators: %d represents the custom dimension */ echo '<option '.selected($option_track_authors, 'dimension' . $i, false).' value="dimension'.esc_attr($i).'">'.sprintf(esc_html__('Custom Dimension #%d', 'siteseo'), esc_html($i)).'</option>'; } echo '</select> </td> </tr> <tr> <th scope="row">'.esc_html__('Track Categories', 'siteseo').'</th> <td> <select name="siteseo_options[track_categories]"> <option value="none" '.selected($option_track_categories, 'none', false).'>'.esc_html__('None','siteseo').'</option>'; for($i = 1; $i <= 20; ++$i){ /* translators: %d represents the custom dimension */ echo '<option '.selected($option_track_categories, 'dimension' . $i, false).' value="dimension'.esc_attr($i).'">'.sprintf(esc_html__('Custom Dimension #%d', 'siteseo'), esc_html($i)).'</option>'; } echo '</select> </td> </tr> <tr> <th scope="row">'.esc_html__('Track Tags', 'siteseo').'</th> <td> <select name="siteseo_options[track_tags]"> <option value="none" '.selected($option_track_tag, 'none', false).'>'.esc_html__('None','siteseo').'</option>'; for($i = 1; $i <= 20; ++$i){ /* translators: %d represents the custom dimension */ echo '<option '.selected($option_track_tag, 'dimension' . $i, false).' value="dimension'.esc_attr($i).'">'.sprintf(esc_html__('Custom Dimension #%d', 'siteseo'), esc_html($i)).'</option>'; } echo '</select> </td> </tr> <tr> <th scope="row">'.esc_html__('Track Post Types','siteseo').'</th> <td> <select name="siteseo_options[track_post_types]"> <option value="none" '.selected($option_track_post_types, 'none', false).'>'.esc_html__('None','siteseo').'</option>'; for($i = 1; $i <= 20; ++$i){ /* translators: %d represents the custom dimension */ echo '<option '.selected($option_track_post_types, 'dimension' . $i, false).' value="dimension'.esc_attr($i).'">'.sprintf(esc_html__('Custom Dimension #%d', 'siteseo'), esc_html($i)).'</option>'; } echo '</select> </td> </tr> <tr> <th scope="row">'.esc_html__('Track Logged In Users','siteseo').'</th> <td> <select name="siteseo_options[track_user]"> <option value="none" '.selected($option_logged_user, 'none', false).'>'.esc_html__('None','siteseo').'</option>'; for($i = 1; $i <= 20; ++$i){ /* translators: %d represents the custom dimension */ echo '<option '.selected($option_logged_user, 'dimension' . $i, false).' value="dimension'.esc_attr($i).'">'. sprintf(esc_html__('Custom Dimension #%d', 'siteseo'), esc_html($i)).'</option>'; } echo '</select> </td> </tr> </tbody> </table> <div class="description" id="Misc"><span class="line"></span> <h3>'.esc_html__('Misc','siteseo').'</h3> <table> <tbody class="form-table"> <tr> <th scope="row">'.esc_html__('Exclude user roles from tracking (Google Analytics and Matomo)','siteseo').'</th> <td>'; foreach($wp_roles->get_names() as $key => $value){ $select = isset($options['google_analytics_roles'][$key]); echo '<p> <label> <input name="siteseo_options[misc_roles]['.esc_attr($key).']" type="checkbox" '.(!empty($select) ? 'checked="yes"' : 'value="1"').'/> <strong>'. esc_html($value) .'</strong> (<em> '. esc_html(translate_user_role($value, 'default')) .'</em>) </label> </p>'; } echo '</td> </tr> </tbody> </table> </div> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[advanced_tab]" value="1"/>'; } static function clarity(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->analaytics_settings; $options = get_option('siteseo_google_analytics_option_name'); $option_enable_clarity = !empty($options['google_analytics_clarity_enable']) ? $options['google_analytics_clarity_enable'] : ''; $option_project_id = !empty($options['google_analytics_clarity_project_id']) ? $options['google_analytics_clarity_project_id'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('Microsoft Clarity', 'siteseo').'</h3> <p class="description">'.esc_html__('Use Microsoft Clarity to capture session recordings, access instant heatmaps, and gain powerful insights for free. Understand how users interact with your site to enhance the user experience and boost conversions.', 'siteseo').'</p> <div class="siteseo-notice"> <span class="dashicons dashicons-info"></span> <p>'. /* translators: %s represents the microsoft clarity api url */ wp_kses_post(sprintf(__('Create your first Microsoft Clarity project %1$shere%2$s.', 'siteseo'), '<a href="https://clarity.microsoft.com/" target="_blank">', '</a>')) .'</p> </div> <table class="form-table"> <tbody> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Enable Microsoft Clarity','siteseo').'</th> <td> <input type="checkbox" name="siteseo_options[microsoft_clarity]" '.(!empty($option_enable_clarity) ? 'checked="yes"' : ''). ' value="1"> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Enter your Clarity project ID', 'siteseo').'</th> <td> <input type="text" name="siteseo_options[project_id]" placeholder="'.esc_attr__('Enter your Project Id', 'siteseo').'" value="'.esc_attr($option_project_id).'" > <p><span class="dashicons dashicons-external"></span> <a href="https://siteseo.io/docs/analytics/find-my-microsoft-clarity-project-id/" target="_blank"> '.esc_html__('Find your project ID', 'siteseo').' </a> </span> </p> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[clarity_tab]" value="1" />'; } static function google_anlytics(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } $options = get_option('siteseo_google_analytics_option_name'); //$options = $siteseo->analaytics_settings; $option_enable_anaytics = !empty($options['google_analytics_enable']) ? $options['google_analytics_enable'] : ''; $option_anaytics_id = !empty($options['google_analytics_ga4']) ? $options['google_analytics_ga4'] : ''; $option_enable_optimize = !empty($options['google_analytics_link_tracking_enable']) ? $options['google_analytics_link_tracking_enable'] : ''; $option_enable_download_tracking= !empty($options['google_analytics_download_tracking_enable']) ? $options['google_analytics_download_tracking_enable'] : ''; $option_download_tracking = !empty($options['google_analytics_download_tracking']) ? $options['google_analytics_download_tracking'] : ''; $option_affiliate_tracking_enable = !empty($options['google_analytics_affiliate_tracking_enable']) ? $options['google_analytics_affiliate_tracking_enable'] : ''; $option_affiliate_tracking = !empty($options['google_analytics_affiliate_tracking']) ? $options['google_analytics_affiliate_tracking'] : ''; $option_phone_tracking = !empty($options['google_analytics_phone_tracking']) ? $options['google_analytics_phone_tracking'] : ''; $option_container_id = !empty($options['google_analytics_optimize']) ? $options['google_analytics_optimize'] : ''; $option_conversion_id = !empty($options['google_analytics_ads']) ? $options['google_analytics_ads'] : ''; $option_ip_anonymization = !empty($options['google_analytics_ip_anonymization']) ? $options['google_analytics_ip_anonymization'] : ''; $option_links_attribution = !empty($options['google_analytics_link_attribution']) ? $options['google_analytics_link_attribution'] : ''; $option_domain_tracking = !empty($options['google_analytics_cross_enable']) ? $options['google_analytics_cross_enable'] : ''; $option_cross_domain = !empty($options['google_analytics_cross_domain']) ? $options['google_analytics_cross_domain'] : ''; $option_enable_remarketing = !empty($options['google_analytics_remarketing']) ? $options['google_analytics_remarketing'] : ''; $google_analytics_fileds = [ 'general-settings' =>'General', 'tracking-settings'=>'Tracking', 'events-settings' => 'Events' ]; echo '<table class="form-table"> <tbody> <tr> <th scope="row"> <div class="siteseo-container">'; $is_first = true; foreach($google_analytics_fileds as $post_key => $post_val){ $active_class = $is_first ? 'active' : ''; echo '<a href="#'.esc_attr($post_key).'" class="'.esc_attr($active_class).'">'.esc_html($post_val).'</a>'; $is_first = false; } echo '</div></th> <td> <div id="general-settings"> <h3>'.esc_html__('Google Anlytics', 'siteseo').'</h3> <div class="siteseo_wrap_label"><p class="description">'.esc_html__('Connect your Google Analytics to your website. The tracking code will be automatically added to your site.', 'siteseo') .'</p></div> <span class="line"></span> <div class="siteseo_wrap_label"><p class="'.esc_html__('description">Link your Google Analytics to your website. The tracking code will be automatically added to your site', 'siteseo').'</p></div> <span class="line"></span> <table class="form-table"> <tbody> <tr> <th scope="row">'.esc_html__('General', 'siteseo').'</th> <td></td> </tr> <tr> <th scope="row">'.esc_html__('Enable Google Analytics tracking', 'siteseo').'</th> <td> <label><input type="checkbox" name="siteseo_options[google_anlytics_tracking]" '.(!empty($option_enable_anaytics) ? 'checked="yes"' : '') . ' value="1"/> ' . esc_html__('Activate Google Analytics tracking using the Global Site Tag (gtag.js).', 'siteseo') . '</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Enter your measurement ID (GA4)', 'siteseo').'</th> <td> <input type="text" placeholder="'.esc_attr('Enter your measurement ID (G-XXXXXXXXXX)','siteseo').'" name="siteseo_options[anlytics_measurement_id]" value="'.esc_attr($option_anaytics_id).'"> <p> <span class="dashicons dashicons-external"></span> <a href="https://support.google.com/analytics/answer/9539598?hl=en&ref_topic=9303319" target="_blank">'.esc_html__('Find your measurement ID', 'siteseo').'</a> </p> </td> </tr> </tbody> </table> </div></div> <div id="tracking-settings"> <span class="line"></span> <h3>'.esc_html__('Tracking','siteseo').'</h3> <p class="description">'.esc_html__('Set up your Google Analytics tracking code.', 'siteseo').'</P> <table class="form-table"> <tbody> <tr> <th scope="row">'.esc_html__('Enable Google Optimize.', 'siteseo').'</th> <td> <label> <input type="text" name="siteseo_options[container_id]" placeholder="'.esc_attr__('Enter your Google Optimize container ID.', 'siteseo').'" value="'.esc_attr($option_container_id).'"/> </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Enable Google Ads','siteseo').'</th> <td> <label> <input type="text" placeholder="'.esc_attr__('Enter your Google Ads conversion ID (eg: AW-123456789).', 'siteseo').'" name="siteseo_options[conversion_id]" value="'.esc_attr($option_conversion_id).'"/> </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Enable remarketing, demographics, and interests reporting', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[enable_remarketing]" '.(!empty($option_enable_remarketing) ? 'checked="yes"' : '').' value="1"/> '. esc_html__('Enable remarketing, demographics, and interests reporting', 'siteseo').' </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Enable IP Anonymization', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[ip_anonymiza]" '.(!empty($option_ip_anonymization) ? 'checked="yes"' : '').'/> '. esc_html__('Enable IP Anonymization', 'siteseo') .' </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Enhanced Link Attribution', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[link_attribution]" '.(!empty($option_links_attribution) ? 'checked="yes"' : '').'/> '. esc_html__('Enhanced Link Attribution', 'siteseo').' </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Enable cross-domain tracking', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[domain_tracking]" '.(!empty($option_domain_tracking) ? 'checked="yes"' : '').' /> '. esc_html__('Enable cross-domain tracking', 'siteseo').' </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Cross domains', 'siteseo').'</th> <td> <input type="text" placeholder="Enter your domains: siteseo.io,sub.siteseo.io,sub2.siteseo.io" name="siteseo_options[cross_domain]" value="'.esc_attr($option_cross_domain).'" /> </td> </tr> </tbody> <table> </div> <div id="events-settings"> <span class="line"></span> <h3>'.esc_html__('Events', 'siteseo').'</h3> <P class="description">'.esc_html__('Track events in Google Analytics', 'siteseo').'</p> <table class="form-table"> <tbody> <tr> <th scope="row">'.esc_html__('Enable Google Optimize', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[google_optimize]" '.(!empty($option_enable_optimize) ? 'checked="yes"' : ''). ' value="1">' . esc_html__(' Enable external links tracking', 'siteseo') . ' </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Enable downloads tracking (eg: PDF, XLSX, DOCX...)', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[enable_download_tracking]" '.(!empty($option_enable_download_tracking) ? 'checked="yes"' : '').' value="1"> '.esc_html__('Enable download tracking', 'siteseo').' </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Track downloads clicks', 'siteseo').'</th> <td> <input type="text" placeholder="pdf|docs|pptx|zip" name="siteseo_options[track_downlaods]" value="'.esc_attr($option_download_tracking).'"/> <p class="description">'.esc_html__('Separate each file type extensions with a pipe "|"','siteseo').'</p> </td> </tr> <tr> <th scope="row">'.esc_html__('Enable affiliate/outbound links tracking (eg: aff, go, out, recommends)', 'siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[aff_tracking_enable]" '.(!empty($option_affiliate_tracking_enable ) ? 'checked="yes"' : '').' value="1"/> '. esc_html__('Enable affiliate/outbound tracking','siteseo') .'</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Track affiliate/outbound links','siteseo').'</th> <td> <input type="text" name="siteseo_options[aff_tracking]" placeholder="aff|go|out" value="'.esc_attr($option_affiliate_tracking).'"/> <p class="description">'.esc_html__('Separate each keyword with a pipe "|"', 'siteseo').'</p> </td> </tr> <tr> <th scope="row">'.esc_html__('Track phone links','siteseo').'</th> <td> <input type="checkbox" name="siteseo_options[track_phones]" '.(!empty($option_phone_tracking ) ? 'checked="yes"' : '') . ' value="1"/> '.esc_html__(' Enable tracking of "tel:" links' , 'siteseo'). ' <div class="siteseo-styles pre"><pre>'.esc_html('<a href="tel:+33123456789">','siteseo').'</pre></div> </td> </tr> </tbody> </table </div> </td> </tbody> </table> <input type="hidden" name="siteseo_options[analytics_tab]" value="1"/>'; } static function save_settings(){ global $siteseo; check_admin_referer('siteseo_analytics_settings'); if(!siteseo_user_can('manage_analytics') || !is_admin()){ return; } $options = []; if(!empty($_post['siteseo_options'])){ return; } if(isset($_POST['siteseo_options']['analytics_tab'])){ $options['google_analytics_enable'] = isset($_POST['siteseo_options']['google_anlytics_tracking']); $options['google_analytics_ga4'] = isset($_POST['siteseo_options']['anlytics_measurement_id']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['anlytics_measurement_id'])) : ''; $options['google_analytics_link_tracking_enable'] = isset($_POST['siteseo_options']['google_optimize']); $options['google_analytics_download_tracking_enable'] = isset($_POST['siteseo_options']['enable_download_tracking']); $options['google_analytics_download_tracking'] = isset($_POST['siteseo_options']['track_downlaods']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['track_downlaods'])) : ''; $options['google_analytics_affiliate_tracking_enable'] = isset($_POST['siteseo_options']['aff_tracking_enable']); $options['google_analytics_affiliate_tracking'] = isset($_POST['siteseo_options']['aff_tracking']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['aff_tracking'])) : ''; $options['google_analytics_phone_tracking'] = isset($_POST['siteseo_options']['track_phones']); $options['google_analytics_optimize'] = isset($_POST['siteseo_options']['container_id']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['container_id'])) : ''; $options['google_analytics_ads'] = isset($_POST['siteseo_options']['conversion_id']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['conversion_id'])) : ''; $options['google_analytics_remarketing'] = isset($_POST['siteseo_options']['enable_remarketing']); $options['google_analytics_ip_anonymization'] = isset($_POST['siteseo_options']['ip_anonymiza']); $options['google_analytics_link_attribution'] = isset($_POST['siteseo_options']['link_attribution']); $options['google_analytics_cross_enable'] = isset($_POST['siteseo_options']['domain_tracking']); $options['google_analytics_cross_domain'] = isset($_POST['siteseo_options']['cross_domain']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['cross_domain'])) : ''; } if(isset($_POST['siteseo_options']['clarity_tab'])){ $options['google_analytics_clarity_enable'] = isset($_POST['siteseo_options']['microsoft_clarity']); $options['google_analytics_clarity_project_id'] = isset($_POST['siteseo_options']['project_id']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['project_id'])) : ''; } if(isset($_POST['siteseo_options']['matomo_tab'])){ $options['google_analytics_matomo_enable'] = isset($_POST['siteseo_options']['enable_matomo']); $options['google_analytics_matomo_self_hosted'] = isset($_POST['siteseo_options']['self_hosted']); $options['google_analytics_matomo_id'] = isset($_POST['siteseo_options']['tracking_id']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['tracking_id'])) : ''; $options['google_analytics_matomo_site_id'] = isset($_POST['siteseo_options']['site_id']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['site_id'])) : ''; $options['google_analytics_matomo_subdomains'] = isset($_POST['siteseo_options']['track_visitors']); $options['google_analytics_matomo_site_domain'] = isset($_POST['siteseo_options']['site_domain']); $options['google_analytics_matomo_cross_domain'] = isset($_POST['siteseo_options']['enable_cross_domains']); $options['google_analytics_matomo_no_js'] = isset($_POST['siteseo_options']['track_users']); $options['google_analytics_matomo_cross_domain_sites'] = isset($_POST['siteseo_options']['corss_domains']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['corss_domains'])) : ''; $options['google_analytics_matomo_no_cookies'] = isset($_POST['siteseo_options']['disabled_cookies']); $options['google_analytics_matomo_link_tracking'] = isset($_POST['siteseo_options']['outlink_tracking']); $options['google_analytics_matomo_no_heatmaps'] = isset($_POST['siteseo_options']['disabled_heatmaps']); $options['google_analytics_matomo_dnt'] = isset($_POST['siteseo_options']['enable_donottack']); } if(isset($_POST['siteseo_options']['advanced_tab'])){ $options['google_analytics_cd_author'] = isset($_POST['siteseo_options']['track_authors']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['track_authors'])) : ''; $options['google_analytics_cd_category'] = isset($_POST['siteseo_options']['track_categories']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['track_categories'])) : ''; $options['google_analytics_cd_tag'] = isset($_POST['siteseo_options']['track_tags']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['track_tags'])) : ''; $options['google_analytics_cd_post_type'] = isset($_POST['siteseo_options']['track_post_types']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['track_post_types'])) : ''; $options['google_analytics_cd_logged_in_user'] = isset($_POST['siteseo_options']['track_user']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['track_user'])) : ''; // mics roles if(isset($_POST['siteseo_options']['misc_roles'])){ $options['google_analytics_roles'] = map_deep(wp_unslash($_POST['siteseo_options']['misc_roles']), 'sanitize_text_field'); } } if(isset($_POST['siteseo_options']['custom_tracking_tab']) && current_user_can('unfiltered_html')){ // NOTE: These options can not be sanitized as we need user to be able to add some JS code, so we have added a capability check which only a super admin can have. $options['google_analytics_other_tracking'] = isset($_POST['siteseo_options']['head_tracking']) ? wp_unslash($_POST['siteseo_options']['head_tracking']) : ''; $options['google_analytics_other_tracking_body'] = isset($_POST['siteseo_options']['body_tracking']) ? wp_unslash($_POST['siteseo_options']['body_tracking']) : ''; $options['google_analytics_other_tracking_footer'] = isset($_POST['siteseo_options']['footer_tracking']) ? wp_unslash($_POST['siteseo_options']['footer_tracking']) : ''; } if(isset($_POST['siteseo_options']['cookies_tab'])){ $options['google_analytics_hook'] = isset($_POST['siteseo_options']['cookie_pos']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['cookie_pos'])) : ''; $options['google_analytics_disable'] = isset($_POST['siteseo_options']['opt_tracking']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['opt_tracking'])) : ''; $options['google_analytics_half_disable'] = isset($_POST['siteseo_options']['half_disable']); $options['google_analytics_opt_out_edit_choice'] = isset($_POST['siteseo_options']['opt_edit_choices']); $options['google_analytics_opt_out_msg'] = isset($_POST['siteseo_options']['opt_msg']) ? wp_kses_post(wp_unslash($_POST['siteseo_options']['opt_msg'])) : 'We use cookies to enhance your experience.'; $options['google_analytics_opt_out_msg_ok'] = isset($_POST['siteseo_options']['opt_msg_ok']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['opt_msg_ok'])) : 'Accept'; $options['google_analytics_opt_out_msg_edit'] = isset($_POST['siteseo_options']['opt_edit_btn']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['opt_edit_btn'])) : 'Manage cookies'; $options['google_analytics_opt_out_msg_close'] = isset($_POST['siteseo_options']['opt_close']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['opt_close'])) : 'X'; $options['google_analytics_cb_exp_date'] = isset($_POST['siteseo_options']['cd_exp_date']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['cd_exp_date'])) : '30'; $options['google_analytics_cb_pos'] = isset($_POST['siteseo_options']['cd_pos']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['cd_pos'])) : 'center'; $options['google_analytics_cb_txt_align'] = isset($_POST['siteseo_options']['cd_txt_align']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['cd_txt_align'])) : 'center'; $options['google_analytics_cb_width'] = isset($_POST['siteseo_options']['cd_width']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['cd_width'])) : '100%'; $options['google_analytics_cb_scheme'] = isset($_POST['siteseo_options']['google_analytics_cb_scheme']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['google_analytics_cb_scheme'])) : ''; // Colors $options['google_analytics_cb_backdrop'] = isset($_POST['siteseo_options']['cd_backdrop']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['cd_backdrop'])) : ''; $options['google_analytics_cb_backdrop_bg'] = isset($_POST['siteseo_options']['backdrop_bg']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['backdrop_bg'])) : ''; $options['google_analytics_cb_bg'] = isset($_POST['siteseo_options']['cookiesbar_bg']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['cookiesbar_bg'])) : ''; $options['google_analytics_cb_txt_col'] = isset($_POST['siteseo_options']['cookiebar_txt']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['cookiebar_txt'])) : ''; $options['google_analytics_cb_lk_col'] = isset($_POST['siteseo_options']['line_co']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['line_co'])) : ''; $options['google_analytics_cb_btn_bg'] = isset($_POST['siteseo_options']['primary_btn_bg']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['primary_btn_bg'])) : ''; $options['google_analytics_cb_btn_bg_hov'] = isset($_POST['siteseo_options']['primary_btn_bg_hov']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['primary_btn_bg_hov'])) : ''; $options['google_analytics_cb_btn_col'] = isset($_POST['siteseo_options']['primary_btn_txt']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['primary_btn_txt'])) : ''; $options['google_analytics_cb_btn_col_hov'] = isset($_POST['siteseo_options']['primary_btn_txt_hov']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['primary_btn_txt_hov'])) : ''; $options['google_analytics_cb_btn_sec_bg'] = isset($_POST['siteseo_options']['sec_btn_bg']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['sec_btn_bg'])) : ''; $options['google_analytics_cb_btn_sec_bg_hov'] = isset($_POST['siteseo_options']['sec_btn_bg_hov']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['sec_btn_bg_hov'])) : ''; $options['google_analytics_cb_btn_sec_col'] = isset($_POST['siteseo_options']['sec_btn_txt']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['sec_btn_txt'])) : ''; $options['google_analytics_cb_btn_sec_col_hov'] = isset($_POST['siteseo_options']['sec_btn_txt_hov']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['sec_btn_txt_hov'])) : ''; } update_option('siteseo_google_analytics_option_name', $options); } } main/settings/onboarding.php 0000644 00000047706 15104342737 0012207 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO\Settings; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class OnBoarding{ static $current_step = ''; static $import_options = []; static $steps = []; static $current_step_no = 1; static function init(){ if(wp_doing_ajax()){ return; } self::$steps = [ 'your-site' => [ 'title' => 'Your Site', 'desc' => 'Your site and social data', 'fn' => '\SiteSEO\Settings\OnBoarding::site_page', ], 'indexing' => [ 'title' => 'Indexing', 'desc' => 'Select post type indexing', 'fn' => '\SiteSEO\Settings\OnBoarding::indexing_page', ], 'advanced' => [ 'title' => 'Advanced', 'desc' => 'URL configuration', 'fn' => '\SiteSEO\Settings\OnBoarding::advanced_page', ], 'ready' => [ 'title' => 'Ready', 'desc' => 'All set now!', 'fn' => '\SiteSEO\Settings\OnBoarding::ready_page', ], ]; $active_plugins = get_option('active_plugins', []); $importable_plugins = Util::importable_plugins(); $importable_plugins = array_keys($importable_plugins); $importable_found = array_intersect($active_plugins, $importable_plugins); if(!empty($importable_found)){ $import_step = [ 'import' => [ 'title' => 'Import', 'desc' => 'Importing meta data', 'fn' => '\SiteSEO\Settings\OnBoarding::import_page', ] ]; self::$steps = array_merge($import_step, self::$steps); self::$import_options = $importable_found; } self::$current_step = !empty($_REQUEST['step']) ? sanitize_text_field(wp_unslash($_REQUEST['step'])) : ''; remove_all_actions('admin_notices'); remove_all_actions('all_admin_notices'); remove_all_actions('network_admin_notices'); add_action('admin_menu', '\SiteSEO\Settings\OnBoarding::add_to_menu'); add_action('admin_init', '\SiteSEO\Settings\OnBoarding::page'); } static function enqueue_assets(){ wp_enqueue_media(); wp_enqueue_script('siteseo-onboarding', SITESEO_ASSETS_URL . '/js/onboarding.js', ['jquery'], SITESEO_VERSION, true); wp_enqueue_style('siteseo-onboarding' , SITESEO_ASSETS_URL . '/css/onboarding.css', [], SITESEO_VERSION); wp_add_inline_script('siteseo-onboarding', "let siteseo_onboarding = ".wp_json_encode([ 'nonce' => wp_create_nonce('siteseo_admin_nonce'), 'ajax_url' => admin_url('admin-ajax.php'), ])); } static function add_to_menu(){ add_submenu_page('', __('SiteSEO Onboarding', 'siteseo'), 'Onboarding', 'siteseo_manage', 'siteseo-onboarding', 'SiteSEO\Settings\Onboarding::wizard'); } static function page(){ self::enqueue_assets(); ob_start(); ?><!DOCTYPE html> <html <?php language_attributes();?>> <?php echo'<head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>'.esc_html__('SiteSEO OnBoarding', 'siteseo').'</title>'; wp_print_head_scripts(); wp_print_styles('siteseo-onboarding'); echo '</head> <body>'; self::wizard(); if(function_exists('wp_print_media_templates')){ wp_print_media_templates(); } wp_print_footer_scripts(); wp_print_scripts('siteseo-onboarding'); echo '</body> </html>'; die(); } static function wizard(){ echo '<div id="siteseo-onboarding-root"> <div class="siteseo-onboarding-nav-wrapper"> <nav> <div class="content"> <div class="header"> <img src="'.esc_url(SITESEO_ASSETS_URL) .'/img/siteseo-white.png" height="40"/> <a href="'.esc_url(admin_url('?page=siteseo')).'" title="'.esc_attr__('Exit to SiteSEO Dashboard', 'siteseo').'"><svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#fff"><path d="M200-120q-33 0-56.5-23.5T120-200v-160h80v160h560v-560H200v160h-80v-160q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm220-160-56-58 102-102H120v-80h346L364-622l56-58 200 200-200 200Z"/></svg></a> </div>'; $step_count = 1; echo '<div class="steps">'; foreach(self::$steps as $step_slug => $step){ echo '<div class="step"> <div class="step-milestone" data-step="'.esc_attr($step_count).'" data-step-slug="'.esc_attr($step_slug).'"></div> <div class="step-info"><span>'.esc_html($step['title']).'</span><span class="description">'.esc_html($step['desc']).'</span></div> </div>'; $step_count++; } echo ' </div> </div> <div class="footer">A Softaculous Product</div> </nav> </div> <main> <div class="siteseo-onboarding-content">'; self::welcome_page(); foreach(self::$steps as $step){ call_user_func($step['fn']); self::$current_step_no++; // increasing the step number after we have rendered the step page. } echo '</div> </main> </div>'; } static function welcome_page(){ $is_active = empty(self::$current_step) ? 'siteseo-step-active' : ''; echo '<div class="siteseo-step-page siteseo-step-is-welcome '.esc_attr($is_active).'" data-step="welcome"> <h1>'.esc_html__('Welcome to the SiteSEO Setup Wizard', 'siteseo').'</h1> <p>'.esc_html__('This wizard will guide you through setting up SiteSEO and help you get started in no time.', 'siteseo').'</p> <button class="siteseo-btn primary" id="siteseo-onboarding-begin" style="margin-top:20px">'.esc_html__('Let\'s begin!', 'siteseo').'</button> </div>'; } static function import_page(){ $is_active = !empty(self::$current_step) && self::$current_step == 'import' ? 'siteseo-step-active' : ''; echo '<div class="siteseo-step-page '.esc_attr($is_active).'" data-step="import"> <span>Step '.esc_html(self::$current_step_no).' of '.count(self::$steps).'</span> <h1>'.esc_html__('Import data from your current SEO plugin', 'siteseo').'</h1> <p>'.esc_html__('SiteSEO has detected the presence of other SEO plugins. To ensure a smooth transition, please select the plugins you wish to import SEO data from', 'siteseo').'</p> <div class="siteseo-onboarding-import-plugins">'; $importable_plugins = Util::importable_plugins(); echo '<form><div class="siteseo-radio-input">'; foreach(self::$import_options as $plugin){ $id = strtolower(str_replace(' ', '-', $plugin)); echo '<input type="radio" name="plugin_name" value="'.esc_attr($id).'" id="'.esc_attr($id).'"/> <label for="'.esc_attr($id).'">'.esc_html($importable_plugins[$plugin]).'</label>'; } echo '</div> <div class="siteseo-onboarding-import-info"> <details> <summary>'.esc_html__('What will be imported?', 'siteseo').'</summary> <ul> <li>'. esc_html__('Title tags', 'siteseo') .'</li> <li>'. esc_html__('Meta description', 'siteseo') .'</li> <li>'. esc_html__('Facebook Open Graph tags (title, description and image thumbnail)', 'siteseo') .'</li> <li>'. esc_html__('Twitter tags (title, description and image thumbnail)', 'siteseo') .'</li> <li>'. esc_html__('Meta Robots (noindex, nofollow...)', 'siteseo') .'</li> <li>'. esc_html__('Canonical URL', 'siteseo').'</li> <li>'. esc_html__('Focus / target keywords', 'siteseo') .'</li> </ul> </details> <button class="siteseo-btn primary" id="siteseo-do-import">Import</button> <p class="siteseo-onboarding-msg"></p> </div> </form> <div class="siteseo-onboarding-content-footer"> <button class="siteseo-skip-step siteseo-btn secondary">'.esc_html__('Skip Step', 'siteseo').'</button><button class="siteseo-btn primary siteseo-skip-step">'.esc_html__('Next Step', 'siteseo').'</button> </div> </div> </div>'; } static function site_page(){ $title_options = get_option('siteseo_titles_option_name', []); $social_options = get_option('siteseo_social_option_name', []); $site_name = !empty($title_options['titles_home_site_title']) ? $title_options['titles_home_site_title'] : '%%sitetitle%%'; $alt_site_name = !empty($title_options['titles_home_site_title_alt']) ? $title_options['titles_home_site_title_alt'] : ''; $site_type = !empty($social_options['social_knowledge_type']) ? $social_options['social_knowledge_type'] : ''; $org_name = !empty($social_options['social_knowledge_name']) ? $social_options['social_knowledge_name'] : ''; $org_img = !empty($social_options['social_knowledge_img']) ? $social_options['social_knowledge_img'] : ''; $fb_url = !empty($social_options['social_accounts_facebook']) ? $social_options['social_accounts_facebook'] : ''; $x_account = !empty($social_options['social_accounts_twitter']) ? $social_options['social_accounts_twitter'] : ''; $additional_url = !empty($social_options['social_accounts_additional']) ? implode("\n", $social_options['social_accounts_additional']) : ''; $is_active = !empty(self::$current_step) && self::$current_step == 'your-site' ? 'siteseo-step-active' : ''; echo '<div class="siteseo-step-page '.esc_attr($is_active).'" data-step="your-site"> <span>Step '.esc_html(self::$current_step_no).' of '.count(self::$steps).'</span> <h1>Your Site: '.esc_html(get_bloginfo('name')).'</h1> <p>'.esc_html__('We need some basic information about your site, so we can built up the knowledge graph', 'siteseo').'</p> <form> <div class="siteseo-input-block"> <label>'.esc_html__('Website Name', 'siteseo').'</label> <input type="text" name="website_name" value="'.esc_attr($site_name).'"/> <p class="siteseo-input-description">'.esc_html__('Enter the name of your site as it should appear in search results, %%sitetitle%% is a dynamic variable for your site title', 'siteseo').'</p> </div> <div class="siteseo-input-block"> <label>'.esc_html__('Altername sitename', 'siteseo').'</label> <input type="text" name="alternate_site_name" value="'.esc_attr($alt_site_name).'" placeholder="Alternate site name"/> <p class="siteseo-input-description">'.esc_html__('The website\'s alternate name, like a common acronym or shorter version, if applicable.', 'siteseo').'</p> </div> <div class="siteseo-input-block"> <label>'.esc_html__('Is your site about an Organization or a Person?', 'siteseo').'</label> <select type="text" name="site_type"> <option value="Person" '.selected($site_type, 'Person', false).'>Person</option> <option value="Organization" '.selected($site_type, 'Organization', false).'>Organization</option> </select> </div> <div class="siteseo-input-block"> <label>'.esc_html__('Your/Organization name', 'siteseo').'</label> <input type="text" name="organization_name" placeholder="eg:. My Company Name" value="'.esc_attr($org_name).'"/> </div> <div class="siteseo-input-block"> <label>'.esc_html__('Organization Logo', 'siteseo').'</label> <button id="siteseo-onboarding-img-holder"> <img src="'.esc_url($org_img).'"/> <svg xmlns="http://www.w3.org/2000/svg" height="50px" viewBox="0 -960 960 960" width="50px" fill="#5f6368" style="'.(!empty($org_img) ? 'display:none;' : '').'"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"/></svg></button> <p class="siteseo-input-description">'.esc_html__('A square image is preferred, with a minimum size of 112x112 pixels.', 'siteseo').'</p> <input type="hidden" name="organization_logo" value="'.esc_url($org_img).'"/> <button class="siteseo-btn primary" id="siteseo-upload-org-img" style="align-self:flex-start">'.esc_html__('Select Image', 'siteseo').'</button> </div> <h4>Social Details</h4> <div class="siteseo-input-block"> <label>'.esc_html__('Facebook page URL', 'siteseo').'</label> <input type="text" name="social_fb" value="'.esc_url($fb_url).'" placeholder="eg: https://facebook.com/my-page-url"/> </div> <div class="siteseo-input-block"> <label>'.esc_html__('X Username', 'siteseo').'</label> <input type="text" name="social_x" value="'.esc_attr($x_account).'" placeholder="eg: @x_account"/> </div> <div class="siteseo-input-block"> <label>'.esc_html__('Additional Accounts', 'siteseo').'</label> <textarea rows="3" name="social_additional" placeholder="eg:https://somesocial.com/my-page">'.esc_textarea($additional_url).'</textarea> <p class="siteseo-input-description">'.esc_html__('Enter 1 URL per line.', 'siteseo').'</p> </div> <div class="siteseo-onboarding-content-footer"> <button class="siteseo-skip-step siteseo-btn secondary">'.esc_html__('Skip Step', 'siteseo').'</button><button class="siteseo-btn primary siteseo-save-n-continue">'.esc_html__('Save and Continue', 'siteseo').'<span class="siteseo-spinner"></span></button> </div> </form> </div>'; } static function indexing_page(){ $is_active = !empty(self::$current_step) && self::$current_step == 'indexing' ? 'siteseo-step-active' : ''; $post_types = get_post_types(['public' => true, 'show_ui' => true], 'objects', 'and'); unset($post_types['attachment']); $taxonomies = get_taxonomies(['public' => true, 'show_ui' => true], 'objects', 'and'); echo '<div class="siteseo-step-page '.esc_attr($is_active).'" data-step="indexing"> <span>Step '.esc_html(self::$current_step_no).' of '.count(self::$steps).'</span> <h1>Indexing</h1> <p>'.esc_html__('Let us know which parts of your website you’d like to be crawled.', 'siteseo').'</p> <form method="POST"> <div class="siteseo-input-block"> <label>'.esc_html__('Is your site under construction or live?', 'siteseo').'</label> <div class="siteseo-radiogroup"> <label><input type="radio" name="site_status" value="underconstruction"/>Under Construction</label> <label><input type="radio" name="site_status" value="live" checked/>Live</label> </div> <p class="siteseo-input-description">'.esc_html__('If your site is under construction then Search Engines will be discouraged to crawl your site by adding noindex metatag attribute and sitemap will be disabled.', 'siteseo').'</p> </div> <div class="siteseo-live-site-options" style="margin-top:35px;"> <p>'.esc_html__('Choose items to exclude from search results', 'siteseo').'</p> <div class="siteseo-input-block"> <label>'.esc_html__('Post Types', 'siteseo').'</label> <div class="siteseo-radiogroup">'; if(!empty($post_types)){ foreach($post_types as $post){ echo '<div><input type="checkbox" name="post_types" value="'.esc_attr($post->name).'" id="post_type_'.esc_attr($post->name).'"/> <label for="post_type_'.esc_attr($post->name).'">'.esc_html($post->label).'</label> </div>'; } echo '<p class="siteseo-input-description">'.esc_html__('Discourage search engines from indexing these post types.', 'siteseo').'</p>'; } else { echo '<p class="siteseo-input-description">'.esc_html__('No post type found.', 'siteseo').'</p>'; } //TODO:: Will need to add options for Archive as well echo '</div> </div> <div class="siteseo-input-block"> <label>'.esc_html__('Taxonomies', 'siteseo').'</label> <div class="siteseo-radiogroup">'; if(!empty($taxonomies)){ foreach($taxonomies as $taxonomy){ echo '<div><input type="checkbox" name="taxonomies" value="'.esc_attr($taxonomy->name).'" id="taxonomy_'.esc_attr($taxonomy->name).'"/> <label for="taxonomy_'.esc_attr($taxonomy->name).'">'.esc_html($taxonomy->label).'</label> </div>'; } echo '<p class="siteseo-input-description">'.esc_html__('Discourage search engines from indexing these taxonomies.', 'siteseo').'</p> <p class="siteseo-input-description">'.esc_html__('Note: We strongly recommend disabling the indexing of tags to avoid potential duplicate content issues that could negatively impact your site\'s SEO.', 'siteseo').'</p>'; } else { echo '<p class="siteseo-input-description">'.esc_html__('No taxonomy found.', 'siteseo').'</p>'; } echo '</div> </div> </div> <div class="siteseo-onboarding-content-footer"> <button class="siteseo-skip-step siteseo-btn secondary">'.esc_html__('Skip Step', 'siteseo').'</button><button class="siteseo-btn primary siteseo-save-n-continue">'.esc_html__('Save and Continue', 'siteseo').'<span class="siteseo-spinner"></span></button> </div> </form> </div>'; } static function advanced_page(){ $is_active = !empty(self::$current_step) && self::$current_step == 'advanced' ? 'siteseo-step-active' : ''; echo '<div class="siteseo-step-page '.esc_attr($is_active).'" data-step="advanced"> <span>Step '.esc_html(self::$current_step_no).' of '.count(self::$steps).'</span> <h1>Advanced Options</h1> <p>'.esc_html__('We\'re nearly there—just a few final optimizations left!', 'siteseo').'</p> <form method="POST"> <div class="siteseo-input-block"> <div class="siteseo-radiogroup"> <label><input type="checkbox" name="universal_metabox" checked/>Enable Universal Metabox</label> </div> <p class="siteseo-input-description">'.esc_html__('Universal metabox makes SiteSEO on page content SEO helper compatible with every Page Builder, so if you are not using Gutenberg then this is a must.', 'siteseo').'</p> </div> <div class="siteseo-input-block"> <div class="siteseo-radiogroup"> <label><input type="checkbox" name="author_noindex"/>'.esc_html__('Don\'t let search engines index author archive pages', 'siteseo').'</label> </div> <p class="siteseo-input-description">'.esc_html__('Recommended: Enable this option if you are the sole author of the site to prevent duplicate content on author archive pages.', 'siteseo').'</p> </div> <div class="siteseo-input-block"> <div class="siteseo-radiogroup"> <label><input type="checkbox" name="redirect_attachment"/>'.esc_html__('Redirect attachment pages to the file itself', 'siteseo').'</label> </div> <p class="siteseo-input-description">'.esc_html__('By default SiteSEO redirects to the parent post.', 'siteseo').'</p> </div> <div class="siteseo-input-block"> <div class="siteseo-radiogroup"> <label><input type="checkbox" name="category_url"/>'.esc_html__('Remove /category/ in your permalinks', 'siteseo').'</label> </div> <p class="siteseo-input-description">'.esc_html__('This reduces the length of the URL.', 'siteseo').'</p> </div> <div class="siteseo-onboarding-content-footer"> <button class="siteseo-skip-step siteseo-btn secondary">'.esc_html__('Skip Step', 'siteseo').'</button><button class="siteseo-btn primary siteseo-save-n-continue">'.esc_html__('Save and Continue', 'siteseo').'<span class="siteseo-spinner"></span></button> </div> </form> </div>'; } static function ready_page(){ $is_active = !empty(self::$current_step) && self::$current_step == 'ready' ? 'siteseo-step-active' : ''; echo '<div class="siteseo-step-page '.esc_attr($is_active).'" data-step="ready"> <span>Step '.esc_html(self::$current_step_no).' of '.count(self::$steps).'</span> <h1>Done! 🎉</h1> <p>'.esc_html__('We are done with the setup, now you can start making content and submit the Sitemap to the search engines.', 'siteseo').'</p> <h4>'.esc_html__('What Next?', 'siteseo').'</h4> <ol style="margin:0"> <li><a href="?page=siteseo-sitemaps" target="_blank">'.esc_html__('Configure your Sitemap', 'siteseo').'</a></li> <li>'.esc_html__('Submit yours sitemap to search engines', 'siteseo').'</li> </ol> <h4>'.esc_html__('You can also, subscribe to our newletter', 'siteseo').'</h4> '.esc_html__('You will get', 'siteseo').' <ul style="list-style-type:none"> <li><span class="dashicons dashicons-minus"></span> '.esc_html__('Alerted about Google Algorithm changes.', 'siteseo').'</li> <li><span class="dashicons dashicons-minus"></span> '.esc_html__('Updates about our products.', 'siteseo').'</li> <li><span class="dashicons dashicons-minus"></span> '.esc_html__('Improve SEO of your website with our resourceful blogs.', 'siteseo').'</li> </ul> <a class="siteseo-btn secondary" href="https://siteseo.io/subscribe/" style="align-self:flex-start;" target="_blank">'.esc_html__('Subscribe', 'siteseo').'</a> <div class="siteseo-onboarding-content-footer"> <a href="'.esc_url(admin_url()).'"class="siteseo-btn primary">Go to Dashboard</a> <a href="?page=siteseo"class="siteseo-btn primary">Review Settings</a> <a href="https://siteseo.io/docs/" class="siteseo-btn primary" target="_blank">Knowledge Base</a> </div> </div>'; } } main/settings/sitemap.php 0000644 00000047016 15104342737 0011521 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO\Settings; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Sitemap{ static function menu(){ global $siteseo; $sitemap_toggle = isset($siteseo->setting_enabled['toggle-xml-sitemap']) ? $siteseo->setting_enabled['toggle-xml-sitemap'] : ''; $nonce = wp_create_nonce('siteseo_toggle_nonce'); $current_tab = isset($_GET['tab']) ? sanitize_key($_GET['tab']) : 'tab_sitemap_general'; // Default tab $titles_meta_subtabs = [ 'tab_sitemap_general' => esc_html__('Home', 'siteseo'), 'tab_sitemap_post_types' => esc_html__('Post types', 'siteseo'), 'tab_sitemap_taxonomy ' => esc_html__('Taxonomy', 'siteseo'), 'tab_sitmap_html' => esc_html__('HTML Sitemap', 'siteseo') ]; echo '<div id="siteseo-root">'; Util::admin_header(); echo '<form method="post" id="siteseo-form" class="siteseo-option" name="siteseo-flush">'; wp_nonce_field('siteseo_sitemap_settings'); Util::render_toggle('Sitemaps - SiteSEO', 'sitemap_toggle', $sitemap_toggle, $nonce); echo '<div id="siteseo-tabs" class="wrap"> <div class="nav-tab-wrapper">'; foreach($titles_meta_subtabs as $tab_key => $tab_caption){ $active_class = ($current_tab === $tab_key) ? ' nav-tab-active' : ''; echo '<a id="' . esc_attr($tab_key) . '-tab" class="nav-tab' . esc_attr($active_class) . '" data-tab="' . esc_attr($tab_key) . '">' . esc_html($tab_caption) . '</a>'; } echo '</div> <div class="tab-content-wrapper"> <div class="siteseo-tab' .($current_tab == 'tab_sitemap_general' ? ' active' : '').'" id="tab_sitemap_general" style="display: none;">'; self::general_sitemaps(); echo '</div> <div class="siteseo-tab' .($current_tab == 'tab_sitemap_post_types' ? ' active' : '').'" id="tab_sitemap_post_types" style="display: none;">'; self::post_types_sitemaps(); echo '</div> <div class="siteseo-tab' .($current_tab == 'tab_sitemap_taxonomy' ? ' active' : '').'" id="tab_sitemap_taxonomy" style="display: none;">'; self::taxonomy_sitemap(); echo '</div> <div class="siteseo-tab' .($current_tab == 'tab_sitmap_html' ? ' active' : '').'" id="tab_sitmap_html" style="display: none;">'; self::html_sitemap(); echo '</div> </div>'; Util::submit_btn(); echo '</form></div>'; } static function general_sitemaps(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->sitemap_settings; $options = get_option('siteseo_xml_sitemap_option_name', []); $xml_sitemap = !empty($options['xml_sitemap_general_enable']) ? $options['xml_sitemap_general_enable'] : ''; $img_sitemap = !empty($options['xml_sitemap_img_enable']) ? $options['xml_sitemap_img_enable'] : ''; $author_sitemap = !empty($options['xml_sitemap_author_enable']) ? $options['xml_sitemap_author_enable'] : ''; $html_sitemap = !empty($options['xml_sitemap_html_enable']) ? $options['xml_sitemap_html_enable'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('General','siteseo').'</h3> <p>'.esc_html__('Sitemaps are pages which help search engine, know your site better and makes it easier for them to index the pages.','siteseo').'</p> <p>'.esc_html__('Not having a sitemap does not mean search engines won\'t be able to crawl your website, but sitemaps make it easier for them to discover all the URLs which are needed to be indexed.','siteseo').'</p> <div class="siteseo-styles pre"><pre><span class="dashicons dashicons-external"></span><a href="'.esc_url(get_option('home')).'/sitemaps.xml" target="_blank">' . esc_url(get_option('home')) . '/sitemaps.xml</a></pre></div> <div class="siteseo-notice"> <span id="siteseo-dash-icon" class="dashicons dashicons-info"></span> <p>'. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('To view your sitemap, %1$s enable permalinks %2$s (other than the default one) and save the settings to flush them.', 'siteseo'), '<strong>', '</strong>')).'</p> </div> <table class="form-table"> <tbody> <tr> <th scope="row">'.esc_html__('Enable XML Sitemap','siteseo').'</th> <td> <label><input id="siteseo_enable_sitemap" name="siteseo_options[enable_xml_sitemap]" type="checkbox" '.(!empty($xml_sitemap) ? 'checked' : '').' value="1"/>'. esc_html__('Enable XML Sitemap', 'siteseo').'</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Enable Image Sitemap','siteseo').'</th> <td> <label><input id="siteseo_image_sitemap" name="siteseo_options[enable_img_sitemap]" type="checkbox" '.(!empty($img_sitemap) ? 'checked' : '').' value="1"/>'. esc_html__('Enable Image Sitemap for standard images, image galleries, featured images, and WooCommerce product images.)', 'siteseo').'</label> <p class="description">'.esc_html__('Images in XML sitemaps are only visible from the source code.', 'siteseo').'</p> </td> </tr> <tr> <th scope="row">'.esc_html__('Enable Author Sitemap','siteseo').'</th> <td> <label><input id="siteseo_author_sitemap" name="siteseo_options[enable_author_sitemap]" type="checkbox" '.(!empty($author_sitemap) ? 'checked' : '').' value="1"/>' . esc_html__('Enable Author Sitemap', 'siteseo').'</label> <p class="description">'.esc_html__('Ensure that you enable the author archive from SEO, under the Titles & Metas section, in the Archives tab.','siteseo').'</p> </td> </tr> <tr> <th scope="row">'.esc_html__('Enable HTML Sitemap','siteseo').'</th> <td> <label><input id="siteseo_html_sitemap" name="siteseo_options[enable_html_sitemap]" type="checkbox" '.(!empty($html_sitemap) ? 'checked' : ''). ' value="1"/>' . esc_html__('Enable HTML Sitemap', 'siteseo').'</label> </td> </tr> </tbody> </table> <input type="hidden" name="siteseo_options[general_sitemaps] value="1"/>'; } static function post_types_sitemaps(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->sitemap_settings; $options = get_option('siteseo_xml_sitemap_option_name', []); $option_sitemap_posts = !empty($options['xml_sitemap_post_types_list']['post']['include']) ? $options['xml_sitemap_post_types_list']['post']['include'] : ''; $option_sitemap_pages = !empty($options['xml_sitemap_post_types_list']['page']['include']) ? $options['xml_sitemap_post_types_list']['page']['include'] : ''; $option_sitemap_media = !empty($options['xml_sitemap_post_types_list']['media']['include']) ? $options['xml_sitemap_post_types_list']['media']['include'] : ''; $post_types = siteseo_post_types(); echo '<h3 class="siteseo-tabs">'.esc_html__('Post Types', 'siteseo').'</h3> <p>'.esc_html__('Select Post Types to Include or Exclude', 'siteseo').'</p> <table class="form-table"> <tbody>'; foreach($post_types as $post_type){ $post_type_name = $post_type->name; $post_type_label = $post_type->labels->singular_name; $option_sitemap_custom = !empty($options['xml_sitemap_post_types_list'][$post_type_name]['include']) ? 'checked="yes"' : ''; echo '<tr> <th></th> <td> <label for="sitemap_post_types_'.esc_attr($post_type_name).'"> <h4>'.esc_html($post_type_label).' <em>(['.esc_html($post_type_name).'])</em></h4> <input id="sitemap_post_types_'.esc_attr($post_type_name).'" name="siteseo_options[xml_sitemap_post_types_list]['.esc_attr($post_type_name).'][include]" type="checkbox" '.esc_attr($option_sitemap_custom).' value="1"/> '.esc_html__('Include', 'siteseo').' </label> </td> </tr>'; } echo '</tbody> </table> <input type="hidden" name= siteseo_options[post_types_tab] value="1"/>'; } static function taxonomy_sitemap(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->sitemap_settings; $get_taxonomies = get_taxonomies(['public' => true, 'show_ui' => true], 'objects'); $check_taxonomies = apply_filters('siteseo_sitemaps_tax', $get_taxonomies); $options = get_option('siteseo_xml_sitemap_option_name'); $option_category = isset($options['xml_sitemap_taxonomies_list']['category']['include']) ?? ''; $option_post_tags = isset($options['xml_sitemap_taxonomies_list']['post_tag']['include']) ?? ''; $get_taxonomies = get_taxonomies(); $check_taxomies = apply_filters('siteseo_sitemaps_tax', $get_taxonomies); $excluded_taxonomies = ['post_format', 'category', 'post_tag']; echo '<h3 class="siteseo-tabs">'.esc_html__('Taxonomies', 'siteseo').'</h3> <p>'.esc_html__('Select Taxonomies to Include or Exclude', 'siteseo').'</p> <table class="form-table"> <tr scope="row"> <th>'.esc_html__('Select to INCLUDE Taxonomies', 'siteseo').'</th> <td><br/><br/> <label for="sitemap_post_types_pages"> <h4>'.esc_html__('Categories ', 'siteseo').' <em>[categories]</em></h4> <input id="sitemap_post_types_pages" name="siteseo_options[xml_sitemap_taxonomies_list][category][include]" type="checkbox" '.(!empty($option_category) ? 'checked' : 'value="1"').'/> '.esc_html__('Include', 'siteseo').' </label> </td> </tr> <tr> <th></th> <td> <label for="sitemap_post_types_pages"> <h4>'.esc_html__('Tags', 'siteseo').' <em>[post_tag]</em></h4> <input id="sitemap_post_types_pages" name="siteseo_options[xml_sitemap_taxonomies_list][post_tag][include]" type="checkbox" '.(!empty($option_post_tags) ? 'checked' : 'value="1"').'/> '.esc_html__('Include', 'siteseo').' </label> </td> </tr>'; foreach($check_taxonomies as $taxonomy_name => $taxonomy_obj){ if(in_array($taxonomy_name, $excluded_taxonomies)){ continue; } //check selected $is_included = !empty($options['xml_sitemap_taxonomies_list'][$taxonomy_name]['include']); // Generate a row for the taxonomy echo '<tr scope="row"> <th></th> <td> <label for="sitemap_taxonomy_'.esc_attr($taxonomy_name).'"> <h4>'.esc_html($taxonomy_obj->labels->name).' <em>[' . esc_html($taxonomy_name).']</em></h4> <input id="sitemap_taxonomy_' . esc_attr($taxonomy_name) . '" name="siteseo_options[xml_sitemap_taxonomies_list][' . esc_attr($taxonomy_name).'][include]" type="checkbox" '.($is_included ? 'checked' : '').' value="1" /> ' . esc_html__('Include', 'siteseo') . ' </label> </td> </tr>'; } echo '</table><input type="hidden" name="siteseo_options[taxonomy_sitemap_tabs]" value="1">'; } static function html_sitemap(){ if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->$sitemap_settings; $options = get_option('siteseo_xml_sitemap_option_name', []); $include_pages = !empty($options['xml_sitemap_html_mapping']) ? $options['xml_sitemap_html_mapping'] : ''; $exclude_page = !empty($options['xml_sitemap_html_exclude']) ? $options['xml_sitemap_html_exclude'] : ''; $order = !empty($options['xml_sitemap_html_order']) ? $options['xml_sitemap_html_order'] : ''; $order_by = !empty($options['xml_sitemap_html_orderby']) ? $options['xml_sitemap_html_orderby'] : ''; $disable_date = !empty($options['xml_sitemap_html_date']) ? $options['xml_sitemap_html_date'] : ''; $remove_archive = !empty($options['xml_sitemap_html_archive_links']) ? $options['xml_sitemap_html_archive_links'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('HTML Sitemap', 'siteseo').'</h3> <p>'.esc_html__('Generate an HTML sitemap for your visitors to improve your SEO.','siteseo').'</p> <p>'.esc_html__('Restricted to 1,000 posts per post type. You can change the order and sorting settings below.','siteseo').'</p> <div class="siteseo-notice"><span class="dashicons dashicons-info"></span> <div> <h3>'.esc_html__('How to make use of the HTML Sitemap?', 'siteseo').'</h3> <h4>'.esc_html__('Block Editor', 'siteseo').'</h4> <p>'. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('Insert the HTML sitemap block via the %1$s Block Editor %2$s.', 'siteseo'), '<strong>', '</strong>')).'</p> <h4>'.esc_html__('Shortcode', 'siteseo').'</h4> <p>'.esc_html__('You can also insert this shortcode into your content (post, page, custom post type, etc.):', 'siteseo').'</p> <div class="siteseo-styles pre"><pre>'.esc_attr('[siteseo_html_sitemap]','siteseo').'</div></pre> <p>'.esc_html__('To include specific custom post types, use the CPT attribute:', 'siteseo') .'</p> <div class="siteseo-styles pre"><pre>'.esc_attr('[siteseo_html_sitemap cpt="post,product"]','siteseo').'</div></pre> <h4>'.esc_html__('Other', 'siteseo').'</h4> <p>'.esc_html__('Display the sitemap dynamically by entering an ID in the first field below.', 'siteseo').'</p> </div> </div> <table class="form-table"> <tr scope="row"> <th>'.esc_html__('Post, Page, or Custom Post Type IDs to display:','siteseo').'</th> <td> <input type="text" value="'.esc_html($include_pages).'" name="siteseo_options[page_numbers]" placeholder="'.esc_html__('eg:2, 28, 68','siteseo').'"> </td> </tr> <tr scope="row"> <th>'.esc_html__('Exclude Posts, Pages, Custom Post Types or Terms IDs:','siteseo').'</th> <td> <input type="text" value="'.esc_html($exclude_page).'" name="siteseo_options[exclude_page]" placeholder="'.esc_html__('eg: 13 ,8 ,28','siteseo').'"> </td> </tr> <tr scope="row"> <th>'.esc_html__('Order:','siteseo').'</th> <td> <select name="siteseo_options[order]"> <option value="DESC" '.selected($order, 'DESC', false).'>'.esc_html__('DESC (descending order from highest to lowest values (3, 2, 1; c, b, a))','siteseo').'</option> <option value="ASC" '.selected($order, 'ASC', false).'>'.esc_html__('ASC (ascending order from lowest to highest values (1, 2, 3; a, b, c))','siteseo').'</option> </select> </td> </tr> <tr scope="row"> <th>'.esc_html__('Order By:','siteseo').'</th> <td> <select name="siteseo_options[order_by]"> <option value="date" '.selected($order_by, 'date', false).'>'.esc_html__('Deafult (date)','siteseo').'</option> <option value="post_title" '.selected($order_by, 'post_title', false).'>'.esc_html__('Post Title','siteseo').'</option> <option value="modified_date" '.selected($order_by, 'modified_date', false).'>'.esc_html__('Modified date','siteseo').'</option> <option value="post_id" '.selected($order_by, 'post_id', false).'>'.esc_html__('POST ID','siteseo').'</option> <option value="menu_order" '.selected($order_by, 'menu_order', false).'>'.esc_html__('Menu Order','siteseo').'</option> </select> </td> </tr> <tr scope="row"> <th>'.esc_html__('Disable Date:','siteseo').'</th> <td> <label for="sitemap_html_date"> <input id="sitemap_html_date" name="siteseo_options[disable_date]" type="checkbox" '.(!empty($disable_date) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Disable the date display after each post, page, or post type?', 'siteseo'). '</label> </td> </tr> <tr scope="row"> <th>'.esc_html__('Remove Archive Links:','siteseo').'</th> <td> <label for="sitemap_remove_link"> <input id="sitemap_remove_link" name="siteseo_options[remove_links]" type="checkbox" '.(!empty($remove_archive) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Remove links from archive pages (e.g., Products).', 'siteseo'). '</label> </td> </tr> </table><input type="hidden" name="siteseo_options[html_sitemap]" value="1"/>'; } static function save_settings(){ global $siteseo; check_admin_referer('siteseo_sitemap_settings'); if(!siteseo_user_can('manage_sitemap') || !is_admin()){ return; } $options = []; if(empty($_POST['siteseo_options'])){ return; } if(isset($_POST['siteseo_options']['general_sitemaps'])){ $options['xml_sitemap_general_enable'] = isset($_POST['siteseo_options']['enable_xml_sitemap']); $options['xml_sitemap_img_enable'] = isset($_POST['siteseo_options']['enable_img_sitemap']); $options['xml_sitemap_author_enable'] = isset($_POST['siteseo_options']['enable_author_sitemap']); $options['xml_sitemap_html_enable'] = isset($_POST['siteseo_options']['enable_html_sitemap']); flush_rewrite_rules(); } if(isset($_POST['siteseo_options']['html_sitemap'])){ $options['xml_sitemap_html_mapping'] = isset($_POST['siteseo_options']['page_numbers']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['page_numbers'])) : ''; $options['xml_sitemap_html_exclude'] = isset($_POST['siteseo_options']['exclude_page']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['exclude_page'])) : ''; $options['xml_sitemap_html_order'] = isset($_POST['siteseo_options']['order'])? sanitize_text_field(wp_unslash($_POST['siteseo_options']['order'])) : ''; $options['xml_sitemap_html_orderby'] = isset($_POST['siteseo_options']['order_by']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['order_by'])) : ''; $options['xml_sitemap_html_date'] = isset($_POST['siteseo_options']['disable_date']); $options['xml_sitemap_html_archive_links'] = isset($_POST['siteseo_options']['remove_links']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['remove_links'])) : ''; } // posts if(isset($_POST['siteseo_options']['post_types_tab'])){ if(isset($_POST['siteseo_options']['xml_sitemap_post_types_list'])){ $xml_post_types = map_deep(wp_unslash($_POST['siteseo_options']['xml_sitemap_post_types_list']), 'sanitize_text_field'); foreach($xml_post_types as $posttypes_key => $posttypes_value) { if(isset($posttypes_value['include'])) { $options['xml_sitemap_post_types_list'][$posttypes_key]['include'] = $posttypes_value['include']; } } } } // Taxonomies if(isset($_POST['siteseo_options']['taxonomy_sitemap_tabs'])){ if(isset($_POST['siteseo_options']['xml_sitemap_taxonomies_list'])){ $xml_tax_list = map_deep(wp_unslash($_POST['siteseo_options']['xml_sitemap_taxonomies_list']), 'sanitize_text_field'); foreach($xml_tax_list as $taxonomy_key => $taxonomy_value){ if(isset($taxonomy_value['include'])){ $options['xml_sitemap_taxonomies_list'][$taxonomy_key]['include'] = $taxonomy_value['include']; } } } } update_option('siteseo_xml_sitemap_option_name',$options); } } main/settings/instant.php 0000644 00000034044 15104342737 0011534 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO\Settings; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Instant{ static function menu(){ global $siteseo; $indexing_toggle = isset($siteseo->setting_enabled['toggle-instant-indexing']) ? $siteseo->setting_enabled['toggle-instant-indexing'] : ''; $nonce = wp_create_nonce('siteseo_toggle_nonce'); $current_tab = isset($_GET['tab']) ? sanitize_key($_GET['tab']) : 'tab_siteseo_general'; $instant_subtabs = [ 'tab_siteseo_general' => esc_html__('General', 'siteseo'), 'tab_siteseo_settings' => esc_html__('Settings', 'siteseo'), 'tab_siteseo_history' => esc_html__('History', 'siteseo'), ]; echo '<div id="siteseo-root">'; Util::admin_header(); echo '<form method="post" id="siteseo-form" class="siteseo-option" name="siteseo-flush">'; wp_nonce_field('siteseo_instant_indexing'); Util::render_toggle('Instant Indexing - SiteSEO', 'indexing_toggle', $indexing_toggle, $nonce); echo '<div id="siteseo-tabs" class="wrap"> <div class="nav-tab-wrapper">'; foreach($instant_subtabs as $tab_key => $tab_caption){ $active_class = ($current_tab === $tab_key) ? ' nav-tab-active' : ''; echo '<a id="'.esc_attr($tab_key).'-tab" class="nav-tab'.esc_attr($active_class).'" data-tab="'.esc_attr($tab_key).'">'.esc_html($tab_caption).'</a>'; } echo '</div> <div class"tab-content-wrapper"> <div class="siteseo-tab'.($current_tab == 'tab_siteseo_general' ? ' active' : '').'" id="tab_siteseo_general" style="display: none;">'; self::general(); echo '</div> <div class="siteseo-tab'.($current_tab == 'tab_siteseo_settings' ? ' active' : '').'" id="tab_siteseo_settings" style="display: none;">'; self::settings(); echo '</div> <div class="siteseo-tab'.($current_tab == 'tab_siteseo_history' ? 'active' : '').'" id="tab_siteseo_history" style="display : none;">'; self::history(); echo '</div> </div>'; Util::submit_btn(); echo '</form></div>'; } static function general(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } $options = get_option('siteseo_instant_indexing_option_name'); //$options = $siteseo->instant_settings; $option_engines = !empty($options['engines']) ? $options['engines'] : ''; $option_search_engine_google = !empty($option_engines['google']) ? $option_engines['google'] : ''; $option_search_engine_bing = !empty($option_engines['bing']) ? $option_engines['bing'] : ''; $option_action = !empty($options['instant_indexing_google_action']) ? $options['instant_indexing_google_action'] : ''; $option_manual_batch = !empty($options['instant_indexing_manual_batch']) ? $options['instant_indexing_manual_batch'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('Instant Indexing','siteseo').'</h3> <div class="siteseo_wrap_label"> <p class="description">'.esc_html__('Utilize the Indexing API to inform Google and Bing about updates or removals of pages from their indexes. The process may take a few minutes. You can submit URLs in batches of up to 100 (maximum 200 requests per day for Google).','siteseo').'</p> </div> <div class="siteseo-notice"> <span class="dashicons dashicons-info"></span> <div><h3>'.esc_html__('How does this work?', 'siteseo').'</h3> <ol> <li>'. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('Setup your Google / Bing API keys from the %1$s Settings %2$s tab', 'siteseo'), '<strong>', '</strong>')).'</li> <li>'. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('%1$s Enter the URLs %2$s you want to index in the field below.', 'siteseo'), '<strong>', '</strong>')).'</li> <li><strong>'.wp_kses_post(__('Save changes', 'siteseo')).'</strong></li> <li>'. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('Click %1$s Submit URLs to Google & Bing %2$s', 'siteseo'), '<strong>', '</strong>')).'</li> </ol> </div> </div> <table class="form-table"> <tbody> <tr> <th scope="row">'.esc_html__('select search engines','siteseo').'</th> <td> <div class="siteseo_wrap_label"><label for="siteseo_search_engines"> <input id="siteseo_search_engines" name="siteseo_options[search_engine_google]" type="checkbox"' . (!empty($option_search_engine_google) ? 'checked="yes"' : '') . ' value="1"/>'.esc_html__('Google', 'siteseo') . '</label></div> <label for="siteseo_search_engines"> <input id="siteseo_search_engines" name="siteseo_options[search_engine_bing]" type="checkbox"' . (!empty($option_search_engine_bing) ? 'checked="yes"' : '') . ' value="1"/>'.esc_html__('Bing', 'siteseo') . '</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Which action to run for Google?', 'siteseo') .'</th> <td> <div class="siteseo_wrap_label"> <label> <input id="siteseo_update_urls" name="siteseo_options[instant_indexing_actions]" type="radio" value="update_urls" '.checked($option_action, 'update_urls', false).'/> '.esc_html__('Update URLs', 'siteseo').' </label> </div> <div class="siteseo_wrap_label"> <label> <input id="siteseo_remove_urls" name="siteseo_options[instant_indexing_actions]" type="radio" value="remove_urls" '.checked($option_action, 'remove_urls', false).'/> '.esc_html__('Remove URLs (the URL must return a 404 or 410 status code, or the page must include the <meta name="robots" content="noindex" /> meta tag).', 'siteseo').' </label> </div> </td> </tr> <tr> <th scope="row">'.esc_html__('Submit URLs for indexing','siteseo').'</th> <td> <textarea rows="20" name="siteseo_options[instant_indexing_batch]" placeholder="'.esc_html__('Submit one URL per line for search engine submission (maximum of 100 URLs).','siteseo').'">'.esc_attr($option_manual_batch).'</textarea> </td> </tr> <tr> <th scope="row"></th> <td> <button id="siteseo-submit-urls-button" class="btn btnSecondary">'.esc_html__('Submits URLs to Google & Bing', 'siteseo').'</button> </td><div style="position:absolute;margin-top:52.5%;margin-left:38%;" class="spinner"></div> </tr> <tr> <th scope="row"></th> <td> <div id="url-submitter-response"></div> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[general]" value="1"/>'; } static function settings(){ global $siteseo,$docs; if(!empty($_POST['submit'])){ self::save_settings(); } $docs['instant_indexing']['api'] = 'https://console.cloud.google.com/apis/library/indexing.googleapis.com?hl=en'; $docs['instant_indexing']['google'] = 'https://siteseo.io/docs/api-cli-dev/use-google-instant-indexing-api-with-siteseo-pro/'; //$options = $siteseo->instant_settings; $options = get_option('siteseo_instant_indexing_option_name'); $option_google_api_key = !empty($options['instant_indexing_google_api_key']) ? $options['instant_indexing_google_api_key'] : ''; $option_bing_api_key = !empty($options['instant_indexing_bing_api_key']) ? $options['instant_indexing_bing_api_key'] : ''; $option_auto_url_submission = !empty($options['instant_indexing_automate_submission']) ? $options['instant_indexing_automate_submission'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('Settings','siteseo').'</h3> <table class="form-table"> <tbody> <tr> <th scope="row">'.esc_html__('Instant Indexing Google API Key','siteseo').'</th> <td> <textarea name="siteseo_options[google_api_key]" rows="12" placeholder="'.esc_html__('Paste your Google Json key file here','siteseo').'">'.esc_html($option_google_api_key).'</textarea> </td> </tr> <tr> <th scope="row">'.esc_html__('Instant Indexing Bing API Key', 'siteseo').'</th> <td> <input type="text" id="bing-api-key" name="siteseo_options[bing_api_key]" placeholder="'.esc_html__('Enter your Bing Instant Indexing API', 'siteseo').'" value="'.esc_attr($option_bing_api_key).'"> <button type="button" id="siteseo-generate-api-key-btn" class="btn btnSecondary">'.esc_html__('Generate key', 'siteseo').'</button> <p class="description">'.esc_html__('The Bing Indexing API key is generated automatically. Click Generate Key if you need to recreate it or if it missing.', 'siteseo') .'</p> <p class="description">'.esc_html__('A key should look like this: YjI4MGQxZmU0NWM1NGY2ZGIxMDk5M2VlYTAxMTUyODI=', 'siteseo') .'</p> </td> </tr> <tr> <th scope="row">'.esc_html__('Automate URL Submission','siteseo').'</th> <td> <label for="siteseo_search_engines"> <input id="siteseo_search_engines" name="siteseo_options[auto_submission]" type="checkbox"'.(!empty($option_auto_url_submission) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Activate automatic URL submission for the IndexNow API.', 'siteseo') . '</label> <div class="siteseo_wrap_label"> <p class="description">'.esc_html__('Inform search engines via the IndexNow protocol currently Bing whenever a post is created, updated, or removed.','siteseo').'</p> </div> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[setting_tab]" value="1"/>'; } static function history(){ global $siteseo; $options = get_option('siteseo_instant_indexing_option_name'); $indexing_history = !empty($options['indexing_history']) ? $options['indexing_history'] : ''; echo'<h3 class="siteseo-tabs">'.esc_html__('History', 'siteseo').'</h3> <div class="siteseo_wrap_label"> <p class="description">'.esc_html__('Most Recent 10 Indexing API Requests.', 'siteseo').'</p> </div> <table class="wp-list-table widefat fixed striped siteseo-history-table"> <thead><tr> <th>'.esc_html__('Time & Date', 'siteseo').'</th> <th>'.esc_html__('URLs', 'siteseo').'</th> <th>'.esc_html__('Google Response', 'siteseo').'</th> <th>'.esc_html__('Bing Response', 'siteseo').'</th> </tr></thead> <tbody>'; if(empty($indexing_history)){ echo'<tr> <td>'.esc_html__('No submissions yet.', 'siteseo').'</td> </tr></tbody></table><br/><br/>'; return; } foreach($indexing_history as $history){ echo'<tr> <td>'.esc_html(date_i18n('Y-m-d H:i:s', $history['time'])).'</td> <td>'.esc_html(implode(', ', $history['urls'])).'</td> <td>'.(isset($history['google_status_code']) ? esc_html($history['google_status_code']) : 'N/A').'</td> <td>'.(isset($history['bing_status_code']) ? esc_html($history['bing_status_code']) : 'N/A') . (isset($history['source']) && $history['source'] === 'auto' ? esc_html(' ( Auto )') : '') . '</td> </tr>'; } echo'</tr> </tbody></table><br/> <tr> <td> <button id="siteseo-clear-history" class="btn btnSecondary">'.esc_html__('Clean History', 'siteseo').'</button> </td> </tr><br/><br/> <a class="siteseo-show-details">'.esc_html__('Response code guide', 'siteseo').'<span class="dash-icon dashicons dashicons-arrow-down-alt2"></span></a> <div class="siteseo-response-code-table"> <table class="wp-list-table widefat fixed striped siteseo-history-table"> <thead> <tr> <th>'.esc_html__('Response Code', 'siteseo').'</th> <th>'.esc_html__('Response Message', 'siteseo').'</th> <th>'.esc_html__('Reason', 'siteseo').'</th> </tr> </thead> <tr> <td>'.esc_html__('200', 'siteseo').'</td> <td>'.esc_html__('Ok', 'siteseo').'</td> <td>'.esc_html__('URLs submitted successfully.', 'siteseo').'</td> </tr> <tr> <td>'.esc_html__('202', 'siteseo').'</td> <td>'.esc_html__('Accepted', 'siteseo').'</td> <td>'.esc_html__('URL received. IndexNow key validation pending.', 'siteseo').'</td> </tr> <tr> <td>'.esc_html__('400', 'siteseo').'</td> <td>'.esc_html__('Bad Request', 'siteseo').'</td> <td>'.esc_html__('Request Invalid format.', 'siteseo').'</td> </tr> <tr> <td>'.esc_html__('403', 'siteseo').'</td> <td>'.esc_html__('Forbidden', 'siteseo').'</td> <td>'.esc_html__('Key not valid.', 'siteseo').'</td> </tr> <tr> <td>'.esc_html__('422', 'siteseo').'</td> <td>'.esc_html__('Unprocessable Entity', 'siteseo').'</td> <td>'.esc_html__('URLs don\'t belong to the host.', 'siteseo').'</td> </tr> <tr> <td>'.esc_html__('429', 'siteseo').'</td> <td>'.esc_html__('Too Many Requests', 'siteseo').'</td> <td>'.esc_html__('Too Many Requests: Potential Spam.', 'siteseo').'</td> </tr> <tbody> </table></div><br/><br/>'; } static function save_settings(){ global $siteseo; check_admin_referer('siteseo_instant_indexing'); if(!siteseo_user_can('manage_instant_indexing')|| !is_admin()){ return; } $options = $siteseo->instant_settings; if(empty($_POST['siteseo_options'])){ return; } if(isset($_POST['siteseo_options']['general'])){ // general tab $options['engines']['bing'] = isset($_POST['siteseo_options']['search_engine_bing']); $options['engines']['google'] = isset($_POST['siteseo_options']['search_engine_google']); $options['instant_indexing_google_action'] = isset($_POST['siteseo_options']['instant_indexing_actions']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['instant_indexing_actions'])) : 'URL_UPDATED'; $options['instant_indexing_manual_batch'] = isset($_POST['siteseo_options']['instant_indexing_batch']) ? sanitize_textarea_field(wp_unslash($_POST['siteseo_options']['instant_indexing_batch'])) : ''; } if(isset($_POST['siteseo_options']['setting_tab'])){ // setting tab $options['instant_indexing_google_api_key'] = isset($_POST['siteseo_options']['google_api_key']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['google_api_key'])) : ''; $options['instant_indexing_bing_api_key'] = isset($_POST['siteseo_options']['bing_api_key']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['bing_api_key'])) : ''; $options['instant_indexing_automate_submission'] = isset($_POST['siteseo_options']['auto_submission']); } update_option('siteseo_instant_indexing_option_name', $options); } } main/settings/dashboard.php 0000644 00000035353 15104342737 0012007 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO\Settings; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Dashboard{ static function dashboard_tab(){ global $siteseo; $pro = get_option('siteseo_pro_options'); $options = $siteseo->setting_enabled; $titles_meta_toggle = isset($options['toggle-titles']) ? $options['toggle-titles'] : ''; $sitemap_toggle = isset($options['toggle-xml-sitemap']) ? $options['toggle-xml-sitemap'] : ''; $social_toggle = isset($options['toggle-social']) ? $options['toggle-social'] : ''; $advanced_toggle = isset($options['toggle-advanced']) ? $options['toggle-advanced'] : ''; $analytics_toggle = isset($options['toggle-google-analytics']) ? $options['toggle-google-analytics'] : ''; $indexing_toggle = isset($options['toggle-instant-indexing']) ? $options['toggle-instant-indexing'] : ''; //pro-features $toggle_localBusiness = isset($pro['toggle_state_local_buz']) ? $pro['toggle_state_local_buz'] : ''; $toggle_easy_digital = isset($pro['toggle_state_easy_digital']) ? $pro['toggle_state_easy_digital'] : ''; $toggle_woocommerce = isset($pro['toggle_state_woocommerce']) ? $pro['toggle_state_woocommerce'] : ''; $toggle_structured_data = isset($pro['toggle_state_stru_data']) ? $pro['toggle_state_stru_data'] : ''; $toggle_state_redirect = isset($pro['toggle_state_redirect_monitoring']) ? $pro['toggle_state_redirect_monitoring'] : ''; $toggle_state_google_news = isset($pro['toggle_state_google_news']) ? $pro['toggle_state_google_news'] : ''; $toggle_state_video_sitemap = isset($pro['toggle_state_video_sitemap']) ? $pro['toggle_state_video_sitemap'] : ''; $nonce = wp_create_nonce('siteseo_toggle_nonce'); $pro_nonce = wp_create_nonce('siteseo_pro_toggle_nonce'); $siteseo_dashboard_img = SITESEO_ASSETS_URL.'/img/seo-get-started.jpg'; $siteseo_loginizer_product = SITESEO_ASSETS_URL.'/img/loginizer_product.png'; echo'<div id="siteseo-root">'; Util::admin_header(); $dismissed_intro = get_option('siteseo_dismiss_intro', 0); echo'<div id="siteseo-dashbord">'; if(empty($dismissed_intro)){ echo '<div class="siteseo-dashbord-intro"> <div class="siteseo-text-content"> <h2>'.esc_html__('HOW-TO GET STARTED', 'siteseo').'</h2><h1>'.esc_html__('Welcome to SiteSEO!', 'siteseo').'</h1> <p>'.esc_html__('Launch our installation wizard to quickly and easily configure the basic SEO settings for your site. Cant find the answers to your questions? Write us at support@siteseo.io. A happiness engineer will be happy to help you.', 'siteseo').'</p> <div class="siteseo-buttons"> <a class="get-started" href="?page=siteseo-onboarding">'.esc_html__('Get started', 'siteseo').'</a> <a class="dismiss" id="siteseo-dismiss-get-started" href="#">'.esc_html__('Dismiss', 'siteseo').'</a> </div> </div> <div class="siteseo-image-content"><img alt="'.esc_html__('Illustration of a megaphone with various icons representing SEO and digital marketing', 'siteseo').'" height="470" src="'.esc_url($siteseo_dashboard_img).'" width="470"/> </div> </div>'; } echo '<div class="siteseo-dashbord-content"> <section class="siteseo-dashboard-features"> <h2>'.esc_html__('Manage SiteSEO Features', 'siteseo').'</h2></br/> <div class="siteseo-dashbord-container"> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-edit-large siteseo-card-icon"></span> <h3>'.esc_html__('Titles & Metas', 'siteseo').'</h3> <p>'.esc_html__('Manage all your titles and metas for post types, taxonomies more...', 'siteseo').'</p> </div> <div class="siteseo-card-footer"> <a href="admin.php?page=siteseo-titles">'.esc_html__('Settings', 'siteseo').'</a>'; Util::render_toggle('Titles & Metas -SiteSEO', 'titles_meta_toggle', $titles_meta_toggle, $nonce, true); echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-networking siteseo-card-icon"></span> <h3>'.esc_html__('XML & HTML Sitemaps', 'siteseo').'</h3> <p>'.esc_html__('Manage your XML - Image - Video- Taxonomies - HTML Sitemap more...', 'siteseo').'</p> </div> <div class="siteseo-card-footer"> <a href="admin.php?page=siteseo-sitemaps">'.esc_html__('Settings', 'siteseo').'</a>'; Util::render_toggle('Sitemaps - SiteSEO', 'sitemap_toggle', $sitemap_toggle, $nonce,true); echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-share siteseo-card-icon"></span> <h3>'.esc_html__('Social Networks', 'siteseo').'</h3> <p>'.esc_html__('Open Graph, X Card, Google Knowledge Graph and more...', 'siteseo').'</p> </div> <div class="siteseo-card-footer"> <a href="admin.php?page=siteseo-social">'.esc_html__('Settings','siteseo').'</a>'; Util::render_toggle('Social - SiteSEO', 'social_toggle', $social_toggle, $nonce,true); echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-performance siteseo-card-icon"></span> <h3>'.esc_html__('Analytics', 'siteseo').'</h3> <p>'.esc_html__('Track everything about your visitors with Analytics/Matomo more...', 'siteseo').'</p> </div> <div class="siteseo-card-footer"> <a href="admin.php?page=siteseo-analytics">'.esc_html__('Settings','siteseo').'</a>'; Util::render_toggle('Analytics - SiteSEO', 'analytics_toggle', $analytics_toggle, $nonce,true); echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-superhero siteseo-card-icon"></span> <h3>'.esc_html__('Instant Indexing','siteseo').'</h3> <p>'.esc_html__('Ping Google & Bing to quickly index your content. Updated and remove submit URLs','siteseo').'</p> </div> <div class="siteseo-card-footer"> <a href="admin.php?page=siteseo-instant-indexing">'.esc_html__('Settings','siteseo').'</a>'; Util::render_toggle('Instant indexing - SiteSEO', 'indexing_toggle', $indexing_toggle, $nonce,true); echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-format-gallery siteseo-card-icon"></span> <h3>'.esc_html__('Image SEO','siteseo').'</h3> <p>'.esc_html__('Optimize your images for SEO. Configure advanced settings more...','siteseo').'</p> </div> <div class="siteseo-card-footer"> <a href="admin.php?page=siteseo-advanced">'.esc_html__('Settings','siteseo').'</a>'; Util::render_toggle('Advanced - SiteSEO', 'advanced_toggle', $advanced_toggle, $nonce,true); echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-upload siteseo-card-icon"></span> <h3>'.esc_html__('Tools', 'siteseo').'</h3> <p>'.esc_html__('Import/Export plugin settings from site to site. Reset settings more...', 'siteseo').'</p> </div> <div class="siteseo-card-footer"> <a href="admin.php?page=siteseo-tools">'.esc_html__('Settings', 'siteseo').'</a> <div class="siteseo-toggle-container"> </div> </div> </div>'; echo'<div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-cart siteseo-card-icon"></span> <h3>'.esc_html__('WooCommerces SEO','siteseo'),'</h3> <p>'.esc_html__('Add meta tags required for WooCommerce SEO','siteseo').'</p> </div> <div class="siteseo-card-footer">'; if(defined('SITESEO_PRO_VERSION')){ echo'<a href="admin.php?page=siteseo-pro-page">'.esc_html__('Settings','siteseo').'</a>'; } else{ echo'<div class="siteseo-pro-badge">Pro</div>'; } if(class_exists('\SiteSEOPro\Settings\Util') && method_exists('\SiteSEOPro\Settings\Util', 'render_toggle')){ \SiteSEOPro\Settings\Util::render_toggle('woocommerce', $toggle_woocommerce, $pro_nonce, true); } echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-money-alt siteseo-card-icon"></span> <h3>'.esc_html__('Easy Digital Downloads', 'siteseo').'</h3> <p>'.esc_html__('Add meta tags required for Easy Digitial Downloads SEO', 'siteseo').'</p> </div> <div class="siteseo-card-footer">'; if(defined('SITESEO_PRO_VERSION')){ echo'<a href="admin.php?page=siteseo-pro-page">'.esc_html__('Settings','siteseo').'</a>'; } else{ echo'<div class="siteseo-pro-badge">Pro</div>'; } if(class_exists('\SiteSEOPro\Settings\Util') && method_exists('\SiteSEOPro\Settings\Util', 'render_toggle')){ \SiteSEOPro\Settings\Util::render_toggle('edd', $toggle_easy_digital, $pro_nonce,true); } echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-code-standards siteseo-card-icon"></span> <h3>'.esc_html__('Page Speed', 'siteseo').'</h3> <p>'.esc_html__('Enhance Your Website Performance with PageSpeed Insights','siteseo').'</p> </div> <div class="siteseo-card-footer">'; if(defined('SITESEO_PRO_VERSION')){ echo'<a href="admin.php?page=siteseo-pro-page">'.esc_html__('Settings', 'siteseo').'</a>'; } else { echo'<div class="siteseo-pro-badge">Pro</div>'; } echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-list-view siteseo-card-icon"></span> <h3>'.esc_html__('Structured Data','siteseo').'</h3> <p>'.esc_html__('Enhance Search Visibility with Structured Data Optimization','siteseo').'</p> </div> <div class="siteseo-card-footer">'; if(defined('SITESEO_PRO_VERSION')){ echo'<a href="admin.php?page=siteseo-pro-page">'.esc_html__('Settings', 'siteseo').'</a>'; } else{ echo'<div class="siteseo-pro-badge">Pro</div>'; } if(class_exists('\SiteSEOPro\Settings\Util') && method_exists('\SiteSEOPro\Settings\Util', 'render_toggle')){ \SiteSEOPro\Settings\Util::render_toggle('structured', $toggle_structured_data, $pro_nonce,true); } echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-location siteseo-card-icon"></span> <h3>'.esc_html__('Local Business', 'siteseo').'</h3> <p>'.esc_html__('Optimize Your Online Presence for Local Business Success', 'siteseo').'</p> </div> <div class="siteseo-card-footer">'; if(defined('SITESEO_PRO_VERSION')){ echo '<a href="admin.php?page=siteseo-pro-page">'.esc_html__('Settings', 'siteseo').'</a>'; } else{ echo'<div class="siteseo-pro-badge">Pro</div>'; } if(class_exists('\SiteSEOPro\Settings\Util') && method_exists('\SiteSEOPro\Settings\Util', 'render_toggle')){ \SiteSEOPro\Settings\Util::render_toggle('local', $toggle_localBusiness, $pro_nonce, true); } echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-editor-unlink siteseo-card-icon"></span> <h3>'.esc_html__('Redirections / 404 monitoring','siteseo').'</h3> <p>'.esc_html__('Track 404 errors and set up redirects to improve user experience and SEO.','siteseo').'</p> </div> <div class="siteseo-card-footer">'; if(defined('SITESEO_PRO_VERSION')){ echo'<a href="admin.php?page=siteseo-pro-page">'.esc_html__('Settings', 'siteseo').'</a>'; } else{ echo'<div class="siteseo-pro-badge">Pro</div>'; } if(class_exists('\SiteSEOPro\Settings\Util') && method_exists('\SiteSEOPro\Settings\Util', 'render_toggle')){ \SiteSEOPro\Settings\Util::render_toggle('404_monitoring', $toggle_state_redirect, $pro_nonce, true); } echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-index-card siteseo-card-icon"></span> <h3>'.esc_html__('Google News','siteseo').'</h3> <p>'.esc_html__('Generate and manage a Google News sitemap to ensure your news articles get indexed quickly.','siteseo').'</p> </div> <div class="siteseo-card-footer">'; if(defined('SITESEO_PRO_VERSION')){ echo'<a href="admin.php?page=siteseo-pro-page">'.esc_html__('Settings', 'siteseo').'</a>'; } else{ echo'<div class="siteseo-pro-badge">Pro</div>'; } if(class_exists('\SiteSEOPro\Settings\Util') && method_exists('\SiteSEOPro\Settings\Util', 'render_toggle')){ \SiteSEOPro\Settings\Util::render_toggle('google_news', $toggle_state_google_news, $pro_nonce, true); } echo'</div> </div> <div class="siteseo-card"> <div class="siteseo-card-body"> <span class="dashicons dashicons-format-video siteseo-card-icon"></span> <h3>'.esc_html__('Video Sitemap','siteseo').'</h3> <p>'.esc_html__('Create and manage a video sitemap to help search engines index your video content efficiently.','siteseo').'</p> </div> <div class="siteseo-card-footer">'; if(defined('SITESEO_PRO_VERSION')){ echo'<a href="admin.php?page=siteseo-pro-page">'.esc_html__('Settings', 'siteseo').'</a>'; } else{ echo'<div class="siteseo-pro-badge">Pro</div>'; } if(class_exists('\SiteSEOPro\Settings\Util') && method_exists('\SiteSEOPro\Settings\Util', 'render_toggle')){ \SiteSEOPro\Settings\Util::render_toggle('video_sitemap', $toggle_state_video_sitemap, $pro_nonce, true); } echo'</div> </div>'; echo'</div></section>'; echo'<section class="siteseo-dashboard-extras"> <div class="siteseo-need-help"> <h3>'.esc_html__('Support', 'siteseo').'</h3> <p>'.esc_html__('If you are facing any issue contact us, our team will help you', 'siteseo').'</p> <div> <a href="https://siteseo.io/docs/" class="siteseo-button siteseo-btn-black siteseo-100" target="_blank">'.esc_html__('Check the Docs', 'siteseo').'</a> <a href="https://softaculous.deskuss.com/open.php?topicId=22" class="siteseo-button siteseo-btn-transparent siteseo-100" target="_blank">'.esc_html__('Contact Support', 'siteseo').'</a> </div> </div> <div class="siteseo-rating-tab"> <div class="siteseo-rating"> <a class="siteseo-stars" href="https://wordpress.org/support/plugin/siteseo/reviews/?filter=5#new-post" target="_blank"> <span class="dashicons dashicons-star-filled"></span> <span class="dashicons dashicons-star-filled"></span> <span class="dashicons dashicons-star-filled"></span> <span class="dashicons dashicons-star-filled"></span> <span class="dashicons dashicons-star-filled"></span> </a> </div> <p>'.esc_html__('Please take a moment to rate us —it really helps us a lot!', 'siteseo').'</p> </div> </section> </div> </div> </div>'; } } main/settings/titles.php 0000644 00000131264 15104342737 0011362 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO\Settings; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Titles{ static function menu(){ global $siteseo; $current_tab = isset($_GET['tab']) ? sanitize_key($_GET['tab']) : 'tab_siteseo_home'; // Default tab $titles_meta_subtabs = [ 'tab_siteseo_home' => esc_html__('Home', 'siteseo'), 'tab_siteseo_post_types' => esc_html__('Post types', 'siteseo'), 'tab_siteseo_archives' => esc_html__('Archives', 'siteseo'), 'tab_siteseo_taxonomies' => esc_html__('Taxonomies', 'siteseo'), 'tab_siteseo_advanced' => esc_html__('Advanced','siteseo') ]; echo '<div id="siteseo-root">'; Util::admin_header(); echo '<form method="post" id="siteseo-form" class="siteseo-option" name="siteseo-flush">'; wp_nonce_field('siteseo_title_settings'); $titles_meta_toggle = isset($siteseo->setting_enabled['toggle-titles']) ? $siteseo->setting_enabled['toggle-titles'] : ''; $nonce = wp_create_nonce('siteseo_toggle_nonce'); Util::render_toggle('Titles & Metas - SiteSEO', 'titles_meta_toggle', $titles_meta_toggle, $nonce); echo '<div id="siteseo-tabs" class="wrap"> <div class="nav-tab-wrapper">'; foreach($titles_meta_subtabs as $tab_key => $tab_caption) { $active_class = ($current_tab === $tab_key) ? ' nav-tab-active' : ''; echo '<a id="' . esc_attr($tab_key) . '-tab" class="nav-tab' . esc_attr($active_class) . '" data-tab="' . esc_attr($tab_key) . '">' . esc_html($tab_caption) . '</a>'; } echo '</div> <div class="tab-content-wrapper"> <div class="siteseo-tab '.($current_tab == 'tab_siteseo_home' ? ' active' : '').'" id="tab_siteseo_home" style="display: none;">'; self::home(); echo '</div> <div class="siteseo-tab '.($current_tab == 'tab_siteseo_post_types' ? ' active' : '').'" id="tab_siteseo_post_types" style="display: none;">'; self::post_types(); echo '</div> <div class="siteseo-tab '.($current_tab == 'tab_siteseo_archives' ? ' active' : '').'" id="tab_siteseo_archives" style="display: none;">'; self::archives(); echo '</div> <div class="siteseo-tab '.($current_tab == 'tab_siteseo_taxonomies' ? ' active' : '').'" id="tab_siteseo_taxonomies" style="display: none;" style="display: none;">'; self::taxonomies(); echo '</div> <div class="siteseo-tab '.($current_tab == 'tab_siteseo_advanced' ? ' active' : '').'" id="tab_siteseo_advanced">'; self::advanced(); echo '</div> </div>'; Util::submit_btn(); echo '</form></div>'; } static function home(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } $options = get_option('siteseo_titles_option_name'); //$options = $siteseo->titles_settings; $option_separator = !empty($options['titles_sep']) ? $options['titles_sep'] : ''; $option_site_title = !empty($options['titles_home_site_title']) ? $options['titles_home_site_title'] : ''; $option_site_title_alt = !empty($options['titles_home_site_title_alt']) ? $options['titles_home_site_title_alt'] : ''; $option_site_desc = !empty($options['titles_home_site_desc']) ? $options['titles_home_site_desc'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('HOME','siteseo').'</h3> <div class="siteseo-notice"> <span id="siteseo-dash-icon" class="dashicons dashicons-info"></span> <p>'.esc_html__('Search engines use the title and meta description to create a snippet of your site for the search results page.', 'siteseo').'</p> </div> <p>'.esc_html__('Personalize the title and meta description for your homepage.','siteseo').'</p> <span class="dashicons dashicons-external"></span> <a href="'.esc_attr('https://siteseo.io/docs/meta/google-uses-the-wrong-meta-title-meta-description-in-search-results/').'" target="_blank">'.esc_html__('Incorrect meta title or description appearing in search results?', 'siteseo').'</a> <table class="form-table"> <tbody> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Separator','siteseo').'</th> <td> <input type="text" name="siteseo_options[separator]" placeholder="'.esc_attr__('Specify your separator, e.g:-','siteseo').'" value="'.esc_attr($option_separator).'"> <p class="description">'.esc_attr__('Include this separator using %%sep%% in your title and meta description.','siteseo').'</p> </td> </tr> <td colspan="2"><span class="dashed-line"></span></td> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Site title','siteseo').'</th> <td> <input type="text" name="siteseo_options[site_title]" value="'.esc_attr($option_site_title).'" placeholder="'.esc_html__('My fantastic site','siteseo').'"> <div class="wrap-tags"> <button class="tag-title-btn" id="btn-site-title" data-tag="%%sitetitle%%"><span id="icon" class="dashicons dashicons-insert"></span>'. esc_html__('SITE TITLE','siteseo').'</button> <button class="tag-title-btn" id="btn-separator" data-tag="%%sep%%"><span id="icon" class="dashicons dashicons-insert"></span>'. esc_html__('SEPARATOR','siteseo').'</button> <button class="tag-title-btn" id="btn-tagline" data-tag="%%tagline%%"><span id="icon" class="dashicons dashicons-insert"></span>'. esc_html__('TAGLINE','siteseo').'</button>'; siteseo_suggestion_button(); echo '</div> </td> </tr> <td colspan="2"><span class="dashed-line"></span></td> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Alternative site title','siteseo').'</th> <td> <input type="text" value="'.esc_attr($option_site_title_alt).'" name="siteseo_options[alt_site_title]" placeholder="'.esc_html__('Alternative website title','siteseo').'"> <p class="description">'.esc_html__('The alternative name of the website (e.g., a commonly recognized acronym or shorter name, if applicable). Ensure the name meets the criteria.', 'siteseo').'</p> </td> </tr> <td colspan="2"><span class="dashed-line"></span></td> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Meta description','siteseo').'</th> <td> <textarea type="text" name="siteseo_options[media_desc]" placeholder="'.esc_html__('This is an awesome website about galactic creatures.','siteseo').'">'.esc_html($option_site_desc).'</textarea> <div class="wrap-tags"> <button class="tag-title-btn" id="btn-tagline-meta" data-tag="%%tagline%%"><span id="icon" class="dashicons dashicons-insert"></span>'. esc_html__('TAGLINE','siteseo').'</button>'; siteseo_suggestion_button(); echo '</div> </td> </tr> </tbody> </table> <input type="hidden" name="siteseo_options[home_tab]" value="1"/>'; } static function advanced(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->titles_settings; $options = get_option('siteseo_titles_option_name'); $option_noindex = !empty($options['titles_noindex']) ? $options['titles_noindex'] : ''; $option_nofollow = !empty($options['titles_nofollow']) ? $options['titles_nofollow'] : ''; $option_noimage = !empty($options['titles_noimageindex']) ? $options['titles_noimageindex'] : ''; $option_noarchive = !empty($options['titles_noarchive']) ? $options['titles_noarchive'] : ''; $option_nosnippet = !empty($options['titles_nosnippet']) ? $options['titles_nosnippet'] : ''; $option_nositelinkssearchbox = !empty($options['titles_nositelinkssearchbox']) ? $options['titles_nositelinkssearchbox'] : ''; $option_page_rel = !empty($options['titles_paged_rel']) ? $options['titles_paged_rel'] : ''; $option_paged_noindex = !empty($options['titles_paged_noindex']) ? $options['titles_paged_noindex'] : ''; $option_attachments_noindex = !empty($options['titles_attachments_noindex']) ? $options['titles_attachments_noindex'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('Advanced','siteseo').'</h3> <p>'.esc_html__('Customize your metas for all pages','siteseo').'</p> <table class="form-table"> <tbody> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('noindex','siteseo').'</th> <td> <label> <input name="siteseo_options[noindex]" type="checkbox" '.(!empty($option_noindex) ? 'checked="yes"' : '') . ' value="1"/>' . esc_html__('noindex', 'siteseo') . '</label> <p class="description">'.esc_attr__('Do not show all pages of the site in Google search results and avoid displaying "Cached" links in search results.','siteseo').'</p> '.wp_kses_post('<p class="description">Check also the<strong>"Search engine visibility"</strong> setting from the <a href="%s">WordPress Reading page</a></p>','siteseo').' </td> </tr> <td colspan="2"><span class="dashed-line"></span></td> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('nofollow','siteseo').'</th> <td> <label> <input name="siteseo_options[no_follow]" type="checkbox"'.(!empty($option_nofollow) ? 'checked="yes"' : '') . ' value="1"/>'. esc_html__('nofollow', 'siteseo'). '</label> <p class="description">'.esc_html__('Do not follow links on all pages.','siteseo').'</p> </td> <tr> <td colspan="2"><span class="dashed-line"></span></td> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('noimageindex','siteseo').'</th> <td> <label> <input name="siteseo_options[no_image]" type="checkbox"'.(!empty($option_noimage) ? 'checked="yes"' : '').' value="1"/>'. esc_html__('noimageindex', 'siteseo'). '</label> <p class="description">'.esc_html__('Do not follow links on any pages.','siteseo').'</p> </td> <tr> <td colspan="2"><span class="dashed-line"></span></td> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('noarchive','siteseo').'</th> <td> <label> <input name="siteseo_options[no_archive]" type="checkbox"'.(!empty($option_noarchive) ? 'checked="yes"' : '').' value="1"/>' . esc_html__('noarchive', 'siteseo'). '</label> <p class="description">'.esc_html__('Do not show a "Cached" link in Google search results.','siteseo').'</p> </td> </tr> <td colspan="2"><span class="dashed-line"></span></td> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('nosnippet','siteseo').'</th> <td> <label> <input name="siteseo_options[no_snippet]" type="checkbox"'.(!empty($option_nosnippet) ? 'checked="yes"' : '').' value="1"/>' . esc_html__('nosnippet', 'siteseo'). '</label> <p class="description">'.esc_html__('Do not show a description in the Google search results for any pages.','siteseo').'</p> </td> </tr> <td colspan="2"><span class="dashed-line"></span></td> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('nositelinkssearchbox','siteseo').'</th> <td> <label> <input name="siteseo_options[no_site_links_searchbox]" type="checkbox"'.(!empty($option_nositelinkssearchbox) ? 'checked="yes"' : ''). ' value="1"/>' . esc_html__('nositelinkssearchbox', 'siteseo') . '</label> <p class="description">'.esc_html__('Prevents Google from displaying a sitelinks search box in search results. Enabling this option will remove the "Website" schema from your source code.','siteseo') .'</p> </td> </tr> <td colspan="2"><span class="dashed-line"></span></td> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Indicate paginated content to Google','siteseo').'</th> <td> <label> <input name="siteseo_options[page_rel]" type="checkbox"' . (!empty($option_page_rel) ? 'checked="yes"' : '') . ' value="1"/>' . esc_html__('Add rel next/prev link in head of paginated archive pages', 'siteseo') . '</label> <p class="description">'.esc_html__('eg: https://example.com/category/my-category/page/2/.','siteseo').'</p> </td> </tr> <td colspan="2"><span class="dashed-line"></span></td> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('noindex on paged archives','siteseo').'</th> <td> <label> <input name="siteseo_options[titles_paged_noindex]" type="checkbox" '. (!empty($option_paged_noindex) ? 'checked="yes"' : '') . ' value="1"/>'.esc_html__('Add a "noindex" meta robots for all paginated archive pages', 'siteseo'). '</label> <p class="description">'.esc_html__('eg: https://example.com/category/my-category/page/2/.','siteseo').'</p> </td> </tr> <td colspan="2"><span class="dashed-line"></span></td> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('noindex on attachment pages','siteseo').'</th> <td> <label> <input name="siteseo_options[attachments_noindex]" type="checkbox"' . (!empty($option_attachments_noindex) ? 'checked="yes"' : '').' value="1"/>'.esc_html__(' Add a "noindex" meta robots for all attachment pages', 'siteseo') . '</label> <p class="description">'.esc_html__('eg: https://example.com/my-media-attachment-page.','siteseo').'</p> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[advanced_tab]" value="1"/>'; } static function archives(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } // $options = $siteseo->titles_settings; $options = get_option('siteseo_titles_option_name'); // Load settings $option_author_title = !empty($options['titles_archives_author_title']) ? $options['titles_archives_author_title'] : ''; $option_author_desc = !empty($options['titles_archives_author_desc']) ? $options['titles_archives_author_desc'] : ''; $option_author_noindex = !empty($options['titles_archives_author_noindex']) ? $options['titles_archives_author_noindex'] : ''; $option_author_disabled = !empty($options['titles_archives_author_disable']) ? $options['titles_archives_author_disable'] : ''; $option_date_title = !empty($options['titles_archives_date_title']) ? $options['titles_archives_date_title'] : ''; $option_date_desc = !empty($options['titles_archives_date_desc']) ? $options['titles_archives_date_desc'] : ''; $option_date_noindex = !empty($options['titles_archives_date_noindex']) ? $options['titles_archives_date_noindex'] : ''; $option_date_disabled = !empty($options['titles_archives_date_disable']) ? $options['titles_archives_date_disable'] : ''; $option_search_title = !empty($options['titles_archives_search_title']) ? $options['titles_archives_search_title'] : ''; $option_search_desc = !empty($options['titles_archives_search_desc']) ? $options['titles_archives_search_desc'] : ''; $option_search_noindex = !empty($options['titles_archives_search_title_noindex']) ? $options['titles_archives_search_title_noindex'] : ''; $option_404_title = !empty($options['titles_archives_404_title']) ? $options['titles_archives_404_title'] : ''; $option_404_desc = !empty($options['titles_archives_404_desc']) ? $options['titles_archives_404_desc'] : ''; $archives_fields = [ 'author-archives' => 'Author archives', 'date-archives' => 'Date archives', 'search-archives' => 'Search archives', '404-archives' => '404 archives' ]; $post_types = siteseo_post_types(); echo'<table class="form-table"> <tbody> <tr> <th scope="row"> <div class="siteseo-container">'; $is_first = true; foreach($archives_fields as $post_key => $post_val){ $active_class = $is_first ? 'active' : ''; echo '<a href="-' . esc_attr($post_key) . '" class="' . esc_attr($active_class) . '">' . esc_html($post_val) . '</a>'; $is_first = false; } foreach($post_types as $post_name => $post_type){ if($post_type->has_archive){ $active_class = $is_first ? 'active' : ''; echo '<a href="-' . esc_attr($post_name) . '" class="' . esc_attr($active_class) . '">' . esc_html($post_type->label) . '</a>'; $is_first = false; } } echo '</div> </th> <td> <div id="author-archives"> <h3>'.esc_html__('Archives', 'siteseo').'</h3> <div class="siteseo_wrap_label"> <p class="description">'.esc_html__('Personalize your meta descriptions for all archives.','siteseo').'</p> </div> <span class="line"></span> <h3>'.esc_html__('Author archives', 'siteseo').'</h3> <div class="siteseo_wrap_label"><p>'.esc_html__('Title template', 'siteseo').'</p></div> <input type="text" name="siteseo_options[author_title]" value="'. esc_attr($option_author_title) . '"> <div class="wrap-tags"> <button class="tag-title-btn" id="btn-author-acrhive-title" data-tag="%%post_author%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('POST AUTHOR','siteseo').' </button> <button class="tag-title-btn" id="btn-author-acrhive-separator" data-tag="%%sep%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SEPARATOR','siteseo').' </button> <button class="tag-title-btn" id="btn-author-acrhive-sitetitle" data-tag="%%sitetitle%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SITE TITLE','siteseo').' </button>'; siteseo_suggestion_button(); echo '</div> <div class="siteseo_wrap_label"><p>Meta description template</p></div> <textarea name="siteseo_options[author_desc]">'.esc_html($option_author_desc) . '</textarea><br> <div class="siteseo_wrap_label"> <label> <input name="siteseo_options[author_noindex]" type="checkbox" '.(!empty($option_author_noindex) ? 'checked="yes"' : '').' value="1"/>' . wp_kses_post('Do not display author archives in search engine results <strong>(noindex)</strong>', 'siteseo') .' </label> <label> <input name="siteseo_options[author_disable]" type="checkbox" '.(!empty($option_author_disabled) ? 'checked="yes"' : '').' value="1"/> ' . esc_html__('Disable author archives', 'siteseo') . ' </label> </div> <span class="line"><span> </div> <div id="date-archives"> <h3>'.esc_html__('Date archives', 'siteseo').'</h3> <div class="siteseo_wrap_label"><p>'.esc_html__('Title template','siteseo').'</p></div> <input type="text" name="siteseo_options[date_title]" value="'. esc_attr($option_date_title) .'"> <div class="wrap-tags"> <button class="tag-title-btn" id="btn-date-archive" data-tag="%%archive_date%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('DATE ARCHIVES','siteseo').' </button> <button class="tag-title-btn" id="btn-date-separator" data-tag="%%sep%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SEPARATOR','siteseo').' </button> <button class="tag-title-btn" id="btn-date-sitetitle" data-tag="%%sitetitle%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SITE TITLE','siteseo').' </button>'; siteseo_suggestion_button(); echo '</div> <div class="siteseo_wrap_label"><p>'.esc_html__('Meta description template','siteseo').'</p></div> <textarea name="siteseo_options[date_desc]">'.esc_attr($option_date_desc).'</textarea><br> <div class="siteseo_wrap_label"> <label> <input name="siteseo_options[date_noindex]" type="checkbox" '.(!empty($option_date_noindex) ? 'checked="yes"' : '').' value="1"/>' . wp_kses_post('Do not display date archives in search engine results <strong>(noindex)</strong>', 'siteseo') . ' </label> <label> <input name="siteseo_options[date_disable]" type="checkbox" '.(!empty($option_date_disabled) ? 'checked="yes"' : '').' value="1"/> ' . esc_html__('Disable date archives', 'siteseo') . ' </label> </div> <span class="line"><span> </div> <div id="search-archives"> <h3>Search archives</h3> <div class="siteseo_wrap_label"><p>'.esc_html__('Title template','siteseo').'</p></div> <input type="text" name="siteseo_options[search_title]" value="'.esc_attr($option_search_title).'"> <div class="wrap-tags"> <button class="tag-title-btn" id="btn-search-keyword" data-tag="%%search_keywords%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SEARCH KEYWORDS','siteseo').' </button> <button class="tag-title-btn" id="btn-search-separator" data-tag="%%sep%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SEPARATOR','siteseo').' </button> <button class="tag-title-btn" id="btn-search-sitetitle" data-tag="%%sitetitle%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SITE TITLE','siteseo').' </button>'; siteseo_suggestion_button(); echo '</div> <div class="siteseo_wrap_label"><p>'.esc_html__('Meta description template','siteseo').'</p></div> <textarea name="siteseo_options[search_desc]">'.esc_attr($option_search_desc).'</textarea><br> <div class="siteseo_wrap_label"> <label> <input name="siteseo_options[search_noindex]" type="checkbox" '.(!empty($option_search_noindex) ? 'checked="yes"' : '').' value="1"/> ' . wp_kses_post('Do not display date archives in search engine results <strong>(noindex)</strong>', 'siteseo') . ' </label> </div> <span class="line"><span> </div> <div id="404-archives"> <h3>404 archives</h3> <div class="siteseo_wrap_label"><p>'.esc_html__('Title template','siteseo').'</p></div> <input type="text" name="siteseo_options[title_404]" value="'.esc_attr($option_404_title).'"> <div class="wrap-tags"> <button class="tag-title-btn" id="btn-404-sitetitle" data-tag="%%sep%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SEPARATOR','siteseo').' </button> <button class="tag-title-btn" id="btn-404-separator" data-tag="%%sitetitle%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SITE TITLE','siteseo').' </button>'; siteseo_suggestion_button(); echo '</div> <div class="siteseo_wrap_label"><p>'.esc_html__('Meta description template','siteseo').'</p></div> <textarea name="siteseo_options[desc_404]">'.esc_attr($option_404_desc).'</textarea><br> </div> <br/><br/> <span class="line"></span>'; foreach($post_types as $post_name => $post_type){ if(empty($post_type->has_archive)){ continue; } $post_data = isset($options['titles_archive_titles'][$post_name]) ? $options['titles_archive_titles'][$post_name] : ''; $archive_title = !empty($post_data['archive_title'])? $post_data['archive_title'] : ''; $archive_description = !empty($post_data['archive_desc']) ? $post_data['archive_desc'] : ''; $archive_noindex = !empty($post_data['archive_noindex']) ? $post_data['archive_noindex'] : ''; $archive_nofollow = !empty($post_data['archive_nofollow']) ? $post_data['archive_nofollow'] : ''; $value_check = !empty($options['titles_archive_titles'][$post_name]['archive_title']) ? $options['titles_archive_titles'][$post_name]['archive_title'] : ''; echo'<div id="'.esc_attr($post_name).'"> <h3>'.esc_html($post_type->label).'</h3> <div class="siteseo_wrap_label"><p>'.esc_html__('Title template','siteseo').'</p></div> <input type="text" name="siteseo_options['.esc_attr($post_name).'][archive_title]" value="'.esc_attr($archive_title).'"> <div class="wrap-tags"> <button class="tag-title-btn" data-tag="%%cpt_plural%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('POST TYPE ARCHIVE NAME','siteseo').' </button> <button class="tag-title-btn" data-tag="%%sep%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SEPARATOR','siteseo').' </button> <button class="tag-title-btn" data-tag="%%sitetitle%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SITE TITLE','siteseo').' </button>'; siteseo_suggestion_button(); echo'</div> <div class="siteseo_wrap_label"><p>'.esc_html__('Meta description template','siteseo').'</p></div> <textarea name="siteseo_options['.esc_attr($post_name).'][archive_desc]">'.esc_attr($archive_description).'</textarea><div class="wrap-tags">'; siteseo_suggestion_button(); echo'</div></div><br> <div class="siteseo_wrap_label"> <label> <input name="siteseo_options['.esc_attr($post_name).'][archive_noindex]" type="checkbox" '.(!empty($archive_noindex) ? 'checked="yes"' : '').' value="1"/> ' . wp_kses_post('Do not display author archives in search engine results <strong>(noindex)</strong>', 'siteseo') .' </label><br/><br/> <label> <input name="siteseo_options['.esc_attr($post_name).'][archive_nofollow]" type="checkbox" '.(!empty($archive_nofollow) ? 'checked="yes"' : 'value="1"').' />'.wp_kses_post(__('Do not follow links for this taxonomy archive<strong>(nofollow)</strong>', 'siteseo')).' </label> </div><span class="line"><span>'; } echo'</td> </tr> </tbody> </table> <input type="hidden" name="siteseo_options[archives_tab]" value="1"/>'; } static function post_types(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } $options = get_option('siteseo_titles_option_name'); $post_types = siteseo_post_types(); echo '<table class="form-table"> <tbody> <tr> <th scope="row"> <div class="siteseo-container">'; $is_first = true; foreach($post_types as $post_type => $post_arr){ $active_class = $is_first ? 'active' : ''; echo '<a href="#'.esc_attr($post_type).'-types" class="'.esc_attr($active_class).'">'.esc_html($post_arr->labels->name).'</a>'; $is_first = false; } echo '</div> </th><td> <div> <h3>'.esc_html__('Post Types', 'siteseo').'</h3> <div class="siteseo_wrap_label"><p class="description">'.esc_html__('Personalize your titles and meta descriptions for single custom post types.', 'siteseo').'</p></div> </div>'; foreach($post_types as $post_type => $post_arr){ // Load array $post_data = isset($options['titles_single_titles'][$post_type]) ? $options['titles_single_titles'][$post_type] : ''; // Load settings $option_post_disabled = !empty($post_data['disabled']) ? true : false; $option_post_title = !empty($post_data['title']) ? $post_data['title'] : ''; $option_post_desc = !empty($post_data['description']) ? $post_data['description'] : ''; $option_noindex = !empty($post_data['noindex']) ? $post_data['noindex'] : ''; $option_nofollow = !empty($post_data['nofollow']) ? $post_data['nofollow'] : ''; $option_date = !empty($post_data['date']) ? $post_data['date'] : ''; $option_thumb_gcs = !empty($post_data['thumb_gcs']) ? $post_data['thumb_gcs'] : ''; echo '<div id="'.esc_attr($post_type).'-types">'; echo '<div class="siteseo-toggle-cnt"> <h3>'.esc_html($post_arr->labels->name.' ['.$post_type.']').'</h3> <div class="siteseo-toggle-meta '.($option_post_disabled ? '' : 'active').'" id="siteseo-toggle-meta-'.esc_attr($post_type).'"></div> <span id="siteseo-arrow-icon" class="dashicons dashicons-arrow-left-alt siteseo-arrow-icon"></span> <p class="toggle_state_posts" id="toggle_state_'.esc_attr($post_type).'">'.(!$option_post_disabled ? ' Click to hide any SEO metaboxes / columns for this post type' : ' Click to show any SEO metaboxes / columns for this post type').'</p> <input type="hidden" name="siteseo_options['.esc_attr($post_type).'][disabled]" id="enable_'.esc_attr($post_type).'_toggle" value="'.esc_attr($option_post_disabled).'" class="siteseo-suboption-toggle"> </div> <div class="siteseo_wrap_label"><p>'.esc_html__('Title template', 'siteseo').'</p></div> <input type="text" name="siteseo_options['.esc_attr($post_type).'][title]" value="'.esc_attr($option_post_title).'"> <div class="wrap-tags"> <button class="tag-title-btn" id="btn-post-title" data-tag="%%post_title%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('POST TITLE', 'siteseo').' </button> <button class="tag-title-btn" id="btn-post-separator" data-tag="%%sep%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SEPARATOR', 'siteseo').' </button> <button class="tag-title-btn" id="btn-post-site-title" data-tag="%%sitetitle%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SITE TITLE', 'siteseo').' </button>'; siteseo_suggestion_button(); echo '</div> <div class="siteseo_wrap_label"><p class="description">'.esc_html__('Meta description template', 'siteseo').'</p></div> <textarea name="siteseo_options['.esc_attr($post_type).'][desc]">'.esc_attr($option_post_desc).'</textarea> <div class="wrap-tags"> <button class="tag-title-btn" id="btn-'.esc_attr($post_type).'-meta" data-tag="%%post_excerpt%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('POST EXCERPT', 'siteseo').' </button>'; siteseo_suggestion_button(); echo '</div> <div class="siteseo_wrap_label"> <label> <input name="siteseo_options['.esc_attr($post_type).'][noindex]" type="checkbox" '.(!empty($option_noindex) ? 'checked="yes"' : 'value="1"').' /> '.wp_kses_post(__('Do not display this single post type in search engine results <strong>(noindex)</strong>', 'siteseo')).' </label> </div>'; if(!empty($option_noindex)){ echo '<div class="siteseo_wrap_label"> <div class="siteseo-notice is-error"> <p>'.wp_kses_post(__('This custom post type is <strong>NOT</strong> excluded from your XML sitemaps despite the fact that it is set to <strong>NOINDEX</strong>.', 'siteseo')).' </p> </div> </div>'; } echo '<div class="siteseo_wrap_label"> <label> <input name="siteseo_options['.esc_attr($post_type).'][nofollow]" type="checkbox" '.(!empty($option_nofollow) ? 'checked="yes"' : 'value="1"').' /> '.wp_kses_post(__('Do not follow links for this single post type <strong>nofollow</strong>', 'siteseo')).' </label> </div> <div class="siteseo_wrap_label"> <label> <input name="siteseo_options['.esc_attr($post_type).'][date]" type="checkbox" '.(!empty($option_date) ? 'checked="yes"' : 'value="1"').' /> '.esc_html__('Display date in Google search results by adding article:published_time and article:modified_time meta?', 'siteseo').' </label> <p class="description">'. esc_html__('Unchecking this does not prevent Google from displaying the post date in search results.', 'siteseo').'</p> </div> <div class="siteseo_wrap_label"> <label> <input name="siteseo_options['.esc_attr($post_type).'][thumb_gcs]" type="checkbox" '.(!empty($option_thumb_gcs) ? 'checked="yes"' : 'value="1"').' /> '.esc_html__('Display post thumbnail in Google Custom Search results?', 'siteseo').' </label> <p class="description">'.esc_html__('This option does not apply to traditional search results.', 'siteseo').'</p> </div> </div>'; } echo '</td></tr> </tbody> </table> <input type="hidden" name="siteseo_options[post_types_tab]" value="1"/>'; } static function taxonomies(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } // $options = $siteseo->titles_setting; $options = get_option('siteseo_titles_option_name'); $taxonomies = get_taxonomies(['show_ui' => true, 'public' => true], 'objects', 'and'); echo '<table class="form-table"> <tbody> <tr> <th scope="row"> <div class="siteseo-container">'; $is_first = true; foreach($taxonomies as $fields_key => $fields_val){ $active_class = $is_first ? 'active' : ''; echo '<a href="#'.esc_attr($fields_key).'-types" class="'.esc_attr($active_class).'">'.esc_html($fields_val->label).'</a>'; $is_first = false; } echo '</th> <td> <h3>'.esc_html__('Taxonomies','siteseo').'</h3> <div class="siteseo_wrap_label"> <p class="description">'.esc_html__('Personalize your meta descriptions for all taxonomy archives.','siteseo').'</p> </div>'; foreach($taxonomies as $taxonomy => $_tax){ // Load array $options_tax = isset($options['titles_tax_titles'][$taxonomy]) ? $options['titles_tax_titles'][$taxonomy] : ''; // Load settings $option_disabled_category = !empty($options_tax['disabled']) ? $options_tax['disabled'] : ''; $option_cat_title = !empty($options_tax['title']) ? $options_tax['title'] : ''; $option_cat_desc = !empty($options_tax['description']) ? $options_tax['description'] : ''; $option_cat_noindex = !empty($options_tax['noindex']) ? $options_tax['noindex'] : ''; $option_cat_nofollow = !empty($options_tax['nofollow']) ? $options_tax['nofollow'] : ''; $taxonomies_fields = [ 'categories-types' => 'Categories', 'tags-types' => 'Tags', ]; echo '<div id="'.esc_attr($taxonomy).'-types"><h3>'.esc_html($_tax->label.'['.$taxonomy.']').'</h3> <div class="siteseo-toggle-cnt"> <div class="siteseo-toggle-meta '.($option_disabled_category ? '' : 'active').'" id="siteseo-toggle-meta-category"></div> <span id="siteseo-arrow-icon" class="dashicons dashicons-arrow-left-alt siteseo-arrow-icon"></span> <p class="toggle_state_category" id="toggle_state_category">' .($option_disabled_category ? 'Enable' : 'Disable'). '</p> <input type="hidden" name="siteseo_options['.esc_attr($taxonomy).'][disabled]" id="enable_'.esc_attr($taxonomy).'" value="'.esc_attr($option_disabled_category).'" class="siteseo-suboption-toggle"> </div> <div class="siteseo_wrap_label"> <p class="description">'.esc_html__('Title template','siteseo').'</p> </div> <input type="text" value="'.esc_attr($option_cat_title).'" name="siteseo_options['.esc_attr($taxonomy).'][title]"> <div class="wrap-tags"> <button class="tag-title-btn" data-tag="%%_category_title%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('CATEGORY TITLE','siteseo').' </button> <button class="tag-title-btn" data-tag="%%sep%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SEPARATOR','siteseo').' </button> <button class="tag-title-btn" data-tag="%%sitetitle%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('SITE TITLE','siteseo').' </button>'; siteseo_suggestion_button(); echo '</div> <div class="siteseo_wrap_label"> <p class="description">Meta description template</p> </div> <textarea name="siteseo_options['.esc_attr($taxonomy).'][desc]">'.esc_attr($option_cat_desc).'</textarea> <div class="wrap-tags"> <button class="tag-title-btn" data-tag="%%_category_description%%"> <span id="icon" class="dashicons dashicons-insert"></span>'.esc_html__('CATEGORY DESCRIPTION','siteseo').' </button>'; siteseo_suggestion_button(); echo '</div> <div class="siteseo_wrap_label"> <label> <input name="siteseo_options['.esc_attr($taxonomy).'][noindex]" type="checkbox" '.(!empty($option_cat_noindex) ? 'checked="yes"' : 'value="1"').' /> '.wp_kses_post(__('Do not display this taxonomy archive in search engine results<strong>(noindex)</strong>', 'siteseo')).' </label> </div>'; if(!empty($option_cat_noindex)){ echo '<div class="siteseo_wrap_label"> <div class="siteseo-notice is-error"> <p>'.wp_kses_post(__('This custom taxonomy is <strong>NOT</strong> excluded from your XML sitemaps despite the fact that it is set to <strong>NOINDEX</strong>. We recommend that you check this out.', 'siteseo')).' </p> </div> </div>'; } echo '<div class="siteseo_wrap_label"> <label> <input name="siteseo_options['.esc_attr($taxonomy).'][nofollow]" type="checkbox" '.(!empty($option_cat_nofollow) ? 'checked="yes"' : 'value="1"').' /> '.wp_kses_post(__('Do not follow links for this taxonomy archive<strong>(nofollow)</strong>', 'siteseo')).' </label> </div> </div>'; } echo '</td> </tr> </tbody> </table> <input type="hidden" name="siteseo_options[taxonomies_tab]" value="1"/>'; } static function save_settings(){ global $siteseo; check_admin_referer('siteseo_title_settings'); if(!siteseo_user_can('manage_title') || !is_admin()){ return; } $options = []; if(empty($_POST['siteseo_options'])){ return; } if(isset($_POST['siteseo_options']['home_tab'])){ $options['titles_sep'] = isset($_POST['siteseo_options']['separator']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['separator'])) : ''; $options['titles_home_site_title'] = isset($_POST['siteseo_options']['site_title']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['site_title'])) : ''; $options['titles_home_site_title_alt'] = isset($_POST['siteseo_options']['alt_site_title']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['alt_site_title'])) : ''; $options['titles_home_site_desc'] = isset($_POST['siteseo_options']['media_desc']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['media_desc'])) : ''; } if(isset($_POST['siteseo_options']['advanced_tab'])){ $options['titles_noindex'] = isset($_POST['siteseo_options']['noindex']); $options['titles_nofollow'] = isset($_POST['siteseo_options']['no_follow']); $options['titles_noimageindex'] = isset($_POST['siteseo_options']['no_image']); $options['titles_noarchive'] = isset($_POST['siteseo_options']['no_archive']); $options['titles_nosnippet'] = isset($_POST['siteseo_options']['no_snippet']); $options['titles_nositelinkssearchbox'] = isset($_POST['siteseo_options']['no_site_links_searchbox']); $options['titles_paged_rel'] = isset($_POST['siteseo_options']['page_rel']); $options['titles_paged_noindex'] = isset($_POST['siteseo_options']['titles_paged_noindex']); $options['titles_attachments_noindex'] = isset($_POST['siteseo_options']['attachments_noindex']); } if(isset($_POST['siteseo_options']['post_types_tab'])){ $post_types = siteseo_post_types(); $post_types = array_keys($post_types); // Saving Posts foreach($post_types as $post_type){ $options['titles_single_titles'][$post_type]['disabled'] = !empty($_POST['siteseo_options'][$post_type]['disabled']) ? true : false; $options['titles_single_titles'][$post_type]['title'] = isset($_POST['siteseo_options'][$post_type]['title']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options'][$post_type]['title'])) : ''; $options['titles_single_titles'][$post_type]['description'] = isset($_POST['siteseo_options'][$post_type]['desc']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options'][$post_type]['desc'])) : ''; $options['titles_single_titles'][$post_type]['noindex'] = isset($_POST['siteseo_options'][$post_type]['noindex']); $options['titles_single_titles'][$post_type]['nofollow'] = isset($_POST['siteseo_options'][$post_type]['nofollow']); $options['titles_single_titles'][$post_type]['date'] = isset($_POST['siteseo_options'][$post_type]['date']); $options['titles_single_titles'][$post_type]['thumb_gcs'] = isset($_POST['siteseo_options'][$post_type]['thumb_gcs']); } } if(isset($_POST['siteseo_options']['archives_tab'])){ $post_types = siteseo_post_types(); $post_types = array_keys($post_types); $options['titles_archives_author_title'] = isset($_POST['siteseo_options']['author_title']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['author_title'])) : ''; $options['titles_archives_author_desc'] = isset($_POST['siteseo_options']['author_desc']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['author_desc'])) : ''; $options['titles_archives_author_noindex'] = isset($_POST['siteseo_options']['author_noindex']); $options['titles_archives_author_disable'] = isset($_POST['siteseo_options']['author_disable']); $options['titles_archives_date_title'] = isset($_POST['siteseo_options']['date_title']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['date_title'])) : ''; $options['titles_archives_date_desc'] = isset($_POST['siteseo_options']['date_desc']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['date_desc'])) : ''; $options['titles_archives_date_noindex'] = isset($_POST['siteseo_options']['date_noindex']); $options['titles_archives_date_disable'] = isset($_POST['siteseo_options']['date_disable']); $options['titles_archives_search_title'] = isset($_POST['siteseo_options']['search_title']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['search_title'])) : ''; $options['titles_archives_search_desc'] = isset($_POST['siteseo_options']['search_desc']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['search_desc'])) : ''; $options['titles_archives_search_title_noindex'] = isset($_POST['siteseo_options']['search_noindex']); $options['titles_archives_404_title'] = isset($_POST['siteseo_options']['title_404']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['title_404'])) : ''; $options['titles_archives_404_desc'] = isset($_POST['siteseo_options']['desc_404']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['desc_404'])) : ''; foreach($post_types as $post_type){ $options['titles_archive_titles'][$post_type]['archive_title'] = isset($_POST['siteseo_options'][$post_type]['archive_title']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options'][$post_type]['archive_title'])) : ''; $options['titles_archive_titles'][$post_type]['archive_desc'] = isset($_POST['siteseo_options'][$post_type]['archive_desc']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options'][$post_type]['archive_desc'])) : ''; $options['titles_archive_titles'][$post_type]['archive_noindex'] = isset($_POST['siteseo_options'][$post_type]['archive_noindex']); $options['titles_archive_titles'][$post_type]['archive_nofollow'] = isset($_POST['siteseo_options'][$post_type]['archive_nofollow']); } } if(isset($_POST['siteseo_options']['taxonomies_tab'])){ $taxonomies = get_taxonomies(['show_ui' => true, 'public' => true], 'objects', 'and'); $taxonomies = array_keys($taxonomies); foreach($taxonomies as $taxonomy){ $options['titles_tax_titles'][$taxonomy]['disabled'] = !empty($_POST['siteseo_options'][$taxonomy]['disabled']) ? true : false; $options['titles_tax_titles'][$taxonomy]['title'] = isset($_POST['siteseo_options'][$taxonomy]['title']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options'][$taxonomy]['title'])) : ''; $options['titles_tax_titles'][$taxonomy]['description'] = isset($_POST['siteseo_options'][$taxonomy]['desc']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options'][$taxonomy]['desc'])) : ''; $options['titles_tax_titles'][$taxonomy]['noindex'] = isset($_POST['siteseo_options'][$taxonomy]['noindex']); $options['titles_tax_titles'][$taxonomy]['nofollow'] = isset($_POST['siteseo_options'][$taxonomy]['nofollow']); } } update_option('siteseo_titles_option_name', $options); } } main/settings/advanced.php 0000644 00000136571 15104342737 0011631 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO\Settings; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Advanced{ static function menu(){ global $siteseo; $current_tab = isset($_GET['tab']) ? sanitize_key($_GET['tab']) : 'tab_image_seo'; // Default tab $titles_meta_subtabs = [ 'tab_image_seo' => esc_html__('Image SEO', 'siteseo'), 'tab_advanced' => esc_html__('Advanced', 'siteseo'), 'tab_appearance' => esc_html__('Appearance', 'siteseo'), 'tab_security' => esc_html__('Security', 'siteseo'), 'tab_toc' => esc_html__('Table of content', 'siteseo') ]; echo '<div id="siteseo-root">'; Util::admin_header(); echo '<form method="post" id="siteseo-form" class="siteseo-option" name="siteseo-flush">'; wp_nonce_field('siteseo_advance_settings'); $advanced_toggle = isset($siteseo->setting_enabled['toggle-advanced']) ? $siteseo->setting_enabled['toggle-advanced'] : ''; $nonce = wp_create_nonce('siteseo_toggle_nonce'); Util::render_toggle('Image SEO & Advanced Settings - SiteSEO', 'advanced_toggle', $advanced_toggle, $nonce); echo '<div id="siteseo-tabs" class="wrap"> <div class="nav-tab-wrapper">'; foreach($titles_meta_subtabs as $tab_key => $tab_caption){ $active_class = ($current_tab === $tab_key) ? ' nav-tab-active' : ''; echo '<a id="' . esc_attr($tab_key) . '-tab" class="nav-tab' . esc_attr($active_class) . '" data-tab="' . esc_attr($tab_key) . '">' . esc_html($tab_caption) . '</a>'; } echo '</div> <div class="tab-content-wrapper"> <div class="siteseo-tab '.($current_tab == 'tab_image_seo' ? ' active' : '').'" id="tab_image_seo" style="display: none;">'; self::image_seo(); echo '</div> <div class="siteseo-tab '.($current_tab == 'tab_advanced' ? ' active' : '').'" id="tab_advanced" style="display: none;">'; self::advanced(); echo '</div> <div class="siteseo-tab '.($current_tab == 'tab_appearance' ? ' active' : '').'" id="tab_appearance" style="display: none;">'; self::appearance(); echo '</div> <div class="siteseo-tab '.($current_tab == 'tab_security' ? ' active' : '').'" id="tab_security" style="display: none;">'; self::security(); echo '</div> <div class="siteseo-tab '.($current_tab == 'tab_toc' ? ' active' : '').'" id="tab_toc" style="display: none;">'; self::toc(); echo '</div> </div>'; Util::submit_btn(); echo '</form></div>'; } static function image_seo(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->$advanced_settings; $options = get_option('siteseo_advanced_option_name'); $option_attachment = isset($options['advanced_attachments']) ? $options['advanced_attachments'] : ''; $option_attachment_file = isset($options['advanced_attachments_file']) ? $options['advanced_attachments_file'] : ''; $option_clean_filename = isset($options['advanced_clean_filename']) ? $options['advanced_clean_filename'] : ''; $option_img_title = isset($options['advanced_image_auto_title_editor']) ? $options['advanced_image_auto_title_editor'] : ''; $option_img_alt = isset($options['advanced_image_auto_alt_editor']) ? $options['advanced_image_auto_alt_editor'] : ''; $option_target_key = isset($options['advanced_image_auto_alt_target_kw']) ? $options['advanced_image_auto_alt_target_kw'] : ''; $option_cap_img = isset($options['advanced_image_auto_caption_editor']) ? $options['advanced_image_auto_caption_editor'] : ''; $option_desc_img = isset($options['advanced_image_auto_desc_editor']) ? $options['advanced_image_auto_desc_editor'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('Image SEO','siteseo').'</h3> <p>'.esc_html__('Images can drive significant traffic to your site. Be sure to always add alt text, optimize file sizes, and properly name the files, among other best practices.','siteseo').'</p> <table class="form-table"> <tbody class="siteseo_tbody"> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Redirect attachment pages to the post parent page.','siteseo').'</th> <td> <label> <input name="siteseo_options[attachment]" type="checkbox"'.(!empty($option_attachment) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Redirect attachment pages to the post parent, or to the homepage if no parent exists.', 'siteseo'). '</label> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Redirect attachment pages to their file URL','siteseo').'</th> <td> <label> <input name="siteseo_options[attachment_file]" type="checkbox"'.(!empty($option_attachment_file) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Redirect attachment pages to their respective file URLs (e.g., https://www.example.com/my-image-file.jpg).', 'siteseo'). '</label> <p class="description">'.esc_html__('If this option is enabled, it will override the redirection of attachment pages to the post parent.','siteseo').'</p> </td> <tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Cleaning media filename','siteseo').'</th> <td> <label> <input name="siteseo_options[clean_filename]" type="checkbox"'.(!empty($option_clean_filename) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('When uploading media, remove accents, spaces, and capital letters, and enforce UTF-8 encoding.', 'siteseo'). '</label> <p class="description">'.esc_html__('e.g. "ExãMple 1 cópy!.jpg" => "example-1-copy.jpg"','siteseo').'</p> </td> <tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Automatically set the image Title','siteseo').'</th> <td> <label> <input name="siteseo_options[auto_img_title]" type="checkbox"'.(!empty($option_img_title) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('When uploading an image file, automatically set the title to match the filename.', 'siteseo'). '</label> <p class="description">'.esc_html__('We use the product title for WooCommerce items.','siteseo').'</p> </td> <tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Automatically set the image Alt txt','siteseo').'</th> <td> <label><input name="siteseo_options[auto_img_alt]" type="checkbox"'.(!empty($option_img_alt) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('When uploading an image file, automatically set the alt text to match the filename.', 'siteseo'). '</label> </td> <tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Automatically set the image alt text using target keywords..','siteseo').'</th> <td> <label> <input name="siteseo_options[auto_target_keyword]" type="checkbox"'.(!empty($option_target_key) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Use the target keywords if no alt text is set for the image.', 'siteseo'). '</label> <p class="description">'.esc_html__('This setting will apply only to images without alt text on the frontend. It is retroactive, meaning if you disable it, images that previously had empty alt text will revert to being empty.','siteseo').'</p> </td> <tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Automatically set the image Caption','siteseo').'</th> <td> <label> <input name="siteseo_options[caption_image]" type="checkbox"'.(!empty($option_cap_img) ? 'checked="yes"' : '') . ' value="1"/>'.esc_html__('When uploading an image file, automatically set the caption to match the filename.', 'siteseo') . '</label> </td> <tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Automatically set the image Description','siteseo').'</th> <td> <label> <input name="siteseo_options[description_img]" type="checkbox"'.(!empty($option_desc_img) ? 'checked="yes"' : ''). ' value="1"/>'.esc_html__('When uploading an image file, automatically set the description to match the filename.', 'siteseo'). '</label> </td> <tr> </tbody> </table><input type="hidden" name="siteseo_options[image_seo]" value="1"/>'; } static function advanced(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->advanced_settings; $options = get_option('siteseo_advanced_option_name'); $option_taxonomy_desc = isset($options['advanced_tax_desc_editor']) ? $options['advanced_tax_desc_editor'] : ''; $option_category_url = isset($options['advanced_category_url']) ? $options['advanced_category_url'] : ''; $option_noreferrer_link = isset($options['advanced_noreferrer']) ? $options['advanced_noreferrer'] : ''; $option_wp_generator = isset($options['advanced_wp_generator']) ? $options['advanced_wp_generator'] : ''; $option_hentry_post = isset($options['advanced_hentry']) ? $options['advanced_hentry'] : ''; $option_author_url = isset($options['advanced_comments_author_url']) ? $options['advanced_comments_author_url'] : ''; $option_site_fileds = isset($options['advanced_comments_website']) ? $options['advanced_comments_website'] : ''; $option_rel_attributes = isset($options['advanced_comments_form_link']) ? $options['advanced_comments_form_link'] : ''; $option_shortlink = isset($options['advanced_wp_shortlink']) ? $options['advanced_wp_shortlink'] : ''; $option_wlw_meta_tag = isset($options['advanced_wp_wlw']) ? $options['advanced_wp_wlw'] : ''; $option_rsd_meta_tag = isset($options['advanced_wp_rsd']) ? $options['advanced_wp_rsd'] : ''; $option_google_meta_value = isset($options['advanced_google']) ? $options['advanced_google'] : ''; $option_bing_meta_value = isset($options['advanced_bing']) ? $options['advanced_bing'] : ''; $option_pinterest_meta_value = isset($options['advanced_pinterest']) ? $options['advanced_pinterest'] : ''; $option_yandex_meta_value = isset($options['advanced_yandex']) ? $options['advanced_yandex'] : ''; $option_remove_wocommerce_cat_url = isset($options['advanced_product_cat_url']) ? $options['advanced_product_cat_url'] : ''; echo '<h3 class="siteseo-tabs">'.esc_html__('Advanced','siteseo').'</h3> <p class="description">'.esc_html__('Advanced SEO options for advanced users.','siteseo').'</p> <table class="form-table"/> <tbody> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Add WP Editor to taxonomy description textarea','siteseo').'</th> <td> <label> <input name="siteseo_options[taxonomy_desc]" type="checkbox"'.(!empty($option_taxonomy_desc) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Add the TINYMCE editor to the term description field to enable rich text formatting.', 'siteseo'). '</label> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Remove /category/ in URL','siteseo').'</th> <td> <label> <input name="siteseo_options[category_url]" type="checkbox"'.(!empty($option_category_url) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Remove /category/ in your permalinks', 'siteseo'). '</label> <p class="description">'.esc_attr('e.g. "https://example.com/category/my-post-category/" => "https://example.com/my-post-category/"','siteseo').'</p> </td> </tr> <tr> <th scope="row">'.esc_html__('Remove category base from product permalinks','siteseo').'</th> <td> <label> <input type="checkbox" name="siteseo_options[remove_cate_woocommerce]" '.(!empty($option_remove_wocommerce_cat_url) ? 'checked="yes"' : '').' value="1"/> '. /* translators: placeholders are just html tags */ wp_kses_post(sprintf(__('Remove %1$s product-category %2$s in your permalinks', 'siteseo'), '<strong>','</strong>')).' </label> </div> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Remove noreferrer link attribute in post content','siteseo').'</th> <td> <label> <input name="siteseo_options[noreferrer_link]" type="checkbox"'.(!empty($option_noreferrer_link) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Remove the noreferrer link attribute from the source code.', 'siteseo'). '</label> <p class="description">'.esc_html__('Useful for affiliate links (eg: Amazon)','siteseo').'</p> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Remove WordPress meta generator tag','siteseo').'</th> <td> <label> <input name="siteseo_options[wp_generator_meta]" type="checkbox"'.(!empty($option_wp_generator) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Remove WordPress meta generator in source code', 'siteseo'). '</label> <div class="siteseo-styles pre"><pre>'.esc_html('<meta name="generator" content="WordPress 6.0.3" />').'</pre></div> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Remove hentry post class','siteseo').'</th> <td> <label> <input name="siteseo_options[hentry_post]" type="checkbox"' . (!empty($option_hentry_post) ? 'checked="yes"' : '') . ' value="1"/>' . esc_html__('Remove the `hentry` post class to prevent Google from treating it as structured data (schema)', 'siteseo') . '</label> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Remove author URL','siteseo').'</th> <td> <label> <input name="siteseo_options[comments_author_url]" type="checkbox"'.(!empty($option_author_url) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Remove the comment author URL in comments if the website field is filled in the profile page.', 'siteseo'). '</label> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Remove website field from comment form','siteseo').'</th> <td> <label> <input name="siteseo_options[website_filed]" type="checkbox"'.(!empty($option_site_fileds) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Remove the website field from the comment form to reduce spam.', 'siteseo'). '</label> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Add the "nofollow", "noopener", and "noreferrer" rel attributes to the links in the comment form.','siteseo').'</th> <td> <label> <input name="siteseo_options[comment_form_link]" type="checkbox"'.(!empty($option_rel_attributes) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Prevent search engines from following or indexing the link to the comment form by adding a "noindex", "nofollow" directive.', 'siteseo'). '</label> <div class="siteseo-styles pre"><pre>'.esc_url('https://www.example.com/my-blog-post/#respond').'</pre></div> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Remove WordPress shortlink meta tag','siteseo').'</th> <td> <label> <input name="siteseo_options[shortlink]" type="checkbox"'.(!empty($option_shortlink) ? 'checked="yes"' : '') .' value="1"/>'.esc_html__('Remove WordPress shortlink meta tag in source', 'siteseo'). '</label> <div class="siteseo-styles pre"><pre>'.esc_html('<link rel="shortlink" href="https://www.example.com/"/>').'</pre></div> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Remove Windows Live Writer meta tag','siteseo').'</th> <td> <label> <input name="siteseo_options[wlw_meta]" type="checkbox"'.(!empty($option_wlw_meta_tag) ? 'checked="yes"' : '').' value="1"/>'.esc_html__('Remove the Windows Live Writer meta tag from the source code.', 'siteseo') . '</label> <div class="siteseo-styles pre"><pre>'.esc_html('<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://www.example.com/wp-includes/wlwmanifest.xml" />').'</pre></div> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Remove RSD meta tag','siteseo').'</th> <td> <label> <input name="siteseo_options[rsd_meta]" type="checkbox"'.(!empty($option_rsd_meta_tag) ? 'checked="yes"' : ''). ' value="1"/>'. esc_html__('Remove the Really Simple Discovery (RSD) meta tag from the source code.', 'siteseo'). '</label> <p class="description">'.esc_html__('The WordPress Site Health feature will display an HTTPS warning if you enable this option. However, this is a false positive.','siteseo').'</p> <div class="siteseo-styles pre"><pre>' . esc_html('<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="https://www.example.com/wp-includes/wlwmanifest.xml" />') . '</pre></div> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Google site verification','siteseo').'</th> <td> <input name="siteseo_options[google_meta_value]" type="text" placeholder="'.esc_html__('Enter Google meta value site verification','siteseo').'" value="'.esc_attr($option_google_meta_value).'"/> <p class="description">'. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('If your site is already verified in %1$s Google Search Console %2$s, you can leave this field blank.', 'siteseo'), '<strong>', '</strong>')).' </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Bing site verification','siteseo').'</th> <td> <input name="siteseo_options[bing_meta_value]" type="text" placeholder="'.esc_html__('Enter Bing meta value site verification','siteseo').'" value="'.esc_attr($option_bing_meta_value).'"/> <p class="description">'. /* translators: placeholders are just <strong> tag */ wp_kses_post(sprintf(__('If your site is already verified in %1$s Bing Webmaster Tools %2$s, you can leave this field blank.', 'siteseo'), '<strong>', '</strong>')).'</p> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Pinterest site verification','siteseo').'</th> <td> <input name="siteseo_options[pinterest_meta_value]" type="text" placeholder="'.esc_html__('Enter the Pinterest meta value for site verification.','siteseo').'" value="'.esc_attr($option_pinterest_meta_value).'"/> </td> </tr> <tr> <th scope="row" style="user-select:auto;">'.esc_html__('Yandex site verification','siteseo').'</th> <td> <input name="siteseo_options[yandex_meta_value]" type="text" placeholder="'.esc_html__('Enter the Yandex meta value for site verification.','siteseo').'" value="'.esc_attr($option_yandex_meta_value).'"/> </td> </tr> </tbody> </table><input type="hidden" name="siteseo_options[advanced_tab]" value="1"/>'; } static function appearance(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } //$options = $siteseo->advanced_settings; $options = get_option('siteseo_advanced_option_name'); $option_enable_universal_metabox = isset($options['appearance_universal_metabox']) ? $options['appearance_universal_metabox'] : ''; $option_disable_universal_metabox = isset($options['appearance_universal_metabox_disable']) ? $options['appearance_universal_metabox_disable'] : ''; $option_content_analysis_metabox = isset($options['appearance_ca_metaboxe']) ? $options['appearance_ca_metaboxe'] : ''; $option_hide_genesis_metabox = isset($options['appearance_genesis_seo_metaboxe']) ? $options['appearance_genesis_seo_metaboxe'] : ''; $option_structured_type_metabox = isset($options['appearance_advice_schema']) ? $options['appearance_advice_schema'] : ''; $option_admin_bar = isset($options['appearance_adminbar']) ? $options['appearance_adminbar'] : ''; $option_noindex_admin_bar = isset($options['appearance_adminbar_noindex']) ? $options['appearance_adminbar_noindex'] : ''; $option_column_title = isset($options['appearance_title_col']) ? $options['appearance_title_col'] : ''; $option_column_desc = isset($options['appearance_meta_desc_col']) ? $options['appearance_meta_desc_col'] : ''; $option_column_redirect = isset($options['appearance_redirect_enable_col']) ? $options['appearance_redirect_enable_col'] : ''; $option_column_post_type = isset($options['appearance_redirect_url_col']) ? $options['appearance_redirect_url_col'] : ''; $option_column_canonical_post_ty = isset($options['appearance_canonical']) ? $options['appearance_canonical'] : ''; $option_column_target_key = isset($options['appearance_target_kw_col']) ? $options['appearance_target_kw_col'] : ''; $option_column_noindex = isset($options['appearance_noindex_col']) ? $options['appearance_noindex_col'] : ''; $option_column_nofollow = isset($options['appearance_nofollow_col']) ? $options['appearance_nofollow_col'] : ''; $option_column_words_no = isset($options['appearance_words_col']) ? $options['appearance_words_col'] : ''; $option_column_score = isset($options['appearance_score_col']) ? $options['appearance_score_col'] : ''; $option_misc_genesis_metabox = isset($options['appearance_genesis_seo_menu']) ? $options['appearance_genesis_seo_menu'] : ''; $appearance_fields =[ 'metaboxes'=>'Metaboxes', 'Admin-bar'=>'Admin bar', 'Columns' => 'Columns', 'Misc' =>'Misc', ]; echo '<table class="form-table"> <tbody> <tr> <th scope="row"> <div class="siteseo-container">'; $is_first = true; foreach($appearance_fields as $post_key => $post_val){ $active_class = $is_first ? 'active' : ''; echo '<a href="#'.esc_attr($post_key).'" class="'.esc_attr($active_class).'">'.esc_html($post_val).'</a>'; $is_first = false; } echo '</div> </th> <td> <div> <h3>'.esc_html__('Appearance','siteseo').'</h3> <div class="siteseo_wrap_label"> <p class="description">'.esc_html__('Customize the plugin to fit your needs','siteseo').'</p> </div> <span class="line"></span> <h3>'.esc_html__('Metaboxes','siteseo').'</h3> <p>'.esc_html__('Edit your SEO metadata directly from your favorite page builder.','siteseo').'</p> <table class="form-table" id="metaboxes"> <tbody> <tr> <th scope="row">'.esc_html__('Universal Metabox (Gutenberg)','siteseo').'</th> <td> <label><input type="checkbox" name="siteseo_options[enable_universal_metabox]" '.(!empty($option_enable_universal_metabox) ? 'checked="yes"' : 'value="1"').' "/> ' . esc_html__('Enable the universal SEO metabox for the Block Editor (Gutenberg)', 'siteseo') . '<label> </td> </tr> <tr> <th scope="row">'.esc_html__('Disable Universal Metabox','siteseo').'</th> <td> </label><input type="checkbox" name="siteseo_options[disable_universal_metabox]" '.(!empty($option_disable_universal_metabox) ? 'checked="yes"' : 'value="1"').' "/>'.esc_html__('Disable the universal SEO metabox','siteseo').' </td> </tr> <tr> <th scope="row">'.esc_html__('Remove Content Analysis Metabox','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_content_analysis_metabox) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[remove_content_analysis]"> '.esc_html__(' Remove Content Analysis Metabox','siteseo').'</label> <p class="description">'.esc_html__('By checking this option, we will no longer track the significant keywords','siteseo').'</p> </td> </tr> <tr> <th scope=row">'.esc_html__('Hide Genesis SEO Metabox','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_hide_genesis_metabox) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[genesis_metabox]"> '.esc_html__(' Remove Genesis SEO Metabox', 'siteseo').'</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Hide advice in Structured Data Types metabox','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_structured_type_metabox) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[structured_data_types_metabox]">'.esc_html__(' Remove the advice if None schema selected', 'siteseo').'</label> </td> </tr> </tbody> </table> <div id="Admin-bar"> <span class="line"></span> <h3>'.esc_html__('Admin bar','siteseo').'</h3> <p class="description">'.esc_html__('The admin bar appears on the top of your pages when logged in to your WP admin','siteseo').'</p> <table> <tbody> <tr> <th scope="row">'.esc_html__('SEO in admin bar','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_admin_bar) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[admin_bar]"> '.esc_html__('Remove SEO from Admin Bar in backend and frontend', 'siteseo').'</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Noindex in admin bar','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_noindex_admin_bar) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[noindex_admin_bar]"> '.esc_html__('Remove noindex item from Admin Bar in backend and frontend', 'siteseo').'</label> </td> </tr> </tbody> </table> </div> <div id="Columns"> <span class="line"></span> <h3>'.esc_html__('Columns','siteseo').'</h3> <p>'.esc_html__('Customize the SEO columns displayed in the posts/pages list.','siteseo').'</p> <table> <tbody> <tr> <th scope="row">'.esc_html__('Show Title tag column in post types','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_column_title) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[title_post_types]"> '.esc_html__('Add title column', 'siteseo').'</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Show Meta description column in post types','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_column_desc) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[desc_post_types]"> '.esc_html__('Add meta description column','siteseo').'</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Show Redirection Enable column in post types','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_column_redirect) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[redirect_post_types]"> '.esc_html__('Add redirection enable column', 'siteseo').'</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Show Redirect URL column in post types','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_column_post_type) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[redirect_url_post_types]"> '.esc_html__('Add redirection URL column', 'siteseo').'</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Show canonical URL column in post types','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_column_canonical_post_ty) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[url_column_post_types]"> '.esc_html__('Add canonical URL column', 'siteseo').'</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Show Target Keyword column in post types','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_column_target_key) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[keyword_column_post_types]"> '.esc_html__('Add target keyword column', 'siteseo').'</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Show noindex column in post types','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_column_noindex) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[noindex_column_post_types]"> '.esc_html__('Display noindex status', 'siteseo').'</label> </td> </tr> <tr> <th scope="row">'.esc_html__('Show nofollow column in post types','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_column_nofollow) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[nofollow_column_post_types]"> '.esc_html__('Display nofollow status', 'siteseo').'</label> </td> </tr> <th scope="row">'.esc_html__('Show total number of words column in post types','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_column_words_no) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[words_column_post_types]"> '.esc_html__('Display total number of words in content', 'siteseo').'</label> </td> </tr> <th scope="row">'.esc_html__('Show content analysis score column in post types','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_column_score) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[score_column_post_types]"> '.esc_html__('Display Content Analysis results column ("Good" or "Should be improved")', 'siteseo').'</label> </td> </tr> </tbody> </table> </div> <div id="Misc"> <span class="line"></span> <h3>'.esc_html__('Misc','siteseo').'</h3> <div class="siteseo_wrap_label"><p>'.esc_html__('Miscellaneous settings for the SEO plugin.','siteseo').'</p></div> <table class="form-table"> <tbody> <tr> <th scope="row">'.esc_html__('Hide Genesis SEO Settings link','siteseo').'</th> <td> <label><input type="checkbox" '.(!empty($option_misc_genesis_metabox) ? 'checked="yes"' : 'value="1"').' name="siteseo_options[genesis_seo_settings]">'.esc_html__('Remove Genesis SEO link in WP Admin Menu', 'siteseo') .'</label> </td> </tr> </tbody> </table> </div> </div> </td> </tr> </tbody> </table> <input type="hidden" name="siteseo_options[appearance_tab]" value="1"/>'; } static function security(){ global $siteseo, $wp_roles, $submenu; if(!empty($_POST['submit'])){ self::save_settings(); } $options = get_option('siteseo_advanced_option_name'); $menus_check = $submenu['siteseo']; $security_fields = [ 'siteseo-metaboxes' => 'SiteSEO Metaboxes', 'siteseo-settings-pages' => 'SiteSEO setting pages', ]; $roles = get_editable_roles(); if(empty($roles)){ return; } wp_nonce_field('siteseo_advance_settings'); echo '<table class="form-table"> <tbody> <tr> <th scope="row"> <div class="siteseo-container">'; $is_first = true; foreach($security_fields as $post_key => $post_val){ $active_class = $is_first ? 'active' : ''; echo '<a href="#' . esc_attr($post_key) . '" class="' . esc_attr($active_class) . '">' . esc_html($post_val) . '</a>'; $is_first = false; } echo '</div> </th> <td> <div> <h3 class="siteseo-tabs">'.esc_html__('Security', 'siteseo').'</h3> <div class="siteseo_wrap_label"> <p class="description">'.esc_html__('Control access to SEO settings and metaboxes by user roles.', 'siteseo').'</p> </div> <h3 class="siteseo-tabs">'.esc_html__('SiteSEO metaboxes', 'siteseo').'</h3> <div class="siteseo_wrap_label"> <p>'.esc_html__('Check a user role to prevent it from editing a specific metabox.', 'siteseo').'</p> </div> <table class="form-table" id="siteseo-metaboxes"> <tbody> <tr> <th scope="row">'.esc_html__('Block SEO metabox to user roles', 'siteseo').'</th> <td>'; foreach($roles as $key => $role){ if(empty($role['capabilities']) || !is_array($role['capabilities']) || !array_key_exists('publish_posts' , $role['capabilities'])){ continue; } $checked = isset($options['security_metaboxe_role'][$key]) ? 'checked' : ''; echo '<label> <input type="checkbox" name="siteseo_options[security_metaboxe_role]['.esc_attr($key).']" value="1" '.esc_attr($checked).'/> <strong>'.esc_html($role['name']).'</strong> </label><br/><br/>'; } echo '</td> </tr> <tr> <th scope="row">'.esc_html__('Block Content analysis metabox to user roles', 'siteseo').'</th> <td>'; foreach($roles as $key => $role){ if(empty($role['capabilities']) || !is_array($role['capabilities']) || !array_key_exists('publish_posts' , $role['capabilities'])){ continue; } $checked = isset($options['security_metaboxe_ca_role'][$key]) ? 'checked' : ''; echo '<label> <input type="checkbox" name="siteseo_options[security_metaboxe_ca_role]['.esc_attr($key).']" value="1" '.esc_attr($checked).'/><strong>'.esc_html($role['name']).'</strong> </label><br/><br/>'; } echo '</td> </tr> </tbody> </table> <span class="line"></span> <h3 class="siteseo-tabs">'.esc_html__('SiteSEO settings pages', 'siteseo').'</h3> <p class="description">'.esc_html__('Check a user role to allow it to edit a specific settings page', 'siteseo').'</p> <table class="form-table" id="siteseo-settings-pages"> <tbody>'; $settings_pages = [ 'titles' => esc_html__('Titles & Metas', 'siteseo'), 'xml-sitemap' => esc_html__('Sitemaps', 'siteseo'), 'social' => esc_html__('Social Networks', 'siteseo'), 'google-analytics' => esc_html__('Analytics', 'siteseo'), 'instant-indexing' => esc_html__('Instant Indexing', 'siteseo'), 'advanced' => esc_html__('Advanced', 'siteseo'), 'import-export' => esc_html__('Tools', 'siteseo') ]; foreach($settings_pages as $page_key => $page_title){ echo '<tr> <th scope="row">' . esc_html($page_title) . '</th> <td>'; foreach($roles as $role_key => $role){ if(empty($role['capabilities']) || !is_array($role['capabilities']) || !array_key_exists('publish_posts' , $role['capabilities']) || $role_key == 'administrator'){ continue; } $checked = isset($options['siteseo_advanced_security_metaboxe_siteseo-' . $page_key][$role_key]) ? 'checked' : ''; echo '<label> <input type="checkbox" name="siteseo_options[siteseo_advanced_security_metaboxe_siteseo-' . esc_attr($page_key) . '][' . esc_attr($role_key) . ']" value="1" ' . esc_attr($checked) . '/> <strong>' . esc_html($role['name']) . '</strong> </label><br/><br/>'; } echo '</td> </tr>'; } //Pro if(is_plugin_active('siteseo-pro/siteseo.php')){ echo '<tr> <th scope="row">' . esc_html__('Pro Features', 'siteseo') . '</th> <td>'; foreach($roles as $key => $role){ if(empty($role['capabilities']) || !is_array($role['capabilities']) || !array_key_exists('publish_posts' , $role['capabilities']) || $key == 'administrator'){ continue; } $checked = isset($options['siteseo_advanced_security_page_pro'][$key]) ? 'checked' : ''; echo '<label> <input type="checkbox" name="siteseo_options[siteseo_advanced_security_page_pro][' . esc_attr($key) . ']" value="1" ' . esc_attr($checked) . '/> <strong>'.esc_html($role['name']).'</strong> </label><br/><br/>'; } echo '</td> </tr>'; } echo '</tbody> </table> </div> </td> </tr> </tbody></table><input type="hidden" name="siteseo_options[security_tab]" value="1"/>'; } static function toc(){ global $siteseo; if(!empty($_POST['submit'])){ self::save_settings(); } $options = get_option('siteseo_advanced_option_name'); $option_toc_enable = isset($options['toc_enable']) ? $options['toc_enable'] : ''; $option_toc_label = isset($options['toc_label']) ? $options['toc_label'] : ''; $option_headings = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']; $option_list_types = [ 'ol' => __('Ordered List', 'siteseo'), 'ul' => __('Unordered List', 'siteseo') ]; echo'<h3 class="siteseo-tabs">'.esc_html__('Table of Contents', 'siteseo').'</h3> <p>'.esc_html__('A table of content works as an index section for your post or page. It helps search engines understand your page structure and users find specific sections quickly, which might help SEO, as it helps search engines better understand the structure of your content and also improves user experience.', 'siteseo').'</p> <p>'.esc_html__('To use Table of Content on your pages, you can use this shortcode', 'siteseo').' <code>[siteseo_toc]</code></p> <table class="form-table"> <tr> <th scope="row">'.esc_html__('Enable TOC', 'siteseo').'</th> <td> <label> <input type="checkbox" value="1" id="siteseo_toc_enable" name="siteseo_options[toc_enable]" '.checked($option_toc_enable, true, false).'/> </label> </td> </tr> <tr> <th scope="row">'.esc_html__('TOC Label', 'siteseo').'</th> <td> <label> <input type="text" value="'.esc_attr($option_toc_label).'" name="siteseo_options[toc_label]" placeholder="'.esc_attr__('Table of content', 'siteseo').'"/> </label> </td> </tr> <tr> <th scope="row">'.esc_html__('Exclude Headings', 'siteseo').'</th> <td> <div style="display:flex; gap: 20px;">'; foreach($option_headings as $heading){ $checked = !empty($options) && !empty($options['toc_excluded_headings']) && is_array($options['toc_excluded_headings']) && in_array($heading, $options['toc_excluded_headings']); echo '<label> <input type="checkbox" value="'.esc_attr($heading).'" name="siteseo_options[toc_excluded_headings][]" '.checked($checked, true, false).'/>'.esc_html(strtoupper($heading)).' </label>'; } echo '</div> </td> </tr> <tr> <th scope="row">'.esc_html__('List Type', 'siteseo').'</th> <td> <div> <label> <select name="siteseo_options[toc_heading_type]">'; foreach($option_list_types as $list_type => $list_title){ $selected = !empty($options['toc_heading_type']) && $options['toc_heading_type'] == $list_type ? 'selected' : ''; echo '<option value="'.esc_attr($list_type).'" '.esc_attr($selected).'>'.esc_html($list_title).'</option>'; } echo '</select> </label> </div> </td> </tr> </table><input type="hidden" name="siteseo_options[toc_tab]" value="1" />'; } static function save_settings(){ global $siteseo; check_admin_referer('siteseo_advance_settings'); if(!siteseo_user_can('manage_advanced') || !is_admin()){ return; } $options = []; if(empty($_POST['siteseo_options'])){ return; } if(isset($_POST['siteseo_options']['image_seo'])){ $options['advanced_attachments'] = isset($_POST['siteseo_options']['attachment']); $options['advanced_attachments_file'] = isset($_POST['siteseo_options']['attachment_file']); $options['advanced_clean_filename'] = isset($_POST['siteseo_options']['clean_filename']); $options['advanced_image_auto_title_editor'] = isset($_POST['siteseo_options']['auto_img_title']); $options['advanced_image_auto_alt_editor'] = isset($_POST['siteseo_options']['auto_img_alt']); $options['advanced_image_auto_alt_target_kw'] = isset($_POST['siteseo_options']['auto_target_keyword']); $options['advanced_image_auto_caption_editor'] = isset($_POST['siteseo_options']['caption_image']); $options['advanced_image_auto_desc_editor'] = isset($_POST['siteseo_options']['description_img']); } if(isset($_POST['siteseo_options']['advanced_tab'])){ $options['advanced_product_cat_url'] = isset($_POST['siteseo_options']['remove_cate_woocommerce']); $options['advanced_tax_desc_editor'] = isset($_POST['siteseo_options']['taxonomy_desc']); $options['advanced_category_url'] = isset($_POST['siteseo_options']['category_url']); $options['advanced_noreferrer'] = isset($_POST['siteseo_options']['noreferrer_link']); $options['advanced_wp_generator'] = isset($_POST['siteseo_options']['wp_generator_meta']); $options['advanced_hentry'] = isset($_POST['siteseo_options']['hentry_post']); $options['advanced_comments_author_url'] = isset($_POST['siteseo_options']['comments_author_url']); $options['advanced_comments_website'] = isset($_POST['siteseo_options']['website_filed']); $options['advanced_comments_form_link'] = isset($_POST['siteseo_options']['comment_form_link']); $options['advanced_wp_shortlink'] = isset($_POST['siteseo_options']['shortlink']); $options['advanced_wp_rsd'] = isset($_POST['siteseo_options']['rsd_meta']); $options['advanced_wp_wlw'] = isset($_POST['siteseo_options']['wlw_meta']); $options['advanced_google'] = isset($_POST['siteseo_options']['google_meta_value']) ? sanitize_text_field(Util::extract_content(wp_unslash($_POST['siteseo_options']['google_meta_value']))) : ''; $options['advanced_bing'] = isset($_POST['siteseo_options']['bing_meta_value']) ? sanitize_text_field(Util::extract_content(wp_unslash($_POST['siteseo_options']['bing_meta_value']))) : ''; $options['advanced_pinterest'] = isset($_POST['siteseo_options']['pinterest_meta_value']) ? sanitize_text_field(Util::extract_content(wp_unslash($_POST['siteseo_options']['pinterest_meta_value']))) : ''; $options['advanced_yandex'] = isset($_POST['siteseo_options']['yandex_meta_value']) ? sanitize_text_field(Util::extract_content(wp_unslash($_POST['siteseo_options']['yandex_meta_value']))) : ''; } if(isset($_POST['siteseo_options']['appearance_tab'])){ $options['appearance_universal_metabox'] = isset($_POST['siteseo_options']['enable_universal_metabox']); $options['appearance_universal_metabox_disable'] = isset($_POST['siteseo_options']['disable_universal_metabox']); $options['appearance_ca_metaboxe'] = isset($_POST['siteseo_options']['remove_content_analysis']); $options['appearance_genesis_seo_metaboxe'] = isset($_POST['siteseo_options']['genesis_metabox']); $options['appearance_advice_schema'] = isset($_POST['siteseo_options']['structured_data_types_metabox']); $options['appearance_adminbar'] = isset($_POST['siteseo_options']['admin_bar']); $options['appearance_adminbar_noindex'] = isset($_POST['siteseo_options']['noindex_admin_bar']); $options['appearance_title_col'] = isset($_POST['siteseo_options']['title_post_types']); $options['appearance_meta_desc_col'] = isset($_POST['siteseo_options']['desc_post_types']); $options['appearance_redirect_enable_col'] = isset($_POST['siteseo_options']['redirect_post_types']); $options['appearance_redirect_url_col'] = isset($_POST['siteseo_options']['redirect_url_post_types']); $options['appearance_canonical'] = isset($_POST['siteseo_options']['url_column_post_types']); $options['appearance_target_kw_col'] = isset($_POST['siteseo_options']['keyword_column_post_types']); $options['appearance_noindex_col'] = isset($_POST['siteseo_options']['noindex_column_post_types']); $options['appearance_nofollow_col'] = isset($_POST['siteseo_options']['nofollow_column_post_types']); $options['appearance_words_col'] = isset($_POST['siteseo_options']['words_column_post_types']); $options['appearance_score_col'] = isset($_POST['siteseo_options']['score_column_post_types']); $options['appearance_genesis_seo_menu'] = isset($_POST['siteseo_options']['genesis_seo_settings']); } if(isset($_POST['siteseo_options']['toc_tab'])){ $options['toc_enable'] = isset($_POST['siteseo_options']['toc_enable']); $options['toc_label'] = isset($_POST['siteseo_options']['toc_label']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['toc_label'])) : ''; $options['toc_heading_type'] = isset($_POST['siteseo_options']['toc_heading_type']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['toc_heading_type'])) : ''; //toc_excluded_headings if(isset($_POST['siteseo_options']['toc_excluded_headings'])){ $options['toc_excluded_headings'] = map_deep(wp_unslash($_POST['siteseo_options']['toc_excluded_headings']), 'sanitize_text_field'); } } if(isset($_POST['siteseo_options']['security_tab'])){ $has_admin = ['security_metaboxe_role', 'security_metaboxe_ca_role']; $settings = [ 'security_metaboxe_role', 'security_metaboxe_ca_role', 'siteseo_advanced_security_metaboxe_siteseo-titles', 'siteseo_advanced_security_metaboxe_siteseo-xml-sitemap', 'siteseo_advanced_security_metaboxe_siteseo-social', 'siteseo_advanced_security_metaboxe_siteseo-google-analytics', 'siteseo_advanced_security_metaboxe_siteseo-instant-indexing', 'siteseo_advanced_security_metaboxe_siteseo-advanced', 'siteseo_advanced_security_metaboxe_siteseo-import-export' ]; $advanced_options = map_deep($_POST['siteseo_options'], function($value){ if(!empty($value)){ if(is_string($value)){ return true; } return sanitize_text_field(wp_unslash($value)); } return ''; }); $filtered_options = []; $roles = get_editable_roles(); foreach($settings as $setting){ $accepted_roles = []; foreach($roles as $key => $role){ // We will skip, admin if the setting does not require it. if(!in_array($setting, $has_admin) && $key == 'administrator'){ continue; } // We only accept roles which has capability to 'publish_posts', as giving access to anyone less does not makes sense. if(empty($role['capabilities']) || !is_array($role['capabilities']) || !array_key_exists('publish_posts' , $role['capabilities'])){ continue; } array_push($accepted_roles, $key); } // Making sure the roles being pushed are the once we want. if(isset($advanced_options[$setting])){ $filtered_options[$setting] = array_intersect( $advanced_options[$setting], array_flip($accepted_roles) ); } } $options = array_merge($options, $filtered_options); } update_option('siteseo_advanced_option_name', $options); } } main/socialmetas.php 0000644 00000060272 15104342737 0010522 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class SocialMetas{ static function add_social_graph(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-social'])){ return; } $org_type = !empty($siteseo->social_settings['social_knowledge_type']) && $siteseo->social_settings['social_knowledge_type'] !== 'none' ? $siteseo->social_settings['social_knowledge_type'] : ''; $org_name = !empty($siteseo->social_settings['social_knowledge_name']) ? $siteseo->social_settings['social_knowledge_name'] : ''; $org_logo = !empty($siteseo->social_settings['social_knowledge_img']) ? $siteseo->social_settings['social_knowledge_img'] : ''; $org_number = !empty($siteseo->social_settings['social_knowledge_phone']) ? $siteseo->social_settings['social_knowledge_phone'] : ''; $org_contact_type = !empty($siteseo->social_settings['social_knowledge_contact_type']) ? $siteseo->social_settings['social_knowledge_contact_type'] : ''; $org_contact_option = !empty($siteseo->social_settings['social_knowledge_contact_option']) ? $siteseo->social_settings['social_knowledge_contact_option'] : ''; $fb_account = !empty($siteseo->social_settings['social_accounts_facebook']) ? $siteseo->social_settings['social_accounts_facebook'] : ''; $twitter_account = !empty($siteseo->social_settings['social_accounts_twitter']) ? $siteseo->social_settings['social_accounts_twitter'] : ''; $insta_account = !empty($siteseo->social_settings['social_accounts_instagram']) ? $siteseo->social_settings['social_accounts_instagram'] : ''; $yt_account = !empty($siteseo->social_settings['social_accounts_youtube']) ? $siteseo->social_settings['social_accounts_youtube'] : ''; $pt_account = !empty($siteseo->social_settings['social_accounts_pinterest']) ? $siteseo->social_settings['social_accounts_pinterest'] : ''; //description $site_url = get_site_url(); $site_description = get_bloginfo('name'); //JSON-LD data $json_ld = [ '@context' => 'https://schema.org', '@type' => $org_type ? esc_html($org_type) : 'Organization', 'name' => esc_html($org_name), 'url' => esc_url($site_url), 'logo' => esc_url($org_logo), 'description' => esc_html($site_description), ]; //contact point if(!empty($org_contact_option) && !empty($org_contact_type) && !empty($org_number)){ $json_ld['contactPoint'] = [ '@type' => 'ContactPoint', 'contactType' => esc_html($org_contact_type), 'telephone' => esc_html($org_number), 'contactOption' => esc_html($org_contact_option), ]; } $same_as = array_filter([esc_url($fb_account), esc_url($twitter_account), esc_url($insta_account), esc_url($yt_account), esc_url($pt_account)]); if(!empty($same_as)){ $json_ld['sameAs'] = $same_as; } // Output JSON-LD script echo '<script type="application/ld+json">'; echo wp_json_encode($json_ld, JSON_UNESCAPED_SLASHES); echo '</script>'; } static function fb_graph(){ global $siteseo, $post; if(empty($siteseo->setting_enabled['toggle-social']) || empty($siteseo->social_settings['social_facebook_og'])){ return; } $fb_page_id = !empty($siteseo->social_settings['social_facebook_link_ownership_id']) ? $siteseo->social_settings['social_facebook_link_ownership_id'] : ''; $fb_link_owership = !empty($siteseo->social_settings['social_facebook_admin_id']) ? $siteseo->social_settings['social_facebook_admin_id'] : ''; $og_url = get_home_url(); $og_sitename = get_bloginfo('name'); // Check $post_id = isset($post) && is_object($post) ? $post->ID : ''; $og_title = get_the_title(); $og_description = get_bloginfo('description'); $og_img = !empty($siteseo->social_settings['social_facebook_img']) ? $siteseo->social_settings['social_facebook_img'] : ''; // Get post types and taxonomies $post_types = siteseo_post_types(); $taxonomies = get_taxonomies(array('public' => true), 'objects'); // home site page if(is_home() && is_front_page()){ $og_title = !empty($siteseo->titles_settings['titles_home_site_title']) ? $siteseo->titles_settings['titles_home_site_title'] : $og_title; $og_description = !empty($siteseo->titles_settings['titles_home_site_desc']) ? $siteseo->titles_settings['titles_home_site_desc'] : $og_description; } // single post types foreach($post_types as $post_type){ // shop page woocommerces if(function_exists('is_shop') && is_shop()){ $shop_page_id = wc_get_page_id('shop'); $archive_title = ''; $archive_desc = ''; if(is_post_type_archive()){ $obj = get_queried_object(); if(!empty($obj) && isset($obj->name)){ $archive_title = !empty($obj->labels->name) ? $obj->labels->name : ''; $archive_desc = !empty($obj->description) ? $obj->description : ''; } } if(!empty(get_post_meta($shop_page_id, '_siteseo_social_fb_title', true))){ $og_title = get_post_meta($shop_page_id, '_siteseo_social_fb_title', true); } elseif(!empty(get_post_meta($shop_page_id, '_siteseo_titles_title', true))){ $og_title = get_post_meta($shop_page_id, '_siteseo_titles_title', true); } elseif(!empty($siteseo->titles_settings['titles_archive_titles']['product']['archive_title'])){ $og_title = $siteseo->titles_settings['titles_archive_titles']['product']['archive_title']; } else { $og_title = $archive_title; } $og_description = !empty(get_post_meta($shop_page_id, '_siteseo_social_fb_desc', true)) ? get_post_meta($shop_page_id, '_siteseo_social_fb_desc', true) : $og_description; if(!empty(get_post_meta($shop_page_id, '_siteseo_social_fb_desc', true))){ $og_description = get_post_meta($shop_page_id, '_siteseo_social_fb_desc', true); } elseif(!empty(get_post_meta($shop_page_id, '_siteseo_titles_desc', true))){ $og_description = get_post_meta($shop_page_id, '_siteseo_titles_desc', true); } elseif(!empty($siteseo->titles_settings['titles_archive_titles']['product']['archive_desc'])){ $og_description = $siteseo->titles_settings['titles_archive_titles']['product']['archive_desc']; } else { $og_description = $archive_desc; } $og_description = isset($og_description) ? esc_attr(\SiteSEO\TitlesMetas::replace_variables($og_description)) : ''; // OG:IMG if(!empty(get_post_meta($shop_page_id, '_siteseo_social_fb_img', true))){ $og_img = get_post_meta($shop_page_id, '_siteseo_social_fb_img', true); } else if(get_the_post_thumbnail_url($post, 'full')){ $og_img = get_the_post_thumbnail_url($post, 'full'); } else { $og_img = !empty($siteseo->social_settings['social_facebook_img']) ? $siteseo->social_settings['social_facebook_img'] : ''; } $og_url = urldecode(get_permalink($shop_page_id)); break; } // archive page if($post_type->has_archive && is_post_type_archive($post_type->name)){ $archive_title = ''; $archive_desc = ''; if(is_post_type_archive()){ $obj = get_queried_object(); if(!empty($obj) && isset($obj->name)){ $archive_title = !empty($obj->labels->name) ? $obj->labels->name : ''; $archive_desc = !empty($obj->description) ? $obj->description : ''; } } $og_title = !empty($siteseo->titles_settings['titles_archive_titles'][$post_type->name]['archive_title']) ? $siteseo->titles_settings['titles_archive_titles'][$post_type->name]['archive_title'] : $archive_title; $og_description = !empty($siteseo->titles_settings['titles_archive_titles'][$post_type->name]['archive_desc']) ? $siteseo->titles_settings['titles_archive_titles'][$post_type->name]['archive_desc'] : $archive_desc; } // blog page if(is_home() && !is_front_page()){ $post_id = get_option('page_for_posts'); //OG:title if(!empty(get_post_meta($post_id, '_siteseo_social_fb_title', true))){ $og_title = get_post_meta($post_id, '_siteseo_social_fb_title', true); } elseif(!empty(get_post_meta($post_id, '_siteseo_titles_title', true))){ $og_title = get_post_meta($post_id, '_siteseo_titles_title', true); } elseif(!empty($siteseo->titles_settings['titles_single_titles'][$post_type->name]['title'])){ $og_title = $siteseo->titles_settings['titles_single_titles'][$post_type->name]['title']; } else{ $og_title = $og_title; } // og:description if(!empty(get_post_meta($post_id, '_siteseo_social_fb_desc', true))){ $og_description = get_post_meta($post_id, '_siteseo_social_fb_desc', true); } elseif(!empty(get_post_meta($post_id, '_siteseo_titles_desc', true))){ $og_description = get_post_meta($post_id, '_siteseo_titles_desc', true); } elseif(!empty($siteseo->titles_settings['titles_single_titles'][$post_type->name]['description'])){ $og_description = $siteseo->titles_settings['titles_single_titles'][$post_type->name]['description']; } elseif(get_the_excerpt($post_id)){ $og_description = wp_trim_words(get_the_excerpt($post_id), 50); } } if(is_singular($post_type->name)){ if(!empty(get_post_meta($post_id, '_siteseo_social_fb_title', true))){ $og_title = get_post_meta($post_id, '_siteseo_social_fb_title', true); } elseif(!empty(get_post_meta($post_id, '_siteseo_titles_title', true))){ $og_title = get_post_meta($post_id, '_siteseo_titles_title', true); } elseif(!empty($siteseo->titles_settings['titles_single_titles'][$post_type->name]['title'])){ $og_title = $siteseo->titles_settings['titles_single_titles'][$post_type->name]['title']; } else{ $og_title = $og_title; } // og:description if(!empty(get_post_meta($post_id, '_siteseo_social_fb_desc', true))){ $og_description = get_post_meta($post_id, '_siteseo_social_fb_desc', true); } elseif(!empty(get_post_meta($post_id, '_siteseo_titles_desc', true))){ $og_description = get_post_meta($post_id, '_siteseo_titles_desc', true); } elseif(!empty($siteseo->titles_settings['titles_single_titles'][$post_type->name]['description'])){ $og_description = $siteseo->titles_settings['titles_single_titles'][$post_type->name]['description']; } elseif(get_the_excerpt($post_id)){ $og_description = wp_trim_words(get_the_excerpt($post_id), 50); } // OG:IMG if(!empty(get_post_meta($post_id, '_siteseo_social_fb_img', true))){ $og_img = get_post_meta($post_id, '_siteseo_social_fb_img', true); } else if(get_the_post_thumbnail_url($post, 'full')){ $og_img = get_the_post_thumbnail_url($post, 'full'); } else { $og_img = !empty($siteseo->social_settings['social_facebook_img']) ? $siteseo->social_settings['social_facebook_img'] : ''; } $og_url = urldecode(get_permalink($post_id)); break; } } // taxonomies foreach($taxonomies as $taxonomy){ if(is_tax($taxonomy->name) || is_category() || is_tag()){ $term = get_queried_object(); $term_id = $term->term_id; // og:title if(!empty(get_term_meta($term_id, '_siteseo_social_fb_title', true))){ $og_title = get_term_meta($term_id, '_siteseo_social_fb_title', true); } elseif(!empty(get_term_meta($term_id, '_siteseo_titles_title', true))){ $og_title = get_term_meta($term_id, '_siteseo_titles_title', true); } elseif(!empty($siteseo->titles_settings['titles_tax_titles'][$taxonomy->name]['title'])){ $og_title = $siteseo->titles_settings['titles_tax_titles'][$taxonomy->name]['title']; } else{ $og_title = $og_title; } // og:description if(!empty(get_term_meta($term_id, '_siteseo_social_fb_desc', true))){ $og_description = get_term_meta($term_id, '_siteseo_social_fb_desc', true); } elseif(!empty(get_term_meta($term_id, '_siteseo_titles_desc', true))){ $og_description = get_term_meta($term_id, '_siteseo_titles_desc', true); } elseif(!empty($siteseo->titles_settings['titles_tax_titles'][$taxonomy->name]['description'])){ $og_description = $siteseo->titles_settings['titles_tax_titles'][$taxonomy->name]['description']; } else{ $og_description = wp_strip_all_tags(term_description($term_id)); } $og_img = !empty(get_term_meta($term_id, '_siteseo_social_fb_img', true)) ? get_term_meta($term_id, '_siteseo_social_fb_img', true) : $og_img; $og_url = urldecode(get_term_link($term_id)); break; } } $og_title = isset($og_title) ? esc_attr(\SiteSEO\TitlesMetas::replace_variables($og_title)) : ''; $og_description = isset($og_description) ? esc_attr(\SiteSEO\TitlesMetas::replace_variables($og_description)) : ''; if(!empty($og_img)){ $og_img = sanitize_url($og_img); $og_img_width = 0; $og_img_height = 0; if(!empty($og_img)){ $image_info = @getimagesize($og_img); if($image_info !== false){ $og_img_width = $image_info[0]; $og_img_height = $image_info[1]; } } } // Setting og:type if(is_home() || is_front_page()){ $og_type = 'website'; // default website } elseif(is_singular('product') || is_singular('download')){ $og_type = 'product'; } elseif(is_singular()){ $og_type = 'article'; } elseif(is_search() || is_archive() || is_404()){ $og_type = 'object'; } if(!empty($og_url)){ echo '<meta property="og:url" content="'.esc_html($og_url).'" />'; } if(!empty($og_sitename)){ echo '<meta property="og:site_name" content="'.esc_html($og_sitename).'" />'; } if(function_exists('get_locale')){ echo '<meta property="og:locale" content="'.esc_html(get_locale()).'" />'; } if(!empty($og_type)){ echo '<meta property="og:type" content="'.esc_attr($og_type).'" />'; } if(!empty($og_title)){ echo '<meta property="og:title" content="'.esc_html($og_title).'" />'; } if(!empty($og_description)){ echo '<meta property="og:description" content="'.esc_html(\SiteSEO\TitlesMetas::truncate_desc($og_description)).'" />'; } if(!empty($og_img)){ echo '<meta property="og:image" content="'.esc_html($og_img).'" />'; if(is_ssl()){ echo '<meta property="og:secure_url" content="'.esc_html($og_img).'" />'; } } if(!empty($og_img_height)){ echo '<meta property="og:image:height" content="'.esc_attr($og_img_height).'" />'; } if(!empty($og_img_width)){ echo '<meta property="og:image:width" content="'.esc_attr($og_img_width).'" />'; } if(!empty($fb_page_id)){ echo '<meta property="fb:pages" content="'.esc_html($fb_page_id) .'" />'; } if(!empty($fb_link_owership)){ echo '<meta property="fb:admins" content="'. esc_html($fb_link_owership).'" />'; } } static function twitter_card(){ global $siteseo, $post; if(empty($siteseo->setting_enabled['toggle-social']) || empty($siteseo->social_settings['social_twitter_card'])){ return; } $site_url = get_home_url(); $sitename = get_bloginfo('name'); $post_id = isset($post) && is_object($post) ? $post->ID : ''; $site_title = get_the_title(); $site_description = get_bloginfo('description'); $twitter_img = !empty($siteseo->social_settings['social_twitter_card_img']) ? $siteseo->social_settings['social_twitter_card_img'] : ''; // home site page if(is_home() && is_front_page()){ $site_title = !empty($siteseo->titles_settings['titles_home_site_title']) ? $siteseo->titles_settings['titles_home_site_title'] : $site_title; $site_description = !empty($siteseo->titles_settings['titles_home_site_desc']) ? $siteseo->titles_settings['titles_home_site_desc'] : $site_description; } // types and taxonomies $post_types = siteseo_post_types(); $taxonomies = get_taxonomies(array('public' => true), 'objects'); // single post types foreach($post_types as $post_type){ // woocommerce if(function_exists('is_shop') && is_shop()){ $shop_page_id = wc_get_page_id('shop'); $archive_title = ''; $archive_desc = ''; if(is_post_type_archive()){ $obj = get_queried_object(); if(!empty($obj) && isset($obj->name)){ $archive_title = !empty($obj->labels->name) ? $obj->labels->name : ''; $archive_desc = !empty($obj->description) ? $obj->description : ''; } } // twitter:title if(!empty(get_post_meta($shop_page_id, '_siteseo_social_twitter_title', true))){ $site_title = get_post_meta($shop_page_id, '_siteseo_social_twitter_title', true); } elseif(!empty(get_post_meta($shop_page_id, '_siteseo_titles_title', true))){ $site_title = get_post_meta($shop_page_id, '_siteseo_titles_title', true); } elseif(!empty($siteseo->titles_settings['titles_archive_titles']['product']['archive_title'])){ $site_title = $siteseo->titles_settings['titles_archive_titles']['product']['archive_title']; } else { $site_title = $archive_title; } // twitter:description if(!empty(get_post_meta($shop_page_id, '_siteseo_social_twitter_desc', true))){ $site_description = get_post_meta($shop_page_id, '_siteseo_social_twitter_desc', true); } elseif(!empty(get_post_meta($shop_page_id, '_siteseo_titles_desc', true))){ $site_description = get_post_meta($shop_page_id, '_siteseo_titles_desc', true); } elseif(!empty($siteseo->titles_settings['titles_archive_titles']['product']['archive_desc'])){ $site_description = $siteseo->titles_settings['titles_archive_titles']['product']['archive_desc']; } else { $site_description = $archive_desc; } // twitter:image if(!empty(get_post_meta($shop_page_id, '_siteseo_social_twitter_img', true))){ $twitter_img = get_post_meta($shop_page_id, '_siteseo_social_twitter_img', true); } else if(get_the_post_thumbnail_url($post, 'full')){ $twitter_img = get_the_post_thumbnail_url($post, 'full'); } else { $twitter_img = isset($siteseo->social_settings['social_twitter_card_img']) ? $siteseo->social_settings['social_twitter_card_img'] : ''; } $site_url = urldecode(get_permalink($shop_page_id)); break; } // archive page if($post_type->has_archive && is_post_type_archive($post_type->name)){ $archive_title = ''; $archive_desc = ''; if(is_post_type_archive()){ $obj = get_queried_object(); if(!empty($obj) && isset($obj->name)){ $archive_title = !empty($obj->labels->name) ? $obj->labels->name : ''; $archive_desc = !empty($obj->description) ? $obj->description : ''; } } $site_title = !empty($siteseo->titles_settings['titles_archive_titles'][$post_type->name]['archive_title']) ? $siteseo->titles_settings['titles_archive_titles'][$post_type->name]['archive_title'] : $archive_title; $site_description = !empty($siteseo->titles_settings['titles_archive_titles'][$post_type->name]['archive_desc']) ? $siteseo->titles_settings['titles_archive_titles'][$post_type->name]['archive_desc'] : $archive_desc; } // blog page if(is_home() && !is_front_page()){ $post_id = get_option('page_for_posts'); // twitter:title if(!empty(get_post_meta($post_id, '_siteseo_social_twitter_title', true))){ $site_title = get_post_meta($post_id, '_siteseo_social_twitter_title', true); } elseif(!empty(get_post_meta($post_id, '_siteseo_titles_title', true))){ $site_title = get_post_meta($post_id, '_siteseo_titles_title', true); } elseif(!empty($siteseo->titles_settings['titles_single_titles'][$post_type->name]['title'])){ $site_title = $siteseo->titles_settings['titles_single_titles'][$post_type->name]['title']; } else{ $site_title = $site_title; } // twitter:description if(!empty(get_post_meta($post_id, '_siteseo_social_twitter_desc', true))){ $site_description = get_post_meta($post_id, '_siteseo_social_twitter_desc', true); } elseif(!empty(get_post_meta($post_id, '_siteseo_titles_desc', true))){ $site_description = get_post_meta($post_id, '_siteseo_titles_desc', true); } elseif(!empty($siteseo->titles_settings['titles_single_titles'][$post_type->name]['description'])){ $site_description = $siteseo->titles_settings['titles_single_titles'][$post_type->name]['description']; } elseif(!empty(get_the_excerpt($post_id))){ $site_description = wp_trim_words(get_the_excerpt($post_id), 50); } } if(is_singular($post_type->name)){ // twitter:title if(!empty(get_post_meta($post_id, '_siteseo_social_twitter_title', true))){ $site_title = get_post_meta($post_id, '_siteseo_social_twitter_title', true); } elseif(!empty(get_post_meta($post_id, '_siteseo_titles_title', true))){ $site_title = get_post_meta($post_id, '_siteseo_titles_title', true); } elseif(!empty($siteseo->titles_settings['titles_single_titles'][$post_type->name]['title'])){ $site_title = $siteseo->titles_settings['titles_single_titles'][$post_type->name]['title']; } else{ $site_title = $site_title; } // twitter:description if(!empty(get_post_meta($post_id, '_siteseo_social_twitter_desc', true))){ $site_description = get_post_meta($post_id, '_siteseo_social_twitter_desc', true); } elseif(!empty(get_post_meta($post_id, '_siteseo_titles_desc', true))){ $site_description = get_post_meta($post_id, '_siteseo_titles_desc', true); } elseif(!empty($siteseo->titles_settings['titles_single_titles'][$post_type->name]['description'])){ $site_description = $siteseo->titles_settings['titles_single_titles'][$post_type->name]['description']; } else{ $site_description = wp_trim_words(get_the_excerpt($post_id), 50); } // twitter:image if(!empty(get_post_meta($post_id, '_siteseo_social_twitter_img', true))){ $twitter_img = get_post_meta($post_id, '_siteseo_social_twitter_img', true); } else if(get_the_post_thumbnail_url($post, 'full')){ $twitter_img = get_the_post_thumbnail_url($post, 'full'); } else { $twitter_img = isset($siteseo->social_settings['social_twitter_card_img']) ? $siteseo->social_settings['social_twitter_card_img'] : ''; } $site_url = urldecode(get_permalink($post_id)); break; } } //taxonomies foreach($taxonomies as $taxonomy){ if(is_tax($taxonomy->name) || is_category() || is_tag()){ $term = get_queried_object(); $term_id = $term->term_id; //twitter:title if(!empty(get_term_meta($term_id, '_siteseo_social_twitter_title', true))){ $site_title = get_term_meta($term_id, '_siteseo_social_twitter_title', true); } elseif(!empty(get_term_meta($term_id, '_siteseo_titles_title', true))){ $site_title = get_term_meta($term_id, '_siteseo_titles_title', true); } elseif(!empty($siteseo->titles_settings['titles_tax_titles'][$taxonomy->name]['title'])){ $site_title = $siteseo->titles_settings['titles_tax_titles'][$taxonomy->name]['title']; } else{ $site_title = $site_title; } // twitter description if(!empty(get_term_meta($term_id, '_siteseo_social_twitter_desc', true))){ $site_description = get_term_meta($term_id, '_siteseo_social_twitter_desc', true); } elseif(!empty(get_term_meta($term_id, '_siteseo_titles_desc', true))){ $site_description = get_term_meta($term_id, '_siteseo_titles_desc', true); } elseif(!empty($siteseo->titles_settings['titles_tax_titles'][$taxonomy->name]['description'])){ $site_description = $siteseo->titles_settings['titles_tax_titles'][$taxonomy->name]['description']; } else{ $site_description = wp_strip_all_tags(term_description($term_id)); } $twitter_img = !empty(get_term_meta($term_id, '_siteseo_social_twitter_img', true)) ? get_term_meta($term_id, '_siteseo_social_twitter_img', true) : $twitter_img; $site_url = urldecode(get_term_link($term_id)); break; } } $site_title = isset($site_title) ? esc_attr(\SiteSEO\TitlesMetas::replace_variables($site_title)) : ''; $site_description = isset($site_description) ? esc_attr(\SiteSEO\TitlesMetas::replace_variables($site_description)) : ''; echo '<meta name="twitter:card" content="summary"/>'; echo '<meta name="twitter:locale" content="'.esc_html(get_locale()).'"/>'; if(!empty($site_title)){ echo '<meta name="twitter:title" content="'.esc_html($site_title).'"/>'; } if(!empty($site_description)){ echo '<meta name="twitter:description" content="'.esc_html(\SiteSEO\TitlesMetas::truncate_desc($site_description)).'"/>'; } if(!empty($site_url)){ echo '<meta name="twitter:url" content="'.esc_html($site_url).'"/>'; } if(!empty($sitename)){ echo '<meta name="twitter:site" content="@'.esc_html($sitename).'"/>'; } if(!empty($twitter_img)){ echo '<meta name="twitter:image" content="'.esc_html($twitter_img).'"/>'; } } } main/metaboxes/settings.php 0000644 00000203643 15104342737 0012046 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO\Metaboxes; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Settings{ static function render_metabox(){ global $siteseo; $metabox_data = []; $show_content_analysis = true; if(is_user_logged_in()){ if(is_super_admin()){ $siteseo->display_ca_metaboxe = 1; $show_content_analysis = true; } else{ $user = wp_get_current_user(); $siteseo_user_role = current($user->roles); $siteseo_options = get_option('siteseo_advanced_option_name'); $ca_metabox_roles = !empty($siteseo_options['security_metaboxe_ca_role']) ? $siteseo_options['security_metaboxe_ca_role'] : []; if(array_key_exists($siteseo_user_role, $ca_metabox_roles)){ $siteseo->display_ca_metaboxe = 1; $show_content_analysis = false; } } } $metabox_data = self::metabox_data(); self::metabox_form_html($metabox_data, $show_content_analysis); } static function metabox_data(){ global $post, $siteseo; $metabox_data = []; $metabox_data['title'] = $post->post_title; $metabox_data['excerpt'] = $post->post_excerpt; // Getting the first paragraph of the post if(empty($metabox_data['excerpt'])){ $post_seperated = get_extended($post->post_content); if(!empty($post_seperated['main'])){ $metabox_data['excerpt'] = wp_strip_all_tags($post_seperated['main']); } } $metabox_data['keywords'] = get_post_meta($post->ID, 'siteseo_analysis_target_kw',true); $metabox_data['meta_title'] = get_post_meta($post->ID, '_siteseo_titles_title', true); $metabox_data['meta_desc'] = get_post_meta($post->ID, '_siteseo_titles_desc', true); $metabox_data['robots_canonical'] = get_post_meta($post->ID, '_siteseo_robots_canonical', true); $metabox_data['robots_primary_cat'] = get_post_meta($post->ID, '_siteseo_robots_primary_cat', true); $metabox_data['fb_title'] = get_post_meta($post->ID, '_siteseo_social_fb_title', true); $metabox_data['fb_desc'] = get_post_meta($post->ID, '_siteseo_social_fb_desc', true); $metabox_data['fb_img'] = get_post_meta($post->ID, '_siteseo_social_fb_img', true); $siteseo_social_fb_img_attachment_id = get_post_meta($post->ID, '_siteseo_social_fb_img_attachment_id', true); $siteseo_social_fb_img_width = get_post_meta($post->ID, '_siteseo_social_fb_img_width', true); $siteseo_social_fb_img_height = get_post_meta($post->ID, '_siteseo_social_fb_img_height', true); $metabox_data['x_title'] = get_post_meta($post->ID, '_siteseo_social_twitter_title', true); $metabox_data['x_desc'] = get_post_meta($post->ID, '_siteseo_social_twitter_desc', true); $metabox_data['x_img'] = get_post_meta($post->ID, '_siteseo_social_twitter_img', true); $siteseo_social_twitter_img_attachment_id = get_post_meta($post->ID, '_siteseo_social_twitter_img_attachment_id', true); $siteseo_social_twitter_img_width = get_post_meta($post->ID, '_siteseo_social_twitter_img_width', true); $siteseo_social_twitter_img_height = get_post_meta($post->ID, '_siteseo_social_twitter_img_height', true); $metabox_data['redirections_enabled'] = get_post_meta($post->ID, '_siteseo_redirections_enabled', true); $metabox_data['redirections_enabled_regex'] = get_post_meta($post->ID, '_siteseo_redirections_enabled_regex', true); $metabox_data['redirections_logged_status'] = get_post_meta($post->ID, '_siteseo_redirections_logged_status', true); $metabox_data['redirections_type'] = get_post_meta($post->ID, '_siteseo_redirections_type', true); $metabox_data['redirections_value'] = get_post_meta($post->ID, '_siteseo_redirections_value', true); $metabox_data['redirections_param'] = get_post_meta($post->ID, '_siteseo_redirections_param', true); $title_options = get_option('siteseo_titles_option_name', []); $metabox_data['disabled_robots'] = [ 'robots_index' => '', 'robots_follow' => '', 'archive' => '', 'snippet' => '', 'imageindex' => '', ]; if(post_password_required($post->ID) === true || !empty($title_options['titles_noindex'])){ $metabox_data['robots_index'] = 'yes'; $metabox_data['disabled_robots']['robots_index'] = 'disabled'; } else{ $metabox_data['robots_index'] = get_post_meta($post->ID, '_siteseo_robots_index', true); } if(!empty($title_options['titles_nofollow'])){ $metabox_data['robots_follow'] = 'yes'; $metabox_data['disabled_robots']['robots_follow'] = 'disabled'; } else{ $metabox_data['robots_follow'] = get_post_meta($post->ID, '_siteseo_robots_follow', true); } if(!empty($title_options['titles_noarchive'])){ $metabox_data['robots_archive'] = 'yes'; $metabox_data['disabled_robots']['archive'] = 'disabled'; } else{ $metabox_data['robots_archive'] = get_post_meta($post->ID, '_siteseo_robots_archive', true); } if(!empty($title_options['titles_nosnippet'])){ $metabox_data['robots_snippet'] = 'yes'; $metabox_data['disabled_robots']['snippet'] = 'disabled'; } else{ $metabox_data['robots_snippet'] = get_post_meta($post->ID, '_siteseo_robots_snippet', true); } if(!empty($title_options['titles_noimageindex'])){ $metabox_data['robots_imageindex'] = 'yes'; $metabox_data['disabled_robots']['imageindex'] = 'disabled'; } else{ $metabox_data['robots_imageindex'] = get_post_meta($post->ID, '_siteseo_robots_imageindex', true); } return $metabox_data; } static function metabox_term_data($term){ global $tag; $metabox_data = []; $metabox_data['title'] = $tag->name; $metabox_data['excerpt'] = $tag->description; $metabox_data['meta_title'] = get_term_meta($term->term_id, '_siteseo_titles_title', true); $metabox_data['meta_desc'] = get_term_meta($term->term_id, '_siteseo_titles_desc', true); // Social Fields $metabox_data['fb_title'] = get_term_meta($term->term_id, '_siteseo_social_fb_title', true); $metabox_data['fb_desc'] = get_term_meta($term->term_id, '_siteseo_social_fb_desc', true); $metabox_data['fb_img'] = get_term_meta($term->term_id, '_siteseo_social_fb_img', true); $metabox_data['x_title'] = get_term_meta($term->term_id, '_siteseo_social_twitter_title', true); $metabox_data['x_desc'] = get_term_meta($term->term_id, '_siteseo_social_twitter_desc', true); $metabox_data['x_img'] = get_term_meta($term->term_id, '_siteseo_social_twitter_img', true); // Social Dimensions $fb_img_id = get_term_meta($term->term_id, '_siteseo_social_fb_img_attachment_id', true); $fb_img_width = get_term_meta($term->term_id, '_siteseo_social_fb_img_width', true); $fb_img_height = get_term_meta($term->term_id, '_siteseo_social_fb_img_height', true); $x_img_id = get_term_meta($term->term_id, '_siteseo_social_twitter_img_attachment_id', true); $x_img_width = get_term_meta($term->term_id, '_siteseo_social_twitter_img_width', true); $x_img_height = get_term_meta($term->term_id, '_siteseo_social_twitter_img_height', true); // Redirection fields $metabox_data['redirections_enabled'] = get_term_meta($term->term_id, '_siteseo_redirections_enabled', true); $metabox_data['redirections_logged_status'] = get_term_meta($term->term_id, '_siteseo_redirections_logged_status', true); $metabox_data['redirections_type'] = get_term_meta($term->term_id, '_siteseo_redirections_type', true); $metabox_data['redirections_value'] = get_term_meta($term->term_id, '_siteseo_redirections_value', true); $metabox_data['robots_canonical']= get_term_meta($term->term_id, '_siteseo_robots_canonical', true); $title_options = get_option('siteseo_titles_option_name', []); $metabox_data['disabled_robots'] = [ 'robots_index' => '', 'robots_follow' => '', 'archive' => '', 'snippet' => '', 'imageindex' => '', ]; if(!empty($title_options['titles_noindex'])){ $metabox_data['robots_index'] = 'yes'; $metabox_data['disabled_robots']['robots_index'] = 'disabled'; } else { $metabox_data['robots_index'] = get_term_meta($term->term_id, '_siteseo_robots_index', true); } if(!empty($title_options['titles_nofollow'])){ $metabox_data['robots_follow'] = 'yes'; $metabox_data['disabled_robots']['robots_follow'] = 'disabled'; } else { $metabox_data['robots_follow'] = get_term_meta($term->term_id, '_siteseo_robots_follow', true); } if(!empty($title_options['titles_noarchive'])){ $metabox_data['robots_archive'] = 'yes'; $metabox_data['disabled_robots']['archive'] = 'disabled'; } else { $metabox_data['robots_archive'] = get_term_meta($term->term_id, '_siteseo_robots_archive', true); } if(!empty($title_options['titles_nosnippet'])){ $metabox_data['robots_snippet'] = 'yes'; $metabox_data['disabled_robots']['snippet'] = 'disabled'; } else { $metabox_data['robots_snippet'] = get_term_meta($term->term_id, '_siteseo_robots_snippet', true); } if(!empty($title_options['titles_noimageindex'])){ $metabox_data['robots_imageindex'] = 'yes'; $metabox_data['disabled_robots']['imageindex'] = 'disabled'; } else { $metabox_data['robots_imageindex'] = get_term_meta($term->term_id, '_siteseo_robots_imageindex', true); } return $metabox_data; } static function metabox_form_html(&$metabox_data, $show_content_analysis = false){ global $siteseo, $post, $pagenow, $typenow; $pro_settings = isset($siteseo->pro) ? $siteseo->pro : ''; $data_attr = []; $data_attr['data_tax'] = ''; $data_attr['termId'] = ''; if('post-new.php' == $pagenow || 'post.php' == $pagenow){ $data_attr['current_id'] = $post->ID; $data_attr['origin'] = 'post'; $data_attr['title'] = get_the_title($data_attr['current_id']); } elseif('term.php' == $pagenow || 'edit-tags.php' == $pagenow){ global $tag; $data_attr['current_id'] = $tag->term_id; $data_attr['termId'] = $tag->term_id; $data_attr['origin'] = 'term'; $data_attr['data_tax'] = $tag->taxonomy; $data_attr['title'] = $tag->name; } $data_attr['isHomeId'] = get_option('page_on_front'); if($data_attr['isHomeId'] === '0'){ $data_attr['isHomeId'] = ''; } // Static Data $home_url = home_url(); $parsed_url = wp_parse_url($home_url); $host_uri = $parsed_url['host']; $social_placeholder = SITESEO_ASSETS_URL . '/img/social-placeholder.png'; $metabox_tag_drop_kses = [ 'button' => [ 'class' => true, 'type' => true, ], 'span' => [ 'class' => true, ], 'div' => [ 'class' => true, 'style' => true, ], 'input' => [ 'type' => true, 'class' => true, 'name' => true, 'spellcheck' => true, 'placeholder' => true, ], 'ul' => true, 'li' => [ 'class' => true, 'data-*' => true, 'tabindex' => true, ] ]; // Preview of social title and description $current_screen = get_current_screen(); if(!empty($current_screen) && $current_screen->base === 'term'){ $term_id = isset($_GET['tag_ID']) ? (int)$_GET['tag_ID'] : 0; $taxonomy = $current_screen->taxonomy; } else{ $post_type = $current_screen->post_type; } $social_preview_title = ''; $social_preview_desc = ''; if(!empty($metabox_data['meta_title'])){ $social_preview_title = $metabox_data['meta_title']; } elseif(!empty($post_type) && !empty($siteseo->titles_settings['titles_single_titles'][$post_type]['title'])){ $social_preview_title = $siteseo->titles_settings['titles_single_titles'][$post_type]['title']; } elseif(!empty($taxonomy) && !empty($siteseo->titles_settings['titles_tax_titles'][$taxonomy]['title'])){ $social_preview_title = $siteseo->titles_settings['titles_tax_titles'][$taxonomy]['title']; } else{ $social_preview_title = get_the_title(); } if(!empty($metabox_data['meta_desc'])){ $social_preview_desc = $metabox_data['meta_desc']; } elseif(!empty($post_type) && !empty($siteseo->titles_settings['titles_single_titles'][$post_type]['description'])){ $social_preview_desc = $siteseo->titles_settings['titles_single_titles'][$post_type]['description']; } elseif(!empty($taxonomy) && !empty($siteseo->titles_settings['titles_tax_titles'][$taxonomy]['description'])){ $social_preview_desc = $siteseo->titles_settings['titles_tax_titles'][$taxonomy]['description']; } else{ $social_preview_desc = get_bloginfo('description'); } if(empty($siteseo->advanced_settings['appearance_ca_metaboxe']) && !empty($show_content_analysis)){ $siteseo_metabox_tabs = [ 'content-analysis' => __('Content Analysis', 'siteseo') ]; } $siteseo_metabox_tabs['title-settings'] = __('Title', 'siteseo'); $siteseo_metabox_tabs['social-settings'] = __('Social', 'siteseo'); $siteseo_metabox_tabs['advanced-settings'] = __('Advanced', 'siteseo'); $siteseo_metabox_tabs['redirect'] = __('Redirects', 'siteseo'); if(!empty($pro_settings['enable_structured_data']) && !empty($pro_settings['toggle_state_stru_data']) && !empty($show_content_analysis)){ $siteseo_metabox_tabs['structured-data-types'] = __('Structured Data Types', 'siteseo'); } if(!empty($pro_settings['toggle_state_video_sitemap']) && !empty($pro_settings['enable_video_sitemap']) && !empty($show_content_analysis)){ $siteseo_metabox_tabs['video-sitemap'] = __('Video Sitemap', 'siteseo'); } if(!empty($pro_settings['toggle_state_google_news']) && !empty($pro_settings['google_news']) && !empty($show_content_analysis)){ $siteseo_metabox_tabs['google-news'] = __('Google News', 'siteseo'); } echo'<div id="siteseo-metabox-wrapper" class="siteseo-metabox-wrapper"> <div class="siteseo-metabox-tabs" data-home-id="'.esc_attr($data_attr['isHomeId']).'" data-term-id="'.esc_attr($data_attr['termId']).'" data_id="'.esc_attr($data_attr['current_id']).'" data_origin="'.esc_attr($data_attr['origin']).'" data_tax="'.esc_attr($data_attr['data_tax']).'">'; wp_nonce_field('siteseo_metabox_nonce', 'siteseo_metabox_nonce'); foreach($siteseo_metabox_tabs as $siteseo_metabox_tab => $siteseo_metabox_tab_title){ $selected_metabox_tab = ''; if($siteseo_metabox_tab === 'content-analysis'){ $selected_metabox_tab = 'siteseo-metabox-tab-label-active'; } if(empty($siteseo->display_ca_metaboxe) && $siteseo_metabox_tab === 'title-settings'){ $selected_metabox_tab = 'siteseo-metabox-tab-label-active'; } echo'<div class="siteseo-metabox-tab-label '.esc_attr($selected_metabox_tab).'" data-tab="siteseo-metabox-tab-'.esc_attr($siteseo_metabox_tab).'">'; if($siteseo_metabox_tab === 'advanced-settings' && !empty($metabox_data['robots_index'])){ echo'<span class="dashicons dashicons-hidden siteseo-noindex-warning"></span>'; } echo esc_html($siteseo_metabox_tab_title).'</div>'; } $home_url = home_url(); $parsed_home_url = wp_parse_url($home_url); $meta_desc_percentage = '1'; if(!empty($metabox_data['meta_desc'])){ $meta_desc_percentage = (strlen($metabox_data['meta_desc'])/160)*100; } elseif(!empty($metabox_data['excerpt'])){ $meta_desc_percentage = (strlen($metabox_data['excerpt'])/160)*100; } if(intval($meta_desc_percentage) > 100){ $meta_desc_percentage = '100'; } $meta_title_percentage = '1'; if(!empty($metabox_data['meta_title'])){ $meta_title_percentage = (strlen($metabox_data['meta_title'])/60)*100; } else if(!empty($metabox_data['title'])){ $meta_title_percentage = (strlen($metabox_data['title'])/60)*100; } if(intval($meta_title_percentage) > 100){ $meta_title_percentage = '100'; } echo'</div>'; if(empty($siteseo->advanced_settings['appearance_ca_metaboxe']) && $show_content_analysis){ echo'<div class="siteseo-sidebar-tabs siteseo-sidebar-tabs-opened"><span>'.esc_html__('Content Analysis', 'siteseo').'</span><span class="siteseo-sidebar-tabs-arrow"><span class="dashicons dashicons-arrow-down-alt2"></span></span></div> <div class="siteseo-metabox-tab-content-analysis siteseo-metabox-tab" style="display:block;">'; self::content_analysis($post); echo'</div>'; } $allowed_suggestion_tags = array( 'button' => array( 'class' => array(), 'type' => array(), ), 'span' => array( 'id' => array(), 'class' => array(), ), 'div' => array( 'class' => array(), 'style' => array(), ), 'input' => array( 'type' => array(), 'class' => true, 'placeholder' => true, ) ); echo'<div class="siteseo-sidebar-tabs '.(empty($siteseo->display_ca_metaboxe) ? 'siteseo-sidebar-tabs-opened' : '').'"><span>'.esc_html__('Title', 'siteseo').'</span><span class="siteseo-sidebar-tabs-arrow"><span class="dashicons dashicons-arrow-down-alt2"></span></span></div> <div class="siteseo-metabox-tab-title-settings siteseo-metabox-tab" style="'.(empty($siteseo->display_ca_metaboxe) ? 'display:block;' : '').'"> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label>'.esc_html__('Search Preview','siteseo').'</label> </div> <div class="siteseo-metabox-search-preview"> <div class="siteseo-search-preview-toggle"> <span id="siteseo-metabox-search-pc" style="display:none">'.esc_html__('Show Desktop version', 'siteseo').'</span> <span id="siteseo-metabox-search-mobile">'.esc_html__('Show Mobile version', 'siteseo').'</span> </div> <div class="siteseo-search-preview-desktop"> <div class="siteseo-search-preview-metadata"> <div style="background-color: #e2eeff; border: 1px solid #e2eeff; height:28px; width:28px; padding: 3px; border-radius: 50px; display:flex; align-items:center; justify-content:center;"> <svg focusable="false" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#0060f0"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.95-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"></path></svg> </div> <div class="siteseo-search-preview-metadata-link"> <div>'.esc_url($parsed_home_url['host']).'</div> <div><cite>'.esc_url(home_url()).'</cite></div> </div> <div> <svg focusable="false" xmlns="http://www.w3.org/2000/svg" width="20" viewBox="0 0 24 24"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"></path></svg> </div> </div> <h3>'.(!empty($metabox_data['meta_title']) ? esc_html(\SiteSEO\TitlesMetas::replace_variables($metabox_data['meta_title'], true)) : (get_the_title() ? esc_html(get_the_title()) : 'Post Title here')).'</h3> <div class="siteseo-search-preview-description"> '.(!empty($metabox_data['meta_desc']) ? esc_html(\SiteSEO\TitlesMetas::replace_variables($metabox_data['meta_desc'], true)) : (!empty($metabox_data['excerpt']) ? esc_html(substr($metabox_data['excerpt'], 0, 160)) : 'Post description')).' </div> </div> </div> </div> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_titles_title_meta">'.esc_html__('Title', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <div class="siteseo-metabox-tags"> <button type="button" class="siteseo-metabox-tag" data-tag="%%post_title%%"><span class="dashicons dashicons-plus"></span> Post Title</button> <button type="button" class="siteseo-metabox-tag" data-tag="%%sitetitle%%"><span class="dashicons dashicons-plus"></span> Site Title</button> <button type="button" class="siteseo-metabox-tag" data-tag="%%sep%%"><span class="dashicons dashicons-plus"></span>Seperator</button>'.wp_kses(siteseo_suggestion_button_metabox(), $allowed_suggestion_tags).' </div> <input type="text" id="siteseo_titles_title_meta" class="siteseo_titles_title_meta" name="siteseo_titles_title" placeholder="'.(!empty($metabox_data['title']) ? esc_attr($metabox_data['title']) : esc_html__('Enter title for this post', 'siteseo')).'" value="'.(!empty($metabox_data['meta_title']) ? esc_html($metabox_data['meta_title']) : '').'"/> <div class="siteseo-metabox-limits"> <span class="siteseo-metabox-limits-meter"><span style="width:'.esc_attr($meta_title_percentage).'%"></span></span> <span class="siteseo-metabox-limits-numbers"><em>'.esc_html(strlen($metabox_data['meta_title'])).'</em> out of 60 max recommended characters</span> </div> </div> </div> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_titles_desc_meta">'.esc_html__('Meta Description', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <div class="siteseo-metabox-tags"> <button type="button" class="siteseo-metabox-tag" data-tag="%%post_excerpt%%"><span class="dashicons dashicons-plus"></span> Post Excerpt</button>'.wp_kses(siteseo_suggestion_button_metabox(), $allowed_suggestion_tags).' </div> <textarea id="siteseo_titles_desc_meta" class="siteseo_titles_desc_meta" name="siteseo_titles_desc" rows="2" placeholder="'.esc_html__('Enter description for this post', 'siteseo').'">'.(!empty($metabox_data['meta_desc']) ? esc_html($metabox_data['meta_desc']) : '').'</textarea> <div class="siteseo-metabox-limits"> <span class="siteseo-metabox-limits-meter"><span style="width:'.esc_attr($meta_desc_percentage).'%"></span></span> <span class="siteseo-metabox-limits-numbers"><em>'.esc_html(strlen($metabox_data['meta_desc'])).'</em> out of 160 max recommended characters</span> </div> </div> </div> </div> <div class="siteseo-sidebar-tabs"><span>'.esc_html__('Social', 'siteseo').'</span><span class="siteseo-sidebar-tabs-arrow"><span class="dashicons dashicons-arrow-down-alt2"></span></span></div> <div class="siteseo-metabox-tab-social-settings siteseo-metabox-tab"> <div class="siteseo-metabox-subtabs"> <div class="siteseo-metabox-tab-label siteseo-metabox-tab-label-active" data-tab="siteseo-metabox-tab-fb-settings">Facebook</div> <div class="siteseo-metabox-tab-label" data-tab="siteseo-metabox-tab-x-settings">X(Twitter)</div> </div> <div class="siteseo-metabox-tab-fb-settings siteseo-metabox-tab" style="display:block;"> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label>'.esc_html__('Preview', 'siteseo').'</label> </div> <div class="siteseo-metabox-fb-preview"> <div class="siteseo-metabox-fb-image"> <img src="'.(!empty($metabox_data['fb_img']) ? esc_url($metabox_data['fb_img']) : esc_url($social_placeholder)).'" alt="Facebook preview" load="lazy"/> </div> <div class="siteseo-metabox-fb-data"> <div class="siteseo-metabox-fb-host">'.(!empty($host_uri) ? esc_html($host_uri) : '').'</div> <div class="siteseo-metabox-fb-title">'.(!empty($metabox_data['fb_title']) ? esc_html(\SiteSEO\TitlesMetas::replace_variables($metabox_data['fb_title'], true)) : esc_html(\SiteSEO\TitlesMetas::replace_variables($social_preview_title, true))).'</div> <div class="siteseo-metabox-fb-desc">'.(!empty($metabox_data['fb_desc']) ? esc_html(\SiteSEO\TitlesMetas::replace_variables($metabox_data['fb_desc'], true)) : esc_html(\SiteSEO\TitlesMetas::replace_variables($social_preview_desc, true))).'</div> </div> </div> </div> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_social_fb_title_meta">'.esc_html__('Facebook Title', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <input type="text" id="siteseo_social_fb_title_meta" class="siteseo_social_fb_title_meta" name="siteseo_social_fb_title" placeholder="'.(!empty($social_preview_title) ? esc_html(\SiteSEO\TitlesMetas::replace_variables($social_preview_title, true)) : '').'" value="'.(!empty($metabox_data['fb_title']) ? esc_attr($metabox_data['fb_title']) : '').'" /> <div class="siteseo-metabox-tags"> <button type="button" class="siteseo-facebook-title" data-tag="%%post_title%%"><span class="dashicons dashicons-plus"></span> Post Title</button> <button type="button" class="siteseo-facebook-title" data-tag="%%sitetitle%%"><span class="dashicons dashicons-plus"></span> Site Title</button> <button type="button" class="siteseo-facebook-title" data-tag="%%sep%%"><span class="dashicons dashicons-plus"></span>Seperator</button>'.wp_kses(siteseo_suggestion_button_metabox(), $allowed_suggestion_tags).' </div> </div> </div> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_social_fb_desc_meta">'.esc_html__('Facebook description', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <textarea id="siteseo_social_fb_desc_meta" class="siteseo_social_fb_desc_meta" name="siteseo_social_fb_desc" rows="2" placeholder="'.(!empty($social_preview_desc) ? esc_html(\SiteSEO\TitlesMetas::replace_variables($social_preview_desc, true)) : '').'">'.(!empty($metabox_data['fb_desc']) ? esc_html($metabox_data['fb_desc']) : '').'</textarea> <div class="siteseo-metabox-tags"> <button type="button" class="siteseo-facebook-desc" data-tag="%%post_excerpt%%"><span class="dashicons dashicons-plus"></span> Post Excerpt</button>'.wp_kses(siteseo_suggestion_button_metabox(), $allowed_suggestion_tags).' </div> </div> </div> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_social_fb_img_meta">'.esc_html__('Facebook Thumbnail', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <span style="color:red; font-weight:bold; display:none;"></span> <input type="text" id="siteseo_social_fb_img_meta" name="siteseo_social_fb_img" class="siteseo_social_fb_img_meta" placeholder="'.esc_html__('Enter URL of the Image you want to be shown as the Facebook image', 'siteseo').'" value="'.(!empty($metabox_data['fb_img']) ? esc_url($metabox_data['fb_img']) : '').'"/> <p class="description">'.esc_html__('Minimum size: 200x200px, ideal ratio 1.91:1, 8Mb max. (eg: 1640x856px or 3280x1712px for retina screens).', 'siteseo').'</p> <input type="hidden" name="siteseo_social_fb_img_attachment_id" id="siteseo_social_fb_img_attachment_id" class="siteseo_social_fb_img_attachment_id" value=""> <input type="hidden" name="siteseo_social_fb_img_width" id="siteseo_social_fb_img_width" class="siteseo_social_fb_img_width" value=""> <input type="hidden" name="siteseo_social_fb_img_height" id="siteseo_social_fb_img_height" class="siteseo_social_fb_img_height" value=""> <button class="components-button is-secondary" id="siteseo_social_fb_img_upload">Upload Image</button> </div> </div> </div> <div class="siteseo-metabox-tab-x-settings siteseo-metabox-tab"> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label>'.esc_html__('Preview','siteseo').'</label> </div> <div> <div class="siteseo-metabox-x-preview"> <div class="siteseo-metabox-x-image"> <img src="'.(!empty($metabox_data['x_img']) ? esc_url($metabox_data['x_img']) : esc_url($social_placeholder)).'" alt="X preview" load="lazy"/> </div> <div class="siteseo-metabox-x-data"> <div class="siteseo-metabox-x-title">'.(!empty($metabox_data['x_title']) ? esc_html(\SiteSEO\TitlesMetas::replace_variables($metabox_data['x_title'], true)) : esc_html(\SiteSEO\TitlesMetas::replace_variables($social_preview_title, true))).'</div> </div> </div> <div class="siteseo-metabox-x-host">From '.(!empty($host_uri) ? esc_html($host_uri) : '').'</div> </div> </div> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_social_twitter_title_meta">'.esc_html__('X Title', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <input type="text" id="siteseo_social_twitter_title_meta" class="siteseo_social_twitter_title_meta" name="siteseo_social_twitter_title" placeholder="'.(!empty($social_preview_title) ? esc_html(\SiteSEO\TitlesMetas::replace_variables($social_preview_title, true)) : '').'" value="'.(!empty($metabox_data['x_title']) ? esc_attr($metabox_data['x_title']) : '').'" /> <div class="siteseo-metabox-tags"> <button type="button" class="siteseo-x-title" data-tag="%%post_title%%"><span class="dashicons dashicons-plus"></span> Post Title</button> <button type="button" class="siteseo-x-title" data-tag="%%sitetitle%%"><span class="dashicons dashicons-plus"></span> Site Title</button> <button type="button" class="siteseo-x-title" data-tag="%%sep%%"><span class="dashicons dashicons-plus"></span>Seperator</button>'.wp_kses(siteseo_suggestion_button_metabox(), $allowed_suggestion_tags).' </div> </div> </div> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_social_twitter_desc_meta">'.esc_html__('X description', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <textarea id="siteseo_social_twitter_desc_meta" class="siteseo_social_twitter_desc_meta" name="siteseo_social_twitter_desc" rows="2" placeholder="'.(!empty($social_preview_desc) ? esc_html(\SiteSEO\TitlesMetas::replace_variables($social_preview_desc, true)) : '').'">'.(!empty($metabox_data['x_desc']) ? esc_attr($metabox_data['x_desc']) : '').'</textarea> <div class="siteseo-metabox-tags"> <button type="button" class="siteseo-x-desc" data-tag="%%post_excerpt%%"><span class="dashicons dashicons-plus"></span> Post Excerpt</button>'.wp_kses(siteseo_suggestion_button_metabox(), $allowed_suggestion_tags).' </div> </div> </div> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_social_twitter_img_meta">'.esc_html__('X Thumbnail', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <span style="color:red; font-weight:bold; display:none;"></span> <input type="text" id="siteseo_social_twitter_img_meta" class="siteseo_social_twitter_img_meta" name="siteseo_social_twitter_img" placeholder="'.esc_html__('Enter URL of the Image you want to be shown as the X image', 'siteseo').'" value="'.(!empty($metabox_data['x_img']) ? esc_attr($metabox_data['x_img']) : '').'" /> <p class="description">'.esc_html__('Minimum size: 144x144px (300x157px with large card enabled), ideal ratio 1:1 (2:1 with large card), 5Mb max.', 'siteseo').'</p> <input type="hidden" name="siteseo_social_twitter_img_attachment_id" id="siteseo_social_twitter_img_attachment_id" class="siteseo_social_twitter_img_attachment_id" value=""> <input type="hidden" name="siteseo_social_twitter_img_width" id="siteseo_social_twitter_img_width" class="siteseo_social_twitter_img_width" value=""> <input type="hidden" name="siteseo_social_twitter_img_height" id="siteseo_social_twitter_img_height" class="siteseo_social_twitter_img_height" value=""> <button class="components-button is-secondary" id="siteseo_social_twitter_img_upload">Upload Image</button> </div> </div> </div> </div>'; if(!empty($pro_settings['enable_structured_data']) && !empty($pro_settings['toggle_state_stru_data']) && !empty($show_content_analysis)){ echo'<div class="siteseo-sidebar-tabs"><span>'.esc_html__('Structured Data Types', 'siteseo').'</span><span class="siteseo-sidebar-tabs-arrow"><span class="dashicons dashicons-arrow-down-alt2"></span></span></div> <div class="siteseo-metabox-tab-structured-data-types siteseo-metabox-tab">'; // Pro fearure do_action('siteseo_display_structured_data_types'); echo'</div>'; } // video sitemap if(!empty($pro_settings['toggle_state_video_sitemap']) && !empty($pro_settings['enable_video_sitemap']) && !empty($show_content_analysis)){ echo'<div class="siteseo-sidebar-tabs"><span>'.esc_html__('Video Sitemap', 'siteseo').'</span><span class="siteseo-sidebar-tabs-arrow"><span class="dashicons dashicons-arrow-down-alt2"></span></span></div> <div class="siteseo-metabox-tab-video-sitemap siteseo-metabox-tab">'; do_action('siteseo_display_video_sitemap'); echo'</div>'; } // gooogle news exclude if(!empty($pro_settings['toggle_state_google_news']) && !empty($pro_settings['google_news']) && !empty($show_content_analysis)){ echo'<div class="siteseo-sidebar-tabs"><span>'.esc_html__('Google News', 'siteseo').'</span><span class="siteseo-sidebar-tabs-arrow"><span class="dashicons dashicons-arrow-down-alt2"></span></span></div> <div class="siteseo-metabox-tab-google-news siteseo-metabox-tab">'; do_action('siteseo_display_google_news'); echo'</div>'; } echo'<div class="siteseo-sidebar-tabs"><span>'; if(!empty($metabox_data['robots_index'])){ echo'<span class="dashicons dashicons-hidden siteseo-noindex-warning"></span>'; } echo esc_html__('Advanced', 'siteseo').'</span><span class="siteseo-sidebar-tabs-arrow"><span class="dashicons dashicons-arrow-down-alt2"></span></span></div> <div class="siteseo-metabox-tab-advanced-settings siteseo-metabox-tab"> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_social_twitter_img_meta">'.esc_html__('Meta Robots Settings', 'siteseo').'</label> <p class="description">'. /* translators: %s represents the degree of severity */ wp_kses_post(sprintf(__('You cannot uncheck a checkbox? This is normal, and it\'s most likely defined in the <a href="%s">global settings of the plugin.</a>', 'siteseo'), esc_url(admin_url('admin.php?page=siteseo-titles#tab=tab_siteseo_titles_single')))).'</p> </div> <div class="siteseo-metabox-input-wrap">'; $robots_options = [ 'siteseo_robots_index_meta' => [ 'desc' => __('Do not display this page in search engine results / Sitemaps', 'siteseo'), 'short' => 'noindex', 'name' => 'siteseo_robots_index', 'checked' => $metabox_data['robots_index'], 'disabled' => $metabox_data['disabled_robots']['robots_index'] ], 'siteseo_robots_follow_meta' => [ 'desc' => __('Do not follow links for this page', 'siteseo'), 'short' => 'nofollow', 'name' => 'siteseo_robots_follow', 'checked' => $metabox_data['robots_follow'], 'disabled' => $metabox_data['disabled_robots']['robots_follow'] ], 'siteseo_robots_imageindex_meta' => [ 'desc' => __('Do not index images for this page', 'siteseo'), 'short' => 'noimageindex', 'name' => 'siteseo_robots_imageindex', 'checked' => $metabox_data['robots_imageindex'], 'disabled' => $metabox_data['disabled_robots']['imageindex'] ], 'siteseo_robots_archive_meta' => [ 'desc' => __('Do not display a "Cached" link in the Google search results', 'siteseo'), 'short' => 'noarchive', 'name' => 'siteseo_robots_archive', 'checked' => $metabox_data['robots_archive'], 'disabled' => $metabox_data['disabled_robots']['archive'] ], 'siteseo_robots_snippet_meta' => [ 'desc' => __('Do not display a description in search results for this page', 'siteseo'), 'short' => 'nosnippet', 'name' => 'siteseo_robots_snippet', 'checked' => $metabox_data['robots_snippet'], 'disabled' => $metabox_data['disabled_robots']['snippet'] ] ]; foreach($robots_options as $robots_id => $robots_option){ $checked = ''; if(!empty($robots_option['checked'])){ $checked = 'checked'; } $disabled = ''; if(!empty($robots_option['disabled'])){ $disabled = 'disabled'; $robots_option['name'] = ''; } echo'<label for="'.esc_attr($robots_id).'" style="display:block; margin-bottom:5px;"> <input type="checkbox" value="yes" id="'.esc_attr($robots_id).'" class="siteseo-metabox-robots-options" name="'.esc_attr($robots_option['name']).'" '.esc_attr($checked).' '.esc_attr($disabled).'/> '.esc_html($robots_option['desc']).' ('.esc_html($robots_option['short']).') </label>'; } echo'</div> </div> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_robots_canonical_meta">'.esc_html__('Canonical URL', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <input id="siteseo_robots_canonical_meta" type="text" name="siteseo_robots_canonical" placeholder="'.esc_url(get_the_permalink()).'" value="'.(!empty($metabox_data['robots_canonical']) ? esc_html($metabox_data['robots_canonical']) : '').'"> </div> </div>'; if(!empty($pagenow) && !empty($typenow) && ($pagenow == 'post.php' || $pagenow == 'post-new.php') && ($typenow == 'post' || $typenow == 'product')){ $categories = (object)[]; if($typenow == 'product'){ $categories = get_the_terms($post, 'product_cat'); } else{ $categories = get_categories(); } if(!empty($categories) && !is_wp_error($categories)){ echo'<div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_robots_canonical_meta">'.esc_html__('Select a primary category', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <select id="siteseo_robots_primary_cat" name="siteseo_robots_primary_cat">'; foreach($categories as $category){ $selected = ''; if(!empty($metabox_data['robots_primary_cat']) && $metabox_data['robots_primary_cat'] == $category->term_id){ $selected = 'selected'; } echo'<option value="'.esc_attr($category->term_id).'" '.esc_attr($selected).'>'.esc_html($category->name).'</option>'; } echo'</select> </div> </div>'; } } echo'</div> <div class="siteseo-sidebar-tabs"><span>'.esc_html__('Redirects', 'siteseo').'</span> <span class="siteseo-sidebar-tabs-arrow"><span class="dashicons dashicons-arrow-down-alt2"></span> </span></div> <div class="siteseo-metabox-tab-redirect siteseo-metabox-tab"> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_redirections_enabled_meta">'.esc_html__('Enable redirection', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <input id="siteseo_redirections_enabled_meta" type="checkbox" name="siteseo_redirections_enabled" value="1" '.(!empty($metabox_data['redirections_enabled']) ? 'checked' : '').'> </div> </div> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_redirections_enabled_meta">'.esc_html__('Login status', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <select name="siteseo_redirections_logged_status" id="siteseo_redirections_logged_status"> <option value="both" '.(!empty($metabox_data['redirections_logged_status']) && $metabox_data['redirections_logged_status'] == 'both' ? 'selected' : '').'>'.esc_html__('All', 'siteseo').'</option> <option value="only_logged_in" '.(!empty($metabox_data['redirections_logged_status']) && $metabox_data['redirections_logged_status'] == 'only_logged_in' ? 'selected' : '').'>'.esc_html__('Only when logged In', 'siteseo').'</option> <option value="only_not_logged_in" '.(!empty($metabox_data['redirections_logged_status']) && $metabox_data['redirections_logged_status'] == 'only_not_logged_in' ? 'selected' : '').'>'.esc_html__('Only when not logged in', 'siteseo').'</option> </select> </div> </div> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_redirections_type">'.esc_html__('Redirection Type', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <select name="siteseo_redirections_type" id="siteseo_redirections_type"> <option value="301" '.(!empty($metabox_data['redirections_type']) && $metabox_data['redirections_type'] == '301' ? 'selected' : '').'>'.esc_html__('301 Moved Permanently', 'siteseo').'</option> <option value="302" '.(!empty($metabox_data['redirections_type']) && $metabox_data['redirections_type'] == '302' ? 'selected' : '').'>'.esc_html__('302 Found / Moved Temporarily', 'siteseo').'</option> <option value="307" '.(!empty($metabox_data['redirections_type']) && $metabox_data['redirections_type'] == '307' ? 'selected' : '').'>'.esc_html__('307 Moved Temporarily', 'siteseo').'</option>'; if($typenow === 'siteseo_404'){ echo'<option value="410" '.(!empty($metabox_data['redirections_type']) && $metabox_data['redirections_type'] == '410' ? 'selected' : '').'>'.esc_html__('410 Gone', 'siteseo').'</option> <option value="451" '.(!empty($metabox_data['redirections_type']) && $metabox_data['redirections_type'] == '451' ? 'selected' : '').'>'. esc_html__('451 Unavailable For Legal Reasons', 'siteseo').'</option>'; } echo'</select> </div> </div> <div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_redirections_value_meta">'.esc_html__('Redirection URL', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <input id="siteseo_redirections_value_meta" type="text" name="siteseo_redirections_value" value="'.(!empty($metabox_data['redirections_value']) ? esc_attr($metabox_data['redirections_value']): '').'"> </div> <input type="hidden" id="analysis_tabs" name="analysis_tabs" value="'.esc_html(wp_json_encode(array_keys($siteseo_metabox_tabs))).'"> </div>'; // Note if($typenow === 'siteseo_404'){ echo'<div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_redirections_param">'.esc_html__('Query parameters', 'siteseo').'</label> </div> <div class="siteseo-metabox-input-wrap"> <select name="siteseo_redirections_param" id="siteseo_redirections_param"> <option value="exact_match" '.(!empty($metabox_data['redirections_param']) && $metabox_data['redirections_param'] == 'exact_match' ? 'selected' : '').'>'.esc_html__('Exactly parameters with exact match', 'siteseo').'</option> <option value="without_param" '.(!empty($metabox_data['redirections_param']) && $metabox_data['redirections_param'] == 'without_param' ? 'selected' : '').'>'.esc_html__('Exclude all parameters', 'siteseo').'</option> <option value="with_ignored_param" '.(!empty($metabox_data['redirections_param']) && $metabox_data['redirections_param'] == 'with_ignored_param' ? 'selected' : '').'>'.esc_html__('Exclude all parameters and pass them to the redirection', 'siteseo').'</option> </select> </div> </div>'; } echo'</div> </div>'; } static function content_analysis($post){ wp_nonce_field('siteseo_ca_nonce', 'siteseo_content_analysis_nonce'); $siteseo_real_preview = [ 'siteseo_nonce' => wp_create_nonce('siteseo_real_preview_nonce'), 'siteseo_real_preview' => admin_url('admin-ajax.php'), 'i18n' => ['progress' => __('Analysis in progress...', 'siteseo')], 'ajax_url' => admin_url('admin-ajax.php'), 'get_preview_meta_title' => wp_create_nonce('get_preview_meta_title'), 'realtime_nonce' => wp_create_nonce('siteseo_realtime_nonce'), ]; $metabox_data = []; $metabox_data['analysis_target_kw'] = get_post_meta($post->ID, '_siteseo_analysis_target_kw', true); $metabox_data['analysis_data'] = get_post_meta($post->ID, '_siteseo_analysis_data', true); $metabox_data['readibility_data'] = get_post_meta($post->ID, '_siteseo_readibility_data', true); $metabox_data['meta_title'] = get_post_meta($post->ID, '_siteseo_titles_title', true); $metabox_data['meta_desc'] = get_post_meta($post->ID, '_siteseo_titles_desc', true); $title_options = get_option('siteseo_titles_option_name', []); if(self::titles_single_cpt_noindex_option() || !empty($title_options['titles_noindex']) || true === post_password_required($post->ID)){ $metabox_data['robots_index'] = 'yes'; } else { $metabox_data['robots_index'] = get_post_meta($post->ID, '_siteseo_robots_index', true); } if(post_password_required($post->ID) === true || !empty($title_options['titles_noindex']) || self::titles_single_cpt_noindex_option()){ $metabox_data['robots_index'] = 'yes'; } else{ $metabox_data['robots_index'] = get_post_meta($post->ID, '_siteseo_robots_index', true); } if(!empty($title_options['titles_nofollow']) || self::titles_single_cpt_nofollow_option()){ $metabox_data['robots_follow'] = 'yes'; } else{ $metabox_data['robots_follow'] = get_post_meta($post->ID, '_siteseo_robots_follow', true); } if(!empty($title_options['titles_noarchive'])){ $metabox_data['robots_archive'] = 'yes'; } else{ $metabox_data['robots_archive'] = get_post_meta($post->ID, '_siteseo_robots_archive', true); } if(!empty($title_options['titles_nosnippet'])){ $metabox_data['robots_snippet'] = 'yes'; } else{ $metabox_data['robots_snippet'] = get_post_meta($post->ID, '_siteseo_robots_snippet', true); } if(!empty($title_options['titles_noimageindex'])){ $metabox_data['robots_imageindex'] = 'yes'; } else{ $metabox_data['robots_imageindex'] = get_post_meta($post->ID, '_siteseo_robots_imageindex', true); } $metabox_data['post_id'] = $post->ID; $metabox_data['readibility_data'] = get_post_meta($post->ID, '_siteseo_readibility_data', true); self::siteseo_content_analysis_tab($metabox_data); } static function titles_single_cpt_nofollow_option(){ $siteseo_get_current_cpt = get_post_type(); $options = get_option('siteseo_titles_option_name'); if(!empty($options) && isset($options['titles_single_titles'][$siteseo_get_current_cpt]['nofollow'])){ return $options['titles_single_titles'][$siteseo_get_current_cpt]['nofollow']; } } static function btn_secondary_classes() { //Classic Editor compatibility global $pagenow; $current_screen = null; if(function_exists('get_current_screen')){ $current_screen = get_current_screen(); } if(!empty($current_screen) && method_exists($current_screen, 'is_block_editor') && true === $current_screen->is_block_editor()){ $btn_classes_secondary = 'components-button is-secondary'; } elseif(isset($pagenow) && ($pagenow === 'term.php' || $pagenow === 'post.php' || $pagenow === 'post-new.php')){ $btn_classes_secondary = 'button button-secondary'; } else{ $btn_classes_secondary = 'btn btnSecondary'; } return $btn_classes_secondary; } static function siteseo_content_analysis_tab(&$metabox_data){ global $post; echo '<div class="siteseo-metabox-option-wrap"> <div class="siteseo-metabox-label-wrap"> <label for="siteseo_titles_title_meta">' . esc_html__('Focus Keywords', 'siteseo') . '</label> </div> <div class="siteseo-metabox-input-wrap"> <div id="siteseo_tags_wrapper" style="display: flex; flex-wrap: wrap; gap: 5px; padding: 5px; border: 1px solid #ccc; border-radius: 5px;">'; if(!empty($metabox_data['analysis_target_kw'])){ $tags_arr = explode(',', $metabox_data['analysis_target_kw']); if(!empty($tags_arr) && is_array($tags_arr)){ foreach($tags_arr as $tag_name){ echo '<span class="siteseo-tag">'.esc_html($tag_name).'<span class="siteseo-remove-tag">×</span></span>'; } } } echo '<input id="siteseo_analysis_target_kw_meta" class="siteseo_analysis_target_kw_meta" type="text" placeholder="' . esc_html__('Enter your target keywords', 'siteseo') . '" style="border: none; outline: none; flex: 1; min-width: 150px;" /> <input type="hidden" id="siteseo_tags_hidden" name="siteseo_analysis_target_kw" value="' . (!empty($metabox_data['analysis_target_kw']) ? esc_attr($metabox_data['analysis_target_kw']) : '') . '" /> </div> <p class="description">Press <kbd>Enter</kbd> key on your keyboard to add keyword</p> <button id="siteseo_refresh_seo_analysis" type="button" style="margin-top:10px;" class="'.esc_attr(self::btn_secondary_classes()).'" data_id="'.esc_attr(get_the_ID()).'" data_post_type="'.esc_attr(get_current_screen()->post_type).'"> '.esc_html__('Refresh analysis', 'siteseo').'</button> <p class="description">'.esc_html__('Refresh analysis after saving the post to improve the accuracy of the analysis', 'siteseo').'</p> </div> </div> <div id="siteseo-metabox-content-analysis"> <div id="siteseo-metabox-tabs-container"> <div class="siteseo-metabox-subtabs"> <div class="siteseo-metabox-tab-label siteseo-metabox-tab-label-active" data-tab="siteseo-metabox-seo-analysis-tab">'. esc_html__('SEO Analysis', 'siteseo').'</div> <div class="siteseo-metabox-tab-label" data-tab="siteseo-metabox-readibility-analysis-tab">'.esc_html__('Content Readability', 'siteseo').'</div> </div> <div id="siteseo-metabox-tab-content"> <div class="siteseo-metabox-seo-analysis-tab siteseo-metabox-tab" style="display:block;">'; $post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : 0; $post = get_post($post_id); Analysis::display_seo_analysis($post); echo'</div> <div class="siteseo-metabox-readibility-analysis-tab siteseo-metabox-tab"> <p class="description">' . esc_html__('This section works as a guide to help you write, better content for your user, this do not have a direct affect on SEO, but it will help you write better content for your users which will help user stay on your site longer, or will improve the Click Through rate. Which will signal search engines about the userfulness and likeleyness of your content by your user which indirectly improve SEO of the page.', 'siteseo') . '</p>'; Analysis::display_content_readibility($metabox_data); echo'</div> </div> </div> </div>'; } static function titles_single_cpt_noindex_option(){ $siteseo_get_current_cpt = get_post_type(); $options = get_option('siteseo_titles_option_name'); if(!empty($options) && isset($options['titles_single_titles'][$siteseo_get_current_cpt]['noindex'])){ return $options['titles_single_titles'][$siteseo_get_current_cpt]['noindex']; } } static function save_ca_metabox($post_id, $post){ if(!isset($_POST['siteseo_content_analysis_nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['siteseo_content_analysis_nonce'])), 'siteseo_ca_nonce')){ return $post_id; } // Post type object $post_type = get_post_type_object($post->post_type); //Check permission if(!current_user_can($post_type->cap->edit_post, $post_id) || !siteseo_user_can_metabox()){ return $post_id; } if('attachment' !== get_post_type($post_id)){ if(isset($_POST['siteseo_analysis_target_kw'])){ update_post_meta($post_id, '_siteseo_analysis_target_kw', self::clean_post('siteseo_analysis_target_kw')); } else{ delete_post_meta($post_id, '_siteseo_analysis_target_kw'); } } } static function save_metabox($post_id, $post){ global $siteseo; // Security Check if(!isset($_POST['siteseo_metabox_nonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['siteseo_metabox_nonce'])), 'siteseo_metabox_nonce')){ return $post_id; } //Post type object $post_type = get_post_type_object($post->post_type); //Check permission if(!current_user_can($post_type->cap->edit_post, $post_id) || !siteseo_user_can_metabox()){ return $post_id; } if('attachment' !== get_post_type($post_id)){ $analysis_tabs = []; $analysis_tabs = json_decode(self::clean_post('analysis_tabs'), true); if(!empty($analysis_tabs) && is_array($analysis_tabs) && in_array('content-analysis', $analysis_tabs)){ if(!empty($_POST['siteseo_analysis_target_kw'])){ update_post_meta($post_id, '_siteseo_analysis_target_kw', self::clean_post('siteseo_analysis_target_kw')); } else{ delete_post_meta($post_id, '_siteseo_analysis_target_kw'); } } if(!empty($analysis_tabs) && is_array($analysis_tabs) && in_array('title-settings', $analysis_tabs)){ if(!empty($_POST['siteseo_titles_title'])){ update_post_meta($post_id, '_siteseo_titles_title', self::clean_post('siteseo_titles_title')); } else{ delete_post_meta($post_id, '_siteseo_titles_title'); } if(!empty($_POST['siteseo_titles_desc'])){ update_post_meta($post_id, '_siteseo_titles_desc', self::clean_post('siteseo_titles_desc')); } else{ delete_post_meta($post_id, '_siteseo_titles_desc'); } } if(!empty($analysis_tabs) && is_array($analysis_tabs) && in_array('advanced-settings', $analysis_tabs)){ if(isset($_POST['siteseo_robots_index'])){ update_post_meta($post_id, '_siteseo_robots_index', 'yes'); } else{ delete_post_meta($post_id, '_siteseo_robots_index'); } if(isset($_POST['siteseo_robots_follow'])){ update_post_meta($post_id, '_siteseo_robots_follow', 'yes'); } else{ delete_post_meta($post_id, '_siteseo_robots_follow'); } if(isset($_POST['siteseo_robots_imageindex'])){ update_post_meta($post_id, '_siteseo_robots_imageindex', 'yes'); } else{ delete_post_meta($post_id, '_siteseo_robots_imageindex'); } if(isset($_POST['siteseo_robots_archive'])){ update_post_meta($post_id, '_siteseo_robots_archive', 'yes'); } else{ delete_post_meta($post_id, '_siteseo_robots_archive'); } if(isset($_POST['siteseo_robots_snippet'])){ update_post_meta($post_id, '_siteseo_robots_snippet', 'yes'); } else{ delete_post_meta($post_id, '_siteseo_robots_snippet'); } if(!empty($_POST['siteseo_robots_canonical'])){ update_post_meta($post_id, '_siteseo_robots_canonical', self::clean_post('siteseo_robots_canonical')); } else{ delete_post_meta($post_id, '_siteseo_robots_canonical'); } if(!empty($_POST['siteseo_robots_primary_cat'])){ update_post_meta($post_id, '_siteseo_robots_primary_cat', self::clean_post('siteseo_robots_primary_cat')); } else{ delete_post_meta($post_id, '_siteseo_robots_primary_cat'); } } if(!empty($analysis_tabs) && is_array($analysis_tabs) && in_array('social-settings', $analysis_tabs)){ //Facebook if(!empty($_POST['siteseo_social_fb_title'])){ update_post_meta($post_id, '_siteseo_social_fb_title', self::clean_post('siteseo_social_fb_title')); } else{ delete_post_meta($post_id, '_siteseo_social_fb_title'); } if(!empty($_POST['siteseo_social_fb_desc'])){ update_post_meta($post_id, '_siteseo_social_fb_desc', self::clean_post('siteseo_social_fb_desc')); } else{ delete_post_meta($post_id, '_siteseo_social_fb_desc'); } if(!empty($_POST['siteseo_social_fb_img'])){ update_post_meta($post_id, '_siteseo_social_fb_img', self::clean_post('siteseo_social_fb_img')); } else{ delete_post_meta($post_id, '_siteseo_social_fb_img'); } if(!empty($_POST['siteseo_social_fb_img_attachment_id']) && !empty($_POST['siteseo_social_fb_img'])){ update_post_meta($post_id, '_siteseo_social_fb_img_attachment_id', self::clean_post('siteseo_social_fb_img_attachment_id')); } else{ delete_post_meta($post_id, '_siteseo_social_fb_img_attachment_id'); } if(!empty($_POST['siteseo_social_fb_img_width']) && !empty($_POST['siteseo_social_fb_img'])){ update_post_meta($post_id, '_siteseo_social_fb_img_width', self::clean_post('siteseo_social_fb_img_width')); } else{ delete_post_meta($post_id, '_siteseo_social_fb_img_width'); } if(!empty($_POST['siteseo_social_fb_img_height']) && !empty($_POST['siteseo_social_fb_img'])){ update_post_meta($post_id, '_siteseo_social_fb_img_height', self::clean_post('siteseo_social_fb_img_height')); } else{ delete_post_meta($post_id, '_siteseo_social_fb_img_height'); } //Twitter if(!empty($_POST['siteseo_social_twitter_title'])){ update_post_meta($post_id, '_siteseo_social_twitter_title', self::clean_post('siteseo_social_twitter_title')); } else{ delete_post_meta($post_id, '_siteseo_social_twitter_title'); } if(!empty($_POST['siteseo_social_twitter_desc'])){ update_post_meta($post_id, '_siteseo_social_twitter_desc', self::clean_post('siteseo_social_twitter_desc')); } else{ delete_post_meta($post_id, '_siteseo_social_twitter_desc'); } if(!empty($_POST['siteseo_social_twitter_img'])){ update_post_meta($post_id, '_siteseo_social_twitter_img', self::clean_post('siteseo_social_twitter_img')); } else{ delete_post_meta($post_id, '_siteseo_social_twitter_img'); } if(!empty($_POST['siteseo_social_twitter_img_attachment_id']) && !empty($_POST['siteseo_social_twitter_img'])){ update_post_meta($post_id, '_siteseo_social_twitter_img_attachment_id', self::clean_post('siteseo_social_twitter_img_attachment_id')); } else{ delete_post_meta($post_id, '_siteseo_social_twitter_img_attachment_id'); } if(!empty($_POST['siteseo_social_twitter_img_width']) && !empty($_POST['siteseo_social_twitter_img'])){ update_post_meta($post_id, '_siteseo_social_twitter_img_width', self::clean_post('siteseo_social_twitter_img_width')); } else{ delete_post_meta($post_id, '_siteseo_social_twitter_img_width'); } if(!empty($_POST['siteseo_social_twitter_img_height']) && !empty($_POST['siteseo_social_twitter_img'])){ update_post_meta($post_id, '_siteseo_social_twitter_img_height', self::clean_post('siteseo_social_twitter_img_height')); } else{ delete_post_meta($post_id, '_siteseo_social_twitter_img_height'); } } if(!empty($analysis_tabs) && is_array($analysis_tabs) && in_array('redirect', $analysis_tabs)){ if(isset($_POST['siteseo_redirections_type'])){ update_post_meta($post_id, '_siteseo_redirections_type', self::clean_post('siteseo_redirections_type')); } if(!empty($_POST['siteseo_redirections_value'])){ update_post_meta($post_id, '_siteseo_redirections_value', self::clean_post('siteseo_redirections_value')); } else{ delete_post_meta($post_id, '_siteseo_redirections_value'); } if(isset($_POST['siteseo_redirections_param'])){ update_post_meta($post_id, '_siteseo_redirections_param', self::clean_post('siteseo_redirections_param')); } if(isset($_POST['siteseo_redirections_enabled'])){ update_post_meta($post_id, '_siteseo_redirections_enabled', 'yes'); } else{ delete_post_meta($post_id, '_siteseo_redirections_enabled', ''); } if(isset($_POST['siteseo_redirections_enabled_regex'])){ update_post_meta($post_id, '_siteseo_redirections_enabled_regex', 'yes'); } else{ delete_post_meta($post_id, '_siteseo_redirections_enabled_regex'); } if(isset($_POST['siteseo_redirections_logged_status'])){ update_post_meta($post_id, '_siteseo_redirections_logged_status', self::clean_post('siteseo_redirections_logged_status')); } else{ delete_post_meta($post_id, '_siteseo_redirections_logged_status'); } } if(!empty($analysis_tabs) && is_array($analysis_tabs) && in_array('structured-data-types', $analysis_tabs)){ if(class_exists('\SiteSEOPro\StructuredData') && method_exists('\SiteSEOPro\StructuredData', 'save_metabox')){ \SiteSEOPro\StructuredData::save_metabox($post_id, $post); } } if(!empty($analysis_tabs) && is_array($analysis_tabs) && in_array('video-sitemap', $analysis_tabs)){ if(class_exists('\SiteSEOPro\VideoSitemap') && method_exists('\SiteSEOPro\VideoSitemap', 'save_video_sitemap')){ \SiteSEOPro\VideoSitemap::save_video_sitemap($post_id, $post); } } if(!empty($analysis_tabs) && is_array($analysis_tabs) && in_array('google-news', $analysis_tabs)){ if(class_exists('\SiteSEOPro\GoogleNews') && method_exists('\SiteSEOPro\GoogleNews', 'save_google_news')){ \SiteSEOPro\GoogleNews::save_google_news($post_id, $post); } } } } static function clean_post($name){ return self::clean_post_req($name); } static function clean_get($name){ return self::clean_post_req($name); } static function clean_post_req($name){ if(empty($name)){ return ''; } if(!isset($_REQUEST[$name])){ return ''; } if(is_array($_REQUEST[$name]) || is_object($_REQUEST[$name])){ return map_deep(wp_unslash($_REQUEST[$name]), 'sanitize_text_field'); } return sanitize_text_field(wp_unslash($_REQUEST[$name])); } static function universal(){ global $siteseo, $pagenow, $post; $post_id = !empty($_REQUEST['post']) ? (int) sanitize_text_field(wp_unslash($_REQUEST['post'])) : 0; if(empty($post_id)){ return; } if(!current_user_can('edit_post', $post_id)){ wp_die(esc_html__('You do not have access to edit this post', 'siteseo')); } $tmp_post = $post; $post = get_post($post_id); $tmp_pagenow = $pagenow; $pagenow = 'post.php'; if(empty($post)){ $post = $tmp_post; return; } set_current_screen($post->post_type); echo '<style>body{height: 100vh;} #wpcontent,#wpbody-content,html.wp-toolbar{padding:0;} .postbox .handle-order-higher, .postbox .handle-order-lower,#minor-publishing-actions,.site-menu-header{display:none !important;} #adminmenumain, #wpfooter, #wpadminbar{display:none;} #wpcontent{margin:auto;} #wpbody-content{position:relative;} .siteseo-metabox-tab{background-color:white;} .siteseo-meta-submit-container{position:fixed;bottom: 20px;right : 20px;} #siteseo_cpt form {position:relative;}.siteseo-btn{display: inline-flex;padding: 0.5rem 1rem;gap: 0.5rem;justify-content: center;align-items: center;border-radius: 0.375rem;font-size: 0.875rem;line-height: 1.25rem;font-weight: 500;white-space: nowrap;cursor:pointer;box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);border:none;text-decoration:none; text-align:center;}.siteseo-btn.primary{background-color:#141b38;color:white;} .siteseo-spinner{display:none;border-radius:50%;animation: siteseo-spinner 1s linear infinite;height: 0.9375rem;width: 0.9375rem;border: 2px solid #dddcdc80;border-left-color: #e3e3e3;} .siteseo-spinner-active{display:inline-block;} @keyframes siteseo-spinner{ 0% { transform: rotate(0deg);} 100% {transform: rotate(360deg);}} .components-button{align-items: center; -webkit-appearance: none; background: none; border: 0; border-radius: 2px; box-sizing: border-box; color:#1e1e1e; cursor: pointer;display: inline-flex; font-family: inherit; font-size: 13px; font-weight: 400; height: 36px; margin: 0; padding: 6px 12px; text-decoration: none; transition: box-shadow .1s linear;}.components-button.is-secondary {background: #0000; box-shadow: inset 0 0 0 1px #3858e9; color:#3858e9; outline: 1px solid #0000; white-space: nowrap;}.siteseo-sidebar-tabs{display:none;} .notice, .update-nag{ display: none !important;}</style> <div id="siteseo_cpt"><form id="siteseo-universal-post" action="post.php" method="post"> <input type="hidden" name="post_id" value="'.esc_attr($post_id).'"/>'; wp_nonce_field('siteseo_universal_nonce', 'security'); self::render_metabox(); echo '<div class="siteseo-meta-submit-container"> <button type="submit" class="siteseo-btn primary">'.esc_html__('Save Changes', 'siteseo').'<span class="siteseo-spinner"></span></button> </div></form></div> <script> jQuery(document).ready(function(){ jQuery("#siteseo-universal-post").on("submit", function(event){ event.preventDefault(); let jEle = jQuery(event.target), spinner = jEle.find(".siteseo-spinner"), formData = {}; jQuery(this).serializeArray().forEach(field => { formData[field.name] = field.value; }); formData["action"] = "siteseo_save_universal_metabox"; spinner.addClass("siteseo-spinner-active"); jQuery.ajax({ method : "POST", url : "'.esc_url(admin_url('admin-ajax.php')).'", data : formData, success : function(res){ //console.log(res); } }).always(function(){ spinner.removeClass("siteseo-spinner-active"); }) }); }); </script>'; $post = $tmp_post; $pagenow = $tmp_pagenow; global $wp_version; if(!empty($wp_version) && version_compare($wp_version, '6.4', '>')){ remove_action('wp_footer', 'the_block_template_skip_link'); } wp_footer(); exit; } static function render_term_metabox($term){ $metabox_data = self::metabox_term_data($term); self::metabox_form_html($metabox_data); } static function save_meta_terms($term_id){ // Security Check if(!isset($_POST['siteseo_metabox_nonce']) || !wp_verify_nonce(self::clean_post('siteseo_metabox_nonce'), 'siteseo_metabox_nonce') ){ return $term_id; } // Getting taxonomy $term = get_term($term_id); $taxonomy = get_taxonomy($term->taxonomy); // Is this user allowed to make these changes if(!current_user_can($taxonomy->cap->edit_terms, $term_id)) { return $term_id; } $analysis_tabs = []; $analysis_tabs = json_decode(self::clean_post('analysis_tabs'), true); if(empty($analysis_tabs) || !is_array($analysis_tabs)){ return $term_id; } $tabs = [ 'title-settings' => [ 'siteseo_titles_title' => '_siteseo_titles_title', 'siteseo_titles_desc' => '_siteseo_titles_desc', ], 'advanced-settings' => [ 'siteseo_robots_index' => '_siteseo_robots_index', 'siteseo_robots_follow' => '_siteseo_robots_follow', 'siteseo_robots_imageindex'=> '_siteseo_robots_imageindex', 'siteseo_robots_archive' => '_siteseo_robots_archive', 'siteseo_robots_snippet' => '_siteseo_robots_snippet', 'siteseo_robots_canonical' => '_siteseo_robots_canonical', ], 'social-settings' => [ 'siteseo_social_fb_title' => '_siteseo_social_fb_title', 'siteseo_social_fb_desc' => '_siteseo_social_fb_desc', 'siteseo_social_fb_img' => '_siteseo_social_fb_img', 'siteseo_social_fb_img_attachment_id' => '_siteseo_social_fb_img_attachment_id', 'siteseo_social_fb_img_width' => '_siteseo_social_fb_img_width', 'siteseo_social_fb_img_height' => '_siteseo_social_fb_img_height', 'siteseo_social_twitter_title' => '_siteseo_social_twitter_title', 'siteseo_social_twitter_desc' => '_siteseo_social_twitter_desc', 'siteseo_social_twitter_img' => '_siteseo_social_twitter_img', ], 'redirect' => [ 'siteseo_redirections_type' => '_siteseo_redirections_type', 'siteseo_redirections_logged_status' => '_siteseo_redirections_logged_status', 'siteseo_redirections_value' => '_siteseo_redirections_value', 'siteseo_redirections_enabled' => '_siteseo_redirections_enabled', ] ]; // Save the key for all the options which are checkboxes $is_checkboxes = [ 'siteseo_robots_index', 'siteseo_robots_follow', 'siteseo_robots_imageindex', 'siteseo_robots_archive', 'siteseo_robots_snippet', 'siteseo_redirections_enabled', ]; foreach($tabs as $tab => $fields){ if(!in_array($tab, $analysis_tabs)){ continue; } foreach($fields as $post_key => $meta_key){ if(!empty($_POST[$post_key])){ $value = in_array($post_key, $is_checkboxes) ? 'yes' : self::clean_post($post_key); update_term_meta($term_id, $meta_key, $value); } else { delete_term_meta($term_id, $meta_key); } } } return $term_id; } } main/metaboxes/analysis.php 0000644 00000154204 15104342737 0012027 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO\Metaboxes; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Analysis{ static function display_content_readibility($metabox_data){ if(empty($metabox_data) || !isset($metabox_data['post_id'])){ return; // Safeguard in case $metabox_data is incomplete or invalid. } $post_id = $metabox_data['post_id']; $readability_data = get_post_meta($post_id, '_siteseo_readibility_data', true); // Fetch and analyze readability data $analyzes = self::analyze_content($readability_data); // Render the readability data self::render_readibility($analyzes, $readability_data); } static function analyze_content($data){ $analyzes = []; // Analyze different aspects $analyzes = self::analyze_power_word($analyzes, $data); $analyzes = self::analyze_title_number($analyzes, $data); $analyzes = self::analyze_passive_voice($analyzes, $data); $analyzes = self::analyze_paragraph_length($analyzes, $data); return $analyzes; } static function analyze_power_word($analyzes, $data){ if(!empty($data['power_words'])){ $analyzes['power_words'] = [ 'desc' => '<p>'.__('Good: You have power words in your title.', 'siteseo').'</p>', 'impact' => 'good', 'title'=>'Power Word in title' ]; } else{ $analyzes['power_words'] = [ 'desc' => '<p>'.__('Consider adding power words to your title for better impact.', 'siteseo').'</p>', 'impact' => 'low', 'title'=> __('Power Word in title', 'siteseo') ]; } return $analyzes; } static function analyze_title_number($analyzes, $data){ if(!empty($data['number_found'])){ $analyzes['number_found'] = [ /* translators: %s is the number found in the title */ 'desc' => '<p>'.sprintf(__('Good: Your title contains the number "%s".', 'siteseo'), $data['number_found']).'</p>', 'impact' => 'good', 'title' => 'Number in title' ]; } else{ $analyzes['number_found'] = [ 'desc' => '<p>'.__('Consider adding a number to your title to improve CTR.', 'siteseo').'</p>', 'impact' => 'low', 'title' => 'Number in title' ]; } return $analyzes; } static function analyze_passive_voice($analyzes, $data){ //$analyzes['title'] ='Passive Voice'; if(empty($data['passive_voice'])){ $analyzes['passive_voice'] = [ 'desc' => '<p>'.__('Great: No passive voice detected.', 'siteseo').'</p>', 'impact' => 'good', 'title' => 'Passive Voice' ]; } else { $percentage = round(($data['passive_voice']['passive_sentences'] * 100) / $data['passive_voice']['total_sentences']); if($percentage <= 10){ $analyzes['passive_voice'] = [ /* translators: %s is the number found in the title */ 'desc' => '<p>'.sprintf(__('Good: Only %s%% of sentences use passive voice.', 'siteseo'), $percentage).'</p>', 'impact' => 'good', 'title' => 'Passive Voice' ]; } elseif($percentage < 20){ $analyzes['passive_voice'] = [ /* translators: %s is the percentage of sentences using passive voice */ 'desc' => '<p>'.sprintf(__('Okay: %s%% of sentences use passive voice. Try to reduce it.', 'siteseo'), $percentage).'</p>', 'impact' => 'medium', 'title' => 'Passive Voice' ]; } else{ $analyzes['passive_voice'] = [ /* translators: %s is the percentage of sentences using passive voice */ 'desc' => '<p>'.sprintf(__('High: %s%% of sentences use passive voice. Consider revising.', 'siteseo'), $percentage).'</p>', 'impact' => 'high', 'title' => 'Passive Voice' ]; } } return $analyzes; } static function analyze_paragraph_length($analyzes, $data){ if(empty($data['paragraph_length']) || $data['paragraph_length'] < 150){ $analyzes['paragraph_length'] = [ 'desc' => '<p>Good: Your paragraphs are concise.</p>', 'impact' => 'good', 'title' => 'Paragraph Length' ]; } else{ $analyzes['paragraph_length'] = [ /* translators: %s is the current paragraph length in words */ 'desc' => '<p>'.sprintf(__('Consider reducing paragraph length. Current length: %s words.', 'siteseo'), $data['paragraph_length']) . '</p>', 'impact' => 'low', 'title' => 'Paragraph Length' ]; } return $analyzes; } static function render_readibility($analyzes, $analysis_data, $echo = true){ $acceptable_svg = [ 'svg' => [ 'role' => true, 'aria-hidden' => true, 'focusable' => true, 'width' => true, 'height' => true, 'viewbox' => true, 'version' => true, 'xmlns' => true, 'fill' => true, ], 'path' => ['fill' => true, 'd' => true] ]; if(!empty($analyzes)){ $order = ['1' => 'high', '2' => 'medium', '3' => 'low', '4' => 'good']; usort($analyzes, function ($a, $b) use ($order) { return array_search($a['impact'], $order) - array_search($b['impact'], $order); }); // Define SVG icons $high_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"/></svg>'; $medium_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/></svg>'; $good_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>'; // Generate HTML $html = '<div id="siteseo-readibility-tabs">'; foreach($analyzes as $key => $value){ $impact_icon = ''; switch ($value['impact']) { case 'high': $impact_icon = $high_icon; break; case 'medium': case 'low': $impact_icon = $medium_icon; break; case 'good': $impact_icon = $good_icon; break; } $html .= '<div class="siteseo-analysis-block">'; $html .= '<div class="siteseo-analysis-block-title">'; $html .= '<div><span class="impact ' . esc_attr($value['impact']) .'" aria-hidden="true">' . $impact_icon . '</span>' . /* translators: %s represents the degree of severity */ '<span class="screen-reader-text">'. sprintf(esc_html__('Degree of severity: %s','siteseo'), esc_html($value['impact'])).'</span>' . esc_html($value['title']) . '</div>'; $html .= '<span class="siteseo-arrow" aria-hidden="true"></span></div>'; $html .= '<div class="siteseo-analysis-block-content">' . wp_kses_post($value['desc']) . '</div>'; $html .= '</div>'; } $html .= '</div>'; if($echo){ $allowed_html = array_merge(wp_kses_allowed_html('post'), $acceptable_svg); echo wp_kses($html, $allowed_html); return; } return $html; } } // Analaysis static function display_seo_analysis($post){ $seo_analysis = self::perform_seo_analysis($post); echo '<div id="siteseo-analysis-tabs"> <div id="siteseo-analysis-tabs-1"> <div class="siteseo-analysis-summary">'; if(!empty($seo_analysis)){ // grp usort($seo_analysis['checks'], function ($a, $b) { $order = ['error' => 0, 'warning' => 1, 'good' => 2]; $a_status_class = isset($a['status_class']) ? $a['status_class'] : ''; $b_status_class = isset($b['status_class']) ? $b['status_class'] : ''; $a_order = isset($order[$a_status_class]) ? $order[$a_status_class] : 3; $b_order = isset($order[$b_status_class]) ? $order[$b_status_class] : 3; return $a_order - $b_order; }); echo '<div class="siteseo-analysis-summary-pill">'; // counts logic if(!empty($seo_analysis['error_count'])){ echo '<span><svg fill="#f33" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M24 22h-24l12-20z"/></svg>'.esc_html($seo_analysis['error_count']). ' Errors</span>'; } if(!empty($seo_analysis['warning_count'])){ echo '<span><svg xmlns="http://www.w3.org/2000/svg" fill="#fa3" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M0 96C0 60.7 28.7 32 64 32H384c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96z"/></svg>'.esc_html($seo_analysis['warning_count']). ' Warnings</span>'; } if(!empty($seo_analysis['good_count'])){ echo '<span><svg xmlns="http://www.w3.org/2000/svg" fill="#0c6" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512z"/></svg><span>'.esc_html($seo_analysis['good_count']). ' Good</span></span>'; } echo '</div> </div><!-- .analysis-score -->'; // A triangle with exclamation in it. $medium_icon_svg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"/></svg>'; // A check inside a solid circle $good_icon = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM369 209L241 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L335 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>'; $high_icon_svg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c9.4-9.4 24.6-9.4 33.9 0l47 47 47-47c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-47 47 47 47c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-47-47-47 47c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l47-47-47-47c-9.4-9.4-9.4-24.6 0-33.9z"/></svg>'; $allowed_svg_tags = ['svg' => ['xmlns' => true, 'viewbox' => true, 'width' => true, 'height' => true, 'class' => true, 'fill' => true, 'stroke' => true, 'stroke-width' => true], 'path' => ['d' => true, 'fill' => true, 'stroke' => true, 'stroke-width' => true]]; foreach($seo_analysis['checks'] as $check){ echo '<div class="siteseo-analysis-block">'; if(isset($check['label'])){ echo'<div class="siteseo-analysis-block-title">'; if(isset($check['status_class'])){ $impact_icon = ''; switch($check['status_class']){ case 'good': $impact_icon = $good_icon; break; case 'warning': $impact_icon = $medium_icon_svg; break; case 'error': $impact_icon = $high_icon_svg; break; } echo '<div><span class="impact '.esc_attr($check['status_class']).'" aria-hidden="true">'.wp_kses($impact_icon, $allowed_svg_tags).'</span> <span class="screen-reader-text">'. /* translators: %s represents the degree of severity */ sprintf(esc_html__('Degree of severity: %s','siteseo'), esc_html($check['status_class'])).'</span>'; } echo esc_html($check['label']).'</div> <span class="siteseo-arrow" aria-hidden="true"></span> </div>'; } if(isset($check['details'])){ echo '<div class="siteseo-analysis-block-content" aria-hidden="true">'.wp_kses_post($check['details']).'</div>'; } echo '</div><!-- .siteseo-analysis-block -->'; } echo '</div><!-- #siteseo-analysis-tabs-1 --> </div><!-- #siteseo-analysis-tabs -->'; } } static function perform_seo_analysis($post){ $content = $post->post_content; $title = $post->post_title; $title = !empty(get_post_meta($post->ID, '_siteseo_titles_title',true)) ? get_post_meta($post->ID, '_siteseo_titles_title', true) : $title; $permalink = get_permalink($post->ID); $keywords = get_post_meta($post->ID, '_siteseo_analysis_target_kw', true); $meta_desc = get_post_meta($post->ID, '_siteseo_titles_desc', true); if(empty($meta_desc)){ $meta_desc = ''; } $analysis = [ 'good_count' => 0, 'warning_count' => 0, 'error_count' => 0, 'checks' => [] ]; $canonical_check = self::check_canonical_url($permalink); $analysis['checks'][] = $canonical_check; self::update_analysis_score($analysis, $canonical_check); $word_count_check = self::check_word_count($content); $analysis['checks'][] = $word_count_check; self::update_analysis_score($analysis, $word_count_check); $keywords_density_check = self::check_keywords_density($content, $keywords); $analysis['checks'][] = $keywords_density_check; self::update_analysis_score($analysis, $keywords_density_check); $meta_title_check = self::check_meta_title($title); $analysis['checks'][] = $meta_title_check; self::update_analysis_score($analysis, $meta_title_check); $meta_description_check = self::check_meta_description($content, $meta_desc); $analysis['checks'][] = $meta_description_check; self::update_analysis_score($analysis, $meta_description_check); $image_alt_check = self::check_image_alt_texts($content); $analysis['checks'][] = $image_alt_check; self::update_analysis_score($analysis, $image_alt_check); $links_outbound_check = self::analyze_outbound_links($content); $analysis['checks'][] = $links_outbound_check; self::update_analysis_score($analysis, $links_outbound_check); $links_internal_check = self::analyze_internal_links($content); $analysis['checks'][] = $links_internal_check; self::update_analysis_score($analysis, $links_internal_check); $headings_check = self::check_headings($content); $analysis['checks'][] = $headings_check; self::update_analysis_score($analysis, $headings_check); $social_tags_check = self::check_social_meta_tags($post); $analysis['checks'][] = $social_tags_check; self::update_analysis_score($analysis, $social_tags_check); $structured_data_check = self::check_structured_data($post); $analysis['checks'][] = $structured_data_check; self::update_analysis_score($analysis, $structured_data_check); $permalink_keywords_check = self::check_keywords_in_permalink($permalink, $keywords); $analysis['checks'][] = $permalink_keywords_check; self::update_analysis_score($analysis, $permalink_keywords_check); $meta_robots_check = self::check_meta_robots($post); $analysis['checks'][] = $meta_robots_check; self::update_analysis_score($analysis, $meta_robots_check); $last_modified_check = self::check_last_modified_date($post); $analysis['checks'][] = $last_modified_check; self::update_analysis_score($analysis, $last_modified_check); $nofollow_links_check = self::analyze_nofollow_links($content); $analysis['checks'][] = $nofollow_links_check; self::update_analysis_score($analysis, $nofollow_links_check); $readability_data = []; $readability_data = self::analyze_readability($content, $title); update_post_meta($post->ID, '_siteseo_readibility_data', $readability_data); $analysis['checks'][] = $readability_data; return $analysis; } static function update_analysis_score(&$analysis, $check){ switch($check['status']){ case 'Good': $analysis['good_count']++; break; case 'Warning': $analysis['warning_count']++; break; case 'Error': $analysis['error_count']++; break; } } static function check_canonical_url($permalink){ $response = wp_remote_get($permalink); if(is_wp_error($response)){ return [ 'label' => 'Canonical URL', 'status' => 'Error', 'status_class' => 'error', 'details' => '<p>' . __('Unable to check canonical URL.', 'siteseo') . '</p>' ]; } $content = wp_remote_retrieve_body($response); preg_match_all('/<link[^>]+rel=[\'"](canonical)[\'"][^>]+href=[\'"]([^\'"]+)[\'"][^>]*>/i', $content, $matches); $canonical_urls = !empty($matches[2]) ? array_unique($matches[2]) : []; $count = count($canonical_urls); $details = ''; $status = 'Warning'; $details .= '<p>'. __('A canonical URL is required by search engines to handle duplicate content.', 'siteseo') .'</p>'; if($count > 0){ $details .= '<p>' . sprintf( /* translators: %s represents the degree of severity */ _n( 'We found %s canonical URL in your source code. Below, the list:', 'We found %s canonical URLs in your source code. Below, the list:', $count, 'siteseo' ), number_format_i18n($count) ) . '</p>'; $details .= '<ul>'; foreach($canonical_urls as $link){ $details .= '<li>' . '<span class="dashicons dashicons-arrow-right"></span>' . '<a href="' . esc_url($link) . '" target="_blank">' . esc_url($link) . '</a>' . '<span class="dashicons dashicons-external"></span>' . '</li>'; } $details .= '</ul>'; if($count > 1){ $status = 'Error'; $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('You must fix this. Canonical URL duplication is bad for SEO.', 'siteseo') . '</p>'; } else{ $status = 'Good'; } } else{ if(get_post_meta(get_the_ID(), '_siteseo_robots_index', true)){ $status = 'Good'; $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>' . __('This page doesn\'t have any canonical URL because your post is set to <strong>noindex</strong>. This is normal.', 'siteseo') . '</p>'; } else{ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('This page doesn\'t have any canonical URL.', 'siteseo') . '</p>'; } } return [ 'label' => 'Canonical URL', 'status' => $status, 'status_class' => strtolower($status), 'details' => $details ]; } static function check_word_count($content){ $word_count = str_word_count(wp_strip_all_tags($content)); $unique_words = count(array_unique(str_word_count(wp_strip_all_tags($content), 1))); $details = ''; if($word_count != 0){ $details = '<p>'. __('Word count isn\'t a direct ranking factor, but it\'s important for your content to be high-quality, relevant, and unique. To meet these criteria, your article should include a sufficient number of paragraphs to ensure adequate word count.', 'siteseo') .'</p>'; $details .= '<ul>'; /* translators: %d represents the words found */ $details .= '<li>'. sprintf(__('%d words found', 'siteseo'), $word_count) .'</li>'; /* translators: %d represents the unique words found */ $details .= '<li>'. sprintf(__('%d unique words found', 'siteseo'), $unique_words) .'</li>'; $details .= '</ul>'; } if($word_count == 0){ $status = 'Error'; $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('No content? Try adding a few more paragraphs.!', 'siteseo') . '</p>'; } elseif($word_count > 300){ $status = 'Good'; $details .= '<li><span class="dashicons dashicons-thumbs-up"></span>' . __('Your content contains over 300 words, which meets the minimum requirement for a post', 'siteseo') .'</li>'; } else{ $status = 'Error'; $details .= '<li><span class="dashicons dashicons-thumbs-down"></span>' . __('Your content is too brief. Consider adding a few more paragraphs!', 'siteseo') .'</li>'; } return [ 'label' => __('Word Count', 'siteseo'), 'status' => $status, 'status_class' => strtolower($status), 'details' => $details ]; } static function check_keywords_density($content, $keywords){ $content = strtolower(wp_strip_all_tags($content)); $keywords = array_filter(explode(',', trim($keywords))); $content_words = str_word_count($content, 1); $count_words = count($content_words); $details = ''; if(empty($keywords) || empty($content_words)){ $details .= '<p>' . __('We couldn\'t calculate the keyword density. This may be because you haven\'t added any content or your target keywords are missing from the post.', 'siteseo') . '</p>'; return [ 'label' => __('Keyword Density', 'siteseo'), 'status' => 'Error', 'status_class' => 'error', 'details' => $details ]; } // calulate $density_details = []; $all_density = []; foreach($keywords as $keyword){ $keyword_occurrence = 0; $keyword = strtolower(trim($keyword)); // If keyword has multiple words if(str_word_count($keyword) > 1){ $pattern = '/\b' . preg_quote($keyword, '/') . '\b/i'; preg_match_all($pattern, $content, $matches); $keyword_occurrence = count($matches[0]); } else { $keyword_occurrence = array_count_values($content_words)[$keyword] ?? 0; } // Calculate density as percentage $kw_density = ($keyword_occurrence * str_word_count($keyword) * 100)/$count_words; $all_density[] = number_format($kw_density, 2); $density_details[] = /* translators: %s represents the degree of severity */ sprintf( '<ul><li><span class="dashicons dashicons-arrow-right"></span>%s</li></ul>', sprintf( /* translators: %s represents a keyword density of */ esc_html__('%1$s was found %2$d times in your content, a keyword density of %3$s%%', 'siteseo'), $keyword, $keyword_occurrence, number_format($kw_density, 2) ) ); } $details .= implode('', $density_details); $details .= '<p class="description">'. sprintf( /* translators: %s represents the keywords stuffing */ __('Find out more about <a href="%s" target="_blank">keywords stuffing</a>', 'siteseo'), 'https://www.youtube.com/watch?v=Rk4qgQdp2UA' ) . '</p>'; if(empty($all_density)){ return [ 'label' => __('Keyword Density', 'siteseo'), 'status' => 'Error', 'status_class' => 'error', 'details' => $details ]; } //avg density $avg_density = array_sum($all_density)/count($all_density); $status = ($avg_density > 1) ? 'Good' : 'Warning'; return [ 'label' => __('Keyword Density', 'siteseo'), 'status' => $status, 'status_class' => strtolower($status), 'details' => $details ]; } static function check_meta_title($title, $keywords = []){ $details = ''; $status = 'Good'; $status_class = 'good'; $title = \SiteSEO\TitlesMetas::replace_variables($title); // length if(empty($title)){ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('A custom title has not been set for this post. If the global meta title works for you, you can disregard this recommendation.', 'siteseo') . '</p>'; $status = 'Warning'; $status_class = 'warning'; } elseif(strlen($title) > 60){ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('Your custom title is too lengthy.', 'siteseo') . '</p>'; $status = 'Warning'; $status_class = 'warning'; } elseif(strlen($title) >= 10 && strlen($title) <= 60){ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>' . __('The length of your title is appropriate.', 'siteseo') . '</p>'; } else{ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('Your custom title is too short.', 'siteseo') . '</p>'; $status = 'Warning'; $status_class = 'warning'; } if(!empty($keywords)){ $keyword_counts = []; foreach($keywords as $kw_name){ $kw_count = substr_count(strtolower($title), strtolower($kw_name)); if($kw_count > 0){ $keyword_counts[] = $kw_count; /* translators: %s represents the degree of severity */ $details .= '<ul><li><span class="dashicons dashicons-arrow-right"></span>'. sprintf(esc_html__('%1$s was found %2$d times.', 'siteseo'), $kw_name, $kw_count) . '</li></ul>'; } } if(!empty($keyword_counts)){ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>'.__('The target keywords are included in the Meta Title', 'siteseo').'</p>'; } else { $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'.__('None of your target keywords are present in the Meta Title.', 'siteseo').'</p>'; $status = $status === 'Good' ? 'Warning' : $status; $status_class = $status_class === 'good' ? 'warning' : $status_class; } } return [ 'label' => __('Meta Title', 'siteseo'), 'status' => $status, 'status_class' => $status_class, 'details' => $details ]; } static function check_meta_description($content, $meta_description = '', $keywords = []){ $details = ''; $status = 'Good'; $status_class = 'good'; $desc = !empty($meta_description) ? $meta_description : wp_trim_words($content, 20); $description = \SiteSEO\TitlesMetas::replace_variables($desc); // desc length if(empty($meta_description)){ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('A custom meta description has not been set for this post. If the global meta description works for you, you can ignore this recommendation.', 'siteseo') . '</p>'; $status = 'Warning'; $status_class = 'warning'; } elseif(strlen($description) > 160){ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('Your custom meta description is too lengthy', 'siteseo') .'</p>'; $status = 'Warning'; $status_class = 'warning'; } elseif(strlen($description) >= 50 && strlen($description) <= 160){ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>'. __('The length of your meta description is appropriate.', 'siteseo').'</p>'; } else{ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>'. __('The description has been set properly.', 'siteseo').'</p>'; } if(!empty($keywords)){ $keyword_counts = []; foreach($keywords as $kw_name){ $kw_count = substr_count(strtolower($description), strtolower($kw_name)); if($kw_count > 0){ $keyword_counts[] = $kw_count; $details .= '<li><span class="dashicons dashicons-arrow-right"></span>' . /* translators: %s represents the key word count */ sprintf(esc_html__('%1$s was found %2$d times.', 'siteseo'), $kw_name, $kw_count) . '</li>'; } } if(!empty($keyword_counts)){ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>'. __('The target keywords are included in the Meta description.', 'siteseo') . '</p>'; } else{ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'. __('None of your target keywords are included in the Meta description.', 'siteseo') . '</p>'; $status = $status === 'Good' ? 'Warning' : $status; $status_class = $status_class === 'good' ? 'warning' : $status_class; } } return [ 'label' => 'Meta Description', 'status' => $status, 'status_class' => $status_class, 'details' => $details ]; } static function check_image_alt_texts($content){ $result = [ 'label' => __('Alternative texts of images', 'siteseo'), 'status' => 'Good', 'status_class' => 'good', 'details' => '' ]; if(empty($content)){ $result['status'] = 'Warning'; $result['status_class'] = 'warning'; $result['details'] = '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('No content found to analyze. Please add some content to check for images and alt texts.', 'siteseo') . '</p>'; return $result; } preg_match_all('/<img[^>]+src=[\'"]([^\'"]+)[\'"][^>]*>/i', $content, $image_matches); preg_match_all('/<img[^>]+alt=[\'"]([^\'"]+)[\'"][^>]*>/i', $content, $alt_matches); $images_count = count($image_matches[0]); $alt_text_count = count(array_filter($alt_matches[1], 'strlen')); if($images_count === 0){ $result['status'] = 'Warning'; $result['status_class'] = 'warning'; $result['details'] = '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('We couldn\'t find any images in your content. Adding media can boost your SEO.', 'siteseo') . '</p>'; return $result; } if($images_count !== $alt_text_count){ $result['status'] = ($alt_text_count > 0) ? 'Warning' : 'Error'; $result['status_class'] = strtolower($result['status']); $result['details'] = '<p><span class="dashicons dashicons-thumbs-down"></span>' . esc_html__('No alternative text has been found for these images. Alt tags are essential for SEO and accessibility. Please edit your images in the media library or using your preferred page builder, and provide alternative text.', 'siteseo') . '</p>'; if(!empty($image_matches[1])){ $result['details'] .= '<ul class="attachments">'; foreach($image_matches[1] as $index => $img){ if(empty($alt_matches[1][$index])){ $result['details'] .= '<li class="attachment"><figure>' . '<img src="' . esc_url($img) . '"/>' . '<figcaption style="word-break: break-all;">' . esc_html($img) . '</figcaption>' . '</figure></li>'; } } $result['details'] .= '</ul>'; } $result['details'] .= '<p>'. __('Please note that we scan all your source code, which means some missing alternative text for images may be found in your header, sidebar, or footer.', 'siteseo') .'</p>'; } else{ $result['details'] = '<p><span class="dashicons dashicons-thumbs-up"></span>' . __('All alternative tags have been completed. Great job!', 'siteseo') .'</p>'; } return $result; } static function analyze_outbound_links($content){ preg_match_all('/<a[^>]+href=([\'"])(?!#)([^\'"]+)[\'"][^>]*>/i', $content, $links); $outbound_links = array_filter($links[2], function($link){ return strpos($link, get_site_url()) === false; }); $total_outbound = count($outbound_links); $nofollow_count = preg_match_all('/rel=[\'"]nofollow[\'"]/', implode(' ', $links[0])); $status = $total_outbound > 0 ? 'Good' : 'Warning'; $details = ''; $details .= '<p>'. __('The internet is based on the concept of hyperlinks, so linking to different websites is completely natural. However, avoid linking to low-quality or spammy sites. If youre uncertain about a site quality, add the "nofollow" attribute to your link.', 'siteseo') .'</p>'; if($total_outbound > 0){ /* translators: %s represents the detected outbound links on page */ $details .= '<p>'.sprintf(__('We detected %s outbound links on your page. Below is the list.', 'siteseo'), $total_outbound) .'</p>'; $details .= '<ul>'; foreach($outbound_links as $link){ $details .= '<li><span class="dashicons dashicons-arrow-right"></span>'; $details .= '<a href="'.esc_url($link).'" target="_blank">'.esc_url($link).'</a></li>'; } $details .= '</ul>'; } else{ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('This page does not contain any outbound links.', 'siteseo') . '</p>'; } return [ 'label' => __('Outbound Links', 'siteseo'), 'status' => $status, 'status_class' => strtolower($status), 'details' => $details ]; } static function analyze_internal_links($content){ preg_match_all('/<a[^>]+href=([\'"])(?!#)([^\'"]+)[\'"][^>]*>(.*?)<\/a>/i', $content, $links, PREG_SET_ORDER); $internal_links = array_filter($links, function($link) { return strpos($link[2], get_site_url()) !== false; }); $total_internal = count($internal_links); $status = $total_internal > 0 ? 'Good' : 'Warning'; $details = ''; $details .= '<p>'. __('Internal links are crucial for both SEO and user experience. Always aim to interconnect your content using meaningful and relevant anchor text.', 'siteseo') .'</p>'; if($total_internal > 0){ /* translators: %s represents the internal links pointing to page */ $details .= '<p>'. sprintf(__('We identified %s internal links pointing to this page.', 'siteseo'), $total_internal) .'</p>'; $details .= '<ul>'; foreach($internal_links as $link){ $url = $link[2]; $post_id = url_to_postid($url); $details .= '<li><span class="dashicons dashicons-arrow-right"></span>'; $details .= '<a href="'.esc_url($url) .'" target="_blank">'. esc_html($url) . '</a>'; if($post_id){ $details .= '<a class="nounderline" href="' . get_edit_post_link($post_id) . '" ' . 'title="' . /* translators: %s represents the degree of severity */ sprintf(__('edit %s', 'siteseo'), esc_html(get_the_title($post_id))) . '">' . '<span class="dashicons dashicons-edit-large"></span></a>'; } $details .= '</li>'; } $details .= '</ul>'; } else{ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('This page has no internal links from other content. Links from archive pages are not counted as internal links because they lack contextual relevance.', 'siteseo') . '</p>'; } return [ 'label' => __('Internal Links', 'siteseo'), 'status' => $status, 'status_class' => strtolower($status), 'details' => $details ]; } static function analyze_nofollow_links($content){ preg_match_all('/<a[^>]+href=([\'"])([^\'"]+)[\'"][^>]*>(.*?)<\/a>/i', $content, $all_links, PREG_SET_ORDER); $nofollow_links = array_filter($all_links, function($link){ return preg_match('/rel=[\'"][^\'"]*nofollow[^\'"]*[\'"]/', $link[0]); }); $total_nofollow = count($nofollow_links); $status = $total_nofollow > 0 ? 'Warning' : 'Good'; $details = ''; if($total_nofollow > 0){ $details .= '<p>' . /* translators: %d represents the number nofollow attribute */ sprintf( esc_html__('We found %d links with the nofollow attribute on your page. Avoid overusing the nofollow attribute in links. Below is the list:', 'siteseo'), $total_nofollow ) . '</p>'; $details .= '<ul>'; foreach($nofollow_links as $link){ $href = $link[2]; $link_text = $link[3]; $details .= '<li>'. '<span class="dashicons dashicons-arrow-right"></span>'. '<a href="' . esc_url($href) . '" target="_blank">'.esc_html($link_text).'</a>'. '<span class="dashicons dashicons-external"></span>'. '</li>'; } $details .= '</ul>'; } else{ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>' . __('This page does not contain any nofollow links.', 'siteseo') . '</p>'; } return [ 'label' => __('Nofollow Links', 'siteseo'), 'status' => $status, 'status_class' => strtolower($status), 'details' => $details ]; } static function check_headings($content, $keywords = []) { $details = ''; $status = 'Good'; $status_class = 'good'; if(empty(trim($content))){ return [ 'label' => 'Headings', 'status' => 'Warning', 'status_class' => 'warning', 'details' => '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('No content available to check headings.', 'siteseo') . '</p>' ]; } preg_match_all('/<h([1-6])([^>]*)>(.*?)<\/h\1>/is', $content, $heading_matches); if(empty($heading_matches[0])){ return [ 'label' => 'Headings', 'status' => 'Error', 'status_class' => 'error', 'details' => '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('No headings found in the content. Using headings is essential for both SEO and accessibility!', 'siteseo') . '</p>' ]; } $heading_counts = array_count_values($heading_matches[1]); $total_headings = count($heading_matches[0]); $h1_count = $heading_counts[1] ?? 0; if($h1_count > 0){ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . /* translators: %d represents the number of h1 tags */ sprintf(esc_html__('We found %d Heading 1 (H1) tags in your content.', 'siteseo'), $h1_count+1) . '</p>'; $details .= '<p>' . __('You should avoid using more than one H1 heading in your post content. The rule is simple: each web page should have only one H1, which benefits both SEO and accessibility. Below is the list:', 'siteseo') . '</p>'; $details .= '<ul>'; foreach(array_keys($heading_matches[1], '1') as $index){ $details .= '<li><span class="dashicons dashicons-arrow-right"></span>' . wp_strip_all_tags($heading_matches[0][$index]) . '</li>'; } $details .= '</ul>'; $status = 'Warning'; $status_class = 'warning'; } foreach([2, 3] as $level){ $level_count = $heading_counts[$level] ?? 0; $details .= '<p><span class="dashicons dashicons-info"></span>' . /* translators: %d represents the heading */ sprintf(__('Found %1$d H%2$d heading(s)', 'siteseo'), $level_count, $level) . '</p>'; if($level_count > 0){ $details .= '<ul>'; foreach(array_keys($heading_matches[1], (string)$level) as $index){ $details .= '<li><span class="dashicons dashicons-arrow-right"></span>'. wp_strip_all_tags($heading_matches[0][$index]) .'</li>'; } $details .= '</ul>'; } if(!empty($keywords) && $level_count > 0){ $keyword_found = false; $keyword_details = '<ul>'; foreach($keywords as $kw_name){ $kw_count = 0; foreach(array_keys($heading_matches[1], (string)$level) as $index){ $kw_count += substr_count( strtolower(wp_strip_all_tags($heading_matches[0][$index])), strtolower($kw_name) ); } if($kw_count > 0){ $keyword_found = true; $keyword_details .= '<li><span class="dashicons dashicons-arrow-right"></span>' . /* translators: %s represents the degree of severity */ sprintf(esc_html__('%1$s was found %2$d times.', 'siteseo'), $kw_name, $kw_count) . '</li>'; } } $keyword_details .= '</ul>'; if($keyword_found){ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>' . /* translators: %s represents the target keywords */ sprintf(__('Target keywords were found in Heading %1$d (H%2$d).', 'siteseo'), $level, $level) . '</p>' . $keyword_details; } else{ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . /* translators: %d represents the target keywords */ sprintf(__('None of your target keywords were found in Heading %1$d (H%2$d).', 'siteseo'), $level, $level) . '</p>'; if($status === 'Good'){ $status = 'Warning'; $status_class = 'warning'; } } } } return [ 'label' => 'Headings', 'status' => $status, 'status_class' => $status_class, 'details' => $details ]; } static function check_social_meta_tags($post = null){ if(!$post){ $post = get_queried_object(); } $details = ''; $status = 'Good'; $status_class = 'good'; $og_titles = get_post_meta($post->ID, '_siteseo_social_fb_title', true); $og_title = $og_titles ? $og_titles : ''; if(empty($og_title)){ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'. __('Your Open Graph Title tag has not been set!', 'siteseo') .'</p>'; $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'. __('Your Open Graph Title is missing!', 'siteseo') .'</p>'; $status = 'Error'; $status_class = 'error'; } else{ $details .= '<h4>'. __('Open Graph Title', 'siteseo') . '</h4>'; $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>'. __('An Open Graph Title tag was found in your source code.', 'siteseo') . '</p>'; $details .= '<ul><li><span class="dashicons dashicons-arrow-right"></span>' . esc_html($og_title) . '</li></ul>'; } $og_descriptions = get_post_meta($post->ID, '_siteseo_social_fb_desc', true); $og_description = $og_descriptions ? $og_descriptions : ''; if(empty($og_description)){ $details .= '<h4>'. __('Open Graph Description', 'siteseo') .'</h4>'; $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'. __('Your Open Graph Description has not been set!','siteseo').'</p>'; $status = $status === 'Good' ? 'Warning' : $status; $status_class = $status_class === 'good' ? 'warning' : $status_class; } else { $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>' . /* translators: %s represents the og description */ sprintf(esc_html__('We found %s og:description in your content.', 'siteseo'), $og_descriptions) . '</p>'; } // OG Check $og_images = get_post_meta($post->ID, '_siteseo_social_fb_img', true); $og_image = $og_images ? $og_images : ''; if(empty($og_image)){ $details .= '<h4>'. __('Open Graph Image', 'siteseo') .'</h4>'; $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'. __('Your Open Graph Image has not been set!' ,'siteseo') .'</p>'; $status = $status === 'Good' ? 'Warning' : $status; $status_class = $status_class === 'good' ? 'warning' : $status_class; } else{ /* translators: %s represents the og images */ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>'. sprintf(esc_html__('We found %s og:image in your content.', 'siteseo'), $og_images) . '</p>'; } // Open Graph $og_site_name = get_bloginfo('name'); if(empty($og_site_name)){ $details .= '<h4>'. __('Open Graph Site Name', 'siteseo') .'</h4>'; $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'. __('Your Open Graph Site Name has not been set!' ,'siteseo') .'</p>'; $status = $status === 'Good' ? 'Warning' : $status; $status_class = ($status_class === 'good') ? 'warning' : $status_class; } // Twitter $twitter_title = get_post_meta($post->ID, '_siteseo_social_twitter_title', true); if(empty($twitter_title)){ $details .= '<h4>'. __('X Title', 'siteseo').'</h4>'; $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'. __('Your X Title has not been set!', 'siteseo').'</p>'; $status = $status === 'Good' ? 'Warning' : $status; $status_class = $status_class === 'good' ? 'warning' : $status_class; } $twitter_description = get_post_meta($post->ID, '_siteseo_social_twitter_desc', true); if(empty($twitter_description)){ $details .= '<h4>'. __('X Description','siteseo').'</h4>'; $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'. __('Your X Description has not been set!','siteseo') .'</p>'; $status = $status === 'Good' ? 'Warning' : $status; $status_class = $status_class === 'good' ? 'warning' : $status_class; } $twitter_image = get_post_meta($post->ID, '_siteseo_social_twitter_img', true); if(empty($twitter_image)){ $details .= '<h4>'. __('X Image', 'siteseo') .'</h4>'; $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'. __('Your X Image has not been set!', 'siteseo').'</p>'; $status = $status === 'Good' ? 'Warning' : $status; $status_class = ($status_class === 'good') ? 'warning' : $status_class; } return [ 'label' => __('Social Meta Tags', 'siteseo'), 'status' => $status, 'status_class' => $status_class, 'details' => $details ]; } static function check_structured_data($post){ $schema_type = get_post_meta($post->ID, '_siteseo_structured_data_type', true); $status = !empty($schema_type) ? 'Good' : 'Warning'; return [ 'label' => 'Structured Data', 'status' => $status, 'status_class' => strtolower($status), 'details' => !empty($schema_type) ? 'Schema Type: '.$schema_type : 'No schema defined' ]; } static function check_keywords_in_permalink($permalink, $keywords){ $keywords = array_filter(explode(',', trim($keywords))); $permalink = str_replace('-', ' ', strtolower(basename($permalink))); $content_words = str_word_count($permalink, 1); $count_words = count($content_words); $kw_density = []; $matching_keywords = []; foreach($keywords as $keyword){ $keyword_occurrence = 0; $keyword = strtolower(trim($keyword)); // If keyword has multiple words if(str_word_count($keyword) > 1){ $pattern = '/\b' . preg_quote($keyword, '/') . '\b/i'; preg_match_all($pattern, $permalink, $matches); $keyword_occurrence = count($matches[0]); } else { $keyword_occurrence = array_count_values($content_words)[$keyword] ?? 0; } // Calculate density as percentage $kw_density[] = ($keyword_occurrence * str_word_count($keyword) * 100)/$count_words; if(!empty($kw_density)){ $matching_keywords[] = $keyword; break; } } $status = !empty($kw_density) ? 'Good' : 'Error'; $details = ''; if($status === 'Good'){ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>'. __('Great! One of your target keywords is included in your permalink.', 'siteseo') .'</p>'; $details .= '<ul><li><span class="dashicons dashicons-arrow-right"></span>' . implode(', ', $matching_keywords) . '</li></ul>'; } elseif($permalink === get_home_url() || $permalink === home_url()){ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>'. __('This is your homepage, so this check doesn\'t apply as there is no slug.', 'siteseo') . '</p>'; } else{ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'. __('You should include one of your target keywords in your permalink.', 'siteseo') . '</p>'; } return [ 'label' => __('Keywords in Permalink', 'siteseo'), 'status' => $status, 'status_class' => strtolower($status), 'details' => $details ]; } static function check_meta_robots($post){ $noindex = get_post_meta($post->ID, '_siteseo_robots_index', true); $nofollow = get_post_meta($post->ID, '_siteseo_robots_follow', true); $noimageindex = get_post_meta($post->ID, '_siteseo_robots_imageindex', true); $noarchive = get_post_meta($post->ID, '_siteseo_robots_archive', true); $nosnippet = get_post_meta($post->ID, '_siteseo_robots_snippet', true); $count_meta_robots = 0; $details = ''; $meta_robots_checks = [ 'noindex' => $noindex, 'nofollow' => $nofollow, 'noimageindex' => $noimageindex, 'noarchive' => $noarchive, 'nosnippet' => $nosnippet, ]; foreach($meta_robots_checks as $robot => $value){ if($value !== 'yes'){ continue; } $count_meta_robots++; switch($robot){ case 'noindex': $details .= '<p data-robots="noindex"><span class="dashicons dashicons-thumbs-down"></span>' . __('<strong>noindex</strong> is enabled! Search engines cannot index this page', 'siteseo') . '</p>'; break; case 'nofollow': $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('<strong>nofollow</strong> is on! Search engines can\'t follow your links on this page.', 'siteseo') . '</p>'; break; case 'noimageindex': $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('<strong>nofollow</strong> is enabled! Search engines cannot follow the links on this page.', 'siteseo').'</p>'; break; case 'noarchive': $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('<strong>noarchive</strong> is enabled! Search engines will not cache your page.', 'siteseo') .'</p>'; break; case 'nosnippet': $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>' . __('<strong>nosnippet</strong> is enabled! Search engines will not display a snippet of this page in the search results.', 'siteseo') .'</p>'; break; } } if($count_meta_robots > 0){ /* translators: %s represents the robots tags */ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'. sprintf(esc_html__('We found %s meta robots tags on your page. There may be an issue with your theme!', 'siteseo'), $count_meta_robots) .'</p>'; } if($noindex !== 'yes'){ $details .= '<p data-robots="index"><span class="dashicons dashicons-thumbs-up"></span>'. __('<strong>noindex</strong> is disabled. Search engines will index this page.', 'siteseo') .'</p>'; } if($nofollow !== 'yes'){ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>'. __('<strong>nofollow</strong> is disabled. Search engines will follow links on this page.', 'siteseo') .'</p>'; } if($noimageindex !== 'yes'){ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>'. __('<strong>noimageindex</strong> is disabled. Google will index the images on this page.', 'siteseo') .'</p>'; } if($noarchive !== 'yes'){ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>'. __('<strong>noarchive</strong> is disabled. Search engines will probably cache your page.', 'siteseo') .'</p>'; } if($nosnippet !== 'yes'){ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>'. __('<strong>nosnippet</strong> is disabled. Search engines will display a snippet of this page in search results.', 'siteseo') .'</p>'; } if($count_meta_robots === 0){ $details .= '<p><span class="dashicons dashicons-thumbs-up"></span>' . __('We found no meta robots on this page. It means, your page is index,follow. Search engines will index it, and follow links. ', 'siteseo') . '</p>'; } $status = ($count_meta_robots === 0) ? 'Good' : (($count_meta_robots <= 2) ? 'Warning' : 'Error'); return [ 'label' => 'Meta Robots', 'status' => $status, 'status_class' => strtolower($status), 'details' => $details ]; } static function check_last_modified_date($post){ $last_modified = get_the_modified_date('Y-m-d', $post); $days_since_modified = round((time() - strtotime($last_modified)) / (60 * 60 * 24)); $status = $days_since_modified < 30 ? 'Good' : ($days_since_modified < 90 ? 'Warning' : 'Error'); $details = ''; if($status == 'Error'){ $details .= '<p><span class="dashicons dashicons-thumbs-down"></span>'. __('This post is a little old!', 'siteseo') .'</p>'; } if($days_since_modified < 365){ $details .='<p><span class="dashicons dashicons-thumbs-up"></span>'.__('The last modified date of this article is less than 1 year. Cool', 'siteseo') .'</p>'; } $details .= '<p>'.__('Search engines love fresh content. Update regularly your articles without entirely rewriting your content and give them a boost in search rankings. SiteSEO takes care of the technical part', 'siteseo').'</p>'; return [ 'label' => 'Last Modified Date', 'status' => $status, 'status_class' => strtolower($status), 'details' => $details ]; } static function analyze_readability($post, $title){ $data = []; // These are power words specifically for headlines. // These are not hard rules, but they are perceived to have a higher CTR if used in the heading. $power_words = ['exclusive', 'revealed', 'secrets', 'ultimate', 'proven', 'unleashed', 'discover', 'breakthrough', 'shocking', 'insider', 'elite', 'uncovered', 'powerful', 'guaranteed', 'transformative', 'instant', 'revolutionary', 'unbelievable', 'top', 'best', 'must-have', 'limited', 'rare', 'unique', 'unprecedented', 'premium', 'urgent', 'today', 'now', 'latest', 'new', 'free', 'bonus', 'offer', 'sensational', 'astonishing', 'incredible', 'jaw-dropping', 'unmissable', 'essential', 'critical', 'vital', 'pivotal', 'game-changer', 'spotlight', 'trending', 'hot', 'popular', 'featured', 'special', 'limited-time', 'hurry', 'last chance', 'countdown']; if(!empty($title)){ // Checking power words. $title_words = explode(' ', strtolower($title)); $present_power_words = array_intersect($title_words, $power_words); if(!empty($present_power_words)){ $data['power_words'] = $present_power_words; } // Checking number in the Title if(preg_match('/\s?\d+\s/', preg_quote($title), $number)){ $data['number_found'] = $number[0]; } } // We are checking paragarph length too. if(!isset($data['paragraph_length'])){ $data['paragraph_length'] = 0; } if(!empty($post)){ preg_match_all('/<p>.*<\/p>/U', $post, $paragraphs); foreach($paragraphs[0] as $paragraph){ $paragraph = normalize_whitespace(wp_strip_all_tags($paragraph)); $data['paragraph_length'] += substr_count($paragraph, ' ') + 1; // updating paragraph length self::analyse_passive_voice($paragraph, $data); } } return $data; } static function analyse_passive_voice($paragraph, &$data){ if(empty($paragraph)){ return; } $sentences = explode('.', $paragraph); $passive_count = 0; if(!isset($data['passive_voice']['passive_sentences'])){ $data['passive_voice']['passive_sentences'] = 0; } if(!isset($data['passive_voice']['total_sentences'])){ $data['passive_voice']['total_sentences'] = 0; } if(empty($sentences)){ return; } foreach($sentences as $sentence){ if(empty($sentence)){ continue; } $sentence = normalize_whitespace($sentence); $is_passive = self::sentence_is_passive($sentence); if($is_passive == true){ $passive_count++; } } $data['passive_voice']['passive_sentences'] += $passive_count; $data['passive_voice']['total_sentences'] += count($sentences); } static function sentence_is_passive($sentence){ $be_words = ['am', 'is', 'are', 'was', 'were', 'be', 'being', 'been']; // TODO: We can check if "en" ending words are a comman pattern too, then we will remove the en ending words too from here. $past_particles = ['gone' ,'done' ,'seen' ,'taken' ,'eaten' ,'written' ,'driven' ,'spoken' ,'broken' ,'chosen' ,'fallen' ,'forgotten' ,'forgiven' ,'hidden' ,'known' ,'grown' ,'drawn' ,'flown' ,'thrown' ,'blown' ,'shown' ,'worn' ,'sworn' ,'torn' ,'woken' ,'begun' ,'sung' ,'run' ,'swum' ,'shaken' ,'given' ,'proven' ,'ridden' ,'risen' ,'shone' ,'shot' ,'fought' ,'thought' ,'bought' ,'brought' ,'caught' ,'taught' ,'built' ,'felt' ,'kept' ,'slept' ,'left' ,'lost' ,'meant' ,'met' ,'read' ,'sold' ,'sent' ,'spent' ,'stood' ,'understood' ,'won' ,'held' ,'told' ,'heard' ,'paid' ,'laid' ,'said' ,'found' ,'made' ,'learned' ,'put']; if(empty($sentence)){ return false; } $words = explode(' ', $sentence); for($i = 0; $i < count($words); $i++){ // Checking if we have a be word if(!in_array($words[$i], $be_words)){ continue; } // If be word is there then need to check if next one is past particle with mostly ends with ed. if(strpos($words[$i+1], 'ed') != strlen($words[$i+1]) - 2){ if(!in_array($words[$i+1], $past_particles)){ continue; } } return true; } return false; } } main/imageseo.php 0000644 00000006420 15104342737 0010002 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class ImageSeo{ static function init(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-advanced'])){ return; // toggle disable } if(!empty($siteseo->advanced_settings['advanced_attachments'])){ add_action('template_redirect', '\SiteSEO\ImageSeo::redirect_attachment_to_parent'); } if(!empty($siteseo->advanced_settings['advanced_clean_filename'])){ add_filter('sanitize_file_name', '\SiteSEO\ImageSeo::clean_media_filename', 10, 1); } if(!empty($siteseo->advanced_settings['advanced_image_auto_alt_editor']) || !empty($siteseo->advanced_settings['advanced_image_auto_caption_editor']) || !empty($siteseo->advanced_settings['advanced_image_auto_desc_editor']) || !empty($siteseo->advanced_settings['advanced_image_auto_title_editor']) ){ add_action('add_attachment', '\SiteSEO\ImageSeo::set_image_content'); } } static function set_image_content($attachment_id){ global $siteseo; if(!wp_attachment_is_image($attachment_id)){ return; } $attachment = get_post($attachment_id); $file_name = pathinfo($attachment->guid, PATHINFO_FILENAME); $file_name = sanitize_file_name($file_name); $file_name = ucwords(str_replace(['-', '_'], ' ', $file_name)); // WooCommerce product img $is_woocommerce_product_image = false; $product_title = ''; $parent_id = $attachment->post_parent; if(!empty($parent_id)){ $parent_post = get_post($parent_id); if(!empty($parent_post) && $parent_post->post_type === 'product'){ $is_woocommerce_product_image = true; $product_title = get_the_title($parent_id); } } $file_name = $is_woocommerce_product_image ? $product_title : $file_name; // Adding alt text to the image if(!empty($siteseo->advanced_settings['advanced_image_auto_alt_editor'])){ update_post_meta($attachment_id, '_wp_attachment_image_alt', $file_name); } $options = []; $options['ID'] = $attachment_id; // Adding Title to the image if(!empty($siteseo->advanced_settings['advanced_image_auto_title_editor'])){ $options['post_title'] = $file_name; } // Adding Img Caption if(!empty($siteseo->advanced_settings['advanced_image_auto_caption_editor'])){ $options['post_content'] = $file_name; } // Adding Img Caption if(!empty($siteseo->advanced_settings['advanced_image_auto_desc_editor'])){ $options['post_excerpt'] = $file_name; } if(count($options) > 1){ wp_update_post($options); } } static function clean_media_filename($filename){ $filename = strtolower($filename); $filename = remove_accents($filename); $filename = preg_replace('/[^a-z0-9-.]+/', '-', $filename); $filename = trim($filename, '-.'); $file_info = pathinfo($filename); $name = $file_info['filename']; $extension = isset($file_info['extension']) ? '.' . $file_info['extension'] : ''; $filename = $name . $extension; return $filename; } static function redirect_attachment_to_parent(){ if(is_attachment()){ $attachment_id = get_queried_object_id(); $parent_id = wp_get_post_parent_id($attachment_id); if($parent_id){ wp_redirect(get_permalink($parent_id)); }else{ wp_redirect(home_url()); } exit; } } } main/googleanalytics.php 0000644 00000062621 15104342737 0011402 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class GoogleAnalytics{ static function ga_render(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-google-analytics'])){ return; } if(!empty($siteseo->analaytics_settings['google_analytics_clarity_enable']) && !empty($siteseo->analaytics_settings['google_analytics_clarity_project_id'])){ add_action('wp_head', '\SiteSEO\GoogleAnalytics::microsoft_clarity'); } if(!empty($siteseo->analaytics_settings['google_analytics_enable']) && !empty($siteseo->analaytics_settings['google_analytics_ga4'])){ add_action('wp_head', '\SiteSEO\GoogleAnalytics::ga_tracking_code'); } if(!empty($siteseo->analaytics_settings['google_analytics_enable'])){ add_action('wp_footer', '\SiteSEO\GoogleAnalytics::tracking'); } if(!empty($siteseo->analaytics_settings['google_analytics_link_tracking_enable'])){ add_action('wp_footer', '\SiteSEO\GoogleAnalytics::add_tracking_script'); } if(!empty($siteseo->analaytics_settings['google_analytics_matomo_enable']) && !empty($siteseo->analaytics_settings['google_analytics_matomo_site_id'])){ add_action('wp_footer', '\SiteSEO\GoogleAnalytics::matomo_tracking_code'); } if(!empty($siteseo->analaytics_settings['google_analytics_other_tracking'])){ add_action('wp_head', '\SiteSEO\GoogleAnalytics::add_custom_head_script'); } if(!empty($siteseo->analaytics_settings['google_analytics_other_tracking_body'])){ add_action('wp_body_open', '\SiteSEO\GoogleAnalytics::add_custom_body_script'); } if(!empty($siteseo->analaytics_settings['google_analytics_other_tracking_footer'])){ add_action('wp_footer', '\SiteSEO\GoogleAnalytics::add_custom_footer_script'); } if(!empty($siteseo->analaytics_settings['google_analytics_hook'])){ $load_cookies_bar = $siteseo->analaytics_settings['google_analytics_hook']; add_action($load_cookies_bar, '\SiteSEO\GoogleAnalytics::render_cookie_bar'); } } static function render_cookie_bar(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-google-analytics']) || empty($siteseo->analaytics_settings['google_analytics_disable'])){ return; } // load setting $auto_accept_cookies = !empty($siteseo->analaytics_settings['google_analytics_half_disable']) ? $siteseo->analaytics_settings['google_analytics_half_disable'] : ''; $cookies_msg = !empty($siteseo->analaytics_settings['google_analytics_opt_out_msg']) ? $siteseo->analaytics_settings['google_analytics_opt_out_msg'] : 'By visiting our site, you agree to our privacy policy regarding cookies, tracking statistics, etc.'; $accept_btn_msg = !empty($siteseo->analaytics_settings['google_analytics_opt_out_msg_ok']) ? $siteseo->analaytics_settings['google_analytics_opt_out_msg_ok'] : 'Accept'; $close_btn_msg = !empty($siteseo->analaytics_settings['google_analytics_opt_out_msg_close']) ? $siteseo->analaytics_settings['google_analytics_opt_out_msg_close'] : 'X'; $edit_btn_msg = !empty($siteseo->analaytics_settings['google_analytics_opt_out_msg_edit']) ? $siteseo->analaytics_settings['google_analytics_opt_out_msg_edit'] : 'Manage cookies'; $cookies_expir = !empty($siteseo->analaytics_settings['google_analytics_cb_exp_date']) ? $siteseo->analaytics_settings['google_analytics_cb_exp_date'] : ''; $bar_postion = !empty($siteseo->analaytics_settings['google_analytics_cb_pos']) ? $siteseo->analaytics_settings['google_analytics_cb_pos'] : '' ; $bar_width = !empty($siteseo->analaytics_settings['google_analytics_cb_width']) ? $siteseo->analaytics_settings['google_analytics_cb_width'] : ''; $display_backrop = !empty($siteseo->analaytics_settings['google_analytics_cb_backdrop']) ?? ''; // colors load $backdrop_bg = !empty($siteseo->analaytics_settings['google_analytics_cb_backdrop_bg']) ? $siteseo->analaytics_settings['google_analytics_cb_backdrop_bg'] : ''; $cookiebar_bg = !empty($siteseo->analaytics_settings['google_analytics_cb_bg']) ? $siteseo->analaytics_settings['google_analytics_cb_bg'] : '#ffffff'; $cookiebar_bg_txt = !empty($siteseo->analaytics_settings['google_analytics_cb_txt_col']) ? $siteseo->analaytics_settings['google_analytics_cb_txt_col'] : '#000000'; $cookiesbar_bg_lk = !empty($siteseo->analaytics_settings['google_analytics_cb_lk_col']) ? $siteseo->analaytics_settings['google_analytics_cb_lk_col'] : '#0073aa'; $primary_btn_bg = !empty($siteseo->analaytics_settings['google_analytics_cb_btn_bg']) ? $siteseo->analaytics_settings['google_analytics_cb_btn_bg'] : '#0073aa'; $primary_btn_bg_hov = !empty($siteseo->analaytics_settings['google_analytics_cb_btn_bg']) ? $siteseo->analaytics_settings['google_analytics_cb_btn_bg'] : '#ffffff'; $primary_btn_txt = !empty($siteseo->analaytics_settings['google_analytics_cb_btn_col']) ? $siteseo->analaytics_settings['google_analytics_cb_btn_col'] : '#005177'; $primary_btn_txt_hov = !empty($siteseo->analaytics_settings['google_analytics_cb_btn_col']) ? $siteseo->analaytics_settings['google_analytics_cb_btn_col'] : '#ffffff'; $sec_btn_bg = !empty($siteseo->analaytics_settings['google_analytics_cb_btn_sec_bg']) ? $siteseo->analaytics_settings['google_analytics_cb_btn_sec_bg'] : '#cccccc'; $sec_btn_bg_txt = !empty($siteseo->analaytics_settings['google_analytics_cb_btn_sec_col']) ? $siteseo->analaytics_settings['google_analytics_cb_btn_sec_col'] : '#000000'; $sec_btn_bg_hov = !empty($siteseo->analaytics_settings['google_analytics_cb_btn_sec_bg_hov']) ? $siteseo->analaytics_settings['google_analytics_cb_btn_sec_bg_hov'] : '#aaaaaa'; $sec_btn_txt_hov = !empty($siteseo->analaytics_settings['google_analytics_cb_btn_sec_col_hov']) ? $siteseo->analaytics_settings['google_analytics_cb_btn_sec_col_hov'] : '#000000'; //position $position_class = ''; $backdrop = false; switch(strtolower($bar_postion)){ case 'middle': $position_class = 'siteseo-cookie-bar-middle'; $backdrop = true; break; case 'top': $position_class = 'siteseo-cookie-bar-top'; $backdrop = false; break; default: $position_class = 'siteseo-cookie-bar-bottom'; $backdrop = false; } /* Translators: %s is the background color */ $bar_styles = sprintf( 'background-color: %s; color: %s;', esc_attr($cookiebar_bg), esc_attr($cookiebar_bg_txt) ); $backdrop_html = ''; if(!empty($display_backrop) && $backdrop){ $backdrop_html = '<div id="siteseo-cookie-bar-backdrop" style="background-color:'.esc_attr($backdrop_bg).'" class="siteseo-cookie-bar-backdrop"></div>'; } $css = '<style> #siteseo-cookie-bar-accept{ --primary-btn-bg: '.esc_attr($primary_btn_bg).'; --primary-btn-text: '.esc_attr($primary_btn_txt).'; --primary-btn-hover-bg: '.esc_attr($primary_btn_bg_hov).'; --primary-btn-hover-text: '.esc_attr($primary_btn_txt_hov).'; } #siteseo-cookie-bar-close{ --secondary-btn-bg: '.esc_attr($sec_btn_bg).'; --secondary-btn-text: '.esc_attr($sec_btn_bg_txt).'; --secondary-btn-hover-bg: '.esc_attr($sec_btn_bg_hov).'; --secondary-btn-hover-text: '.esc_attr($sec_btn_txt_hov).'; } </style>'; $html = $backdrop_html; $html .= '<div id="siteseo-cookie-bar" class="siteseo-cookie-bar '.esc_attr($position_class).'" style="'.esc_attr($bar_styles).'" data-half-disable="'.esc_attr($auto_accept_cookies).'"> <div class="siteseo-cookie-bar-content"> <span>'.wp_kses_post($cookies_msg).'</span> <div class="siteseo-cookie-bar-buttons"> <button id="siteseo-cookie-bar-accept" class="siteseo-cookie-bar-button siteseo-cookie-bar-primary-btn" style="background-color: '.esc_attr($primary_btn_bg).'; color: '.esc_attr($primary_btn_txt).'"> '.esc_html($accept_btn_msg).' </button> <button id="siteseo-cookie-bar-close" class="siteseo-cookie-bar-button siteseo-cookie-bar-secondary-btn" style="background-color: '.esc_attr($sec_btn_bg).'; color: '.esc_attr($sec_btn_bg_txt).'"> '.esc_html($close_btn_msg).' </button> </div> </div> </div> <button id="siteseo-cookie-bar-manage-btn" class="siteseo-cookie-bar-button siteseo-cookie-bar-primary-btn" style="background-color: '.$primary_btn_bg.'; color: '.esc_attr($primary_btn_txt).'"> '.esc_html($edit_btn_msg).' </button>'; echo wp_kses_post($html); } static function update_src_tag($tag, $handle, $src){ global $siteseo; $tracking_handles = [ 'siteseo-gtag', 'siteseo-matomo-tracking', 'siteseo-microsoft-clarity', 'siteseo-microsoft-clarity-js-after', 'siteseo-ga-tracking' ]; if(!in_array($handle, $tracking_handles)){ return $tag; } if(!empty($siteseo->analaytics_settings['google_analytics_disable']) && !isset($_COOKIE['siteseo-user-consent-accept']) && !isset($_COOKIE['siteseo-user-consent-close'])){ $tag = str_replace(' src=', ' data-src-siteseo=', $tag); } return $tag; } static function process_script_src($scripts){ global $siteseo; if(!empty($siteseo->analaytics_settings['google_analytics_disable']) && !isset($_COOKIE['siteseo-user-consent-accept']) && !isset($_COOKIE['siteseo-user-consent-close'])){ $scripts = preg_replace('/(<script[^>]*) src=(["\'])(.*?)\\2/i', '$1 data-src-siteseo=$2$3$2', $scripts); } return $scripts; } static function add_custom_head_script(){ global $siteseo; $scripts = $siteseo->analaytics_settings['google_analytics_other_tracking']; $scripts = self::process_script_src($scripts); echo wp_kses($scripts, [ 'script' => [ 'async' => [], 'src' => [], 'data-src-siteseo' => [], 'type' => [] ] ]); } static function add_custom_body_script(){ global $siteseo; $scripts = $siteseo->analaytics_settings['google_analytics_other_tracking_body']; $scripts = self::process_script_src($scripts); echo wp_kses($scripts, [ 'script' => [ 'async' => [], 'src' => [], 'data-src-siteseo' => [], 'type' => [] ] ]); } static function add_custom_footer_script(){ global $siteseo; $scripts = $siteseo->analaytics_settings['google_analytics_other_tracking_footer']; $scripts = self::process_script_src($scripts); echo wp_kses($scripts, [ 'script' => [ 'async' => [], 'src' => [], 'data-src-siteseo' => [], 'type' => [] ] ]); } static function exclude_user_tracking(){ global $siteseo; if(!is_user_logged_in()){ return false; } $current_user = wp_get_current_user(); if(!$current_user){ return false; } $excluded_roles = isset($siteseo->analaytics_settings['google_analytics_roles']) ? $siteseo->analaytics_settings['google_analytics_roles'] : []; if(empty($excluded_roles)){ return false; } foreach($current_user->roles as $user_role){ if(isset($excluded_roles[$user_role])){ return true; } } return false; } static function custom_dimensions(){ global $siteseo; $dimensions = []; $settings = $siteseo->analaytics_settings; // Track Authors if(!empty($settings['track_authors']) && $settings['track_authors'] !== 'none'){ if(is_singular()){ $author_id = get_post_field('post_author', get_the_ID()); $author_name = get_the_author_meta('display_name', $author_id); $dimensions[$settings['track_authors']] = $author_name; } } // Track Categories if(!empty($settings['track_categories']) && $settings['track_categories'] !== 'none'){ if(is_singular()){ $categories = get_the_category(); if(!empty($categories)){ $category_names = array_map(function($cat){ return $cat->name; }, $categories); $dimensions[$settings['track_categories']] = implode(', ', $category_names); } } } // Track Tags if(!empty($settings['track_tags']) && $settings['track_tags'] !== 'none'){ if(is_singular()){ $tags = get_the_tags(); if(!empty($tags)){ $tag_names = array_map(function($tag){ return $tag->name; }, $tags); $dimensions[$settings['track_tags']] = implode(', ', $tag_names); } } } // Track Post Types if(!empty($settings['track_post_types']) && $settings['track_post_types'] !== 'none'){ if(is_singular()){ $dimensions[$settings['track_post_types']] = get_post_type(); } } // Track Logged In Users if(!empty($settings['track_user']) && $settings['track_user'] !== 'none'){ if(is_user_logged_in()){ $current_user = wp_get_current_user(); $dimensions[$settings['track_user']] = $current_user->roles[0]; } } return $dimensions; } static function matomo_tracking_code(){ global $siteseo; if(self::exclude_user_tracking()){ return; } $settings = $siteseo->analaytics_settings; $tracking_url = !empty($settings['google_analytics_matomo_id']) ? $settings['google_analytics_matomo_id'] : ''; $site_id = !empty($settings['google_analytics_matomo_site_id']) ? $settings['google_analytics_matomo_site_id'] : ''; $cross_domain = !empty($settings['google_analytics_matomo_cross_domain']) ? $settings['google_analytics_matomo_cross_domain'] : ''; $do_not_track = !empty($settings['google_analytics_matomo_dnt']) ? $settings['google_analytics_matomo_dnt'] : ''; $disable_cookies = !empty($settings['google_analytics_matomo_no_cookies']) ? $settings['google_analytics_matomo_no_cookies'] : ''; $disable_heatmaps = !empty($settings['google_analytics_matomo_no_heatmaps']) ? $settings['google_analytics_matomo_no_heatmaps'] : ''; $track_subdomains = !empty($settings['google_analytics_matomo_subdomains']) ? $settings['google_analytics_matomo_subdomains'] : ''; $track_js_disabled = !empty($settings['google_analytics_matomo_no_js']) ? $settings['google_analytics_matomo_no_js'] : ''; wp_register_script('siteseo-matomo-tracking', false, [], null, [ 'strategy' => true, 'in_footer' => true, ]); wp_enqueue_script('siteseo-matomo-tracking'); add_filter('script_loader_tag', '\SiteSEO\GoogleAnalytics::update_src_tag', 10, 3); wp_add_inline_script('siteseo-matomo-tracking', "var _paq = _paq || []; _paq.push(['setSiteId', '".esc_html($site_id)."']); _paq.push(['setTrackerUrl', '".esc_html($tracking_url)."']); if(".esc_html($cross_domain).") _paq.push(['enableCrossDomainLinking']); if(".esc_html($do_not_track).") _paq.push(['setDoNotTrack', true]); if(".esc_html($disable_cookies).") _paq.push(['disableCookies']); if(".esc_html($disable_heatmaps).") _paq.push(['disableAllHeatmaps']); if(".esc_html($track_subdomains).") _paq.push(['setDocumentTitle', document.domain + '/' + document.title]); _paq.push(['trackPageView']); _paq.push(['enableLinkTracking']); (function(){ var u=\"".esc_html($tracking_url)."\"; _paq.push(['setTrackerUrl', u + 'matomo.php']); _paq.push(['setSiteId', '".esc_html($site_id)."']); var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s); })();"); if($track_js_disabled){ echo '<noscript><img src="'.esc_url($tracking_url.'/matomo.php?idsite='.$site_id.'&rec=1').'" style="border:0" alt="" /></noscript>'; } } static function add_tracking_script(){ global $siteseo; if(self::exclude_user_tracking()){ return; } echo '<script> document.addEventListener("DOMContentLoaded", function() {'; if(!empty($siteseo->analaytics_settings['google_analytics_link_tracking_enable'])){ echo 'document.querySelectorAll("a").forEach(function(link){ if(link.hostname !== location.hostname){ link.addEventListener("click", function(){ gtag("event", "click", { "event_category": "External Link", "event_label": link.href }); }); } });'; } if(!empty($siteseo->analaytics_settings['google_analytics_download_tracking_enable']) && !empty($siteseo->analaytics_settings['google_analytics_download_tracking'])) { $fileExtensions = preg_replace('/\s+/', '', $siteseo->analaytics_settings['google_analytics_download_tracking']); $fileExtensionsPattern = str_replace('|', '|\\.', $fileExtensions); echo 'document.querySelectorAll("a[href$=\'.' .esc_js(str_replace('|', '\'], a[href$=\'.', $fileExtensions)) . '\']").forEach(function(link) { link.addEventListener("click", function() { gtag("event", "download", { "event_category": "Download", "event_label": link.href }); }); });'; } if(!empty($siteseo->analaytics_settings['google_analytics_affiliate_tracking_enable']) && ! empty($options['google_analytics_affiliate_tracking'])){ $keywords = wp_json_encode( explode( ',', $options['google_analytics_affiliate_tracking'])); echo 'const keywords = '.esc_attr($keywords).'; document.querySelectorAll("a").forEach(function(link){ keywords.forEach(function(keyword){ if(link.href.includes(keyword.trim())){ link.addEventListener("click", function(){ gtag("event", "click", { "event_category": "Affiliate/Outbound Link", "event_label": link.href }); }); } }); });'; } if(!empty($siteseo->analaytics_settings['google_analytics_phone_tracking'])){ echo 'document.querySelectorAll("a[href^=\'tel:\']").forEach(function(link){ link.addEventListener("click", function() { gtag("event", "click", { "event_category": "Telephone Link", "event_label": link.href }); }); });'; } echo '}); </script>'; } static function tracking(){ global $siteseo; if(self::exclude_user_tracking()){ return; } $settings = $siteseo->analaytics_settings; $ga_id = !empty($settings['google_analytics_optimize']) ? $settings['google_analytics_optimize'] : ''; $conversion_id = !empty($settings['google_analytics_ads']) ? $settings['google_analytics_ads'] : ''; $optimize_id = !empty($settings['google_analytics_ads']) ? $settings['google_analytics_ads'] : ''; $remarketing = !empty($settings['google_analytics_remarketing']) ? $settings['google_analytics_remarketing'] : ''; $anonymize_ip = !empty($settings['google_analytics_ip_anonymization']) ? $settings['google_analytics_ip_anonymization'] : ''; $enhanced_link = !empty($settings['google_analytics_link_attribution']) ? $settings['google_analytics_link_attribution'] : ''; $cross_domain = !empty($settings['google_analytics_cross_domain']) ? $settings['google_analytics_cross_domain'] : ''; $cross_domain_name = !empty($settings['google_analytics_remarketing']) ? $settings['google_analytics_remarketing'] : ''; //custom dimensions $get_custom_dimensions = self::custom_dimensions(); wp_enqueue_script('siteseo-gtag', 'https://www.googletagmanager.com/gtag/js?id=' . esc_attr($ga_id), [], SITESEO_VERSION, [ 'strategy' => 'async', ]); add_filter('script_loader_tag', '\SiteSEO\GoogleAnalytics::update_src_tag', 10, 3); $gtag_config = [ 'anonymize_ip' => $anonymize_ip ? true : false, 'link_attribution' => $enhanced_link ? true : false, ]; if($cross_domain && $cross_domain_name){ $gtag_config['linker'] = [ 'domains' => [$cross_domain_name] ]; } // config foreach($get_custom_dimensions as $dimension => $value){ $gtag_config[$dimension] = $value; } $inline_script = 'window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag("js", new Date()); window.addEventListener("load", function (){ var links = document.querySelectorAll("a"); for(let i = 0; i < links.length; i++){ links[i].addEventListener("click", function(e) { var n = this.href.includes("' . wp_parse_url(home_url(), PHP_URL_HOST) . '"); if (n == false) { gtag("event", "click", {"event_category": "external links","event_label" : this.href}); } }); } }); gtag("config", "'.esc_js($ga_id).'", '.wp_json_encode($gtag_config).');'; if($optimize_id){ $inline_script .= 'gtag("config", "'.esc_js($optimize_id).'");'; } if($conversion_id){ $inline_script .= 'gtag("config", "'.esc_js($conversion_id).'");'; } if($remarketing){ $inline_script .= 'gtag("set", "allow_google_signals", true);'; } wp_add_inline_script('siteseo-gtag', $inline_script); } static function microsoft_clarity(){ global $siteseo; if(self::exclude_user_tracking()){ return; } $project_id = !empty($siteseo->analaytics_settings['google_analytics_clarity_project_id']) ? $siteseo->analaytics_settings['google_analytics_clarity_project_id'] : ''; if(empty($project_id)){ return; } wp_register_script('siteseo-microsoft-clarity', '', [], SITESEO_VERSION, true); wp_enqueue_script('siteseo-microsoft-clarity'); $inline_script = "(function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src='https://www.clarity.ms/tag/'+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, 'clarity', 'script', '".esc_js($project_id)."');"; wp_add_inline_script('siteseo-microsoft-clarity', $inline_script); add_filter('script_loader_tag', '\SiteSEO\GoogleAnalytics::update_src_tag', 10, 3); } static function ga_tracking_code(){ global $siteseo; if(self::exclude_user_tracking()){ return; } $ga_id = isset($siteseo->analaytics_settings['google_analytics_ga4']) ? esc_attr($siteseo->analaytics_settings['google_analytics_ga4']) : ''; if(empty($ga_id)){ return; } wp_enqueue_script('siteseo-ga-tracking', 'https://www.googletagmanager.com/gtag/js?id=' . $ga_id, [], SITESEO_VERSION, true); add_filter('script_loader_tag', '\SiteSEO\GoogleAnalytics::add_async_attribute', 10, 2); $inline_script = " window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', '{$ga_id}'); "; wp_add_inline_script('siteseo-ga-tracking', $inline_script); } static function add_async_attribute($tag, $handle){ global $siteseo; if('siteseo-ga-tracking' === $handle){ if(!empty($siteseo->analaytics_settings['google_analytics_disable'])){ if(isset($_COOKIE['siteseo-user-consent-accept']) && $_COOKIE['siteseo-user-consent-accept'] === 'true'){ return str_replace(' src', ' async src', $tag); } else{ return str_replace(' src', ' data-src-siteseo', $tag); } } } return $tag; } /** TODO:: temporary in this file*/ static function handle_custom_redirect(){ global $post; // post types and taxonomies $post_types = siteseo_post_types(); $taxonomies = get_taxonomies(array('public' => true), 'objects'); $is_singular = false; foreach($post_types as $post_type){ if(is_singular($post_type->name)){ $is_singular = true; break; } } $is_taxonomy = false; foreach($taxonomies as $taxonomy){ if(is_tax($taxonomy->name)){ $is_taxonomy = true; break; } } if($is_singular || is_404() || $is_taxonomy || is_category() || is_tag()){ if(is_404()){ $args = array( 'post_type' => 'siteseo_404', 'posts_per_page' => 1, 'meta_query' => array( array( 'key' => '_siteseo_redirections_enabled', 'value' => 'yes', 'compare' => '=' ) ) ); $redirect_posts = get_posts($args); if(empty($redirect_posts)){ return; } $post = $redirect_posts[0]; } // Taxonomy archives if($is_taxonomy || is_category() || is_tag()){ $term = get_queried_object(); $term_id = $term->term_id; // Check redirection is enabled $enable_redirect = get_term_meta($term_id, '_siteseo_redirections_enabled', true); if(empty($enable_redirect)){ return; } $login_status = get_term_meta($term_id, '_siteseo_redirections_logged_status', true); $redirect_type = get_term_meta($term_id, '_siteseo_redirections_type', true); $redirect_url = get_term_meta($term_id, '_siteseo_redirections_value', true); $param_handling = get_term_meta($term_id, '_siteseo_redirections_param', true); } // Singular posts, pages, and products else{ $enable_redirect = get_post_meta($post->ID, '_siteseo_redirections_enabled', true); if(empty($enable_redirect)){ return; } $login_status = get_post_meta($post->ID, '_siteseo_redirections_logged_status', true); $redirect_type = get_post_meta($post->ID, '_siteseo_redirections_type', true); $redirect_url = get_post_meta($post->ID, '_siteseo_redirections_value', true); $param_handling = get_post_meta($post->ID, '_siteseo_redirections_param', true); } if($login_status === 'only_logged_in' && !is_user_logged_in()){ return; } if($login_status === 'only_not_logged_in' && is_user_logged_in()){ return; } if(!empty($redirect_url)){ $final_url = $redirect_url; if(is_404() && !empty($_SERVER['QUERY_STRING'])){ switch($param_handling){ case 'exact_match': $current_params = sanitize_text_field(wp_unslash($_SERVER['QUERY_STRING'])); $redirect_params = wp_parse_url($redirect_url, PHP_URL_QUERY); if($current_params !== $redirect_params){ return; } break; case 'without_param': $final_url = strtok($redirect_url, '?'); break; case 'with_ignored_param': $query_string = sanitize_text_field(wp_unslash($_SERVER['QUERY_STRING'])); $final_url = $redirect_url; if(!empty($query_string)){ $final_url .= (strpos($redirect_url, '?') !== false ? '&' : '?') . $query_string; } break; } } $status_code = !empty($redirect_type) ? intval($redirect_type) : 301; if(in_array($status_code, [410, 451]) && is_404()){ status_header($status_code); nocache_headers(); include(get_query_template('404')); exit; } wp_redirect($final_url, $status_code); exit; } } } } main/admin.php 0000644 00000050110 15104342737 0007274 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Admin{ static function permission(){ add_action('admin_init','\SiteSEO\Admin::add_capabilities'); } static function init(){ global $siteseo, $pagenow; if(!empty($_GET['page']) && $_GET['page'] == 'siteseo-onboarding'){ \SiteSEO\Settings\Onboarding::init(); } add_action('admin_menu', '\SiteSEO\Admin::add_menu'); // We do not anything else after this. if(!empty($_REQUEST['page']) && sanitize_text_field(wp_unslash($_GET['page'])) == 'siteseo-metabox-wizard'){ add_action('admin_enqueue_scripts', '\SiteSEO\Admin::enqueue_metaboxes'); return; } if($pagenow == 'post.php' || $pagenow == 'post-new.php'){ add_action('admin_enqueue_scripts', '\SiteSEO\Admin::enqueue_metaboxes'); add_action('add_meta_boxes', '\SiteSEO\Admin::add_metaboxes'); } if($pagenow == 'term.php' || $pagenow == 'edit-tags.php'){ add_action('admin_enqueue_scripts', '\SiteSEO\Admin::enqueue_metaboxes'); add_action('admin_init', '\SiteSEO\Admin::add_term_metabox'); } add_filter('plugin_action_links', '\SiteSEO\Install::action_links', 10, 2); add_filter( 'admin_footer_text', '\SiteSEO\Admin::rating_promotion'); add_action('admin_enqueue_scripts', '\SiteSEO\Admin::enqueue_script'); add_action('enqueue_block_editor_assets', '\SiteSEO\Admin::enqueue_metaboxes'); add_filter( 'block_categories_all','\SiteSEO\Admin::create_siteseo_block'); add_filter('admin_body_class', '\SiteSEO\Admin::body_class', 10, 1); add_action('admin_bar_menu', '\SiteSEO\Admin::admin_bar', PHP_INT_MAX); add_action('admin_bar_menu', '\SiteSEO\Admin::noindex_warning', 100); add_action('admin_enqueue_scripts', '\SiteSEO\Admin::header_enqueue'); add_action('admin_enqueue_scripts', '\SiteSEO\Admin::enqueue_admin_styles'); // We do not want to show any metabox if we have universal metabox enabled. if(empty($siteseo->setting_enabled['toggle-advanced']) || empty($siteseo->advanced_settings['appearance_universal_metabox'])){ add_action('enqueue_block_editor_assets', '\SiteSEO\Admin::enqueue_sidebar'); } // Coloumn add_filter('manage_posts_columns', '\SiteSEO\Columns::add_columns'); add_filter('manage_pages_columns', '\SiteSEO\Columns::add_columns'); add_action('manage_posts_custom_column', '\SiteSEO\Columns::populate_custom_seo_columns', 10, 2); add_action('manage_pages_custom_column', '\SiteSEO\Columns::populate_custom_seo_columns', 10, 2); add_filter('manage_edit-post_sortable_columns', '\SiteSEO\Columns::make_seo_columns_sortable'); add_filter('manage_edit-page_sortable_columns', '\SiteSEO\Columns::make_seo_columns_sortable'); add_action('admin_menu', '\SiteSEO\Columns::hide_genesis_seo', 999); add_action('woocommerce_process_product_meta', '\SiteSEO\Metaboxes\Settings::save_metabox', 10, 2); add_action('save_post', '\SiteSEO\Metaboxes\Settings::save_ca_metabox', 10, 2); add_action('save_post', '\SiteSEO\Metaboxes\Settings::save_metabox', 10, 2); } static function enqueue_admin_styles($hook){ if($hook !== 'edit.php'){ return; } wp_enqueue_style('siteseo-admin-columns', SITESEO_ASSETS_URL.'/css/admin-columns.css'); } static function add_capabilities(){ $options = get_option('siteseo_advanced_option_name'); $roles = wp_roles(); foreach($roles->get_names() as $role_slug => $role_name){ $role = get_role($role_slug); if(!$role) continue; if($role_slug === 'administrator'){ $role->add_cap('siteseo_manage', true); // Adding the only cap to admin. continue; } $has_any_permission = false; // The structure is page name => capability name without the prefix of siteseo_manage_ // Will need to add it here whenever a new page is added to SiteSEO $pages = [ 'titles' => 'titles', 'xml-sitemap' => 'sitemap', 'social' => 'social', 'google-analytics' => 'analytics', 'instant-indexing' => 'instant_indexing', 'advanced' => 'advanced', 'import-export' => 'tools' ]; $has_access = 0; // To make sure siteseo_manage is added once. foreach($pages as $page => $cap){ $option_key = "siteseo_advanced_security_metaboxe_siteseo-{$page}"; if(isset($options[$option_key][$role_slug]) && $options[$option_key][$role_slug]){ $has_any_permission = true; $has_access++; } if($has_any_permission){ if($has_access == 1){ $role->add_cap('siteseo_manage', true); } $role->add_cap('siteseo_manage_'.$cap, true); }else{ $role->remove_cap('siteseo_manage_'.$cap); } } // If no one has this access then just remove siteseo_manage as well. if(empty($has_access)){ $role->remove_cap('siteseo_manage'); } } } static function body_class($classes){ if(empty($_GET['page']) || strpos(sanitize_text_field(wp_unslash($_GET['page'])), 'siteseo') === FALSE){ return $classes; } $classes .= ' siteseo-admin-body'; return $classes; } static function noindex_warning($wp_admin_bar){ global $siteseo; $noindex_enabled = !empty($siteseo->titles_settings['titles_noindex']) ?? ''; $disable_noindex = !empty($siteseo->advanced_settings['appearance_adminbar_noindex']) ?? ''; if(empty($noindex_enabled) || !empty($disable_noindex)){ return $wp_admin_bar; } $wp_admin_bar->add_node([ 'id' => 'noindex-warning', 'title' => '<div class="warning-container"><svg xmlns="http://www.w3.org/2000/svg" height="20" viewBox="0 -960 960 960" width="20" fill="#FFFFFF"><path d="m768-91-72-72q-48.39 32-103.19 49Q538-97 480.49-97q-79.55 0-149.52-30Q261-157 208.5-209.5T126-331.97q-30-69.97-30-149.52 0-57.51 17-112.32 17-54.8 49-103.19l-72-73 51-51 678 679-51 51Zm-288-78q43.69 0 84.85-12Q606-193 643-216L215-644q-23 37-35 78.15-12 41.16-12 84.85 0 129.67 91.16 220.84Q350.33-169 480-169Zm318-97-53-52q22-37 34.5-78.15Q792-437.31 792-481q0-129.67-91.16-220.84Q609.67-793 480-793q-43 0-84.5 12T317-747l-53-52q48.39-32 103.19-49Q422-865 479.9-865q80.1 0 149.6 30t122 82.5Q804-700 834-630.5t30 149.6q0 57.9-17 112.36T798-266ZM536-531ZM432-427Z"/></svg>' . esc_html__('Noindex is on!', 'siteseo') . '</div>', 'href' => admin_url('admin.php?page=siteseo-titles'), 'meta' => [ 'class' => 'siteseo-noindex-warning', ], ]); } static function add_menu(){ $capability = 'siteseo_manage'; $siteseo_icon = SITESEO_ASSETS_URL.'/img/logo-24.svg'; $current_user = wp_get_current_user(); $is_admin = in_array('administrator', $current_user->roles); $options = get_option('siteseo_advanced_option_name'); add_menu_page(__('SiteSEO', 'siteseo'), 'SiteSEO', 'manage_options', 'siteseo', '\SiteSEO\Settings\Dashboard::dashboard_tab', esc_url($siteseo_icon)); add_submenu_page('siteseo', __('Dashboard', 'siteseo'), 'Dashboard', 'manage_options', 'siteseo','\SiteSEO\Settings\Dashboard::dashboard_tab'); $menu_pages = [ 'titles' => [ 'slug' => 'siteseo-titles', 'title' => __('Titles & Metas', 'siteseo'), 'callback' => '\SiteSEO\Settings\Titles::menu', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-titles' ], 'sitemap' => [ 'slug' => 'siteseo-sitemaps', 'title' => __('Sitemaps', 'siteseo'), 'callback' => '\SiteSEO\Settings\Sitemap::menu', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-xml-sitemap' ], 'social' => [ 'slug' => 'siteseo-social', 'title' => __('Social Networks', 'siteseo'), 'callback' => '\SiteSEO\Settings\Social::menu', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-social' ], 'analytics' => [ 'slug' => 'siteseo-analytics', 'title' => __('Analytics', 'siteseo'), 'callback' => '\SiteSEO\Settings\Analytics::menu', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-google-analytics' ], 'indexing' => [ 'slug' => 'siteseo-instant-indexing', 'title' => __('Instant Indexing', 'siteseo'), 'callback' => '\SiteSEO\Settings\Instant::menu', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-instant-indexing' ], 'advanced' => [ 'slug' => 'siteseo-advanced', 'title' => __('Advanced', 'siteseo'), 'callback' => '\SiteSEO\Settings\Advanced::menu', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-advanced' ], 'tools' => [ 'slug' => 'siteseo-tools', 'title' => __('Tools', 'siteseo'), 'callback' => '\SiteSEO\Settings\Tools::menu', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-import-export' ] ]; foreach($menu_pages as $page){ $show_page = $is_admin; if(!$is_admin){ foreach($current_user->roles as $role){ if(isset($options[$page['option_key']][$role]) && $options[$page['option_key']][$role]){ $show_page = true; break; } } } if($show_page){ add_submenu_page('siteseo', $page['title'], $page['title'], $capability, $page['slug'], $page['callback']); } } // Page for Universal metabox add_submenu_page('admin.php', __('Universal MetaBox', 'siteseo'), __('Universal MetaBox', 'siteseo'), 'edit_posts', 'siteseo-metabox-wizard', '\SiteSEO\Metaboxes\Settings::universal'); if(is_plugin_active('siteseo-pro/siteseo-pro.php')){ $show_pro = $is_admin; if(!$show_pro){ foreach($current_user->roles as $role){ if(isset($options['siteseo_advanced_security_page_pro'][$role]) && $options['siteseo_advanced_security_page_pro'][$role]){ $show_pro = true; break; } } } } } static function admin_bar($wp_admin_bar){ global $siteseo; $current_user = wp_get_current_user(); $is_admin = in_array('administrator', $current_user->roles); $disable_admin_bar = !empty($siteseo->advanced_settings['appearance_adminbar']) ?? ''; if(!$is_admin && !current_user_can('siteseo_access') || !empty($disable_admin_bar)){ return; } $siteseo_icon = SITESEO_ASSETS_URL . '/img/logo-24.svg'; $wp_admin_bar->add_node([ 'id' => 'siteseo', 'title' => '<span><img src="'.esc_url($siteseo_icon).'" alt="SiteSEO Logo" '. 'style="height:20px;vertical-align:middle;margin-right:5px;">'. esc_html__('SiteSEO', 'siteseo') .'</span>', 'href' => admin_url('admin.php?page=siteseo'), 'meta' => ['class' => 'siteseo-admin-bar'] ]); $options = get_option('siteseo_advanced_option_name'); $submenus = [ 'siteseo-dashboard' => [ 'title' => __('Dashboard', 'siteseo'), 'page' => 'siteseo', 'option_key' => null ], 'siteseo-titles' => [ 'title' => __('Titles & Metas', 'siteseo'), 'page' => 'siteseo-titles', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-titles' ], 'siteseo-sitemaps' => [ 'title' => __('Sitemaps', 'siteseo'), 'page' => 'siteseo-sitemaps', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-xml-sitemap' ], 'siteseo-social' => [ 'title' => __('Social Networks', 'siteseo'), 'page' => 'siteseo-social', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-social' ], 'siteseo-analytics' => [ 'title' => __('Analytics', 'siteseo'), 'page' => 'siteseo-analytics', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-google-analytics' ], 'siteseo-instant-indexing' => [ 'title' => __('Instant Indexing', 'siteseo'), 'page' => 'siteseo-instant-indexing', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-instant-indexing' ], 'siteseo-advanced' => [ 'title' => __('Advanced', 'siteseo'), 'page' => 'siteseo-advanced', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-advanced' ], 'siteseo-tools' => [ 'title' => __('Tools', 'siteseo'), 'page' => 'siteseo-tools', 'option_key' => 'siteseo_advanced_security_metaboxe_siteseo-import-export' ] ]; foreach($submenus as $id => $submenu){ $show_item = $is_admin; if(!$is_admin && $submenu['option_key']){ foreach($current_user->roles as $role){ if(isset($options[$submenu['option_key']][$role]) && $options[$submenu['option_key']][$role]){ $show_item = true; break; } } } if($show_item || $submenu['option_key'] === null){ $wp_admin_bar->add_node([ 'id' => $id, 'parent' => 'siteseo', 'title' => $submenu['title'], 'href' => admin_url('admin.php?page=' . $submenu['page']) ]); } } if(current_user_can('administrator')){ $wp_admin_bar->add_node([ 'id' => 'siteseo-configuration-wizard', 'parent' => 'siteseo', 'title' => __('Configuration Wizard', 'siteseo'), 'href' => admin_url('admin.php?page=siteseo-onboarding') ]); } // Pro if(is_plugin_active('siteseo-pro/siteseo-pro.php')){ $show_pro = $is_admin; if(!$show_pro){ foreach($current_user->roles as $role){ if(isset($options['siteseo_advanced_security_page_pro'][$role]) && $options['siteseo_advanced_security_page_pro'][$role]){ $show_pro = true; break; } } } if($show_pro){ $wp_admin_bar->add_node([ 'id' => 'siteseo-pro-page', 'parent' => 'siteseo', 'title' => __('Pro Features', 'siteseo'), 'href' => admin_url('admin.php?page=siteseo-pro-page') ]); } } } static function header_enqueue($hook){ wp_enqueue_style('siteseo-admin', SITESEO_ASSETS_URL.'/css/header.css', SITESEO_VERSION); $allowed_pages = ['post.php', 'post-new.php', 'edit.php']; if(in_array($hook, $allowed_pages)){ wp_enqueue_style('siteseo-metabox-pages',SITESEO_ASSETS_URL . '/css/header.css',SITESEO_VERSION); } } static function enqueue_metaboxes(){ wp_enqueue_media(); wp_enqueue_style('siteseo-metabox-pages', SITESEO_ASSETS_URL.'/css/metabox.css'); wp_enqueue_script('siteseo-metabox', SITESEO_ASSETS_URL.'/js/metabox.js', ['jquery'], SITESEO_VERSION); wp_localize_script('siteseo-metabox', 'siteseoAdminAjax', [ 'url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('siteseo_admin_nonce') ]); do_action('siteseo_structured_data_types_enqueue'); } static function cookies_bar(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-google-analytics']) || empty($siteseo->analaytics_settings['google_analytics_disable'])){ return; } wp_enqueue_style('siteseo-admin-cookies', SITESEO_ASSETS_URL.'/css/cookies.css'); wp_enqueue_script('siteseo-cookies-js', SITESEO_ASSETS_URL.'/js/cookies-bar.js', ['jquery'], SITESEO_VERSION, true); } static function enqueue_script(){ if(empty($_GET['page']) || strpos(sanitize_text_field(wp_unslash($_GET['page'])), 'siteseo') === FALSE){ return; } $current_user = wp_get_current_user(); $is_admin = in_array('administrator', $current_user->roles); if($is_admin || current_user_can('siteseo_manage')){ wp_enqueue_media(); wp_enqueue_script('siteseo-admin', SITESEO_ASSETS_URL.'/js/admin.js', ['jquery'], SITESEO_VERSION, true); wp_enqueue_style('siteseo-admin-bar', SITESEO_ASSETS_URL .'/css/admin-bar.css'); wp_enqueue_style('siteseo-admin-pages', SITESEO_ASSETS_URL.'/css/siteseo.css'); wp_localize_script('siteseo-admin', 'siteseoAdminAjax', array( 'url' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('siteseo_admin_nonce') )); } } static function register_sitmap_block(){ global $siteseo; if(empty($siteseo->sitemap_settings['xml_sitemap_html_enable'])){ return; } wp_register_script('sitemap-html-block', SITESEO_ASSETS_URL.'/js/block.js', array('wp-blocks', 'wp-element', 'wp-editor'), filemtime(SITESEO_ASSETS_PATH . '/js/block.js')); $html = \SiteSEO\GenerateSitemap::html_sitemap(); // Localize wp_localize_script('sitemap-html-block', 'siteseositemap', array( 'previewData' => $html, )); register_block_type('siteseo/html-sitemap', array( 'editor_script' => 'sitemap-html-block', 'render_callback' => '\SiteSEO\GenerateSitemap::html_sitemap' )); } static function create_siteseo_block($categories){ $siteseo[] = [ 'slug' => 'siteseo', 'title' => 'SiteSEO' ]; return $siteseo; } static function enqueue_sidebar(){ $assets = include SITESEO_ASSETS_PATH . '/js/sidebar/build/index.asset.php'; $css_file = SITESEO_ASSETS_PATH . '/js/sidebar/build/index.css'; $js_dependencies = $assets['dependencies']; wp_enqueue_style('siteseo-sidebar', SITESEO_ASSETS_URL . '/js/sidebar/build/index.css', [], $assets['version'].time()); wp_enqueue_script('siteseo-sidebar', SITESEO_ASSETS_URL . '/js/sidebar/build/index.js', $js_dependencies, $assets['version']); wp_localize_script('siteseo-sidebar', 'siteseo_sidebar', [ 'nonce' => wp_create_nonce('siteseo_sidebar_nonce'), 'ajax_url' => admin_url('admin-ajax.php') ]); } static function add_metaboxes($post_type, $post = false){ global $siteseo; if(!is_user_logged_in()){ return; } $metabox_roles = !empty($siteseo->advanced_settings['security_metaboxe_role']) ? $siteseo->advanced_settings['security_metaboxe_role'] : []; $allow_user = true; $user = wp_get_current_user(); $user_role = current($user->roles); if(array_key_exists($user_role, $metabox_roles)){ $allow_user = false; } if(empty($allow_user)){ return; } // Checking if it is a block editor if(function_exists('get_current_screen')){ $screen = get_current_screen(); if(!empty($screen) && method_exists($screen, 'is_block_editor') && $screen->is_block_editor() === true){ if(!empty($siteseo->advanced_settings['appearance_universal_metabox']) && empty($siteseo->advanced_settings['appearance_universal_metabox_disable'])){ return; } } } $post_types = siteseo_post_types(); $post_types = array_keys($post_types); foreach($post_types as $post_type){ if(empty($siteseo->titles_settings['titles_single_titles'][$post_type]['disabled'])){ add_meta_box('siteseo-post-metabox', 'SiteSEO', '\SiteSEO\Metaboxes\Settings::render_metabox', $post_type, 'normal', 'high'); } } } static function add_term_metabox(){ $metabox_roles = !empty($siteseo->advanced_settings['security_metaboxe_role']) ? $siteseo->advanced_settings['security_metaboxe_role'] : []; $allow_user = true; if(is_user_logged_in()){ $user = wp_get_current_user(); if(is_super_admin()){ $allow_user = true; } else{ $user_role = current($user->roles); if(array_key_exists($user_role, $metabox_roles)){ $allow_user = false; } } } if(empty($allow_user)){ return; } $taxonomies = get_taxonomies(['show_ui' => true, 'public' => true], 'objects', 'and'); $taxonomies = array_keys($taxonomies); foreach($taxonomies as $key){ add_action($key . '_edit_form', '\SiteSEO\Metaboxes\Settings::render_term_metabox', 10, 2); add_action('edit_' . $key, '\SiteSEO\Metaboxes\Settings::save_meta_terms', 10, 2); } } static function rating_promotion(){ global $wp_version; $screen = get_current_screen(); if(!isset($screen->id) || strpos($screen->id, 'siteseo') === false){ return; } $linkText = esc_html__('Give us a 5-star rating!', 'siteseo'); $href = 'https://wordpress.org/support/plugin/siteseo/reviews/?filter=5#new-post'; $link1 = wp_kses_post(sprintf( /* translators: 1: URL to review page, 2: Link title text */ __('<a href="%1$s" target="_blank" title="%2$s" id="siteseo-start-promo">★★★★★</a>', 'siteseo'), esc_url($href), $linkText )); $link2 = wp_kses_post(sprintf( /* translators: 1: URL to review page, 2: Link title text */ __('<a href="%1$s" target="_blank" title="%2$s">WordPress.org</a>', 'siteseo'), esc_url($href), $linkText )); ob_start(); printf( /* translators: 1: SiteSEO, 2: Star rating link, 3: WordPress.org link */ wp_kses_post(__('Please rate %1$s %2$s on %3$s to help us spread the word. Thank you!', 'siteseo')) . '<br>', wp_kses_post(sprintf('<strong>%s</strong>', esc_html__('SiteSEO', 'siteseo'))), wp_kses_post($link1), wp_kses_post($link2) ); printf( wp_kses_post('<p class="alignright">%1$s</p>'), sprintf( /* translators: 1: WordPress version, 2: SiteSEO version */ esc_html__('WordPress %1$s | SiteSEO %2$s', 'siteseo'), esc_html($wp_version), esc_html(SITESEO_VERSION) ) ); remove_filter('update_footer', 'core_update_footer'); return ob_get_clean(); } } main/columns.php 0000644 00000012235 15104342737 0007672 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Columns{ static function add_columns($colums){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-advanced'])){ return $colums; // toggle disable } $options = $siteseo->advanced_settings; if(!empty($options['appearance_title_col'])){ $colums['seo_title'] = __('Title tag', 'siteseo'); } if(!empty($options['appearance_meta_desc_col'])){ $colums['meta_description'] = __('Meta Desc' , 'siteseo'); } if(!empty($options['appearance_redirect_enable_col'])){ $colums['redirect_enabled'] = __('Redirect?', 'siteseo'); } if(!empty($options['appearance_redirect_url_col'])){ $colums['redirect_url'] = __('Redirect URL', 'siteseo'); } if(!empty($options['appearance_canonical'])){ $colums['canonical_url'] = __('Canonical', 'siteseo'); } if(!empty($options['appearance_target_kw_col'])){ $colums['target_keyword'] = __('Target Kw', 'siteseo'); } if(!empty($options['appearance_noindex_col'])){ $colums['noindex'] = __('noindex?', 'siteseo'); } if(!empty($options['appearance_nofollow_col'])){ $colums['nofollow'] = __('nofollow?', 'siteseo'); } if(!empty($options['appearance_words_col'])){ $colums['word_count'] = __('Words', 'siteseo'); } if(!empty($options['appearance_score_col'])){ $colums['seo_score'] = __('Score', 'siteseo'); } return $colums; } static function populate_custom_seo_columns($column, $post_id){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-advanced'])){ return; // toggle disable } $options = $siteseo->advanced_settings; switch($column){ case 'seo_title': if(!empty($options['appearance_title_col'])){ $title = get_post_meta($post_id, '_siteseo_titles_title', true); echo esc_html(\SiteSEO\TitlesMetas::replace_variables($title)); } break; case 'meta_description': if(!empty($options['appearance_meta_desc_col'])){ $desc = get_post_meta($post_id, '_siteseo_titles_desc', true); $replaced_desc = \SiteSEO\TitlesMetas::replace_variables($desc); echo esc_html($replaced_desc); } break; case 'redirect_enabled': if(!empty($options['appearance_meta_desc_col'])){ $redirect_enabled = get_post_meta($post_id, 'siteseo_redirections_enabled', true); echo $redirect_enabled ? esc_html__('Yes', 'siteseo') : esc_html__('No', 'siteseo'); } break; case 'redirect_url': if(!empty($options['appearance_redirect_enable_col'])){ echo esc_url(get_post_meta($post_id, '_siteseo_redirections_value', true)); } break; case 'canonical_url': if(!empty($options['appearance_redirect_url_col'])){ echo esc_url(get_post_meta($post_id, '_siteseo_robots_canonical', true)); } break; case 'target_keyword': if(!empty($options['appearance_canonical'])){ $keywords = esc_html(get_post_meta($post_id, '_siteseo_analysis_target_kw', true)); echo isset($keywords) ? esc_html($keywords) :''; } break; case 'noindex': if(!empty($options['appearance_noindex_col'])){ $noindex = get_post_meta($post_id, '_siteseo_robots_index', true); echo $noindex ? esc_html__('Yes', 'siteseo') : esc_html__('No', 'siteseo'); } break; case 'nofollow': if(!empty($options['appearance_nofollow_col'])){ $nofollow = get_post_meta($post_id, '_siteseo_robots_follow', true); echo $nofollow ? esc_html__('Yes', 'siteseo') : esc_html__('No', 'siteseo'); } break; case 'word_count': if(!empty($options['appearance_words_col'])){ $content = get_post_field('post_content', $post_id); echo esc_html(str_word_count(wp_strip_all_tags($content))); } break; case 'seo_score': if(!empty($options['appearance_score_col'])){ $score = get_post_meta($post_id, '_siteseo_score', true); echo !empty($score) ? esc_html($score) : ''; } break; } } static function make_seo_columns_sortable($columns){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-advanced'])){ return $columns; // toggle disable } $options = $siteseo->advanced_settings; if(!empty($options['appearance_title_col'])){ $columns['seo_title'] = 'seo_title'; } if(!empty($options['appearance_meta_desc_col'])){ $columns['meta_description'] = 'meta_description'; } if(!empty($options['appearance_target_kw_col'])){ $columns['target_keyword'] = 'target_keyword'; } if(!empty($options['appearance_words_col'])){ $columns['word_count'] = 'word_count'; } if(!empty($options['appearance_score_col'])){ $columns['seo_score'] = 'seo_score'; } return $columns; } static function hide_genesis_seo(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-advanced'])){ return; // toggle disable } $options = $siteseo->advanced_settings; if(!empty($options['appearance_genesis_seo_menu'])){ remove_theme_support('genesis-seo-settings-menu'); } if(!empty($options['appearance_genesis_seo_metaboxe'])){ remove_action('admin_menu', 'genesis_add_inpost_seo_box'); } } } main/install.php 0000644 00000013302 15104342737 0007654 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Install{ static function activate(){ self::default_settings(); update_option('siteseo_version', SITESEO_VERSION); } static function deactivate(){ flush_rewrite_rules(); } static function uninstall(){ flush_rewrite_rules(); delete_option('siteseo_version'); delete_option('siteseo_toggle'); delete_option('siteseo_titles_option_name'); delete_option('siteseo_social_option_name'); delete_option('siteseo_advanced_option_name'); delete_option('siteseo_instant_indexing_option_name'); delete_option('siteseo_xml_sitemap_option_name'); delete_option('siteseo_google_analytics_option_name'); delete_option('siteseo_dismiss_intro'); } static function action_links($links, $file){ if($file === plugin_basename(SITESEO_FILE)){ $links['siteseo-settings'] = '<a href="'.admin_url('admin.php?page=siteseo').'">'. __('Settings', 'siteseo').'</a>'; $links['siteseo-wizard'] = '<a href="'.admin_url('?page=siteseo-onboarding').'">'. __('Configuration Wizard', 'siteseo').'</a>'; $links['siteseo-docs-link'] = '<a href="https://siteseo.io/docs/" target="_blank"">'. __('Docs', 'siteseo').'</a>'; } return $links; } static function default_settings(){ // We do not need to set defaults if we just upgrading the plugin $current_version = get_option('siteseo_version'); if(!empty($current_version)){ return; } $titles_metas = get_option('siteseo_titles_option_name', []); $social_settings = get_option('siteseo_social_option_name', []); $advanced_settings = get_option('siteseo_advanced_option_name', []); $sitemap_settings = get_option('siteseo_xml_sitemap_option_name', []); $toggle_settings = [ 'toggle-titles' => true, 'toggle-xml-sitemap' => true, 'toggle-instant-indexing' => true, 'toggle-advanced' => true, 'toggle-social' => true, 'toggle-google-analytics' => true ]; // Titles and Metas $titles_metas['titles_sep'] = '-'; $titles_metas['titles_home_site_title'] = !isset($titles_metas['titles_home_site_title']) ? '%%sitetitle%%' : $titles_metas['titles_home_site_title']; $titles_metas['titles_home_site_desc'] = !isset($titles_metas['titles_home_site_desc']) ? '%%tagline%%' : $titles_metas['titles_home_site_desc']; $post_types = siteseo_post_types(); if(!empty($post_types) && is_array($post_types)){ $post_types = array_keys($post_types); foreach($post_types as $post_type){ $titles_metas['titles_single_titles'][$post_type]['title'] = !isset($titles_metas['titles_single_titles'][$post_type]['title']) ? '%%post_title%% %%sep%% %%sitetitle%%' : $titles_metas['titles_single_titles'][$post_type]['title']; $titles_metas['titles_single_titles'][$post_type]['description'] = !isset($titles_metas['titles_single_titles'][$post_type]['description']) ? '%%post_excerpt%% ' : $titles_metas['titles_single_titles'][$post_type]['description']; } } $taxonomies = get_taxonomies(array('public' => true), 'objects'); if(!empty($taxonomies) && is_array($taxonomies)){ $taxonomies = array_keys($taxonomies); foreach($taxonomies as $taxonomy){ $titles_metas['titles_tax_titles'][$taxonomy]['title'] = !isset($titles_metas['titles_tax_titles'][$taxonomy]['title']) ? '%%_category_title%% %%sep%% %%sitetitle%%' : $titles_metas['titles_tax_titles'][$taxonomy]['title']; $titles_metas['titles_tax_titles'][$taxonomy]['description'] = !isset($titles_metas['titles_tax_titles'][$taxonomy]['description']) ? '%%_category_description%%' : $titles_metas['titles_tax_titles'][$taxonomy]['description']; } } $titles_metas['titles_archives_author_title'] = !isset($titles_metas['titles_archives_author_title']) ? '%%post_author%% %%sep%% %%sitetitle%%' : $titles_metas['titles_archives_author_title']; $titles_metas['titles_archives_author_noindex'] = !isset($titles_metas['titles_archives_author_noindex']) ?? ''; $titles_metas['titles_archives_date_title'] = !isset($titles_metas['titles_archives_date_title']) ? '%%archive_date%% %%sep%% %%sitetitle%%' : ''; $titles_metas['titles_archives_date_noindex'] = !isset($titles_metas['titles_archives_date_noindex']) ?? ''; $titles_metas['titles_archives_search_title_noindex'] = !isset($titles_metas['titles_archives_search_title_noindex']) ?? ''; $titles_metas['titles_nositelinkssearchbox'] = !isset($titles_metas['titles_nositelinkssearchbox']) ?? ''; $titles_metas['titles_archives_search_title'] = !isset($titles_metas['titles_archives_search_title']) ? '%%search_keywords%% %%sep%% %%sitetitle%%' : ''; $titles_metas['titles_archives_404_title'] = !isset($titles_metas['titles_archives_404_title']) ? '404 - Page not found %%sep%% %%sitetitle%%' : $titles_metas['titles_archives_404_title']; // Social $social_settings['social_twitter_card'] = true; $social_settings['social_facebook_og'] = true; // Sitemap $sitemap_settings['xml_sitemap_general_enable'] = true; $sitemap_settings['xml_sitemap_post_types_list']['post']['include'] = true; $sitemap_settings['xml_sitemap_post_types_list']['page']['include'] = true; $sitemap_settings['xml_sitemap_taxonomies_list']['category']['include'] = true; $sitemap_settings['xml_sitemap_taxonomies_list']['post_tag']['include'] = true; // Advanced $advanced_settings['advanced_attachments'] = true; $advanced_settings['appearance_universal_metabox'] = true; update_option('siteseo_toggle', $toggle_settings); update_option('siteseo_titles_option_name', $titles_metas); update_option('siteseo_social_option_name', $social_settings); update_option('siteseo_xml_sitemap_option_name', $sitemap_settings); update_option('siteseo_advanced_option_name', $advanced_settings); } } main/import.php 0000644 00000060443 15104342737 0007530 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Import{ static function rank_math(){ $imported_count = 0; $log = []; $posts = get_posts(['posts_per_page' => -1, 'post_type' => 'any', 'post_status' => 'any']); foreach($posts as $post){ $robots = get_post_meta($post->ID, 'rank_math_robots', true); $robots_array = is_array($robots) ? $robots : []; $meta_mapping = [ '_siteseo_titles_title' => get_post_meta($post->ID, 'rank_math_title', true), '_siteseo_titles_desc' => get_post_meta($post->ID, 'rank_math_description', true), '_siteseo_social_fb_title' => get_post_meta($post->ID, 'rank_math_facebook_title', true), '_siteseo_social_fb_desc' => get_post_meta($post->ID, 'rank_math_facebook_description', true), '_siteseo_social_fb_img' => get_post_meta($post->ID, 'rank_math_facebook_image', true), '_siteseo_social_twitter_title' => get_post_meta($post->ID, 'rank_math_twitter_title', true), '_siteseo_social_twitter_desc' => get_post_meta($post->ID, 'rank_math_twitter_description', true), '_siteseo_social_twitter_img' => get_post_meta($post->ID, 'rank_math_twitter_image', true), '_siteseo_robots_index' => in_array('noindex', $robots_array) ? '1' : '', '_siteseo_robots_follow' => in_array('nofollow', $robots_array) ? '1' : '', '_siteseo_robots_imageindex' => in_array('noimageindex', $robots_array) ? '1' : '', '_siteseo_robots_archive' => in_array('noarchive', $robots_array) ? '1' : '', '_siteseo_robots_snippet' => in_array('nosnippet', $robots_array) ? '1' : '', '_siteseo_robots_canonical' => get_post_meta($post->ID, 'rank_math_canonical_url', true), '_siteseo_analysis_target_kw' => get_post_meta($post->ID, 'rank_math_focus_keyword', true), '_siteseo_robots_primary_cat' => get_post_meta($post->ID, 'rank_math_primary_category', true) ]; foreach($meta_mapping as $siteseo_key => $value){ if(!empty($value)){ update_post_meta($post->ID, $siteseo_key, $value); $imported_count++; } } $log[] = "Imported post ID: {$post->ID}"; } $taxonomies = get_taxonomies(); foreach($taxonomies as $taxonomy){ $terms = get_terms([ 'taxonomy' => $taxonomy, 'hide_empty' => false, ]); foreach($terms as $term){ $term_robots = get_term_meta($term->term_id, 'rank_math_robots', true); $term_robots_array = is_array($term_robots) ? $term_robots : []; $meta_mapping = [ '_siteseo_titles_title' => get_term_meta($term->term_id, 'rank_math_title', true), '_siteseo_titles_desc' => get_term_meta($term->term_id, 'rank_math_description', true), '_siteseo_social_fb_title' => get_term_meta($term->term_id, 'rank_math_facebook_title', true), '_siteseo_social_fb_desc' => get_term_meta($term->term_id, 'rank_math_facebook_description', true), '_siteseo_social_fb_img' => get_term_meta($term->term_id, 'rank_math_facebook_image', true), '_siteseo_social_twitter_title' => get_term_meta($term->term_id, 'rank_math_twitter_title', true), '_siteseo_social_twitter_desc' => get_term_meta($term->term_id, 'rank_math_twitter_description', true), '_siteseo_social_twitter_img' => get_term_meta($term->term_id, 'rank_math_twitter_image', true), '_siteseo_robots_index' => in_array('noindex', $term_robots_array) ? '1' : '', '_siteseo_robots_follow' => in_array('nofollow', $term_robots_array) ? '1' : '', '_siteseo_robots_imageindex' => in_array('noimageindex', $term_robots_array) ? '1' : '', '_siteseo_robots_archive' => in_array('noarchive', $term_robots_array) ? '1' : '', '_siteseo_robots_snippet' => in_array('nosnippet', $term_robots_array) ? '1' : '', '_siteseo_robots_canonical' => get_term_meta($term->term_id, 'rank_math_canonical_url', true), '_siteseo_analysis_target_kw' => get_term_meta($term->term_id, 'rank_math_focus_keyword', true) ]; foreach($meta_mapping as $siteseo_key => $value){ if(!empty($value)){ update_term_meta($term->term_id, $siteseo_key, $value); $imported_count++; } } $log[] = "Imported term ID: {$term->term_id}"; } } return [ 'count' => $imported_count, 'log' => $log, /* translators: %d count of items imported */ 'message' => sprintf(__('Rank Math import completed. Imported %d items.', 'siteseo'), $imported_count) ]; } static function yoast_seo(){ $imported_count = 0; $log = []; $posts = get_posts(['posts_per_page' => -1, 'post_type' => 'any', 'post_status' => 'any']); foreach($posts as $post){ $yoast_robots = get_post_meta($post->ID, '_yoast_wpseo_meta-robots-adv', true); $robots_array = $yoast_robots ? explode(',', $yoast_robots) : []; $meta_mapping = [ '_siteseo_titles_title' => get_post_meta($post->ID, '_yoast_wpseo_title', true), '_siteseo_titles_desc' => get_post_meta($post->ID, '_yoast_wpseo_metadesc', true), '_siteseo_social_fb_title' => get_post_meta($post->ID, '_yoast_wpseo_opengraph-title', true), '_siteseo_social_fb_desc' => get_post_meta($post->ID, '_yoast_wpseo_opengraph-description', true), '_siteseo_social_fb_img' => get_post_meta($post->ID, '_yoast_wpseo_opengraph-image', true), '_siteseo_social_twitter_title' => get_post_meta($post->ID, '_yoast_wpseo_twitter-title', true), '_siteseo_social_twitter_desc' => get_post_meta($post->ID, '_yoast_wpseo_twitter-description', true), '_siteseo_social_twitter_img' => get_post_meta($post->ID, '_yoast_wpseo_twitter-image', true), '_siteseo_robots_index' => get_post_meta($post->ID, '_yoast_wpseo_meta-robots-noindex', true) ? '1' : '', '_siteseo_robots_follow' => get_post_meta($post->ID, '_yoast_wpseo_meta-robots-nofollow', true) ? '1' : '', '_siteseo_robots_imageindex' => in_array('noimageindex', $robots_array) ? '1' : '', '_siteseo_robots_archive' => in_array('noarchive', $robots_array) ? '1' : '', '_siteseo_robots_snippet' => in_array('nosnippet', $robots_array) ? '1' : '', '_siteseo_robots_canonical' => get_post_meta($post->ID, '_yoast_wpseo_canonical', true), '_siteseo_analysis_target_kw' => get_post_meta($post->ID, '_yoast_wpseo_focuskw', true), '_siteseo_robots_primary_cat' => get_post_meta($post->ID, '_yoast_wpseo_primary_category', true) ]; foreach($meta_mapping as $siteseo_key => $value){ if(!empty($value)){ update_post_meta($post->ID, $siteseo_key, $value); $imported_count++; } } $log[] = "Imported post ID: {$post->ID}"; } $yoastseo_term_meta = get_option('wpseo_taxonomy_meta'); foreach($yoastseo_term_meta as $taxonomy){ if(!is_array($taxonomy)){ continue; } foreach($taxonomy as $term_id => $term){ $meta_mapping = [ '_siteseo_titles_title' => !empty($term['wpseo_title']) ? $term['wpseo_title'] : '', '_siteseo_titles_desc' => !empty($term['wpseo_desc']) ? $term['wpseo_desc'] : '', '_siteseo_social_fb_title' => !empty($term['wpseo_opengraph-title']) ? $term['wpseo_opengraph-title'] : '', '_siteseo_social_fb_desc' => !empty($term['wpseo_opengraph-description']) ? $term['wpseo_opengraph-description'] : '', '_siteseo_social_fb_img' => !empty($term['wpseo_opengraph-image']) ? $term['wpseo_opengraph-image'] : '', '_siteseo_social_twitter_title' => !empty($term['wpseo_twitter-title']) ? $term['wpseo_twitter-title'] : '', '_siteseo_social_twitter_desc' => !empty($term['wpseo_twitter-description']) ? $term['wpseo_twitter-description'] : '', '_siteseo_social_twitter_img' => !empty($term['wpseo_twitter-image']) ? $term['wpseo_twitter-image'] : '', '_siteseo_robots_index' => !empty($term['wpseo_noindex']) ? 'yes' : '', '_siteseo_robots_follow' => !empty($term['wpseo_nofollow']) ? 'yes' : '', '_siteseo_robots_imageindex' => !empty($term['wpseo_noimageindex']) ? 'yes' : '', '_siteseo_robots_archive' => !empty($term['wpseo_noarchive']) ? 'yes' : '', '_siteseo_robots_snippet' => !empty($term['wpseo_nosnippet']) ? 'yes' : '', '_siteseo_analysis_target_kw' => !empty($term['wpseo_focuskw']) ? $term['wpseo_focuskw'] : '', '_siteseo_robots_primary_cat' => !empty($term['wpseo_primary_category']) ? $term['wpseo_primary_category'] : '', '_siteseo_robots_canonical' => !empty($term['wpseo_canonical']) ? $term['wpseo_canonical'] : '', ]; foreach($meta_mapping as $siteseo_key => $value){ if(!empty($value)){ update_term_meta($term_id, $siteseo_key, $value); $imported_count++; } } $log[] = "Imported term ID: {$term_id}"; } } return [ 'count' => $imported_count, 'log' => $log, /* translators: %d count of items imported */ 'message' => sprintf(__('Yoast SEO import completed. Imported %d items.', 'siteseo'), $imported_count) ]; } static function aio_seo(){ $imported_count = 0; $log = []; $posts = get_posts(['posts_per_page' => -1, 'post_type' => 'any', 'post_status' => 'any']); foreach($posts as $post){ $meta_mapping = [ '_siteseo_titles_title' => get_post_meta($post->ID, '_aioseo_title', true), '_siteseo_titles_desc' => get_post_meta($post->ID, '_aioseo_description', true), '_siteseo_social_fb_title' => get_post_meta($post->ID, '_aioseo_og_title', true), '_siteseo_social_fb_desc' => get_post_meta($post->ID, '_aioseo_og_description', true), '_siteseo_social_fb_img' => get_post_meta($post->ID, '_aioseo_og_image', true), '_siteseo_social_twitter_title' => get_post_meta($post->ID, '_aioseo_twitter_title', true), '_siteseo_social_twitter_desc' => get_post_meta($post->ID, '_aioseo_twitter_description', true), '_siteseo_social_twitter_img' => get_post_meta($post->ID, '_aioseo_twitter_image', true), '_siteseo_robots_index' => get_post_meta($post->ID, '_aioseo_noindex', true) ? '1' : '', '_siteseo_robots_follow' => get_post_meta($post->ID, '_aioseo_nofollow', true) ? '1' : '', '_siteseo_robots_imageindex' => '1', '_siteseo_robots_archive' => '1', '_siteseo_robots_snippet' => '1', // Default to 1 if not specified '_siteseo_robots_canonical' => get_post_meta($post->ID, '_aioseo_canonical_url', true), '_siteseo_analysis_target_kw' => get_post_meta($post->ID, '_aioseo_keywords', true) ]; foreach($meta_mapping as $siteseo_key => $value){ if(!empty($value)){ update_post_meta($post->ID, $siteseo_key, $value); $imported_count++; } } $log[] = "Imported post ID: {$post->ID}"; } $taxonomies = get_taxonomies(); foreach($taxonomies as $taxonomy){ $terms = get_terms([ 'taxonomy' => $taxonomy, 'hide_empty' => false, ]); foreach($terms as $term){ $meta_mapping = [ '_siteseo_titles_title' => get_term_meta($term->term_id, '_aioseo_title', true), '_siteseo_titles_desc' => get_term_meta($term->term_id, '_aioseo_description', true), '_siteseo_social_fb_title' => get_term_meta($term->term_id, '_aioseo_og_title', true), '_siteseo_social_fb_desc' => get_term_meta($term->term_id, '_aioseo_og_description', true), '_siteseo_social_fb_img' => get_term_meta($term->term_id, '_aioseo_og_image', true), '_siteseo_social_twitter_title' => get_term_meta($term->term_id, '_aioseo_twitter_title', true), '_siteseo_social_twitter_desc' => get_term_meta($term->term_id, '_aioseo_twitter_description', true), '_siteseo_social_twitter_img' => get_term_meta($term->term_id, '_aioseo_twitter_image', true), '_siteseo_robots_index' => get_term_meta($term->term_id, '_aioseo_noindex', true) ? '1' : '', '_siteseo_robots_follow' => get_term_meta($term->term_id, '_aioseo_nofollow', true) ? '1' : '', '_siteseo_robots_canonical' => get_term_meta($term->term_id, '_aioseo_canonical_url', true), '_siteseo_analysis_target_kw' => get_term_meta($term->term_id, '_aioseo_keywords', true) ]; foreach($meta_mapping as $siteseo_key => $value){ if(!empty($value)){ update_term_meta($term->term_id, $siteseo_key, $value); $imported_count++; } } $log[] = "Imported term ID: {$term->term_id}"; } } return [ 'count' => $imported_count, 'log' => $log, /* translators: %d count of items imported */ 'message' => sprintf(__('All In One SEO import completed. Imported %d items.', 'siteseo'), $imported_count) ]; } static function seo_framework(){ $imported_count = 0; $log = []; $posts = get_posts(['posts_per_page' => -1, 'post_type' => 'any', 'post_status' => 'any']); foreach($posts as $post){ $meta_mapping = [ '_siteseo_titles_title' => get_post_meta($post->ID, '_genesis_title', true), '_siteseo_titles_desc' => get_post_meta($post->ID, '_genesis_description', true), '_siteseo_social_fb_title' => get_post_meta($post->ID, '_open_graph_title', true), '_siteseo_social_fb_desc' => get_post_meta($post->ID, '_open_graph_description', true), '_siteseo_social_fb_img' => get_post_meta($post->ID, '_social_image_url', true), '_siteseo_social_twitter_title' => get_post_meta($post->ID, '_twitter_title', true), '_siteseo_social_twitter_desc' => get_post_meta($post->ID, '_twitter_description', true), '_siteseo_social_twitter_img' => get_post_meta($post->ID, '_twitter_image', true), '_siteseo_robots_index' => get_post_meta($post->ID, '_genesis_noindex', true) ? '1' : '', '_siteseo_robots_follow' => get_post_meta($post->ID, '_genesis_nofollow', true) ? '1' : '', '_siteseo_robots_imageindex' => '1', '_siteseo_robots_archive' => '1', '_siteseo_robots_snippet' => '1', '_siteseo_robots_canonical' => get_post_meta($post->ID, '_genesis_canonical_uri', true), '_siteseo_analysis_target_kw' => get_post_meta($post->ID, '_genesis_keywords', true) ]; foreach($meta_mapping as $siteseo_key => $value){ if(!empty($value)){ update_post_meta($post->ID, $siteseo_key, $value); $imported_count++; } } $log[] = "Imported post ID: {$post->ID}"; } $taxonomies = get_taxonomies(); foreach($taxonomies as $taxonomy){ $terms = get_terms([ 'taxonomy' => $taxonomy, 'hide_empty' => false, ]); foreach($terms as $term){ $term_data = get_term_meta($term->term_id, 'autodescription-term-settings', true); if(empty($term_data) || !is_array($term_data)){ continue; } $meta_mapping = [ '_siteseo_titles_title' => !empty($term_data['doctitle']) ? $term_data['doctitle'] : '', '_siteseo_titles_desc' => !empty($term_data['description']) ? $term_data['description'] : '', '_siteseo_social_fb_title' => !empty($term_data['og_title']) ? $term_data['og_title'] : '', '_siteseo_social_fb_desc' => !empty($term_data['og_description']) ? $term_data['og_description'] : '', '_siteseo_social_fb_img' => !empty($term_data['social_image_url']) ? $term_data['social_image_url'] : '', '_siteseo_social_twitter_title' => !empty($term_data['tw_title']) ? $term_data['tw_title'] : '', '_siteseo_social_twitter_desc' => !empty($term_data['tw_description']) ? $term_data['tw_description'] : '', '_siteseo_social_twitter_img' => !empty($term_data['social_image_url']) ? $term_data['social_image_url'] : '', '_siteseo_robots_index' => !empty($term_data['noindex']) ? true : '', '_siteseo_robots_follow' => !empty($term_data['nofollow'] ) ? true : '', '_siteseo_robots_archive' => !empty($term_data['noarchive']) ? true : '', '_siteseo_robots_canonical' => !empty($term_data['canonical']) ? $term_data['canonical'] : '', '_siteseo_analysis_target_kw' => !empty($term_data['keywords']) ? $term_data['keywords'] : '', ]; foreach($meta_mapping as $siteseo_key => $value){ if(!empty($value)){ update_term_meta($term->term_id, $siteseo_key, $value); $imported_count++; } } $log[] = "Imported term ID: {$term->term_id}"; } } return [ 'count' => $imported_count, 'log' => $log, /* translators: %d count of items imported */ 'message' => sprintf(__('SEO Framework import completed. Imported %d items.', 'siteseo'), $imported_count) ]; } static function seo_press(){ $imported_count = 0; $log = []; $posts = get_posts(['posts_per_page' => -1, 'post_type' => 'any', 'post_status' => 'any']); foreach($posts as $post){ $robots_index = get_post_meta($post->ID, '_seopress_robots_index', true); $robots_follow = get_post_meta($post->ID, '_seopress_robots_follow', true); $robots_imageindex = get_post_meta($post->ID, '_seopress_robots_imageindex', true); $robots_archive = get_post_meta($post->ID, '_seopress_robots_archive', true); $meta_mapping = [ '_siteseo_titles_title' => get_post_meta($post->ID, '_seopress_titles_title', true), '_siteseo_titles_desc' => get_post_meta($post->ID, '_seopress_titles_desc', true), '_siteseo_social_fb_title' => get_post_meta($post->ID, '_seopress_social_fb_title', true), '_siteseo_social_fb_desc' => get_post_meta($post->ID, '_seopress_social_fb_desc', true), '_siteseo_social_fb_img' => get_post_meta($post->ID,'_seopress_social_fb_img',true), '_siteseo_social_twitter_title' => get_post_meta($post->ID, '_seopress_social_twitter_title', true), '_siteseo_social_twitter_desc' => get_post_meta($post->ID, '_seopress_social_twitter_desc', true), '_siteseo_social_twitter_img' => get_post_meta($post->ID, '_seopress_social_twitter_img', true), '_siteseo_robots_index' => (!empty($robots_index) && $robots_index === 'yes') ? '1' : '0', '_siteseo_robots_follow' => (!empty($robots_follow) && $robots_follow === 'yes') ? '1' : '0', '_siteseo_robots_imageindex' => (!empty($robots_imageindex) && $robots_imageindex === 'yes') ? '1' : '0', '_siteseo_robots_archive' => (!empty($robots_archive) && $robots_archive === 'yes') ? '1' : '0', '_siteseo_robots_snippet' => get_post_meta($post->ID, '_seopress_robots_snippet', true), '_siteseo_robots_canonical' => get_post_meta($post->ID, '_seopress_robots_canonical', true), '_siteseo_analysis_target_kw' => get_post_meta($post->ID, '_seopress_analysis_target_kw', true), '_siteseo_redirections_enabled' => get_post_meta($post->ID, '_seopress_redirections_enabled', true) ? '1' : '0', '_siteseo_redirections_value' => get_post_meta($post->ID, '_seopress_redirections_value', true), '_siteseo_redirections_type' => get_post_meta($post->ID, '_seopress_redirections_type', true), '_siteseo_redirections_param' => get_post_meta($post->ID, '_seopress_redirections_param', true), '_siteseo_redirections_logged_status' => get_post_meta($post->ID, '_seopress_redirections_logged_status', true), '_siteseo_redirections_enabled_regex' => get_post_meta($post->ID, '_seopress_redirections_enabled_regex', true), ]; foreach($meta_mapping as $siteseo_key => $value){ if(!empty($value)){ update_post_meta($post->ID, $siteseo_key, $value); $imported_count++; } } $log[] = "Imported post ID: {$post->ID}"; } $taxonomies = get_taxonomies(); foreach($taxonomies as $taxonomy){ $terms = get_terms([ 'taxonomy' => $taxonomy, 'hide_empty' => false, ]); foreach($terms as $term){ $robots_index = get_term_meta($term->term_id, '_seopress_robots_index', true); $robots_follow = get_term_meta($term->term_id, '_seopress_robots_follow', true); $robots_imageindex = get_term_meta($term->term_id, '_seopress_robots_imageindex', true); $robots_archive = get_term_meta($term->term_id, '_seopress_robots_archive', true); $meta_mapping = [ '_siteseo_titles_title' => get_term_meta($term->term_id, '_seopress_titles_title', true), '_siteseo_titles_desc' => get_term_meta($term->term_id, '_seopress_titles_desc', true), '_siteseo_social_fb_title' => get_term_meta($term->term_id, '_seopress_social_fb_title', true), '_siteseo_social_fb_desc' => get_term_meta($term->term_id, '_seopress_social_fb_desc', true), '_siteseo_social_fb_img' => get_term_meta($term->term_id,'_seopress_social_fb_img',true), '_siteseo_social_twitter_title' => get_term_meta($term->term_id, '_seopress_social_twitter_title', true), '_siteseo_social_twitter_desc' => get_term_meta($term->term_id, '_seopress_social_twitter_desc', true), '_siteseo_social_twitter_img' => get_term_meta($term->term_id, '_seopress_social_twitter_img', true), '_siteseo_robots_index' => (!empty($robots_index) && $robots_index === 'yes') ? '1' : '0', '_siteseo_robots_follow' => (!empty($robots_follow) && $robots_follow === 'yes') ? '1' : '0', '_siteseo_robots_imageindex' => (!empty($robots_imageindex) && $robots_imageindex === 'yes') ? '1' : '0', '_siteseo_robots_archive' => (!empty($robots_archive) && $robots_archive === 'yes') ? '1' : '0', '_siteseo_robots_snippet' => get_term_meta($term->term_id, '_seopress_robots_snippet', true), '_siteseo_robots_canonical' => get_term_meta($term->term_id, '_seopress_robots_canonical', true), '_siteseo_analysis_target_kw' => get_term_meta($term->term_id, '_seopress_analysis_target_kw', true), '_siteseo_redirections_enabled' => get_term_meta($term->term_id, '_seopress_redirections_enabled', true) ? '1' : '0', '_siteseo_redirections_value' => get_term_meta($term->term_id, '_seopress_redirections_value', true), '_siteseo_redirections_type' => get_term_meta($term->term_id, '_seopress_redirections_type', true), '_siteseo_redirections_param' => get_term_meta($term->term_id, '_seopress_redirections_param', true), '_siteseo_redirections_logged_status' => get_term_meta($term->term_id, '_seopress_redirections_logged_status', true), '_siteseo_redirections_enabled_regex' => get_term_meta($term->term_id, '_seopress_redirections_enabled_regex', true), ]; foreach($meta_mapping as $siteseo_key => $value){ if(!empty($value)){ update_term_meta($term->term_id, $siteseo_key, $value); $imported_count++; } } $log[] = "Imported term ID: {$term->term_id}"; } } return [ 'count' => $imported_count, 'log' => $log, /* translators: %d count of items imported */ 'message' => sprintf(__('SEOPress migration completed. Imported %d items.', 'siteseo'), $imported_count) ]; } static function slim_seo(){ $imported_count = 0; $log = []; $posts = get_posts(['posts_per_page' => -1, 'post_type' => 'any', 'post_status' => 'any']); $taxonomies = get_taxonomies(array('public' => true), 'objects'); foreach($posts as $post){ $post_data = get_post_meta($post->ID, 'slim_seo', true); if(empty($post_data) || !is_array($post_data)){ continue; } $meta_mapping = [ '_siteseo_titles_title' => $post_data['title'] ?? '', '_siteseo_titles_desc' => $post_data['description'] ?? '', '_siteseo_social_fb_img' => $post_data['facebook_image'] ?? '', '_siteseo_social_twitter_img' => $post_data['twitter_image'] ?? '', '_siteseo_robots_index' => ($post_data['noindex'] ?? false) ? '1' : '', '_siteseo_robots_canonical' => $post_data['canonical'] ?? '', ]; foreach($meta_mapping as $siteseo_key => $value){ if(!empty($value)){ update_post_meta($post->ID, $siteseo_key, $value); $imported_count++; } } $log[] = "Imported post ID: {$post->ID}"; } $taxonomies = get_taxonomies(); foreach($taxonomies as $taxonomy){ $terms = get_terms([ 'taxonomy' => $taxonomy, 'hide_empty' => false, ]); foreach($terms as $term){ $term_data = get_term_meta($term->term_id, 'slim_seo', true); if(empty($term_data) || !is_array($term_data)){ continue; } $meta_mapping = [ '_siteseo_titles_title' => !empty($term_data['title']) ? $term_data['title'] : '', '_siteseo_titles_desc' => !empty($term_data['description']) ? $term_data['description'] : '', '_siteseo_social_fb_img' => !empty($term_data['facebook_image']) ? $term_data['facebook_image'] : '', '_siteseo_social_twitter_img' => !empty($term_data['twitter_image']) ? $term_data['twitter_image'] : '', '_siteseo_robots_index' => !empty($term_data['noindex']) ? true : '', '_siteseo_robots_canonical' => !empty($term_data['canonical']) ? $term_data['canonical'] : '', ]; foreach($meta_mapping as $siteseo_key => $value){ if(!empty($value)){ update_term_meta($term->term_id, $siteseo_key, $value); $imported_count++; } } $log[] = "Imported term ID: {$term->term_id}"; } } return [ 'count' => $imported_count, 'log' => $log, /* translators: %d count of items imported */ 'message' => sprintf(__('Slim SEO import completed. Imported %d items.', 'siteseo'), $imported_count) ]; } } main/advanced.php 0000644 00000015121 15104342737 0007754 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Advanced{ static function tags(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-advanced'])){ return; // toggle disable } // meta tags if(!empty($siteseo->advanced_settings['advanced_google'])){ echo '<meta name="google-site-verification" content="'.esc_attr($siteseo->advanced_settings['advanced_google']).'" />' . "\n"; } if(!empty($siteseo->advanced_settings['advanced_bing'])){ echo '<meta name="msvalidate.01" content="'.esc_attr($siteseo->advanced_settings['advanced_bing']).'" />' . "\n"; } if(!empty($siteseo->advanced_settings['advanced_pinterest'])){ echo '<meta name="p:domain_verify" content="'.esc_attr($siteseo->advanced_settings['advanced_pinterest']).'" />'; } if(!empty($siteseo->advanced_settings['advanced_yandex'])){ echo '<meta name="yandex-verification" content="'.esc_attr($siteseo->advanced_settings['advanced_yandex']).'" />'; } if(!empty($siteseo->advanced_settings['advanced_wp_rsd'])){ remove_action('wp_head', 'rsd_link'); } } static function remove_links(){ global $siteseo; if(empty($siteseo->setting_enabled['toggle-advanced'])){ return; // toggle disable } if(!empty($siteseo->advanced_settings['advanced_wp_rsd'])){ remove_action('wp_head', 'rsd_link'); } if(!empty($siteseo->advanced_settings['advanced_wp_wlw'])){ remove_action('wp_head', 'wlwmanifest_link'); } if(!empty($siteseo->advanced_settings['advanced_wp_shortlink'])){ remove_action('wp_head', 'wp_shortlink_wp_head'); } if(!empty($siteseo->advanced_settings['advanced_wp_generator'])){ remove_action('wp_head', 'wp_generator'); } if(!empty($siteseo->advanced_settings['advanced_comments_form_link'])){ add_filter('comment_form_default_fields', '\SiteSEO\Advanced::remove_comment_url_field'); } if(!empty($siteseo->advanced_settings['advanced_comments_author_url'])){ add_filter('get_comment_author_link', '\SiteSEO\Advanced::remove_author_link_if_profile_url'); } if(!empty($siteseo->advanced_settings['advanced_hentry'])){ add_filter('post_class', '\SiteSEO\Advanced::remove_hentry_post_class'); } if(!empty($siteseo->advanced_settings['advanced_noreferrer'])){ add_filter('the_content', '\SiteSEO\Advanced::remove_noreferrer_from_post_content'); } if(!empty($siteseo->advanced_settings['advanced_tax_desc_editor'])){ add_action('edit_term', '\SiteSEO\Advanced::add_wp_editor_to_taxonomy_description', 10, 2); } if(!empty($siteseo->advanced_settings['advanced_category_url'])){ add_action('init', '\SiteSEO\Advanced::remove_category_base', 111); add_action('template_redirect', '\SiteSEO\Advanced::redirect_category'); } } static function add_wp_editor_to_taxonomy_description($tag){ if('edit' !== get_current_screen()->base || 'edit-tags' !== get_current_screen()->id){ return; } if(isset($tag->description)){ $editor_settings = array( 'textarea_name' => 'description', 'textarea_rows' => 10, 'editor_class' => 'wp-editor-area', 'media_buttons' => true, 'tinymce' => true, 'quicktags' => true, ); wp_editor($tag->description, 'description', $editor_settings); } } static function remove_noreferrer_from_post_content($content){ $content = preg_replace('/<a[^>]+rel=["\']?noreferrer["\']?[^>]*>/i', '<a', $content); return $content; } static function remove_hentry_post_class($classes){ $classes = array_diff($classes, array('hentry')); return $classes; } static function remove_comment_url_field($fields){ if(isset($fields['url'])){ unset($fields['url']); } return $fields; } static function remove_author_link_if_profile_url(){ $user_id = $comment->user_id; if(!empty($user_id)){ $user_website = get_the_author_meta('user_url', $user_id); if($user_website){ return get_comment_author($comment->comment_ID); } } return $author; } static function remove_category_base(){ $categories = get_categories(array('hide_empty' => false)); $category_slugs = wp_list_pluck($categories, 'slug'); if(empty($category_slugs)){ return; } $category_pattern = '(' . implode('|', $category_slugs) .')'; add_rewrite_rule( '^'.$category_pattern.'/?$', 'index.php?category_name=$matches[1]', 'top' ); // Add rule for handle pagination add_rewrite_rule( '^'.$category_pattern.'/page/([0-9]+)/?$', 'index.php?category_name=$matches[1]&paged=$matches[2]', 'top' ); } static function redirect_category(){ if(is_category() && !is_admin()){ $category = get_query_var('category_name'); $category_base = get_option('category_base'); $base_to_check = !empty($category_base) ? $category_base : 'category'; if(!empty($category) && strpos(sanitize_url($_SERVER['REQUEST_URI']), '/'.$base_to_check.'/') !== false){ wp_safe_redirect(home_url('/' . $category . '/'), 301); exit; } } } static function remove_wc_category_base(){ global $siteseo; if(empty($siteseo->advanced_settings['advanced_product_cat_url']) || empty($siteseo->setting_enabled['toggle-advanced'])){ return; } if(!in_array('woocommerce/woocommerce.php', apply_filters('active_plugins', get_option('active_plugins')))){ return; } add_filter('term_link', '\SiteSEO\Advanced::remove_category_base_woo', 10, 3); add_filter('request', '\SiteSEO\Advanced::category_url_request'); add_action('created_product_cat', 'flush_rewrite_rules'); add_action('delete_product_cat', 'flush_rewrite_rules'); add_action('edited_product_cat', 'flush_rewrite_rules'); add_action('parse_request', '\SiteSEO\Advanced::old_category_url_request'); } static function remove_category_base_woo($termlink, $term, $taxonomy){ if($taxonomy === 'product_cat'){ $category_base = '/product-category/'; return str_replace($category_base, '/', $termlink); } return $termlink; } static function category_url_request($query_vars){ if(!isset($query_vars['product_cat']) && isset($query_vars['pagename'])){ $pagename = $query_vars['pagename']; $term = get_term_by('slug', $pagename, 'product_cat'); if($term){ $query_vars['product_cat'] = $term->slug; unset($query_vars['pagename']); } } return $query_vars; } static function old_category_url_request($wp){ if(!isset($wp->query_vars['pagename'])){ return; } $pagename = $wp->query_vars['pagename']; $term = get_term_by('slug', $pagename, 'product_cat'); if($term){ $wp->query_vars['product_cat'] = $term->slug; unset($wp->query_vars['pagename']); } } } main/instantindexing.php 0000644 00000021007 15104342737 0011415 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class InstantIndexing{ static function bing_txt_file(){ global $wp, $siteseo; $request = home_url($wp->request); if(empty($request)){ return; } $api_key = $siteseo->instant_settings['instant_indexing_bing_api_key']; $api_url = trailingslashit(home_url()) . $api_key . '.txt'; if($request == $api_url){ header('X-Robots-Tag: noindex'); header('Content-Type: text/plain'); status_header(200); echo esc_html($api_key); die(); } } static function submit_urls_to_google($urls){ $access_token = self::get_google_auth_token(); if(empty($access_token)){ return; } $boundary = wp_rand(); $batch_body = ''; $options = get_option('siteseo_instant_indexing_option_name'); $type = !empty($options['instant_indexing_google_action']) ? $options['instant_indexing_google_action'] : 'URL_UPDATED'; switch($type){ case 'remove_urls': $type = 'URL_DELETED'; break; case 'update_urls': $type = 'URL_UPDATED'; break; } // Creating a batch request foreach($urls as $url){ $post_data = wp_json_encode(['url' => $url, 'type' => $type]); $batch_body .= '--'.$boundary.PHP_EOL; $batch_body .= 'Content-Type: application/http'.PHP_EOL; $batch_body .= 'Content-Transfer-Encoding: binary'.PHP_EOL; $batch_body .= 'Content-ID: <'.esc_url($url).'>'.PHP_EOL.PHP_EOL; $batch_body .= 'POST /v3/urlNotifications:publish HTTP/1.1'.PHP_EOL; $batch_body .= 'Content-Type: application/json' . PHP_EOL; $batch_body .= 'accept: application/json'.PHP_EOL; $batch_body .= 'content-length: '.strlen($post_data).PHP_EOL.PHP_EOL; $batch_body .= $post_data.PHP_EOL; } $batch_body .= '--'.$boundary.'--'; $response = wp_remote_post('https://indexing.googleapis.com/batch', [ 'body' => $batch_body, 'headers' => [ 'Content-Type' => 'multipart/mixed; boundary='.$boundary, 'Authorization' => 'Bearer ' . $access_token ], 'timeout' => 30 ]); if(is_wp_error($response)){ $response = ['error' => $response->get_error_message()]; return; } $res_code = wp_remote_retrieve_response_code($response); if($res_code > 299){ return $response; } $batch_response = self::parse_batch_response($response); $response = [ 'status_code' => wp_remote_retrieve_response_code($response), 'urls' => $batch_response, 'error' => is_wp_error($response) ? $response->get_error_message() : null ]; return $response; } static function parse_batch_response(&$response){ $response_headers = wp_remote_retrieve_headers($response); $response_headers = $response_headers->getAll(); $content_type = $response_headers['content-type']; $urls = []; $content_type = explode(';', $content_type); $boundary = false; foreach($content_type as $part){ $part = explode('=', $part, 2); if (isset($part[0]) && 'boundary' == trim($part[0])) { $boundary = $part[1]; } } $res_body = wp_remote_retrieve_body($response); $res_body = str_replace('--'.$boundary.'--', '--'.$boundary, $res_body); $batch_responses = explode('--'.$boundary, $res_body); $batch_responses = array_filter($batch_responses); foreach($batch_responses as $batch_response){ $batch_response = trim($batch_response); if(empty($batch_response)){ continue; } $batch_response = explode("\r\n\r\n", $batch_response); if(empty($batch_response[2])){ continue; } $batch_body = json_decode($batch_response[2], true); if(empty($batch_body)){ continue; } if(!empty($batch_body['urlNotificationMetadata']) && !empty($batch_body['urlNotificationMetadata']['url'])){ $urls[] = sanitize_url($batch_body['urlNotificationMetadata']['url']); } } return $urls; } static function get_google_auth_token(){ global $siteseo; $endpoint = 'https://oauth2.googleapis.com/token'; $scope = 'https://www.googleapis.com/auth/indexing'; if(!function_exists('openssl_sign')){ return false; } $google_api_data = isset($siteseo->instant_settings['instant_indexing_google_api_key']) ? $siteseo->instant_settings['instant_indexing_google_api_key'] : ''; if(empty($google_api_data)){ return false; } $google_api_data = json_decode($google_api_data, true); if(empty($google_api_data)){ return; } // Header $headers = wp_json_encode(['alg' => 'RS256', 'typ' => 'JWT']); $headers = base64_encode($headers); // Claim Set $now = time(); $claims = wp_json_encode([ 'iss' => $google_api_data['client_email'], 'scope' => 'https://www.googleapis.com/auth/indexing', 'aud' => 'https://oauth2.googleapis.com/token', 'exp' => $now + 3600, 'iat' => $now ]); $claims = base64_encode($claims); // Make sure base64 encoding is URL-safe $headers = str_replace(['+', '/', '='], ['-', '_', ''], $headers); $claim = str_replace(['+', '/', '='], ['-', '_', ''], $claims); // Sign the JWT with the private key $signature_input = "$headers.$claim"; openssl_sign($signature_input, $signature, $google_api_data['private_key'], OPENSSL_ALGO_SHA256); $signature = base64_encode($signature); $signature = str_replace(['+', '/', '='], ['-', '_', ''], $signature); // JWT Token $jwt_assertion = "$signature_input.$signature"; // OAuth2 Request $post_data = http_build_query([ 'grant_type' => 'urn:ietf:params:oauth:grant-type:jwt-bearer', 'assertion' => $jwt_assertion ]); $response = wp_remote_post($endpoint, [ 'body' => $post_data, 'headers' => [ 'Content-Type' => 'application/x-www-form-urlencoded', ] ]); if(is_wp_error($response)){ return false; } $body = json_decode(wp_remote_retrieve_body($response), true); return $body['access_token'] ?? false; } /** * Sends request to index now api with list of urls and key and key location. * * Key location is just the URL to a file which has the same name as the Key * as key.txt and the content in it is the key as well. This is a virtual file. * * @param array $urls List of URLs to submit. * @param string $api_key bing key. * * @return array with 'status_code' and response 'body' */ static function submit_urls_to_bing($urls, $api_key){ $host = wp_parse_url(home_url(), PHP_URL_HOST); $key_location = trailingslashit(home_url()) . $api_key . '.txt'; $endpoint = 'https://api.indexnow.org/indexnow/'; $body = wp_json_encode([ 'host' => $host, 'key' => $api_key, 'keyLocation' => $key_location, 'urlList' => $urls ]); $response = wp_remote_post($endpoint, [ 'body' => $body, 'headers' => [ 'Content-Type' => 'application/json', 'Accept' => 'application/json' ], 'timeout' => 30 ]); return [ 'status_code' => wp_remote_retrieve_response_code($response), 'body' => wp_remote_retrieve_body($response) ]; } // Sends request to bing when the status of post changes // We will only do it only if the post is published. static function on_status_change($new_status, $old_status, $post){ if($new_status == $old_status){ return; } if($new_status != 'publish'){ return; } $options = get_option('siteseo_instant_indexing_option_name', []); $api_key = isset($options['instant_indexing_bing_api_key']) ? $options['instant_indexing_bing_api_key'] : ''; $url = get_permalink($post); if(empty($url) || empty($api_key)){ return; } $url_list = [$url]; $res = self::submit_urls_to_bing($url_list, $api_key); self::save_index_history($url_list, null, $res, 'auto'); } static function save_index_history($urls, $google_response = null, $bing_response = null, $source = 'manual'){ global $siteseo; $history = $siteseo->instant_settings; if(!isset($history['indexing_history'])){ $history['indexing_history'] = []; } array_unshift($history['indexing_history'], [ 'time' => time(), 'urls' => $urls, 'google_status_code' => $google_response['status_code'] ?? null, 'bing_status_code' => $bing_response['status_code'] ?? null, 'source' => $source // 'manual' or 'auto' ]); $history['indexing_history'] = array_slice($history['indexing_history'], 0, 10); update_option('siteseo_instant_indexing_option_name', $history); } } main/ajax.php 0000644 00000046654 15104342737 0007151 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SiteSEO Team */ namespace SiteSEO; if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } class Ajax{ static function hooks(){ add_action('wp_ajax_siteseo_save_titles_meta_toggle', '\SiteSEO\Ajax::save_toggle_state'); add_action('wp_ajax_siteseo_save_sitemap_toggle', '\SiteSEO\Ajax::save_toggle_state'); add_action('wp_ajax_siteseo_save_indexing_toggle', '\SiteSEO\Ajax::save_toggle_state'); add_action('wp_ajax_siteseo_save_advanced_toggle', '\SiteSEO\Ajax::save_toggle_state'); add_action('wp_ajax_siteseo_save_social_toggle', '\SiteSEO\Ajax::save_toggle_state'); add_action('wp_ajax_siteseo_save_analytics_toggle', '\SiteSEO\Ajax::save_toggle_state'); add_action('wp_ajax_siteseo_generate_bing_api_key', '\SiteSEO\Ajax::generate_bing_api_key'); add_action('wp_ajax_siteseo_url_submitter_submit', '\SiteSEO\Ajax::instant_indexing'); add_action('wp_ajax_siteseo_refresh_analysis', '\SiteSEO\Ajax::refresh_seo_analysis'); add_action('wp_ajax_siteseo_export_settings', '\SiteSEO\Ajax::export_settings'); add_action('wp_ajax_siteseo_import_settings', '\SiteSEO\Ajax::import_settings'); add_action('wp_ajax_siteseo_reset_settings', '\SiteSEO\Ajax::reset_settings'); add_action('wp_ajax_siteseo_migrate_seo', '\SiteSEO\Ajax::handle_import'); add_action('wp_ajax_siteseo_dismiss_intro', '\SiteSEO\Ajax::dismiss_intro'); add_action('wp_ajax_siteseo_save_universal_metabox', '\SiteSEO\Ajax::save_universal_metabox'); add_action('wp_ajax_siteseo_resolve_variables', '\SiteSEO\Ajax::resolve_variables'); add_action('wp_ajax_siteseo_clear_indexing_history', '\SiteSEO\Ajax::clear_indexing_history'); // Onboarding Actions add_action('wp_ajax_siteseo_save_onboarding_settings', '\SiteSEO\Ajax::save_onboarding_settings'); } static function handle_import(){ check_ajax_referer('siteseo_admin_nonce', 'nonce'); if(!siteseo_user_can('manage_tools')){ wp_send_json_error(['message' => esc_html__('Insufficient permissions', 'siteseo')]); } $plugin = !empty($_POST['plugin']) ? sanitize_text_field(wp_unslash($_POST['plugin'])) : ''; switch($plugin){ case 'wordpress-seo': $result = \SiteSEO\Import::yoast_seo(); break; case 'all-in-one-seo-pack': $result = \SiteSEO\Import::aio_seo(); break; case 'autodescription': $result = \SiteSEO\Import::seo_framework(); break; case 'wp-seopress': $result = \SiteSEO\Import::seo_press(); break; case 'seo-by-rank-math': $result = \SiteSEO\Import::rank_math(); break; case 'slim-seo': $result = \SiteSEO\Import::slim_seo(); break; default: throw new Exception('Invalid plugin selected'); } if(empty($result)){ wp_send_json_error(['message' => __('Invalid plugin selected', 'siteseo')]); } update_option('siteseo_last_migration_log', $result['log'], false); wp_send_json_success(['message' => $result['message']]); } static function reset_settings(){ check_ajax_referer('siteseo_admin_nonce', 'nonce'); if(!siteseo_user_can('manage_tools')){ wp_send_json_error(['message' => esc_html__('Insufficient permissions', 'siteseo')]); } $options = [ 'siteseo_toggle', 'siteseo_titles_option_name', 'siteseo_social_option_name', 'siteseo_advanced_option_name', 'siteseo_instant_indexing_option_name', 'siteseo_xml_sitemap_option_name', 'siteseo_google_analytics_option_name', 'siteseo_dismiss_intro', 'siteseo_pro_options' ]; foreach($options as $option){ delete_option($option); } wp_send_json_success(['message' => esc_html__('Settings reset successfully.', 'siteseo')]); } static function import_settings(){ check_ajax_referer('siteseo_admin_nonce', 'nonce'); if(!siteseo_user_can('manage_tools')){ wp_send_json_error(['message' => esc_html__('Insufficient permissions', 'siteseo')]); } if(!isset($_FILES['import_file'])){ wp_send_json_error(array('message' => 'No file was uploaded.')); } // If name or tmp path is not available return if(empty($_FILES['import_file']['name']) || empty($_FILES['import_file']['tmp_name'])){ wp_send_json_error(array('message' => 'No file was uploaded.')); } $imported_file = $_FILES['import_file']['tmp_name']; $filename = sanitize_file_name($_FILES['import_file']['name']); $file_extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION)); // Verify file exists and is readable if(!file_exists($imported_file) || !is_readable($imported_file) || !is_uploaded_file($imported_file)){ wp_send_json_error(array('message' => __('Uploaded file is not readable.', 'siteseo'))); } // Making sure is the correct file format if($file_extension !== 'json') { wp_send_json_error(array('message' => __('Invalid file type. Please upload a JSON file.', 'siteseo'))); } $file_contents = file_get_contents($imported_file); $settings = json_decode($file_contents, true); if(json_last_error() !== JSON_ERROR_NONE){ wp_send_json_error(array('message' => __('Invalid JSON file.', 'siteseo'))); } if(empty($settings) || !is_array($settings)){ wp_send_json_error(array('message' => __('Invalid settings format.', 'siteseo'))); } $settings = map_deep(wp_unslash($settings), 'sanitize_textarea_field'); if(isset($settings['siteseo_titles_option_name'])){ update_option('siteseo_titles_option_name', $settings['siteseo_titles_option_name']); } if(isset($settings['siteseo_social_option_name'])){ update_option('siteseo_social_option_name', $settings['siteseo_social_option_name']); } if(isset($settings['siteseo_xml_sitemap_option_name'])){ update_option('siteseo_xml_sitemap_option_name', $settings['siteseo_xml_sitemap_option_name']); } if(isset($settings['siteseo_toggle'])){ update_option('siteseo_toggle', $settings['siteseo_toggle']); } if(isset($settings['siteseo_advanced_option_name'])){ update_option('siteseo_advanced_option_name', $settings['siteseo_advanced_option_name']); } if(isset($settings['siteseo_instant_indexing_option_name'])){ update_option('siteseo_instant_indexing_option_name', $settings['siteseo_instant_indexing_option_name']); } if(isset($settings['siteseo_google_analytics_option_name'])){ update_option('siteseo_google_analytics_option_name', $settings['siteseo_google_analytics_option_name']); } // Pro if(isset($settings['siteseo_pro_options'])){ update_option('siteseo_pro_options', $settings['siteseo_pro_options']); } wp_send_json_success(['message' => esc_html__('Settings imported successfully.', 'siteseo')]); } static function export_settings(){ check_ajax_referer('siteseo_admin_nonce', 'nonce'); if(!siteseo_user_can('manage_tools')){ wp_send_json_error(['message' => esc_html__('Insufficient permissions', 'siteseo')]); } $export_data = array( 'siteseo_titles_option_name' => get_option('siteseo_titles_option_name'), 'siteseo_social_option_name' => get_option('siteseo_social_option_name'), 'siteseo_xml_sitemap_option_name' => get_option('siteseo_xml_sitemap_option_name'), 'siteseo_toggle' => get_option('siteseo_toggle'), 'siteseo_google_analytics_option_name' => get_option('siteseo_google_analytics_option_name'), 'siteseo_instant_indexing_option_name' => get_option('siteseo_instant_indexing_option_name'), 'siteseo_advanced_option_name' => get_option('siteseo_advanced_option_name'), 'siteseo_pro_options' =>get_option('siteseo_pro_options'), ); $file_name = 'siteseo-settings-export-' . current_time('m-d-Y') . '.json'; header('Content-Type: application/json'); header('Content-Disposition: attachment; filename="'.$file_name.'"'); header('Cache-Control: no-cache, no-store, must-revalidate'); header('Pragma: no-cache'); header('Expires: 0'); echo wp_json_encode($export_data); exit; } static function refresh_seo_analysis(){ check_ajax_referer('siteseo_admin_nonce', 'nonce'); if(!current_user_can('siteseo_manage')){ wp_send_json_error(['message' => esc_html__('Insufficient permissions', 'siteseo')]); } $post_id = isset($_POST['post_id']) ? intval($_POST['post_id']) : 0; $post_type = isset($_POST['post_type']) ? sanitize_text_field(wp_unslash($_POST['post_type'])) : ''; $target_keywords = isset($_POST['target_keywords']) ? sanitize_text_field(wp_unslash($_POST['target_keywords'])) : ''; $post = get_post($post_id); if(!$post || !current_user_can('edit_post', $post_id)){ wp_send_json_error(['message' => __('Invalid post or insufficient permissions', 'siteseo')]); } update_post_meta($post_id, '_siteseo_analysis_target_kw', $target_keywords); $analysis_data = \SiteSEO\Metaboxes\Analysis::perform_seo_analysis($post); update_post_meta($post_id, '_siteseo_analysis_data', $analysis_data); ob_start(); \SiteSEO\Metaboxes\Analysis::display_seo_analysis($post); $analysis_html = ob_get_clean(); wp_send_json_success([ 'html' => $analysis_html, 'analysis_data' => $analysis_data ]); } static function instant_indexing(){ check_ajax_referer('siteseo_admin_nonce', 'nonce'); if(!siteseo_user_can('manage_instant_indexing')){ wp_send_json_error(['message' => esc_html__('Insufficient permissions', 'siteseo')]); } // Validate input if(!isset($_POST['search_engine'], $_POST['urls'])){ wp_send_json_error(['message' => esc_html__('Missing required parameters', 'siteseo')]); } $urls = sanitize_textarea_field(wp_unslash($_POST['urls'])); $options = get_option('siteseo_instant_indexing_option_name'); $google_api_key = isset($options['instant_indexing_google_api_key']) ? $options['instant_indexing_google_api_key'] : ''; $bing_api_key = isset($options['instant_indexing_bing_api_key']) ? $options['instant_indexing_bing_api_key'] : ''; $url_list = array_filter(array_map('trim', explode("\n", $urls))); if(empty($url_list)){ wp_send_json_error(['message' => 'No valid URLs provided']); } $response = []; try{ if(!empty($options['engines']['google']) && !empty($google_api_key)){ $response['google'] = \SiteSEO\InstantIndexing::submit_urls_to_google($url_list); } if(!empty($options['engines']['bing']) && !empty($bing_api_key)){ $response['bing'] = \SiteSEO\InstantIndexing::submit_urls_to_bing($url_list, $bing_api_key); } if(empty($response)){ wp_send_json_error(['message' => 'No search engines configured or missing API keys']); } \SiteSEO\InstantIndexing::save_index_history($url_list, $response['google'] ?? null, $response['bing'] ?? null); wp_send_json_success([ 'message' => 'URLs submitted successfully', 'details' => $response ]); } catch(\Exception $e){ wp_send_json_error(['message' => $e->getMessage()]); } } static function generate_bing_api_key(){ if(!check_ajax_referer('siteseo_admin_nonce', 'nonce', false)){ wp_send_json_error('Invalid nonce'); return; } $lowercase = range('a', 'z'); $uppercase = range('A', 'Z'); $numbers = range('0', '9'); $dash = ['-']; $characters = array_merge($lowercase, $uppercase, $numbers, $dash); $characters_length = count($characters); $length = 32; $api_key = ''; for($i = 0; $i < $length; $i++){ $api_key .= $characters[random_int(0, $characters_length - 1)]; } wp_send_json_success(['api_key' => $api_key]); } static function save_toggle_state(){ check_ajax_referer('siteseo_toggle_nonce', 'nonce'); $action = isset($_POST['action']) ? sanitize_text_field(wp_unslash($_POST['action'])) : ''; switch($action){ case 'siteseo_save_titles_meta_toggle': $toggle_key = 'toggle-titles'; break; case 'siteseo_save_sitemap_toggle': $toggle_key = 'toggle-xml-sitemap'; break; case 'siteseo_save_indexing_toggle': $toggle_key = 'toggle-instant-indexing'; break; case 'siteseo_save_advanced_toggle': $toggle_key = 'toggle-advanced'; break; case 'siteseo_save_social_toggle': $toggle_key = 'toggle-social'; break; case 'siteseo_save_analytics_toggle': $toggle_key = 'toggle-google-analytics'; break; default: wp_send_json_error(['message' => __('Invalid action', 'siteseo')]); return; } $toggle_value = isset($_POST['toggle_value']) ? sanitize_text_field(wp_unslash($_POST['toggle_value'])) : '0'; $options = get_option('siteseo_toggle', []); $options[$toggle_key] = $toggle_value; $updated = update_option('siteseo_toggle', $options); if($updated){ wp_send_json_success([ 'message' => ucfirst($toggle_key) . ' toggle state saved successfully', 'value' => $toggle_value ]); } wp_send_json_error(['message' => __('Failed to save toggle state', 'siteseo')]); } static function save_onboarding_settings(){ check_ajax_referer('siteseo_admin_nonce', 'nonce'); if(!current_user_can('manage_options')){ wp_send_json_error(__('You do not have required permission to edit this file.', 'siteseo')); } if(empty($_POST['step'])){ wp_send_json_error(['message' => __('Could not figure out the current step', 'siteseo')]); } $step_name = !empty($_POST['step']) ? sanitize_text_field(wp_unslash($_POST['step'])) : ''; switch($step_name){ case 'your-site': $title_options = get_option('siteseo_titles_option_name', []); $social_options = get_option('siteseo_social_option_name', []); if(!empty($_POST['data']['website_name'])){ $title_options['titles_home_site_title'] = sanitize_text_field(wp_unslash($_POST['data']['website_name'])); } if(!empty($_POST['data']['alternate_site_name'])){ $title_options['titles_home_site_title_alt'] = sanitize_text_field(wp_unslash($_POST['data']['alternate_site_name'])); } if(!empty($_POST['data']['site_type'])){ $social_options['social_knowledge_type'] = sanitize_text_field(wp_unslash($_POST['data']['site_type'])); } if(!empty($_POST['data']['organization_name'])){ $social_options['social_knowledge_name'] = sanitize_text_field(wp_unslash($_POST['data']['organization_name'])); } if(!empty($_POST['data']['organization_logo'])){ $social_options['social_knowledge_img'] = sanitize_url(wp_unslash($_POST['data']['organization_logo'])); } if(!empty($_POST['data']['social_fb'])){ $social_options['social_accounts_facebook'] = sanitize_url(wp_unslash($_POST['data']['social_fb'])); } if(!empty($_POST['data']['social_x'])){ $social_options['social_accounts_twitter'] = sanitize_text_field(wp_unslash($_POST['data']['social_x'])); } if(!empty($_POST['data']['social_additional'])){ $social_options['social_accounts_additional'] = explode("\n", sanitize_textarea_field(wp_unslash($_POST['data']['social_additional']))); } update_option('siteseo_titles_option_name', $title_options); update_option('siteseo_social_option_name', $social_options); wp_send_json_success(); break; case 'indexing': if(empty($_POST['data'])){ break; } $data = map_deep(wp_unslash($_POST['data']), 'sanitize_text_field'); $site_status = !empty($data['site_status']) ? $data['site_status'] : ''; if(empty($site_status)){ wp_send_json_error(['message' => __('Request data did not reach the backend', 'siteseo')]); } $title_options = get_option('siteseo_titles_option_name', []); if($site_status == 'underconstruction'){ $title_options['titles_noindex'] = true; update_option('siteseo_titles_option_name', $title_options); wp_send_json_success(); } // Saving Post type indexing values if(!empty($data['post_types'])){ if(!is_array($data['post_types'])){ $data['post_types'] = [$data['post_types']]; } $post_types = get_post_types(['public' => true, 'show_ui' => true], 'objects', 'and'); unset($post_types['attachment']); foreach($post_types as $post){ if(in_array($post->name, $data['post_types'])){ $title_options['titles_single_titles'][$post->name]['noindex'] = $post->name; } } } // Saving Taxonomies indexing values if(!empty($data['taxonomies'])){ if(!is_array($data['taxonomies'])){ $data['taxonomies'] = [$data['taxonomies']]; } $taxonomies = get_taxonomies(['public' => true, 'show_ui' => true], 'objects', 'and'); foreach($taxonomies as $taxonomy){ if(in_array($taxonomy->name, $data['taxonomies'])){ $title_options['titles_tax_titles'][$taxonomy->name]['noindex'] = $taxonomy->name; } } } update_option('siteseo_titles_option_name', $title_options); wp_send_json_success(); break; case 'advanced': $data = map_deep(wp_unslash($_POST['data']), 'sanitize_text_field'); $advanced_options = get_option('siteseo_advanced_option_name'); $title_options = get_option('siteseo_titles_option_name', []); $title_options['titles_archives_author_noindex'] = isset($data['author_noindex']) ? $data['author_noindex'] : ''; $advanced_options['advanced_attachments_file'] = isset($data['redirect_attachment']) ? $data['redirect_attachment'] : ''; $advanced_options['advanced_category_url'] = isset($data['category_url']) ? $data['category_url'] : ''; $advanced_options['appearance_universal_metabox_disable'] = isset($data['universal_seo_metabox']) ? '' : '1'; $advanced_options['appearance_universal_metabox'] = isset($data['universal_seo_metabox']) ? '1' : ''; update_option('siteseo_titles_option_name', $title_options); update_option('siteseo_advanced_option_name', $advanced_options); wp_send_json_success(); break; } } static function dismiss_intro(){ check_ajax_referer('siteseo_admin_nonce', 'nonce'); if(!current_user_can('siteseo_manage')){ wp_send_json_error(__('You do not have required permission to edit this file.', 'siteseo')); } update_option('siteseo_dismiss_intro', time()); } static function save_universal_metabox(){ check_ajax_referer('siteseo_universal_nonce', 'security'); if(!current_user_can('siteseo_manage') || !siteseo_user_can_metabox()){ wp_send_json_error(__('You do not have required permission to edit this file.', 'siteseo')); } if(empty($_POST['post_id'])){ wp_send_json_error(__('Post ID not found', 'siteseo')); } $post_id = sanitize_text_field(wp_unslash($_POST['post_id'])); $post = get_post($post_id); \SiteSEO\Metaboxes\Settings::save_metabox($post_id, $post); } static function resolve_variables(){ check_ajax_referer('siteseo_admin_nonce', 'nonce'); if(!current_user_can('siteseo_manage')){ wp_send_json_error(__('You do not have required permission to edit this file.', 'siteseo')); } if(empty($_POST['content']) || empty($_POST['post_id'])){ wp_send_json_error(__('The required content or ID is empty', 'siteseo')); } global $post, $wp_query; $post_id = (int) sanitize_text_field(wp_unslash($_POST['post_id'])); $content = sanitize_text_field(wp_unslash($_POST['content'])); $tmp_post = $post; $post = get_post($post_id); $replaced_content = \SiteSEO\TitlesMetas::replace_variables($content, true); $post = $tmp_post; wp_send_json_success($replaced_content); } static function clear_indexing_history(){ check_ajax_referer('siteseo_admin_nonce', 'nonce'); if(!current_user_can('siteseo_manage')){ wp_send_json_error(__('You do not have required permission to edit this file.', 'siteseo')); } global $siteseo; $indexing_history = $siteseo->instant_settings; if(is_array($indexing_history) && isset($indexing_history['indexing_history'])){ unset($indexing_history['indexing_history']); update_option('siteseo_instant_indexing_option_name', $indexing_history); } wp_send_json_success(); } } readme.txt 0000644 00000030777 15104342737 0006566 0 ustar 00 === SiteSEO - SEO Simplified === Contributors: pagelayer, softaculous Tags: SEO, schema, xml sitemap, meta description Requires at least: 5.0 Tested up to: 6.8 Requires PHP: 7.2 Stable tag: 1.2.5 License: GPLv2 License URI: https://www.gnu.org/licenses/gpl-2.0.html SiteSEO is an easy, fast and powerful SEO plugin for WordPress. Unlock your Website's potential and Maximize your online visibility with our SiteSEO! == Description == SiteSEO is a revolutionary WordPress SEO plugin that seamlessly integrates with all page builders and themes, making it the best choice for optimizing your website. SiteSEO is a powerful WordPress SEO plugin to maximize your online Visibility, boost traffic and elevate rankings. It helps you to manage XML Sitemaps, improve social sharing, manage Titles and Metas and so much more.<br><br> You can find our official documentation at [https://siteseo.io/docs](https://siteseo.io/docs). We are also active in our community support forums on wordpress.org if you are one of our free users. Our Premium Support Ticket System is at [https://softaculous.deskuss.com](https://softaculous.deskuss.com) [Home Page](https://siteseo.io "SiteSEO Homepage") | [Support](https://softaculous.deskuss.com "SiteSEO Support") | [Documents](http://siteseo.io/docs "Documents") ===Key Features :=== - **Content Analysis :** Get valuable insights to create content that is perfectly optimized for search engines. - **Universal SEO Metabox :** Edit your SEO metadata from any page builder or theme builder effortlessly. - **Easy Import :** Migrate your post and term metadata from other plugins with a simple one-click process. ===Why Choose SiteSEO :=== - **Save Time and Money:** Import and export metadata easily with SiteSEO PRO, which starts at $49 per year. - **All-in-One Solution:** SiteSEO comes with all the features you need to optimize your WordPress site's SEO, eliminating the need for additional extensions and potential conflicts. - **Easy and User-Friendly:** You don't need to be an SEO expert or coder to use SiteSEO. Most settings are automatically configured, and an installation wizard guides you through the setup process. ==SiteSEO Free Features : == ===SiteSEO Free offers a comprehensive set of features, including : === - **Google Indexing API and IndexNow API** for quick content indexing. - **Content analysis** with unlimited keywords for optimized content creation. - **Google Knowledge Graph** support for better visibility. - **Social media previews** for Google, Facebook, and Twitter. - **Open Graph and Twitter Cards** integration for enhanced social media sharing. - **Customizable titles and meta** descriptions with dynamic variables. - **Installation wizard** for hassle-free site setup. ==Upgrade to SiteSEO PRO for More Power:== ===Unlock advanced capabilities with SiteSEO PRO, such as:=== - **Enhanced WooCommerce Support:** Optimize e-commerce sites with price and currency meta tags, product XML sitemaps, and more. - **Google Page Speed Insights:** Analyze your site's performance on mobile and desktop, including Core Web Vitals. = Multi-language Support : = SiteSEO is available in multiple languages, and you can contribute to further localization on translate.wordpress.org. = Integrations: = SiteSEO smoothly integrates with popular tools such as Elementor, WooCommerce and more. = Get Started with SiteSEO Today! = Visit our website siteseo.io for more information, join our official community group, and explore our resources to improve your SEO game. Don't miss out on the ultimate SEO solution for your WordPress website – Get SiteSEO now! = Third Party API usage = 1. IndexNow: is used to inform Microsoft Bing about the latest content changes on a user's website. The plugin sends a list of updated URLs along with the API key generated when the user saved the Instant Indexing settings. It also includes the site's URL and the URL of the key location, allowing Bing to verify the website's identity.[Terms and Condition](https://www.indexnow.org/terms) | [IndexNow.org](https://www.indexnow.org) 2. Google Instant Index: Is a service used to notify Google when a post is created, updated, or deleted. SiteSEO utilizes this service to inform Google by sending the updated post's URL, its state ("UPDATE" or "DELETE"), and an access token obtained via Google OAuth. [Terms and Conditions](https://developers.google.com/terms/site-terms) | [Google Search Central](https://developers.google.com) 3. Google OAuth: When using Google Instant Indexing SiteSEO need to verify with Google the keys the users has set to access Google's services. So SiteSEO sends the key users has provided in the SiteSEO settings to Google to verify the user is authorized to use those keys for Instant Indexing. [Terms and Conditions](https://developers.google.com/terms/site-terms) | [Google Search Central](https://developers.google.com) == Installation == 1. Upload 'siteseo' to the '/wp-content/plugins/' directory 2. Activate the plugin through the 'Plugins' menu in WordPress 3. Click on SiteSEO and apply settings. == Frequently Asked Questions == = How to use Google Tag Manager / Facebook Pixel with SiteSEO ? = Go to SiteSEO > Analytics > Custom Tracking tab. Paste GTM / Facebook Pixel tracking code to [HEAD] Add an additional tracking code / [BODY] Add an additional tracking code textarea fields. Save changes and clear your cache. = Which types of sitemaps support SiteSEO? = XML sitemaps for search engines: post, page, post type, taxonomies, images and author. HTML sitemap for accessibility and SEO. SiteSEO PRO supports Google News XML. = Is SiteSEO GDPR compliant? = Yes! = Is SiteSEO compatible with WordPress multisite ? = Yes! = My question is not listed here! = <a href="https://siteseo.io/docs/faq/" target="_blank">Read our complete FAQ on our site</a> == Screenshots == 1. SiteSEO Dashboard 2. Content Analysis Metabox 3. Title Settings Metabox 4. Advanced Settings Metabox 5. Titles and Metas Wizard 6. SiteMap Settings == Changelog == = 1.2.5 (July 3, 2025) = * [Bug Fix] Resolved a minor syntax issue for PHP 7.2 compatibility. = 1.2.4 (July 3, 2025) = * [Pro-Improvement] Added suggested rules for robots.txt and .htaccess. * [Improvement] Added suggested dynamic variables for the social settings in the metabox. * [Improvement] Made the universal metabox icon draggable. * [Bug-Fix] Fixed title and description issues on archive pages. * [Bug-Fix] Resolved title and description issue on non-static homepage. = 1.2.3 (June 17, 2025) = * [Pro-Improvement] Added support for virtual robots.txt. * [Improvement] Introduced the Instant Indexing History feature – now you can view indexing submission history. * [Improvement] Added support for importing settings from Slim SEO. * [Improvement] Added a noindex warning in the metabox. * [Bug-Fix] There was a settings sync issue in the Gutenberg sidebar, which has now been resolved. * [Bug-Fix] Fixed a problem related to description length limits. * [Bug-Fix] Fixed an issue with importing taxonomy settings. * [Bug-Fix] There was an issue with static Posts pages, which has now been resolved. * [Bug-Fix] There was an issue with the social preview in the metabox, which has been resolved. = 1.2.2 (May 19, 2025) = * [Improvement] Improved content saving for site verification tags. * [Bug-Fix] There was an issue with cookies Block which has been resolved. * [Bug-Fix] An issue related to archives has been resolved. * [Bug-Fix] A duplicate meta description issue with Elementor Pro has been resolved. * [Bug-Fix] A duplicate canonical URL issue from WordPress has been resolved. * [Bug-Fix] A pagination issue in the Remove Category feature has been fixed. * [Bug-Fix] An issue with the noindex setting for post types has been resolved. * [Bug-Fix] There was issue with save Order By settings in HTML sitemap has been resolved. = 1.2.1 (April 21, 2025) = * [Pro-Feature] Added RSS sitemap. * [Pro-Feature] Added Video sitemap. * [Bug-Fix] There was an issue with Blocking Metabox this has been fixed. * [Bug-Fix] Some user roles we not getting saved in Advanced security settings, this has been fixed. * [Bug-Fix] Setting Primary Category was not working, this has been fixed. * [Bug-Fix] Share of page on Facebook was not giving the correct Thumbnail image and description that has been fixed. * [Bug-Fix] Auto Indexing on Post publish if the option was enabled was not working that has been fixed. * [Task] A WordPress deprecation warning has been fixed. * [Task] Tested with WordPress 6.8 = 1.2.0 (April 1, 2025) = * [Bug-Fix] There was an issue with H1 heading analysis that has been fixed. * [Bug-Fix] There was an issue with Remove Category slug, this has been fixed. * [Bug-Fix] A few onboarding settings were not getting saved, that has been fixed. = 1.1.9 (March 26, 2025) = * [Bug-Fix] There was issue with Social Network settings getting erased on update, that has been fixed. = 1.1.8 (March 25, 2025) = * [Improvement] Now sitemap supports multiple languages. * [Improvement] Now meta description and canonical URL supports multiple languages. * [Improvement pro] The structured data types feature now supports post types, has been added to the metabox. * [Pro Feature] Added Google News sitemap. * [Pro-Feature] Added Redirections / 404 monitoring feature. * [Bug-Fix] There was an issue with OG URL, that has been fixed. * [Bug-Fix] There was Duplicate meta description and canonical URL on the homepage, that has been fixed. = 1.1.7 (February 28, 2025) = * [Task] Title and Meta settings for Post Types and Taxonomies will be enabled by default. * [Task] WP Sitemap will be disabled, and redirected to SiteSEO sitemap, if SEO settings in SiteSEO are enabled. * [Bug-Fix] There was an issue with SEO metabox, it was showing up even when Universal metabox was enabled, this has been fixed. * [Bug-Fix] Google Instant indexing, was returning an error that has been fixed. = 1.1.6 (February 20, 2025) = * [Bug-Fix] There was an issue with WooCommerce compatibility that has been fixed. * [Bug-Fix] Bing API was giving 202 response, this has been fixed. = 1.1.2 (October 09, 2024) = * [Bug-Fix] A PHP warning related to a decoding function has been fixed. * [Pro-Version] A Pro version have been launched which includes features like WooCommerce SEO, Easy Digital Downloads SEO, Dublin Core and PageSpeed Insight = 1.1.1 (July 30, 2024) = * [Improvement] Title and Description input feedback has been improved when used in the editor. * [Bug-Fix] For some users Content Readibility was causing issue, which has been fixed * [Bug-Fix] There was an issue with Sitemaps, that has been fixed. * [Bug-Fix] There was an issue with X Social card that has been fixed. * [Bug-Fix] Product title and description has issue saving which has been fixed. * [Task] Tested with WordPress 6.6. = 1.1.0 (May 24, 2024) = * [Feature] You can now use SiteSEO OnPage SEO optimization tools from the Sidebar plugin in gutenberg. * [Feature] Added Readibility analysis, which includes, Passive voice anlyser, Power word analyser and more. * [Task] A New On Page optimization widget. * [Task] Refactored and rewrote some components of SiteSEO. = 1.0.9 (May 15, 2024) = * [Feature] Now users can add Table of Content to their posts. * [Feature] Option to create and edit robots.txt file. * [Feature] Option to update .htaccess file. = 1.0.8 (May 08, 2024) = * [Feature] Block and shortcode support for On Page Breadcrumbs. * [Task] Title Settings code refactor. = 1.0.7 (April 17, 2024) = * [Feature] Realtime Content Analysis for Gutenberg. * [Bug-Fix] There was an issue on the search page when SiteSEO was active, which has been fixed. = 1.0.6 (April 12, 2024) = * [Feature] Adding Breadcrumb to your posts and pages, can be added using Gutenberg Block, short code or direct PHP code. * [Improvement] Added option to search in tags. * [Improvement] Added placeholder images in Facebook and Twitter metabox form. * [Task] Added credits. = 1.0.5 (Mar 15, 2024) = * [Bug-Fix] There was an issue with metadata importer which has been fixed. * [Bug-Fix] CSS of SiteSEO was not loading on some pages which was breaking the UI at some places that has been fixed. * [Bug-Fix] Meta description was not adding, which has been fixed. * [Task] Updated docs links. = 1.0.4 (Mar 1, 2024) = * [Improvement] Cleaned code for launch. * [Bug-Fix] CSS taking longer to load Setup wizard has been fixed. * [Task] Fixed PHP warnings. = 1.0.1 (Oct 25, 2023) = * [Improvement] Sanitizing and escaping methods have been added where necessary to prevent XSS vulnerabilities and breaking the HTML document structure. = 1.0.0 (August 06, 2023) = * Released Plugin <a href="https://siteseo.io/blog/" target="_blank">View our complete changelog</a> siteseo.php 0000644 00000017362 15104342737 0006747 0 ustar 00 <?php /* Plugin Name: SiteSEO - SEO Simplified Plugin URI: http://wordpress.org/plugins/siteseo/ Description: SiteSEO is an easy, fast and powerful SEO plugin for WordPress. Unlock your Website's potential and Maximize your online visibility with our SiteSEO! Author: Softaculous Version: 1.2.5 Requires at least: 5.0 Author URI: https://siteseo.io/ License: GPLv2 Text Domain: siteseo */ if(!defined('ABSPATH')){ die('HACKING ATTEMPT!'); } if(!function_exists('add_action')){ echo 'You are not allowed to access this page directly.'; exit; } if(defined('SITESEO_VERSION')){ return; } define('SITESEO_VERSION', '1.2.5'); define('SITESEO_FILE', __FILE__); define('SITESEO_DOCS', 'https://siteseo.io/docs/'); define('SITESEO_DIR_PATH', plugin_dir_path(SITESEO_FILE)); define('SITESEO_DIR_URL', plugin_dir_url(SITESEO_FILE)); define('SITESEO_ASSETS_PATH', SITESEO_DIR_PATH . 'assets'); define('SITESEO_ASSETS_URL', SITESEO_DIR_URL . 'assets'); define('SITESEO_DEV', file_exists(SITESEO_DIR_PATH.'DEV.php')); include_once(SITESEO_DIR_PATH . 'functions.php'); function siteseo_autoloader($class){ if(!preg_match('/^SiteSEO\\\(.*)/is', $class, $m)){ return; } $m[1] = str_replace('\\', '/', $m[1]); // Include file if(file_exists(SITESEO_DIR_PATH . 'main/'.strtolower($m[1]).'.php')){ include_once(SITESEO_DIR_PATH.'main/'.strtolower($m[1]).'.php'); } } spl_autoload_register('siteseo_autoloader'); register_activation_hook(SITESEO_FILE, '\SiteSEO\Install::activate'); register_deactivation_hook(SITESEO_FILE, '\SiteSEO\Install::deactivate'); register_uninstall_hook(SITESEO_FILE, '\SiteSEO\Install::uninstall'); add_action('plugins_loaded', 'siteseo_load_plugin'); function siteseo_load_plugin(){ global $siteseo; if(empty($siteseo)){ $siteseo = new StdClass(); } // Loading all the options. $siteseo->setting_enabled = get_option('siteseo_toggle', []); $siteseo->titles_settings = get_option('siteseo_titles_option_name', []); $siteseo->social_settings = get_option('siteseo_social_option_name', []); $siteseo->advanced_settings = get_option('siteseo_advanced_option_name', []); $siteseo->instant_settings = get_option('siteseo_instant_indexing_option_name', []); $siteseo->sitemap_settings = get_option('siteseo_xml_sitemap_option_name', []); $siteseo->analaytics_settings = get_option('siteseo_google_analytics_option_name', []); siteseo_check_update(); if(!empty($siteseo->setting_enabled['toggle-advanced'])){ add_action('init','\SiteSEO\ImageSeo::init', 11); // Upload happens with AJAX so we need this here } if(wp_doing_ajax()){ \SiteSEO\Ajax::hooks(); return; } if(defined('SITESEO_PRO_VERSION') && version_compare(SITESEO_PRO_VERSION, '1.1.5', '<')){ if(!function_exists('is_plugin_active')){ require_once ABSPATH . 'wp-admin/includes/plugin.php'; } } // Image & Sitemap block add_action('init', '\SiteSEO\Admin::register_sitmap_block'); // TOC add_shortcode('siteseo_toc', '\SiteSEO\TableofContent::render_toc'); add_action('init', '\SiteSEO\TableofContent::enable_toc'); if(!empty($siteseo->setting_enabled['toggle-xml-sitemap']) && !empty($siteseo->sitemap_settings['xml_sitemap_general_enable'])){ add_filter('wp_sitemaps_enabled', '__return_false'); // Disabling default WP Sitemap add_action('init', '\SiteSEO\GenerateSitemap::add_rewrite_rules', 20); add_action('template_redirect', '\SiteSEO\GenerateSitemap::handle_sitemap_requests', 0); } if(!empty($siteseo->sitemap_settings['toggle-xml-sitemap']) && !empty($siteseo->sitemap_settings['xml_sitemap_general_enable'])){ add_shortcode('siteseo_html_sitemap', '\SiteSEO\GenerateSitemap::html_sitemap'); } // Redirect add_action('template_redirect', '\SiteSEO\GoogleAnalytics::handle_custom_redirect'); add_action('init', '\SiteSEO\Advanced::remove_wc_category_base'); if(!empty($siteseo->setting_enabled['toggle-instant-indexing']) && !empty($siteseo->instant_settings['instant_indexing_bing_api_key'])){ add_action('template_redirect', '\SiteSEO\InstantIndexing::bing_txt_file', 0); if(!empty($siteseo->instant_settings['instant_indexing_automate_submission'])){ add_action('transition_post_status', '\SiteSEO\InstantIndexing::on_status_change', 10, 3); } } \SiteSEO\Admin::permission(); if(!empty($siteseo->setting_enabled['toggle-advanced']) && empty($siteseo->advanced_settings['appearance_universal_metabox_disable']) && siteseo_user_can_metabox()){ add_action('wp_enqueue_scripts', 'siteseo_universal_assets'); add_action('enqueue_block_editor_assets', 'siteseo_universal_assets'); } if(!is_admin()){ // Code that will be used in the frontend will go here. remove_action('wp_head', 'rel_canonical'); add_action('after_setup_theme', 'siteseo_remove_elementor_description_meta_tag'); // Cookies enqueue add_action('wp_enqueue_scripts', '\SiteSEO\Admin::cookies_bar'); // Titles and Metas add_action('wp_head', '\SiteSEO\TitlesMetas::add_nositelinkssearchbox', 1); add_action('wp_head', '\SiteSEO\TitlesMetas::add_canonical_url', 1); add_filter('wp_title', '\SiteSEO\TitlesMetas::modify_site_title', 10, 2); add_filter('pre_get_document_title', '\SiteSEO\TitlesMetas::modify_site_title', 10); add_action('wp_head', '\SiteSEO\TitlesMetas::add_meta_description', 1); add_filter('wp_robots', '\SiteSEO\TitlesMetas::advanced_metas', 999); add_action('wp_head', '\SiteSEO\TitlesMetas::add_rel_link_pages', 9); add_action('wp_head', '\SiteSEO\TitlesMetas::date_time_publish', 3); // Social add_action('wp_head', '\SiteSEO\SocialMetas::add_social_graph', 1); add_action('wp_head', '\SiteSEO\SocialMetas::fb_graph', 1); add_action('wp_head', '\SiteSEO\SocialMetas::twitter_card', 1); // Sitemaps add_action('init', '\SiteSEO\GenerateSitemap::settings'); // Image & Advanced add_action('wp_head', '\SiteSEO\Advanced::tags'); add_action('init', '\SiteSEO\Advanced::remove_links'); // Analaytics add_action('init', '\SiteSEO\GoogleAnalytics::ga_render'); add_filter('post_link_category', '\SiteSEO\PrimaryCategory::add_primary_category', 10, 3); add_filter('wc_product_post_type_link_product_cat', '\SiteSEO\PrimaryCategory::wc_primary_category', 10, 3); add_filter('woocommerce_get_breadcrumb', '\SiteSEO\PrimaryCategory::replace_breadcrumb_categories', 10, 2); return; } if(is_admin()){ \SiteSEO\Admin::init(); } } function siteseo_check_update(){ global $siteseo; $current_version = get_option('siteseo_version'); $version = (int) str_replace('.', '', $current_version); // No update required if($current_version == SITESEO_VERSION){ return true; } if($version < 115){ // Older version had enable index, and if it was set it actually meant it was enabled. $options = $siteseo->titles_settings['titles_single_titles']; if(!empty($options)){ foreach($options as &$option){ if(!empty($option['enable'])){ unset($option['enable']); $option['disabled'] = true; } } $siteseo->titles_settings['titles_single_titles'] = $options; } update_option('siteseo_titles_option_name', $siteseo->titles_settings); } if($version > 115 && $version < 117){ $options = $siteseo->titles_settings['titles_single_titles']; // In 115 if enabled was true then the options will be enabled, which was an issue // As it means user will have to manually enable every metabox option. if(!empty($options)){ foreach($options as &$option){ if(!empty($option['enable'])){ unset($option['enable']); } elseif(isset($option['enable'])){ $option['disabled'] = true; unset($option['enable']); } } $siteseo->titles_settings['titles_single_titles'] = $options; } update_option('siteseo_titles_option_name', $siteseo->titles_settings); } // Is it first run ? if(empty($current_version)){ \SiteSEO\Install::activate(); return; } update_option('siteseo_version', SITESEO_VERSION); } assets/css/admin-columns.css 0000644 00000000433 15104342737 0012124 0 ustar 00 .column-seo_title, .column-meta_description, .column-redirect_url, .column-canonical_url{ width: 15%; } .column-redirect_enabled, .column-noindex, .column-nofollow, .column-word_count, .column-seo_score{ width: 8%; text-align: center; } .column-target_keyword{ width: 12%; } assets/css/siteseo.css 0000644 00000052325 15104342737 0011040 0 ustar 00 :root{ --siteseo-theme-color: #163d89; } .siteseo-admin-body #wpcontent{ padding-left:0; background-color:white; } .siteseo-license-tab{ padding: 20px; border-radius: 8px; box-shadow: 0 0 10px rgb(0, 0, 0, 0.1); margin-top:100px; margin-right:15px; background-color:white; } #siteseo-root{ position:relative; width: 100%; } #siteseo-root *{ box-sizing:border-box; } .nav-tab-wrapper{ display: flex; width: 100%; flex-wrap: wrap; border-bottom: 1px solid #ddd; margin-bottom: 20px; row-gap: 7px; } .nav-tab-wrapper .nav-tab{ padding: 10px 20px; text-decoration: none; color: #666; background-color: white; border-bottom: 1px solid transparent; transition: color 0.3s, background-color 0.3s; border: none; outline: none; position: relative; cursor: pointer; } .nav-tab-wrapper .nav-tab:focus{ background-color: transparent; box-shadow: none; } .nav-tab-wrapper .nav-tab::before{ content: ''; position: absolute; bottom: -2px; left: 0; width: 100%; height: 2px; background-color: #003399; transform: scaleX(0); /* Start scale at 0 for animation */ transform-origin: left; transition: transform 0.3s; } .nav-tab-wrapper .nav-tab:hover::before{ transform: scaleX(1); /* Animate scaleX for a smoother hover effect */ } .nav-tab-wrapper .nav-tab-active{ color: #003399; border-bottom: 3px solid #003399; } .nav-tab-wrapper .nav-tab:focus{ outline: none; } #siteseo-dashbord{ padding: 20px 44px 44px 44px; } /* Dashboard */ .siteseo-dashbord-intro{ display: flex; align-items: center; justify-content:space-between; padding: 20px; width: 100%; } .siteseo-text-content{ max-width: 600px; margin-right: 20px; } .siteseo-text-content h2{ color: #333; font-size: 11px; margin-bottom: 10px; } .siteseo-text-content h1{ color: #333; font-size: 30px; margin-bottom: 20px; } .siteseo-text-content p{ margin-bottom:40px; } .siteseo-dashbord-content{ display: flex; justify-content: space-between; padding: 20px; gap:10px; } .siteseo-dashboard-features .siteseo-dashbord-container{ display:flex; flex-wrap:wrap; gap: 20px; } .siteseo-dashboard-features{ width: 75%; } .siteseo-dashboard-extras{ width: 25%; } .siteseo-option{ padding: 44px; border-radius: 8px; } .siteseo-option h2{ font-size: 24px; font-weight: normal; margin: 0 0 20px 0; } .siteseo-option input[type="text"]{ width:50%; height: 130%; } .siteseo-option select{ line-height: 20px; width: 100%; } .siteseo-option input[type="radio"]:focus, .siteseo-option select:focus, .siteseo-option textarea:focus, .siteseo-option input[type="text"]:focus, .siteseo-option input[type="checkbox"]:focus{ border: 2px solid #003399; } .siteseo-option a{ color:#003399; } .line{ display: block; border-top: 1px solid #e0e0e0; margin-bottom: 20px; } .submit-button{ background-color: #003399; color: white; padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 14px; } .dashed-line{ display: block; border-top: 2px dashed #e0e0e0; padding-top: 5px; padding-bottom: 5px; } p.description, .description { font-size: 13px; color: #666; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 5px 0; padding: 0; line-height: 1.5; display: block; visibility: visible; opacity: 1; } .siteseo-tabs{ padding-top:25px; } .siteseo-tab{ width: 100%; display: none; } .siteseo-tab.active{ visibility: visible; overflow: inherit; opacity: 1; transform: translateX(0); display: inherit; position: relative; } .siteseo-styles pre{ font-family: Menlo, Monaco, Andale Mono, Courier New, monospace; padding: 10px; display: inline-block; background-color: #9c9c9c14; border-radius: 3px; color: #00308F; font-size: 13px; word-break: break-all; white-space: pre-line; box-shadow: rgba(9, 30, 66, 0.25) 0px 1px 1px, rgba(9, 30, 66, 0.13) 0px 0px 1px 1px; } .siteseo-notice .is-warning{ background-color: #fff8e1; border: 1px solid #ffeb3b; border-radius: 5px; font-family: Arial, sans-serif; font-size: 14px; color: #333; width: 100%; box-sizing: border-box; } .field-required, .field-recommended{ font-weight: bold; } .field-required{ color: #a00; } .field-recommended{ color: #ffba00; } .siteseo-option input[type="text"], .siteseo-option input[type="password"], .siteseo-option input[type="number"]{ line-height: 40px; } @media only screen and (max-width: 1024px){ .siteseo-option input[type="text"], .siteseo-option input[type="password"], .siteseo-option input[type="number"], .siteseo-option textarea{ min-width: inherit; width: 100%; } } .siteseo-option .btnSecondary{ padding: 10px; border: 2px solid #00308F; color: #00308F; background: transparent; border-radius: 3px; transition: 0.2s; } .siteseo-option .btnSecondary:hover{ color: white; background-color: #00308F; } .siteseo-option .btnPrimary{ padding: 9px; border: 2px solid #00308F; color: white; background-color: #00308F; border-radius: 3px; transition: 0.2s; } .siteseo-option .btnTertiary, .siteseo-styles .btnTertiary{ color:#00308F; background: transparent; padding: 9px; border:none; box-shadow: none; } .siteseo-option .btnTertiary:hover, .siteseo-styles .btnTertiary:hover{ box-shadow: inset 0 0 0 1px #00308F; border: 1px solid #00308F; } .siteseo-notice{ position: relative; display:grid; background: #00308f05; padding: 10px; width: calc(100% - 20px); z-index: 10; border-radius: 5px; width: auto; display: flex; border:1px solid #00308f45; } .siteseo-notice.is-success{ margin-top:5%; border-left-color:#4ab866; margin-right:15px; background:#eff9f1; } .siteseo-notice.is-warning{ background: #fff9e8; border-color: #e2a90057; width: auto; } .siteseo-notice.is-error p{ font-size:13px; } .siteseo-notice.is-error{ font-size: 13px; border-left-color: #cc1818; background: rgb(244 162 162 / 30%); } /* table.form-table td { padding-left: 20%; }*/ .siteseo-archives{ padding-left: 15%; } .siteseo-container{ width: 200px; border: 1px solid #e0e0e0; border-radius: 8px; background-color: #ffffff; padding: 30px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } .siteseo-container a{ padding: 5px; display: block; color: #6c757d; text-decoration: none; margin-bottom: 10px; font-size: 16px; transition: background-color 0.3s, color 0.3s; } .siteseo-container a:last-child{ margin-bottom: 0; } /* Active class styling */ .siteseo-container a.active{ background-color: #e7f3ff; color: #007bff; padding: 8px 10px; border-radius: 4px; border: 1px solid #007bff; } body .siteseo-option select, body .siteseo-option input[type="text"]{ height: 45px; width: 75%; } body .siteseo-option textarea{ min-width: inherit; width: 75%; min-height: 100px; } .siteseo-option .wrap-tags{ position: relative; display: inline-flex; width: 90%; margin: 10px 0; flex-wrap: wrap; gap: 10px; } .siteseo-option .wrap-tags button{ margin-bottom: 10px; } .tag-title-btn{ display: flex; align-items: center; justify-content: center; background-color: #003399; color: white; padding: 10px 10px; max-height: 37px; border: 2px solid transparent; border-radius: 5px; font-family: Arial, sans-serif; font-size: 10px; font-weight: bold; text-align: center; text-decoration: none; cursor: pointer; box-sizing: border-box; } .tag-title-btn span, .tag-select-btn span{ margin-right: 5px; } .tag-select-btn span{ margin-right: 0; } .tag-title-btn:hover{ background-color: white; color: #003399; border-color: #003399; } .tag-title-btn:hover{ border: 2px solid #003399; background-color: white; color: #003399; } .tag-select-btn{ width: 40px; height: 40px; color: white; background-color: #003399; border-radius: 5px; border: 1px solid #666666; display: flex; max-height:37px; align-items: center; justify-content: center; cursor: pointer; transition: background-color 0.3s, color 0.3s; } .tag-select-btn:hover{ border: 2px solid #003399; background-color: white; } .tag-select-btn:hover #icon{ color: #0033a0; } body .siteseo-option option{ padding: 10px; } body .siteseo-option input[type="checkbox"]:checked::before{ content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e"); background: #00308F; width: 100%; height: 100%; margin: 0 !important; display: inline-block; } body .siteseo-option input[type="checkbox"]{ box-shadow: 0 0 0 transparent; border: 1px solid #a4a4a4; border-radius: 4px; cursor: pointer; outline: 0; text-align: center; width: 20px; height: 20px; -webkit-appearance: none; appearance: none; transition: 0.3s all ease-in-out; box-sizing: border-box; padding: 0!important; display: inline-block; } #siteseo-tab-title{ font-family: Arial, sans-serif; font-size: 20px; color: #4a4a4a; margin: 20px; } #siteseo-form{ margin-right:20px; } .siteseo_wrap_label{ margin: 0 0 10px 0; } .siteseo-notice p{ margin: 0% !important; } .siteseo-notice .dashicons{ color:#00308F; } .siteseo-notice #dashicons-warning{ color:rgb(226 169 0); } .siteseo-submit-btn{ display: flex; bottom: 0; } .siteseo-submit-button{ display:static; position: sticky; bottom:20px; } .siteseo-container{ position: sticky; top: 120px; display: inline-block; } .tag-select-btn{ width: 40px; height: 40px; color: white; background-color: #003399; border-radius: 5px; border: 1px solid #666666; display: flex; max-height: 37px; align-items: center; justify-content: center; cursor: pointer; transition: background-color 0.3s, color 0.3s; position: relative; } .tag-select-btn:hover{ color: white; } .siteseo-suggetion{ position: absolute; width: 250px; border: 1px solid #ccc; top: 50px; left:-50px; border-radius: 5px; height: 300px; background-color: white; z-index: 1000; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); display: flex; flex-direction: column; } .search-box-container{ position: sticky; top: 0; background-color: white; padding: 10px; border-bottom: 1px solid #ccc; z-index: 2; } .search-box-container input{ width:100% !important; } .suggestions-container{ flex-grow: 1; overflow-y: auto; } .siteseo-suggetion .search-box{ width: 100%; padding: 5px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 5px; } .siteseo-suggetion .section{ color: rgb(4, 4, 4); padding: 5px; font-weight: bold; font-size: 12px; border-bottom: 1px solid #eee; cursor: pointer; } .siteseo-suggetion .section:hover{ color: #fff; background-color: #003399; } .siteseo-suggetion .section:hover .tag{ background-color: #fff; } .siteseo-suggetion .tag{ color: #000; display: inline-block; background-color: #f0f0f0; padding: 5px 10px; border-radius: 5px; font-family: monospace; margin-top: 5px; } /* metabox css */ #siteseo_metabox_temp{ padding: 10px 20px; font-weight:bold; color: #000000; background-color: white; border-bottom: 1px solid transparent; transition: 0.3s; border: none; outline: none; position: relative; cursor: pointer; background-color:#e0e0e0; } #siteseo_metabox_temp .nav-tab{ background-color:#e0e0e0; } #siteseo_metabox_temp .nav-tab::before{ content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px; transition: width 0.3s; } #siteseo_metabox_temp .nav-tab:hover::before{ width: 100%; } #siteseo_metabox_temp .nav-tab-active{ color: #003399; border-bottom: 3px solid #003399; } #siteseo_metabox_temp.nav-tab:focus{ outline: none; } .siteseo-buttons{ display: flex; gap: 10px; } .siteseo-buttons a{ text-decoration: none; padding: 10px 20px; border-radius: 5px; font-size: 16px; } .siteseo-buttons .get-started{ background-color: #003399; color: #fff; } .siteseo-buttons .dismiss{ color: #003399; } .siteseo-image-content img{ max-width: 100%; height: auto; } /*** Dashboard page carts ****/ .siteseo-card{ display:flex; flex-direction:column; align-items:center; justify-content:space-between; background: white; border: 1px solid #E2E8F0; border-radius: 3px; padding: 25px; text-align: center; position: relative; width: 31.5%; } .siteseo-card-icon{ display:inline-block; font-size: 40px; width: 40px; height: 40px; color: var(--siteseo-theme-color); margin-bottom: 0.2rem; } .siteseo-card h3{ font-size: 16px; margin: 8px 0; color: #003399; font-weight:500; } .siteseo-card p{ font-size: 14px; color: #666; margin: 5px 0; } .siteseo-card .siteseo-card-footer{ display: flex; justify-content: space-between; align-items: center; margin-top:20%; width:100%; padding-top:20px; border-top: 1px solid #E2E8F0; } .siteseo-card .siteseo-card-footer button{ background: #003399; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer; } .siteseo-card .siteseo-card-footer a{ text-decoration: none; background: #003399; color: white; border: none; padding: 8px 15px; border-radius: 5px; cursor: pointer; } .siteseo-card .siteseo-card-footer .toggle{ display: flex; align-items: center; } .siteseo-card .siteseo-card-footer .toggle input{ display: none; } .siteseo-card .siteseo-card-footer .toggle label{ width: 50px; height: 25px; background: #ccc; border-radius: 25px; position: relative; cursor: pointer; border: 2px solid #007bff; } .siteseo-card .siteseo-card-footer .toggle label::after{ content: ''; width: 22px; height: 22px; background: white; border-radius: 50%; position: absolute; top: 0px; left: 0px; transition: 0.3s; } .siteseo-card .siteseo-card-footer .toggle input:checked + label{ background: #007bff; } .siteseo-card .siteseo-card-footer .toggle input:checked + label::after{ left: 25px; } .siteseo-card .pro-feature{ color: red; font-size: 14px; position: absolute; top: 20px; right: 20px; } .siteseo-card #lock{ color: gold; margin-right:2px; font-size: 38px; } /** siteseo-advertisement **/ .siteseo-ad-container{ background-color: #ffffff; border-radius: 8px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); padding: 20px; width: 190px; text-align: center; } .siteseo-ad-logo img{ width: 150px; height: 50px; margin-right: 10px; } .siteseoi-ad-title{ font-size: 24px; font-weight: bold; } .siteseo-ad-description{ font-size: 14px; color: #666666; margin-bottom: 20px; } .siteseo-ad-description em{ font-style: italic; font-weight: bold; color: #333333; } .siteseo-ad-features{ text-align: left; font-size: 14px; color: #333333; margin-bottom: 20px; } .siteseo-ad-button{ background-color: #003399; color: #ffffff; padding: 10px 20px; border: none; border-radius: 5px; text-decoration: none; font-size: 14px; } /* breadcurmbs */ .siteseo-inner-tabs-wrap{ overflow-x: hidden; padding-bottom: 16px; border-bottom: 1px solid #ccc; } .siteseo-inner-tabs-wrap [type="radio"]{ display: none; } .siteseo-inner-tabs-wrap [type="radio"]:nth-of-type(1):checked ~ .siteseo-inner-tabs .siteseo-inner-tab:nth-of-type(1) label, .siteseo-inner-tabs-wrap [type="radio"]:nth-of-type(2):checked ~ .siteseo-inner-tabs .siteseo-inner-tab:nth-of-type(2) label, .siteseo-inner-tabs-wrap [type="radio"]:nth-of-type(3):checked ~ .siteseo-inner-tabs .siteseo-inner-tab:nth-of-type(3) label{ border-bottom-color: #00308F; color: #222; } .siteseo-inner-tabs-wrap [type="radio"]:nth-of-type(1):checked ~ .siteseo-inner-tab-content:nth-of-type(1), .siteseo-inner-tabs-wrap [type="radio"]:nth-of-type(2):checked ~ .siteseo-inner-tab-content:nth-of-type(2), .siteseo-inner-tabs-wrap [type="radio"]:nth-of-type(3):checked ~ .siteseo-inner-tab-content:nth-of-type(3){ display: block; } /* Breadcrumbs seperator */ .siteseo-seperator-btns{ display:flex; gap:4px; margin-bottom:10px; } .siteseo-seperator-btns label{ display:flex; flex-wrap:wrap; align-items:center; justify-content:center; box-sizing:border-box; height:40px; width:40px; border:1px solid #ccc; border-radius: 3px; text-align:center; font-size:20px; font-weight:600; line-height:1.7; cursor:pointer; } .siteseo-seperator-btns label:hover{ border:2px solid #ccc; } .siteseo-seperator-btns label:has(input:checked){ background:#00308F; border: 2px solid #00308F; color: #fff; } .siteseo-seperator-btns label > input{ display:none; } /*sitemap */ .siteseo-sitemap-body{ font-family: Arial, sans-serif; background-color: #f5f5f5; } .siteseo-sitemap-container{ background-color: #ffffff; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); max-width: 800px; margin: 0 auto; } .siteseo-sitemap-header{ max-width: 800px; margin: 0 auto; margin-top: 28px; padding-left: 20px; } .siteseo-sitemap-container h1{ font-size: 24px; color: #333333; } .siteseo-index-link{ font-size: 16px; color: #0073aa; text-decoration: none; } .siteseo-sitemap-description{ font-size: 14px; color: #666666; margin-top: 10px; } .siteseo-sitemap-container table{ width: 100%; border-collapse: collapse; } .siteseo-sitemap-container th, td{ padding: 15px; text-align: left; } .siteseo-sitemap-container th{ background-color: #f9f9f9; font-weight: bold; border-bottom: 1px solid #dddddd; } .siteseo-sitemap-container tr:hover{ background-color: #f5f5f5; } .siteseo-sitemap-url-link{ color: #0073aa; text-decoration: none; } /* toast message settings saved*/ .siteseo-toast{ position: fixed; top: 90px; right: 20px; background: #F0FFF2; color: #000000; padding: 15px; border-radius: 5px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); z-index: 99999; display: none; font-weight: 600; animation: slide-down 0.3s ease-out; } .siteseo-toast.error{ background: #f44336; top: 90px; right: 20px; padding:15px; } .siteseo-toast .dashicons{ color: #008000; vertical-align: middle; margin-right: 3px; font-size: 23px; } /* slide-down animation */ @keyframes slide-down{ from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } } /* bredcurmns css inner tab **/ .siteseo-inner-tabs-wrap{ overflow-x: hidden; padding-bottom: 16px; border-bottom: 1px solid #ccc; } .siteseo-inner-tabs-wrap [type="radio"]{ display: none; } .siteseo-inner-tabs ul{ list-style:unset; } .siteseo-inner-tabs { display: flex !important; list-style: none !important; padding: 0; } .siteseo-inner-tab > label { display: block; position:relative; margin-bottom: -1px; padding: 12px 15px; color: #666; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; border-bottom: 2px solid #fff; cursor: pointer; transition: all 0.3s; } .siteseo-inner-tab:hover label { border-bottom: 2px solid #00308F; } .siteseo-inner-tab-content { display: none; color: #777; } .siteseo-inner-tabs-wrap [type="radio"]:nth-of-type(1):checked ~ .siteseo-inner-tabs .siteseo-inner-tab:nth-of-type(1) label, .siteseo-inner-tabs-wrap [type="radio"]:nth-of-type(2):checked ~ .siteseo-inner-tabs .siteseo-inner-tab:nth-of-type(2) label, .siteseo-inner-tabs-wrap [type="radio"]:nth-of-type(3):checked ~ .siteseo-inner-tabs .siteseo-inner-tab:nth-of-type(3) label{ border-bottom-color: #00308F; color: #222; } .siteseo-inner-tabs-wrap [type="radio"]:nth-of-type(1):checked ~ .siteseo-inner-tab-content:nth-of-type(1), .siteseo-inner-tabs-wrap [type="radio"]:nth-of-type(2):checked ~ .siteseo-inner-tab-content:nth-of-type(2), .siteseo-inner-tabs-wrap [type="radio"]:nth-of-type(3):checked ~ .siteseo-inner-tab-content:nth-of-type(3){ display: block; } /* Breadcrumbs seperator */ .siteseo-seperator-btns{ display:flex; gap:4px; margin-bottom:10px; } .siteseo-pro-badge{ color:rgb(133 77 14); background-color: rgb(254 249 195); border-radius: 9999px; padding: 5px 20px; font-weight:500; font-size:0.95rem; line-height: 1.6rem; cursor:pointer; } /*indexing history-table */ .siteseo-history-table{ margin-top: 20px; border: 1px solid #ccd0d4; box-shadow: 0 1px 1px rgba(0,0,0,.04); background: #fff; } .siteseo-history-table th{ background: #f1f1f1; font-weight: 600; padding: 10px; border-bottom: 1px solid #ddd; height:50px; } .siteseo-history-table td{ padding: 10px; vertical-align: top; font-weight:450; border-bottom: 1px solid #eee; height:50px; } .siteseo_wrap_label{ margin-bottom: 15px; } .siteseo-clear-history-btn{ margin-top: 10px; } .siteseo-show-details{ display: inline-block; margin-top: 20px; cursor: pointer; font-weight: 600; } .siteseo-response-code-table{ display: none; margin-top: 15px; } .siteseo-response-code-table.visible{ display: block; } /* promo for rating */ #siteseo-start-promo{ color: #FDCC0D; font-size:20px; text-decoration: none; } .siteseo-rating .dashicons{ font-size: 30px; width: 30px; height: 30px; } .siteseo-rating .siteseo-stars{ display: flex; gap: 8px; color: #FDCC0D; text-decoration: none; } .siteseo-rating{ display: flex; justify-content: center; } .siteseo-rating-tab{ margin-top: 20px; display: flex; flex-direction: column; border-radius: 10px; padding: 10px; background: linear-gradient(135deg, #022448, #034f84); max-width: 400px; } .siteseo-rating-tab p{ color: #ffffff; margin: 10px 0 0 0; text-align: center; width:100%; } .siteseo-need-help{ display:flex; flex-direction:column; word-wrap:wrap; border-radius: 20px; padding: 15px; background-image:linear-gradient(352deg,rgba(255,209,0,0.62) 0%,rgb(254,255,186) 100%); } .siteseo-need-help h3{ font-size:1.3rem; line-height:1rem; margin: 5px 5px 5px 0; } .siteseo-need-help p{ font-size:0.85rem; } /* Components */ /* Buttons */ .siteseo-button{ display: inline-flex; outline: 0; text-align: center; cursor: pointer; padding: 8px 13px; border-radius: 3px; border: 1px solid transparent; transition: all .3s ease; font-weight: 600; text-transform: uppercase; font-size: 11px; text-decoration: none; gap: 8px; align-items:center; justify-content:center; } .siteseo-btn-black{ background: #0f172a; border-color: #0f172a; color: #fff; } .sitesei-btn-black:hover{ background: #e4461b; border-color: #e4461b; } .siteseo-btn-transparent{ background-color:transparent; color: currentcolor; } .siteseo-btn-transparent:active{ outline:0; } .siteseo-100{ width:100%; } .siteseo-tools-page{ margin-left: 2%; margin-top:3% } assets/css/metabox.css 0000644 00000057363 15104342737 0011033 0 ustar 00 /***** metabox ****/ /* Metabox Styles */ .siteseo-metabox-tabs{ display:flex; flex-wrap:nowrap; background-color: #ededed; font-weight:500; font-size:1.05em; } .siteseo-metabox-subtabs{ display:flex; flex-wrap:nowrap; justify-content:center; font-weight:500; font-size:1.05em; } .siteseo-noindex-warning{ color: #EB0F00; margin-right: 5px; cursor:pointer; } .siteseo-metabox-tabs input, .siteseo-metabox-subtabs input{ display:none; } .siteseo-metabox-tab * { box-sizing:border-box; } .siteseo-metabox-tab, .siteseo-metabox-subtab{ display:none; } .siteseo-metabox-tabs > div, .siteseo-metabox-subtabs > div{ cursor:pointer; padding: 20px; display:inline-flex; align-items:center; justify-content:center; text-align:center; user-select: none; } .siteseo-metabox-tabs > div, .siteseo-metabox-subtabs > div{ border-bottom: 2px solid transparent; } .siteseo-metabox-tab-label-active{ border-bottom: 2px solid #00308F !important; color: #00308F; } .siteseo-metabox-tab{ padding: 10px; } .siteseo-metabox-option-wrap{ display:flex; width: 100%; padding: 20px; flex-wrap:wrap; border-bottom: 1px solid #eee; } #siteseo-post-metabox .siteseo-sidebar-tabs, #wpbody-content .siteseo-sidebar-tabs{ display:none; } /* Side bar tabs */ #siteseo-sidebar-wrapper .siteseo-metabox-tabs{ display:none; } #siteseo-sidebar-wrapper .siteseo-sidebar-tabs{ position:relative; display:flex; justify-content:space-between; align-items:center; width: 100%; padding:16px; border:1px solid #e0e0e0; font-weight: 600; cursor:pointer; user-select:none; } #siteseo-sidebar-wrapper .analysis-score > p{ margin: 10px !important; } #siteseo-sidebar-wrapper .analysis-score .siteseo-tooltip{ display:none; } #siteseo-sidebar-wrapper .analysis-score > span{ display:none; } #siteseo-sidebar-wrapper .siteseo-sidebar-tabs:hover{ background: #f0f0f0; } #siteseo-sidebar-wrapper > span{ display:inline-block; } #siteseo-sidebar-wrapper .siteseo-sidebar-tabs-opened span.siteseo-sidebar-tabs-arrow > .dashicons{ transform: rotate(180deg); } #siteseo-sidebar-wrapper .siteseo-metabox-option-wrap{ padding: 5px; gap:10px; } #siteseo-sidebar-wrapper .siteseo-metabox-option-wrap:not(:last-child){ margin-bottom: 10px; } #siteseo-sidebar-wrapper .siteseo-metabox-search-preview h3{ font-size:17px; } #siteseo-sidebar-wrapper .siteseo-search-preview-description{ font-size:13px; } .siteseo-metabox-option-wrap .siteseo-metabox-label-wrap{ flex-basis: 20%; width: 100%; } .siteseo-metabox-label-wrap label{ font-weight: 500; font-size: 1.2em; } .siteseo-metabox-option-wrap > .siteseo-metabox-input-wrap, .siteseo-metabox-option-wrap > .siteseo-metabox-search-preview{ flex-basis: 55%; width: 100%; } .siteseo-metabox-input-wrap .siteseo-tag-dropdown{ display: inline-block !important; color:#00308F !important; background-color:transparent !important; padding: 2px 5px !important; outline: none; height: unset; } .siteseo-search-preview-desktop{ max-width: 652px; width: 100%; border: 1px solid #d8d8d8; padding: 15px; border-radius: 1px; background-color: white; } .siteseo-metabox-search-preview h3{ font-family: arial, sans-serif; font-size: 20px; font-weight: 400; color: #1a0dab; padding:0; margin:5px 0 3px 0; } .siteseo-search-preview-metadata{ display:flex; gap:7px; align-items:center; } .siteseo-search-preview-metadata-link > div:first-child{ font-size:14px; color: #202124; white-space: nowrap; } .siteseo-search-preview-metadata-link cite{ font-size: 12px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #4d5156; font-style: normal; } .siteseo-search-preview-toggle{ text-align:left; margin-bottom: 4px; user-select:none; color: #00308F; font-weight:bold; cursor:pointer; text-decoration:underline; } .siteseo-search-preview-description{ color:#4d5156; font-family: arial, sans-serif; font-size: 14px; } .siteseo-metabox-tags{ display: flex; flex-wrap: wrap; gap: 4px; margin-top:5px; margin-bottom:5px; } .siteseo-metabox-tags button{ outline: none; border: 1px solid #00308F; border-radius: 2px; color: #00308F; background-color:transparent; padding: 2px 10px; } .siteseo-metabox-tags button:hover{ background-color:#f3f3f3; cursor: pointer; } .siteseo-metabox-limits{ display:flex; flex-wrap: wrap; gap: 5px; justify-content:space-between; align-items:flex-start; width: 100%; } .siteseo-metabox-limits-meter{ flex-basis : 65%; } .siteseo-metabox-limits-meter span{ display:inline-block; height: 10px; background: rgb(0,255,46); background-color: #00308F; } .siteseo-metabox-limits-numbers{ flex-basis : 30%; text-align: right; } .siteseo-metabox-readibility-analysis-tab, .siteseo-metabox-seo-analysis-tab{ width:60%; margin:0 auto; margin-top:5px; } .siteseo-analysis-summary{ display:flex; justify-content:center; margin-bottom: 10px; width: 100%; } .siteseo-analysis-summary .siteseo-analysis-summary-pill{ padding: 3px 15px; border-radius: 50px; display:flex; justify-content:space-between; border:1px solid #d3d3d3; gap:10px; } .siteseo-analysis-summary .siteseo-analysis-summary-pill > span{ display:inline-flex; flex-wrap:nowrap; white-space: nowrap; align-items:center; gap:5px; } .siteseo-analysis-summary .siteseo-analysis-summary-pill svg{ width: 12px; } #siteseo-sidebar-wrapper .siteseo-analysis-summary-pill{ width: 100%; } #siteseo-sidebar-wrapper .siteseo-metabox-readibility-analysis-tab, #siteseo-sidebar-wrapper .siteseo-metabox-seo-analysis-tab{ width:100%; margin-top:20px; } #siteseo-sidebar-wrapper .siteseo-metabox-option-wrap > .siteseo-metabox-input-wrap, #siteseo-sidebar-wrapper .siteseo-metabox-option-wrap > .siteseo-metabox-search-preview{ flex-basis: 100%; } #siteseo-sidebar-wrapper .siteseo-metabox-search-preview h3{ text-transform:none; } #siteseo-sidebar-wrapper .siteseo-metabox-option-wrap .siteseo-metabox-label-wrap{ flex-basis: 100%; } #siteseo-sidebar-wrapper .siteseo-metabox-limits-meter{ flex-basis : 100%; } #siteseo-sidebar-wrapper .siteseo-metabox-limits-numbers{ flex-basis : 100%; text-align: left; } #siteseo-sidebar-wrapper .siteseo-search-preview-toggle{ display:none; } @media only screen and (max-width: 700px) { .siteseo-metabox-option-wrap > .siteseo-metabox-input-wrap, .siteseo-metabox-option-wrap > .siteseo-metabox-search-preview{ flex-basis: 100%; } .siteseo-metabox-option-wrap .siteseo-metabox-label-wrap{ flex-basis: 100%; } .siteseo-metabox-limits-meter{ flex-basis : 100%; } .siteseo-metabox-limits-numbers{ flex-basis : 100%; text-align: left; } .siteseo-search-preview-toggle{ display:none; } .siteseo-metabox-readibility-analysis-tab, .siteseo-metabox-seo-analysis-tab{ width: 100%; margin: 0; } } .siteseo-metabox-option-wrap input[type="checkbox"]:focus, .siteseo-metabox-option-wrap input[type="text"]:focus, .siteseo-metabox-option-wrap select:focus, .siteseo-metabox-option-wrap textarea:focus{ border: 2px solid #003399; } .siteseo-metabox-option-wrap input[type="text"]{ width:100%; } .siteseo-metabox-option-wrap textarea{ width:100%; } .siteseo-metabox-option-wrap input[type="checkbox"]:checked::before{ content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e"); background: #00308F;; width: 100%; height: 100%; margin: 0 !important; display: inline-block; } .siteseo-metabox-option-wrap input[type="checkbox"]{ box-shadow: 0 0 0 transparent; border: 1px solid #a4a4a4; border-radius: 4px; cursor: pointer; outline: 0; text-align: center; width: 20px; height: 20px; -webkit-appearance: none; appearance: none; transition: 0.3s all ease-in-out; box-sizing: border-box; padding: 0!important; display: inline-block; } .siteseo-metabox-x-preview{ max-width:600px; max-height:314px; position:relative; border-radius:16px; } .siteseo-metabox-x-image{ width:100%; height:100%; border-radius:16px; } .siteseo-metabox-x-image img{ width:100%; height:100%; object-fit:cover; aspect-ratio: 1.91/1; border-radius:14px; } .siteseo-metabox-x-data{ position: absolute; left: 10px; border-radius: 4px; padding: 2px 10px; bottom: 12px; color: white; background-color: rgba(0, 0, 0, 0.77); width: auto; max-width: calc(100% - 20px); white-space: nowrap; } .siteseo-metabox-x-host{ font-size:13px; color: rgb(113, 118, 123); } .siteseo-metabox-fb-preview{ width: 100%; max-width:600px; max-height:500px; position:relative; } .siteseo-metabox-fb-image{ width:100%; max-height:314px; } .siteseo-metabox-fb-image img{ width:100%; height:100%; object-fit:cover; aspect-ratio:1.91/1; } .siteseo-metabox-fb-data{ background-color:#f2f3f5; padding:10px; border-left:1px solid #dedddd; border-right:1px solid #dedddd; border-bottom:1px solid #dedddd; width:100%; } .siteseo-metabox-fb-host{ font-size:12px; color:#606770; text-transform:uppercase; } .siteseo-metabox-fb-title{ font-size:16px; line-height:20px; font-weight:bold; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp: 2; overflow: hidden; text-overflow:ellipsis; } .siteseo-metabox-fb-desc{ width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #606770; font-size: 14px; line-height: 20px; word-break: break-word; } /**** anlayisis***/ /* Content Analysis */ .analysis-score .siteseo-tooltip { vertical-align: middle; font-size: 0.75em; } #siteseo-metabox-content-analysis .wrap-insights-post .siteseo-tooltip * { font-weight: normal; } #siteseo-metabox-content-analysis .wrap-insights-post .siteseo-tooltip-headings { font-weight: bold; } #siteseo-metabox-content-analysis a { color: #00308F; } #siteseo-metabox-content-analysis a.nounderline, #siteseo-metabox-content-analysis a.nounderline:hover { text-decoration: none; } #siteseo-metabox-content-analysis .wrap-siteseo-analysis { display: inline-block; width: 100%; } #siteseo-metabox-content-analysis .col-left { width: calc(50% - 30px); float: left; margin-right: 30px; } #siteseo-metabox-content-analysis .col-right { float: right; width: 50%; } #siteseo-metabox-content-analysis #siteseo_suggestions { display: inline-block; width: 100%; margin: 0; height: auto; padding: 20px 0; position: relative; left: -5px; } #siteseo-metabox-content-analysis #siteseo_suggestions li { list-style: none; margin: 5px; display: inline-block; } #siteseo-metabox-content-analysis .analysis-score { clear: both; border-top: 1px solid #e2e4e7; display: flex; justify-content: space-between; align-items: center; } .inline-edit-row fieldset label textarea .column-siteseo_score .analysis-score { display: flex; align-content: center; } #siteseo-metabox-content-analysis .analysis-score p, .column-siteseo_score .analysis-score p { font-weight: bold; font-size: 1.2em; } #siteseo-ca-tabs .siteseo-gsc-render { margin: 1rem 0; } #siteseo-ca-tabs .dashicons { vertical-align: middle; margin-right: 1rem; } #siteseo-ca-tabs .siteseo-gsc-verdict .dashicons { font-size: 30px; width: 30px; height: 30px; } #siteseo-ca-tabs .dashicons-yes-alt { color: #4ab866; } #siteseo-ca-tabs .dashicons-info { color: #ffba00; } #siteseo-ca-tabs .dashicons-dismiss { color: #eb0f00; } #siteseo-ca-tabs .siteseo-gsc-analysis { margin-top: 1rem; margin-bottom: 1rem; display: inline-block; width: 100%; } #siteseo-ca-tabs .siteseo-gsc-cat { border-bottom: 1px solid var(--borderColorCard); margin-bottom: 0.5rem; font-weight: bold; padding-bottom: 0.5rem; } #siteseo-ca-tabs .siteseo-gsc-analysis .siteseo-gsc-item { display: flex; } #siteseo-ca-tabs .siteseo-gsc-analysis .siteseo-gsc-item-name { width: 240px; } #siteseo-ca-tabs .siteseo-gsc-analysis .siteseo-gsc-item div { margin: 0.5rem 0; } #siteseo-ca-tabs .siteseo-gsc-summary { display: block; padding: 20px; margin: 20px 0; top: 0; left: 0; } #siteseo-ca-tabs .siteseo-gsc-verdict { font-weight: bold; font-size: 1.2em; } #siteseo-metabox-content-analysis .analysis-score svg, .column-siteseo_score .analysis-score svg { display: inline-block; height: 30px; width: 30px; margin: 0; border-radius: 100%; position: relative; font-weight: 600; shape-rendering: geometricprecision; font-size: 0.5rem; vertical-align: middle; margin-right: 15px; } .column-siteseo_score .analysis-score p, .column-siteseo_score .analysis-score svg { margin: 0; } @keyframes loadingPulse { 0% { stroke: #adc5d2; } 50% { stroke: #00a0d2; } 100% { stroke: #adc5d2; } } #siteseo-metabox-content-analysis .analysis-score .loading #bar { stroke-dashoffset: 0 !important; stroke: #adc5d2 !important; animation: loadingPulse 3s infinite ease-in-out; } #siteseo-metabox-content-analysis .analysis-score .good #bar, .column-siteseo_score .analysis-score #bar.good { stroke: var(--colorSuccess); } #siteseo-metabox-content-analysis .analysis-score .notgood #bar, .column-siteseo_score .analysis-score #bar.notgood { stroke-dashoffset: 101px; stroke: var(--colorWarning); } #siteseo-metabox-content-analysis .analysis-score svg circle, .column-siteseo_score .analysis-score svg circle { stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; stroke: #ccc; stroke-width: 2em; } #tab_siteseo_page_speed .ps-score svg path, #tab_siteseo_ps .ps-score svg path{ stroke-linecap: round; stroke-width: 2.8; fill: none; } #tab_siteseo_page_speed .ps-score, #tab_siteseo_ps .ps-score{ position: relative; display: inline-block; } #tab_siteseo_page_speed .ps-score svg, #tab_siteseo_ps .ps-score svg{ width: 80px; height: 80px; } #tab_siteseo_page_speed .ps-score span, #tab_siteseo_ps .ps-score span{ font-weight: bold; left: 0; position: absolute; top: 0; width: 80px; height: 80px; align-items: center; display: flex; justify-content: center; margin: 0; } #tab_siteseo_page_speed .ps-score.green #bar, #tab_siteseo_ps .ps-score.green #bar { stroke: #4ab866; } #tab_siteseo_page_speed .ps-score.yellow #bar, #tab_siteseo_ps .ps-score.yellow #bar{ stroke: #ffba00; } #tab_siteseo_page_speed .ps-score.red #bar, #tab_siteseo_ps .ps-score.red #bar{ stroke: #eb0f00; } #tab_siteseo_ps .score, .wrap-siteseo-score .score{ width: 12px; height: 12px; display: inline-block; margin-right: 10px; vertical-align: middle; } #tab_siteseo_ps .score.red, .wrap-siteseo-score .score.red{ border-bottom-color: var(--colorAlert); border-bottom-style: solid; border-bottom-width: 12px; border-left-color: rgba(0, 0, 0, 0); border-left-style: solid; border-left-width: 6px; border-right-color: rgba(0, 0, 0, 0); border-right-style: solid; border-right-width: 6px; } .wrap-siteseo-score small{ font-size: 12px; } .wrap-siteseo-score small.red, .wrap-siteseo-score small.yellow{ color: #eb0f00; } #tab_siteseo_ps .score.yellow, .wrap-siteseo-score .score.yellow{ background-color: #ffba00; display: inline-block; } #tab_siteseo_ps .score.green, .wrap-siteseo-score .score.green{ border-radius: 100%; background-color: #4ab866; } .wrap-siteseo-score small.green{ color: #4ab866; } .wrap-siteseo-score .score.null{ background: #ccc; border-radius: 100%; } #siteseo-metabox-content-analysis .siteseo-analysis-block{ clear: both; } #siteseo-metabox-content-analysis .siteseo-analysis-block-title{ display:flex; align-items:center; gap: 10px; position: relative; } #siteseo-metabox-content-analysis .siteseo-analysis-block .impact.good svg{ fill: #4ab866; width: 14px; height: 14px; } #siteseo-metabox-content-analysis .siteseo-analysis-block .impact.low{ fill: #ffba00; width: 14px; height: 14px; } #siteseo-metabox-content-analysis .siteseo-analysis-block .impact.medium{ fill: #e39f48; width: 14px; height: 14px; } #siteseo-metabox-wrapper .impact.high, #siteseo-metabox-content-analysis .siteseo-analysis-block .impact.high{ fill: #eb0f00; width: 14px; height: 14px; } #siteseo-metabox-content-analysis .siteseo-analysis-block-content .impact.high{ fill: #eb0f00; box-shadow: none; color: #fff; padding: 2px 4px; margin-left: 5px; border-radius: 4px; font-weight: bold; } #siteseo-metabox-content-analysis .siteseo-analysis-block .impact.warning{ fill: #ffba00; width: 14px; height: 14px; } #siteseo-metabox-content-analysis .siteseo-analysis-block .impact.warning{ fill: #e39f48; width: 14px; height: 14px; } #siteseo-metabox-wrapper .impact.error, #siteseo-metabox-content-analysis .siteseo-analysis-block .impact.error{ fill: #eb0f00; width: 14px; height: 14px; } #siteseo-metabox-content-analysis .siteseo-analysis-block-content .impact.error{ fill: #eb0f00; box-shadow: none; color: #fff; padding: 2px 4px; margin-left: 5px; border-radius: 4px; font-weight: bold; } #siteseo-metabox-wrapper .description, #siteseo_pro_cpt .description, #siteseo-metabox-content-analysis .description, .siteseo-option .description{ display: block; font-size: 12px; color: #757575; } @media only screen and (max-width: 782px){ #siteseo-metabox-wrapper .description, #siteseo_pro_cpt .description, #siteseo-metabox-content-analysis .description, .siteseo-option .description{ word-break: break-word; } } #siteseo-metabox-wrapper input~span.description, #siteseo-metabox-wrapper span.description~input, #siteseo-metabox-content-analysis input~span.description, #siteseo-metabox-content-analysis span.description~input, #siteseo_pro_cpt input~span.description, #siteseo_pro_cpt span.description~input { margin-top: 5px; } #siteseo-metabox-content-analysis .siteseo-analysis-block-title{ display:flex; justify-content: space-between; align-items: center; position: relative; background: #fff; color: #1e1e1e; width: 100%; border: 0; margin: 0; padding: 15px 5px; line-height: unset; text-align: left; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 300ms linear; } #siteseo-metabox-content-analysis .siteseo-analysis-block-title > div{ display:flex; align-items:center; gap:10px; } #siteseo-metabox-content-analysis .siteseo-analysis-block-title span{ display:inline-block; } #siteseo-metabox-content-analysis .siteseo-analysis-block-title:hover{ background: #f3f4f5; } #siteseo-metabox-content-analysis .siteseo-analysis-block-title:focus{ color: #191e23; border: none; box-shadow: none; outline-offset: -2px; outline: 1px dotted #555d66; } #siteseo-metabox-content-analysis .siteseo-analysis-block-title .siteseo-arrow::after{ content: "\f343"; font-family: "Dashicons"; } #siteseo-metabox-content-analysis .siteseo-analysis-block-title.open .siteseo-arrow::after{ content: "\f347"; } #siteseo-metabox-content-analysis .siteseo-analysis-block-content{ padding: 0 1rem 0.5rem 1rem; display: none; width: 100%; border-top: 1px solid #e2e4e7; } #siteseo-metabox-content-analysis h3{ margin: 0; font-size: 1em; } /* width */ .siteseo-activity-panel-wrapper::-webkit-scrollbar, .siteseo-tag-variables-list::-webkit-scrollbar, .siteseo-metabox-panel-holder::-webkit-scrollbar { width: 10px; border-radius: 10px; } /* Track */ .siteseo-activity-panel-wrapper::-webkit-scrollbar-track, .siteseo-tag-variables-list::-webkit-scrollbar-track, .siteseo-metabox-panel-holder::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; } /* Handle */ .siteseo-activity-panel-wrapper::-webkit-scrollbar-thumb, .siteseo-tag-variables-list::-webkit-scrollbar-thumb, .siteseo-metabox-panel-holder::-webkit-scrollbar-thumb{ background: #888; border-radius:10px; } /* Handle on hover */ .siteseo-activity-panel-wrapper::-webkit-scrollbar-thumb:hover, .siteseo-tag-variables-list::-webkit-scrollbar-thumb:hover, .siteseo-metabox-panel-holder::-webkit-scrollbar-thumb:hover{ background: #555; } #siteseo-metabox-content-analysis h4{ padding-bottom: 0.5rem; text-transform: uppercase; font-size: 0.85em; position: -webkit-sticky; /* Required for Safari */ position: sticky; top: 0; background: #fff; } .siteseo-stripes{ background-image:linear-gradient(45deg, var(--primaryColor) 25%, transparent 25%, transparent 50%, var(--primaryColor) 50%, var(--primaryColor) 75%, transparent 75%, #fff); background-size: 15px 15px; animation: siteseo-moving-stripes 10s linear infinite; } @keyframes siteseo-moving-stripes{ 100% { background-position: 100% 100%; } } #siteseo-metabox-content-analysis .wrap-analysis-img ul{ display: flex; flex-wrap: wrap; } #siteseo-metabox-content-analysis .wrap-analysis-img ul li{ padding: 0; text-align: left; cursor: default; user-select: auto; } #siteseo-metabox-content-analysis .wrap-analysis-img h4{ border-bottom: 1px solid #dcdcde; padding-bottom: 10px; } #siteseo-metabox-content-analysis .wrap-analysis-img ul li img{ max-width: 150px; max-height: 150px; object-fit: cover; border: 1px solid #dcdcde; cursor: default; padding: 1px; } #siteseo-metabox-wrapper .dashicons, #siteseo-analysis-tabs .dashicons, #siteseo-readibility-tabs .dashicons{ vertical-align: middle; } #siteseo-analysis-tabs, #siteseo-readibility-tabs{ clear: both; } #siteseo-metabox-content-analysis .dashicons-no-alt, #siteseo-metabox-content-analysis .dashicons-yes, #siteseo_pro_cpt .dashicons-no-alt, #siteseo_pro_cpt .dashicons-yes{ color: #fff; background: #4ab866; border-radius: 50px; margin-right: 10px; } #siteseo-metabox-content-analysis .dashicons-no-alt, #siteseo_pro_cpt .dashicons-no-alt{ background: #eb0f00; } #siteseo-metabox-content-analysis .dashicons-thumbs-down{ color: #eb0f00; margin-right: 10px; } #siteseo-metabox-content-analysis .dashicons-thumbs-up{ color: #4ab866; margin-right: 10px; } /**** metabox suggestion btn ***/ .siteseo-search-box-container{ position: sticky; top: 0; background-color: white; padding: 10px; border-bottom: 1px solid #ccc; z-index: 2; } .siteseo-suggestions-container{ max-height: calc(300px - 50px); overflow-y: auto; overflow-x: hidden; padding: 5px; } .siteseo-suggetion .search-box{ width: 100%; padding: 5px; box-sizing: border-box; border: 1px solid #ccc; border-radius: 5px; } .siteseo-suggetion .section{ color: rgb(4, 4, 4); padding: 8px; font-weight: bold; font-size: 12px; border-bottom: 1px solid #eee; cursor: pointer; } .siteseo-suggetion .tag{ color: #000; display: inline-block; background-color: #f0f0f0; padding: 5px 10px; border-radius: 5px; font-family: monospace; margin-top: 5px; word-break: break-word; } .siteseo-suggetion .section:hover{ color: #fff; background-color: #003399; } .siteseo-suggetion .section:hover .tag{ background-color: #fff; } .siteseo-option .wrap-tags{ margin: 10px; display: flex; gap: 10px; } .siteseo-option .wrap-tags button{ margin-bottom: 10px; } .wrap-tags button{ margin-bottom: 10px; } .wrap-tags{ position: relative; display: inline-flex; align-items: center; gap: 10px; margin: 0; } .siteseo-tag-select-btn{ width: 24px; height: 25px; color: white; background-color: #003399; border-radius: 5px; border: 1px solid #666666; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color 0.3s, color 0.3s; padding: 0; margin: 0; } .siteseo-suggetion{ position: absolute; top: 100%; left: 0; width: 250px; top: 10px; left:-36px; border: 1px solid #ccc; border-radius: 5px; height: 300px; background-color: white; z-index: 1000; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); display: none; margin-top: 5px; overflow: hidden; } .siteseo-metabox-input-wrap{ position: relative; } .siteseo-metabox-tags{ display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } #siteseo-metabox-content-analysis .siteseo-metabox-tab{ display: none; } #siteseo-metabox-content-analysis .siteseo-metabox-tab-label{ cursor: pointer; } #siteseo-metabox-content-analysis .siteseo-metabox-tab-label-active{ font-weight: bold; } /*** tags ***/ #siteseo_tags_wrapper{ display: flex; flex-wrap: wrap; gap: 5px; padding: 5px; border: 1px solid #ccc; border-radius: 5px; } #siteseo_analysis_target_kw_meta{ border: none; outline: none; flex: 1; min-width: 150px; } .siteseo-tag{ display: inline-flex; align-items: center; background-color: #808080; color: white; padding: 5px 10px; border-radius: 5px; font-size: 14px; margin: 2px; } .siteseo-remove-tag{ margin-left: 10px; cursor: pointer; font-weight: bold; color: white; } kbd { background-color: #f7f7f7; color: #222325; border-radius: 0.25rem; border: 1px solid #cbcccd; box-shadow: 0 2px 0 1px #cbcccd; cursor: default; font-family: Arial, sans-serif; font-size: 0.75em; line-height: 1; min-width: 0.75rem; text-align: center; padding: 2px 5px; position: relative; top: -1px; } kbd:hover { box-shadow: 0 1px 0 0.5px #cbcccd; top: 1px; } assets/css/cookies.css 0000644 00000003576 15104342737 0011025 0 ustar 00 #siteseo-cookie-bar .siteseo-cookie-bar-content{ display: flex; flex-direction: column; align-items: center; gap: 5px; } #siteseo-cookie-bar{ position: fixed; z-index: 9999; width: 100%; padding: 15px 20px; display: flex; justify-content: center; align-items: center; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); text-align: center; box-sizing: border-box; display: none; } .siteseo-cookie-bar-bottom{ bottom: 0; left: 0; } .siteseo-cookie-bar-middle{ top: 50%; left: 50%; transform: translate(-50%, -50%); width: auto; } .siteseo-cookie-bar-top{ top: 0; left: 0; } .siteseo-cookie-bar-backdrop{ position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 9998; display: none; } .siteseo-cookie-bar-button{ padding: 10px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 14px; margin: 5px; } #siteseo-cookie-bar-accept{ background-color: var(--primary-btn-bg, #0073aa); color: var(--primary-btn-text, #ffffff); } #siteseo-cookie-bar-accept:hover{ background-color: var(--primary-btn-hover-bg, #005f8d); color: var(--primary-btn-hover-text, #ffffff); } #siteseo-cookie-bar-close{ background-color: var(--secondary-btn-bg, #e0e0e0); color: var(--secondary-btn-text, #000000); } #siteseo-cookie-bar-close:hover{ background-color: var(--secondary-btn-hover-bg, #c4c4c4); color: var(--secondary-btn-hover-text, #000000); } #siteseo-cookie-bar-manage-btn{ position: fixed; bottom: 20px; left: 20px; z-index: 9999; cursor: pointer; padding: 10px 15px; border-radius: 5px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); display: block; text-decoration: none; transition: background-color 0.3s ease; } #siteseo-cookie-bar-manage-btn:hover{ background-color: var(--primary-btn-hover-bg, #005f8d); color: var(--primary-btn-hover-text, #ffffff); } .siteseo-cookie-bar-buttons{ display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 10px; } assets/css/onboarding.css 0000644 00000013545 15104342737 0011510 0 ustar 00 :root{ --baseColor: #141b38; } :root *{ box-sizing:border-box; } html, body { height:100%; padding: 0; margin :0; } body{ background-color: #fff; background-image: radial-gradient(#5b5b5b66 0.5px, #fff 0.5px); background-size: 20px 20px; background-position: 0 0,10px 10px; font-family: Verdana, sans-serif; } #siteseo-onboarding-root{ display:flex; height:100%; } #siteseo-onboarding-root .siteseo-onboarding-nav-wrapper{ box-sizing:border-box; width:23%; height: 100%; padding: 10px; } #siteseo-onboarding-root nav{ display:flex; flex-direction:column; justify-content:space-between; background-color:var(--baseColor); height:100%; width:100%; border-radius: 10px; padding: 20px; } #siteseo-onboarding-root nav .header{ display:flex; justify-content:space-between; align-items:center; } #siteseo-onboarding-root nav .footer{ text-align:center; color:#c0c0c0; font-size:0.9rem; } .siteseo-onboarding-nav-wrapper nav .steps{ margin-top: 2em; } .siteseo-onboarding-nav-wrapper nav .step { position:relative; display:flex; padding: 20px 0; color:white; } .step-milestone::after{ content: attr(data-step); border: 2px solid rgba(220, 220, 222, 0.4); border-radius: 100%; width: 24px; height: 24px; position: relative; background: #141b38; line-height: 24px; color: #fff; display: inline-flex; align-items: center; justify-content: center; margin-right: 10px; z-index: 2; } .step-info{ display: flex; flex-direction: column; gap:2px; align-items: flex-start; } .step-info .description{ color: #c0c0c0; font-size:0.8rem; } .step.active:not(:last-child)::after{ background: rgb(255, 255, 255); background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(20, 27, 56, 1) 100%); } .step.done:not(:last-child)::after{ background: rgb(255, 255, 255); } .step.done > .step-milestone::after{ content: "\f15e"; font-family: "dashicons"; color: #fff; background: var(--baseColor); border: 2px solid white; } .step:not(:last-child)::after{ content: ''; position: absolute; height: 80px; width: 2px; background: #7575755e; z-index: 0; left: 13px; top: 35px; } main{ display:flex; width:70%; overflow:auto; } main { scrollbar-width: thin; /* For Firefox */ scrollbar-color: transparent transparent; /* For Firefox */ } .siteseo-onboarding-content{ width:80%; margin: auto; padding: 60px; height: 100%; } .siteseo-step-is-welcome{ align-items:center; margin-top:20%; text-align:center; } .siteseo-step-page{ display:none; } .siteseo-step-active{ display:flex; flex-direction:column; } .siteseo-btn{ display: inline-flex; padding: 0.5rem 1rem; gap: 0.5rem; justify-content: center; align-items: center; border-radius: 0.375rem; font-size: 0.875rem; line-height: 1.25rem; font-weight: 500; white-space: nowrap; cursor:pointer; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); border:none; text-decoration:none; } .siteseo-btn:disabled{ pointer-events: none; } .siteseo-btn.primary{ background-color:var(--baseColor); color:white; } .siteseo-btn.secondary{ border: 1px solid var(--baseColor); color:var(--baseColor); background-color:transparent; } .siteseo-radio-input{ display:flex; gap:10px; width:100%; } .siteseo-radio-input label{ padding:8px 10px; border:2px solid #3d5afe; border-radius:7px; font-weight:500; cursor:pointer; } .siteseo-radio-input label:hover{ box-shadow: 0 0 0 0.1rem rgba(61, 90, 254, 0.4); } .siteseo-radio-input input{ display:none; } .siteseo-radio-input input:checked + label{ box-shadow: 0 0 0 0.20rem rgba(61, 90, 254, 0.4); } .siteseo-onboarding-import-info{ display:none; flex-direction:column; gap:20px; margin-top:10px; align-content:flex-start; } .siteseo-onboarding-import-info summary{ cursor:pointer; user-select:none; } .siteseo-onboarding-import-info button{ align-self:flex-start; } .siteseo-onboarding-msg{ display:none; font-weight:400; font-size:14px; margin:0; } .siteseo-onboarding-msg-success{ color:green; } .siteseo-onboarding-msg-error{ color:red; } .siteseo-onboarding-content-footer{ display:flex; justify-content:flex-end; gap: 10px; margin-top:2.5rem; padding: 20px 0; border-top:1px solid #ededed; } .siteseo-input-block{ display:flex; flex-direction:column; gap:8px; margin-top:32px; } .siteseo-input-block label{ font-weight:500; font-size: .875rem; line-height:1; } .siteseo-input-block input[type="text"], .siteseo-input-block select, .siteseo-input-block textarea{ display: flex; padding: 0.25rem 0.75rem; border-radius: 0.375rem; border:1px solid hsl(240 5.9% 90%); width: 100%; font-size: 1rem; line-height: 1.5rem; height:2.25rem; background-color: transparent; transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 300ms; box-shadow: 0 0 #0000, 0 0 #0000, 0 1px 2px 0 rgba(0, 0, 0, .05); } .siteseo-input-block input[type="radio"]{ display:inline; } .siteseo-input-block textarea{ height:unset; } .siteseo-input-block input[type="text"]:focus-visible, .siteseo-input-block select:focus-visible, .siteseo-input-block textarea:focus-visible{ box-shadow: 0 0 1px 1px hsl(240 5% 64.9%); outline: 2px transparent; } .siteseo-input-block p.siteseo-input-description{ margin:0; font-size:0.8rem; color:#71717a; } #siteseo-onboarding-img-holder{ background:transparent; outline:none; border:2px dashed #ededed; border-radius:6px; width: 400px; height:12rem; cursor:pointer; } #siteseo-onboarding-img-holder img{ width:100%; height:auto; max-height:100%; } .siteseo-radiogroup{ display:flex; flex-direction:column; gap:8px; } .siteseo-radiogroup label{ font-weight:400; font-size: .875rem; } .siteseo-spinner{ display:none; border-radius:50%; animation: siteseo-spinner 1s linear infinite; height: 0.9375rem; width: 0.9375rem; border: 2px solid #dddcdc80; border-left-color: #e3e3e3; } .siteseo-spinner-active{ display:inline-block; } @keyframes siteseo-spinner{ 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } assets/css/admin-bar.css 0000644 00000005571 15104342737 0011220 0 ustar 00 .siteseo-navbar{ margin: 0; display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background-color: white; border-bottom: 1px solid #e0e0e0; position: sticky; top: 32px; width: 100%; z-index: 1000; } .siteseo-navbar .logo{ display: flex; align-items: center; } .siteseo-navbar .logo img{ height: 30px; } .siteseo-navbar .breadcrumb{ display: flex; align-items: center; margin-left: 10px; } .siteseo-navbar .breadcrumb a{ text-decoration: none; font-weight: bold; color: grey; font-size: 13px; } .siteseo-navbar .breadcrumb a.active{ font-weight: bold; color: black; } .siteseo-navbar .breadcrumb span{ margin: 0 5px; color: grey; } .siteseo-navbar .links{ display: flex; align-items: center; } .siteseo-navbar .links a{ text-decoration: none; color: #0033a0; font-size: 12px; font-weight: bold; margin-right: 20px; } .siteseo-navbar .links .support{ background-color: #0033a0; color: white; font-weight: bold; padding: 5px 15px; border-radius: 5px; height: 25px; display: flex; align-items: center; justify-content: center; } /* dash line */ .siteseo-dashline{ border-top: 1px dashed #e0e0e0; width: 100%; } /* tooggle btn */ .siteseo-toggle-cnt{ display: flex; align-items: center; } .siteseo-toggle-Sw{ position: relative; width: 47px; height: 20px; background-color: #ccc; border-radius: 20px; cursor: pointer; margin-right: 10px; transition: background-color 0.3s; } .siteseo-toggle-Sw::before{ content: ''; position: absolute; width: 24px; height: 24px; background-color: white; border: 2px solid #ccc; border-radius: 50%; top: -4px; left: -2px; transition: 0.3s; } .siteseo-toggle-cnt span{ font-size: 14px; color: #555; font-weight: bold; } .siteseo-toggle-Sw.active{ background-color: #003399; } .siteseo-toggle-Sw.active::before{ left: 27px; border-color: #003399; } .siteseo-arrow{ margin-right: 5px; font-size: 14px; color: #555; font-weight: bold; } .siteseo-toggle-cnt p{ font-style: italic; font-size: 11px; font-weight: normal; } .siteseo-arrow-icon{ font-size: 10%; margin-top:7px; margin-right:3px; } .siteseo-option{ background-color: white; } /* sitseo btn */ .siteseo-button{ background-color: #003399; color: white; padding: 15px 30px; border: none; border-radius: 5px; font-size: 16px; cursor: pointer; } .top-line{ width: 100%; height: 1px; background-color: #d1d1d1; margin-bottom: 2%; } /** toogle for post and pages */ .siteseo-toggle-meta{ position: relative; width: 47px; height: 20px; background-color: #ccc; border-radius: 20px; cursor: pointer; margin-right: 10px; transition: background-color 0.3s; } .siteseo-toggle-meta::before{ content: ''; position: absolute; width: 24px; height: 24px; background-color: white; border: 2px solid #ccc; border-radius: 50%; top: -4px; left: -2px; transition: 0.3s; } .siteseo-toggle-meta.active{ background-color: #003399; } .siteseo-toggle-meta.active::before{ left: 27px; border-color: #003399; } assets/css/header.css 0000644 00000001067 15104342737 0010612 0 ustar 00 #wpadminbar .siteseo-noindex-warning, #wpadminbar .siteseo-noindex-warning:hover, #wpadminbar .siteseo-noindex-warning:focus, #wpadminbar .siteseo-noindex-warning *:hover{ background-color: #dc3232 !important; color: #ffffff !important; height: 100%; display: flex; align-items: center; } #wpadminbar .siteseo-noindex-warning .warning-container{ display: flex; align-items: center; padding: 0 10px; height: 100%; } #wpadminbar .siteseo-noindex-warning svg{ margin-right: 6px; vertical-align: middle; } #wpadminbar .siteseo-noindex-warning .ab-item{ height: 100%; } assets/img/social-placeholder.png 0000644 00000520052 15104342737 0013074 0 ustar 00 �PNG IHDR � t ��M sRGB��, pHYs �� ��IDATx���b�8������<���s#���h�3�����ć@0kz�����j�*�����_� gŧ� 7�u�b�K�>��Ģ��P��8��dreί��]?��^�x�m�s��_����Z�Z磯"�B�cL9w�ȿA������?��*��u�N��������+�?sn�u�nk}��s)33�r>m�S���c�i�/�k�A (��r���A&Y�8�n/~�9���Ef�+�S|/���u"r�.��i�s�#�G�T&�;xMͺw��:'W����|f�����~�D�D���h���qpN~�~Bu ����O��9H�>ʹ����#�o 0���Ϗf�{�G�4������I�ܰ��O��{�-"I�ٹ�;/)�y\<ޤ�Y��`x��OҊx�~��z�<�W�}k\��19� B$2�l�_Ut��� ��$���[YM�V�i2@C1�Lh&�|�LX��b��D��m&���w#���BVL�g:ON�ی(d�0S�@683�6�Y�#��S3���N������w�8�?>q��T7����{���%��r����?��_5>6x�;}ҏzL(iʨOP~���©��6&p��5����E ��i��)�<��SÁ�ѽ�}5�#@K}��NI�! ͙!�λ�cH����oO�q�k<z�]����*dkSo�N�A��#x����)C��\������ �g�?�+�~��:B�%S��S?=hnH�"�"%BX��{��I���i��f��̭h�3��Mt� �Ս��u���پ��͙\ ��Y�֨�50�U�|�ڀ����@�˩���-̻�����h�{�p�a�%�X�0�c"��qvz�c�7���~���,�aY�#���obFʠ�tz�{��� ߧ��O?���]��!(�j����d��-l?���B�i�\}��ݘ b�v��4�Ί"�{�#�$� _�a�Z�ꝺA!���4A_�"� z�L�b�AZ�Z�м���a�9���p֬b��A6ȏ�3����ր"��'\$��>%>8�����`|�^&6�h��0�$���B�"�yg�r`I��'$�v ��&���ل�Yo�v29�+��gd� p�Á�I[9A�(��=UF�$��u:Qb�"8U8J���O�f���[{�a�9�W8B�N;������%��<�m�L�TZǫ�֙ -D����� ���sR��T�pN�ھW�9��;p�kp�_�w4NA��(�+�ߡn��I��$K�)(�Zl�D���}�gB���(����}2q� r�һOp�+6�YJ���� �dc�`vIX�� W\\}�e�! �e���+�GU�=Z�x"o�-�]C�V���io��^��QQ~+p&%;�0�/��o��p��_�hi� ��0^8�Bbp�ӭ��|����~��T[T4�ͫ�o��e��!�\�݃ qJQ���8��q�<)�����9���&���9��` O� ��o0 }!���t�E�uv�a��5ͻ��(��m�8<�;�� ��^��1�Dei?��S�R68&�/�<�,^�~��%�P�D֔��Ճ�����{��S��Y�L��Goj�aO�����`����]4m�M� ��QG3f�T�.��"�h"���vw�x�]� i\y0�T��3�!��5!��!<�5��$�>n��J��w er1F�6��tL g���aѬcYҫhX���s��,i�* �[���wO�9Ӄ�ZR)N����6%wp�[���02���q�-��e�Z$�H�'W�GsQ��j� �����I�����p����/� �n)���!`)824Aκj�V�gJ,�z��h��_/�5���P�W"ѥ7��&[�=H0�0f����C��曄�p6q��XX�4I� l������3,uA�r>io1����G��N^�<Q���T�B���E��mZ��I���k=����Z~��� �Ȫۻsj4m�(���H�?p�����9�ޜ2�-�# ®�,9Vz�P��zp`!\��Q3�O�F̊)�OQ��m�6(NO�غP3|��t&o��/�% ŗS9_��'-�hb��M�0���>I|h��<Z�Asܔ�Lޘ8�5n�n֧��VbSS��I�A2��"���x��a"�v�9\�2!� zjQ0�7�\���$��t���Mc����3�@UŁ�% ۳�I縜d�8٠��"��D�B(��Fq�m�f���+�u>F�p���M�F&����"�)���B���*���%�����ؿcyᱼ�:8�� .�r�:�N9a�^EJF�"|��Bl�1� �n�q�k욬�� *Go���@�h���R���m#�c�q���C�B�2ųW;��ޢ:�� t~57�����KA��R���=����t[:����ks��B�qh���p�LDr�� cL�P��~t4kyD���3wLD%�=cW���h.����A�s�uq�Ġ�9&�l!Mϑ�2�]4��t,P��P�Mܐ:�5v����/�W��p��b��AN��Yܾ˫gQ�}�`aMBB(d� |)�AF�y��B�0�B���aB7hڃ�/z��}��R1Iw�d���� �!��d�e8,!<�� ���dv���� u$�]�8��N��W8#�A��S��q�l����䠳��sX.`��� �N3�R5�Ӄ���Y�< Ǯ�71�Q�Xט��J�7��nt��u�A��5U8; ��Ș�nEB�"��EH�*�=n.J���_����B�cR\r�vI��(�|�AQyH"��&%Ȱ~�$��U��l��MeN,�òAv��%0L7w��}����� ����d � �\��oR�E�pt�*x�8���0��� �w4d՛�`W`]qx$�Nab�����)[� ��6n*`k8�x�l����ET�w�8T&XEk����Y$�<��H��&!,�ܖ+~]�J����`�;�ճW�H4���R��9_x��v���Z��v�L�vo~}�j���k#t�i8 ��bs�9gCk���-a�b�p���Y�bKEaJ�6l�Օ�������N:�"�&�~�\ X[(�i>��L*v��/��S6����-�Đ.s�R�w�HDJ6��<�*3o$�'��N?"eXj��?f��!���/�}��t�j��.�H6k������k-;mB��8L<OD:H�A��w���$��;=��u�P��m�[��`���S�=� �7ɞlp=@�qYlA�/D�d-��rB�+5�A���f��u$������azn�X�}��SLw��'}<IH���=r��p�ɵa��"�8���Kr�Y��a��v2ǽ����N� ��m��9�~�|�h�#t*�q��'*�"��3P�+^�/y��J��я���}���@1�>!"�2�b��)@5� 39��T`��s�%<��ik��l�A�8�N��c0�Yr���v�h �L���Ȝ~µ B߯��/x2R�6�~�d1���\xӖ��RCr�j�G]y�DŽ�ǚ���kX#lͷ©f&�U��즗���fH ���'��>���z�[�4V2�,$L�'ǽƏ��Ƅ��|�i�,=�v�$W�f�cV���VL�_dh���V��J��!o�ph��v�u��a�P>!"��{���ҏ6Td0"9 �$��[�W���� ���]�c��v�]܃�C'|���˰{o���}t�zU'\�_AW��l�0[�B6�)��2�����C]�H�q�cU��}�B�р�X���[G������g_W;������lV�0.R�r���� ~��]����R�ư�q���y�)��!�K'�C����%�& Lb�v=U�"�!,�Y� ��B�_ p���� a�ޭy�~����"R�P]��tV�W4jn%��Z�S>�=����*oƯ�bq]ܞ�ʒ��H������F�� > �J �@��´�fy���8!�8}u�sL��}�pR7c���]�<�� ��X�g G�2s��D��Fh�S��u�b�5��9,��t���Q�� g�`��x�Z�N�yl<�\X�@��V�R����?�#���N0�+�.�Ԭ���aV2�Tq\e���=a H�`9�z�j+G22Ö�ԉ'!��_��D�l)\�<0�%�a��R��T���p'�Ic�є� k�����{{�c,^/@��j� o/1�6�Px�ۃ�?2-��x����6��}@�p��{5�S��� 0��zV>�=�Q�_*���^DnA�X~�okҒsXn� bk��*�A���i.j1tv��JK�̤�r��p���5�(�$�eƘ�d�#�A�`L0O�Lٚ�Z�i[���2�mZ�~�a�"����c@ ����[1K)~�r��L�7��X.�� �z��/�m�(b��5>++��*���$�kA��Z���&-s��~:�{�2e& ����)'8�� O��E-,�<�?y��|�^���c�0F8ڗd����8��v��,x��f ��A�K�HH�{���4��F���Ǧ�t�#�����J�B�:�b�f�V��!���$��K�g�?+i���p�QP��`�5��o0EN����{��E-����}�¢D��y6�nY��Ŷ�w7�ɴ[�� �lS�W5n>��=�wVP� ԓ�F_�W�א�<�̾��8�^c��:����<��TϱsL�H���T�4�'i��T�ꫯ��ѽ��<�p*9Ϧf�������F<��v��K���k쟩�\�D�o��^L1�XU8�6�3��ô�l�Fơ�>Q��1�d�Yi ��}=N��ctO��v~{S�i_v�Ÿq(f�s���[T��#�(DO �3���q�-�=zNw'PN5�=�\$�Eͽ�{�WN�^J����-�|�}]�j�8�k�=�&N��1� ������o��i�q�v�G�@;��WG�N�eC�]�:�A��>�hYڹ�r'�sLn�E���ՃS;o��E��7��2��-35-#]�B�:��r&���%��h��A�3�5�Y�+o%���h,,���gzp�d��X���R��-����8�� |c�I�!L}/���Q{@٫� =�"�4�Rd�T�`x�bf��M��u�,Q��Z)8`�˂ڠ�hl#4j�_��`K�Z�蔎y���Wx���[@�c�W/�{������tܲ�In�B��9,��Bd��=�\� ����E�3g���CX��>��� cn~�4�f>���,)��\�#7��'��y���f ��q� ٙ� ?ۿ�>QP?*oR�x G��#���Ԧ�i-.v �|�}WA[��9Ւ^�fsK��9��]ҍ��ՃLe��&j���^�X��[ �z��G� �za�gb��vrt�'>ɇ�@{���t���q��o!�|�{��;z<� G���:U<���zЕ/��n���+�Jr�I�E �ͯ_s��f��-]�1=� .(�9�S�*�R�pn�$WW������Ol���ni�\�!k���L���T�j�ylPJ���lc2r��W$����J�N�*L���А�7 B-��>���97 �6e��5AH3W�0�y�D��W�f�5��A��ݳ~��`�����{�~ ̐K<B(؋:���тB[��$��a������f�(-����ڗ�'-�a��� �qB4��+��k�w�- �s�.�ͫ��XL�� BҒ���o��(�h�%ʲ����P1j9!��V�i��8u#| D��i5m�$ P�E���M�3���D��MK���� ��{Uנ��t�����Hl����B=���ށ�-�ʀ�Z&�Wk�]BȈ���҃�^Wn�#����b�XOQ[Hw+P��b��R���E��<s? �s�ے^�.��#�G.��+��FxP����w����=l��'-�1�tӃ�%Q���Ű�klw���a!���;r�>�I6K8�ѱ-e�p���5q ^֗�KW$�����=�J��¡9���ń�wJ�a���R�e���\a���%��\�LEv��Q�HO��4S�8�I?��w�&!Ű��j�%UM5� O*�WO���*[z�͔j8a��#����T�7�z�(��~����>���5v>s?�Э���s*qu���]7�t�]�s!�f^�sXn��@����5@v�� ꀲ*�?�u�Q���+Uw�妼e��pH8��^".]��j��恔'�_яXm�� ^v���N����)s�38�U�*.��tt.NB8����wݑi��`�Gc�X��' ���ŜK��٧�>& ���_���&�h��I�����\.�!���Tp.h>�c��Ыes�='���%���D$'�sr?d�5�M�crS���:�ͷR�z�ܺ"�/�6 �@�z�y�-$5sȯ�F��Qb��N\��}<V$� >�������@���y� 9o�H�c�F��7DŽ�] ��˻��m��=�{��\4�z�aI_bP���Oě�ۭ<>�<�(��m�����?�;B��6��ϯN�kl�|<S��v�ӎ�������� ����)�Rr3v+���R �h g w��8��p�l:��,�'����_cJ|��6��/�V�K���靹���L�~��HX�H3 ƺ\��,�=hY��u !Ú=ڽ�J*c���^Z�ZX��c�8��S�e��.!��m����}�NJ�Z>D�E�&����� <a��zhz]��Ft@!�s��$|q� �ӛ�e��sx�� ���Ej�H��p���̀{��g@4�<� ��;�`.��[���G���8���PJFkt�E�����ښ�һ�n^�PV���:ϧ��p�^��� ��@euB�Y�!kNi[;Z}�άj���k��A��r��l�u��0�"V��������p� ��p_Q���`��>ߖ)ΰ�91I���*[E,��:e�C�� t��_/^�l�E�$�f�g&��ooJ?&dr� 5L�� �mGeE8X�?��O�?�rjq f # f:�1J�q���[��rm�;梓K��>�J��c�@{O���op�Ŧa2��;�\{�ń�=Υ}�J��� !���N� �o;�FsHXZ8�?�C��Z�����c7�/F�P��?�J%�B�ڵ�\�����T�xb(=��o[��V<���:"�g��ՃzOq��xwl��Ӌ>��l8*�4����9}q��F�P��I� ���·���o ��&���q�RR���m� _�:a����уz��(YO9�Ir���� @����>�2�6�� ���Z���1� S(f_T���ˠ�oB��$��!�J82������{x� �����O��O�W�R=6�~C�pC��?�E�ߪ�A����;V��t���k.ʪ��o�./ �$x�} �<�����̶�řƞ����(��w����<�Y`�GE�[��sLn`�(�(�dՉ����҃�v����{����|�h�?M �\�}���xIb�Ɠ!0�YToRs1f�:���:�'!7�pK���I��͉���J!���G"�X��d�5ı_�ێt�p:G�B����u���·0�]y�A��DN� 牥�Ջ"+[�����e���[�I�k٠N�j�邗���Ճ�Ճ�XT���t����}��3����?(�M�eV��.4��G��[ ��9,��\�Ti��T�T��=T���J�G٠=H������D_(�<e�5�B*�|qL�$BhQ0��=����C+�}B��6�p-�H�C���B@X^�%Fv�I���no�^�k$��#���s��z�#��P*~�o�%��E�}�~ω ?Ɩ��:'�_ 8 ��:�D�?Z���zP}��E��m��W��;^=��6 5�Ix֑�mB��>l80�p�R`�X�5��0�����$�L��sL��*��y:��&��^ca~uJ'U�.BY_r�XM��� /$}: � ����B�ef��i��{v��&��45�F����� O������'W�$IŲ�M��2ҋ<�a퉠搔�������"��(C��v���@F�ă�J��gq U��^����co�xqz���.,�� ������'��vZSX�Q��uu2�eb����v���a�S�: ቝc��t�N���Rl����pt�x2!D 3�@)m=����yO�:��w������4�� _�W�p�k��ZT� ��#�eiTQ��R�`w;��1�?�L>�e�k�]���n��)�4��� ���e�E��&`/]�9/>�[=ؔ� �u2>��J���;��7�09-�3~ ���w�k����X��A��o��]a����2-��2�1y|l��[0��=�$�C��(��]��о�fS�e ��L� ��5;Q��R}�+���+�A�k��^�(�v��A��0C�H��}%�ےbb0���X���D �no). ��[2���q]����K�l )!t��4O�w���?��I��� �T�u;U"�*��HR l/N���EZ�l8*�V;�i���F?����<>6|� ��E�`�e�� G7�W��-$Z���la����yw�R_w^�Q�8�R����(v�P� �Q�\���$��j��o:&�Z��_�,~'ݍ~��lB8B��2l^�dt1H/�CG�Պ�k�VW �3{V�g�Pɸ�(��f{��2�t�E��+"�K��ޓO�MoK�� Ge� 2ae�� &�f����̥/�w���1y|l��a������������/��y/&��I-�V��V�0�z��J�\��,�Ut�&�o�&��g����>Nv#P��D+6��D��$]x}̻����9�*�ţ��2*.'z���6)C�#���l�s�*���ø�w��L\� ��\Н��ca�ȟ������NA`P [�>�B�ƶ��'�2��if�Nů��{u��;���J?90�9��갤m%^Q}~�`z��1I��'�V�ue%�8���[8� BH�K��%)�-d48�� VF�pВZc�����u���O�����wzx{�a�~�:���F^����-&&�!���L�j�LƁ��i���-���K�B�(%����[����k�U�A}>G%�Ԣ�L��4̯��y�м����6�ү�v Zf[� �9!��Ѹes"�u�V�@$��yDc*�� ]��'`�s�)_,!�X�Ml��y��� �!�w;@�0�L��W�x�n��3ygrV�-�50رW�C�%��&��Y=֨�O8Ju(���!�%�~NdC�BG��M�Aʁ% ����ml̿�d+:Ln� Jy8ĻG1LIG{o��D &��>sn���<⬀���B�F�!�$�9캾�dJ��V�=]��u\��u��F��C+��~qa�,�\ֵc��Ճ�%/���׃�����dy�^ 3>��>�b��c�Z��9ę���C�uN%� �a ��`�%釕Ǽ��0��f��)B�Aܹs�"��,��KF��ݿG�kM)d"�wx��ft��%;�pts��B�D�7X[X�p��8��]��/����7�VLl���3#��Ry�!�Ÿ����'3�WU�w7��ׁ��4h��ψ�@.�-��*���xc��]Z��Ch��^��h�Jo��+a)�s���1�Z2��b�ޥ�5��;2ÕWY�IDr����� f(k��D��+�2�����{ Z��E���Z�5���oK�K���Ӡ!S�y^P�}��Pzr*�� �E�*/�$�ڃ3��G$]��r�������b��G�n��R�$�-$N��·�R�s)�9Q����U*P�[�t�E߃��~`���'���2gvk ۍڏ��m@���q�E�Q%�7Ȧ���Ə�t?�.p� �/���H�躿�.�δ*�GN� ��"�0�F���^�K9�g��Z�-\$��-w�^}y_Tq'!9 s��]Mq�JU�pʩ��!|���F�WG��b��f�����%Ճ�'��%:F?1 ~z0�0-ݦo��4�~A�f\�/��e��3+x@4�Y�Dff�E��}D&�eb;i�@�({�n��@�̺��:2=� ��n0@�e��(g:���]B�M�����ʇ����#��I���{��f@�6�$��1��H�X4B�_�B�?��Ho�ѭ�Pω�n�.����p��j�ф7 .\7۽U�э��� L�����~:8O�^�.j����S:/+��L�%S[��v� �ת7��2�n})�ʏj�x��ԍ��N��L$:S�!�po�y`^�x����(WK�+.J�8�@��Zb��R��{���<X���=`��B��Ճ��h�Y y�z��zI������&�P�9��_h�&�*�U�m+?�^��¿-�5]`�Yp�?�����27x;Rd�,̩#��G�.�Ye;�ׅc^�QB�fm7�7� ����icrȚ�P� ��0IX��}BX�?�9�>���?/�e�6py_ d�Iwu���ьK���~q�"����֪5~ܶ�L��⾓���ȰDpH�X��LT4�W���iI��ж�� �D�z����2/�eV���̀JR/Wяq�_3�8롏f��&2o�f���o��5������"�2V2�z�7=�MtA��"%҅A?�6m�n�;�37��u�+�E���Q�eD�a�s^�����qx`�e�s818��GsX�M���G�O�����kw��]�mBh Y�'ͣLe�����}d�OiH˟��of��n�m\��f�:���ܕ{��ME���=�(� ӮR�E��OiF����l�=0,���Z9j�@C�$�l62p��o��!��?ܢ��HnT���V�A�X}� �J���P3^qIr 6����?�=�&�!,a8!7q�}��An��q�;�uR����2S�V/�}63�1ou�n��~�٭7n�nH�����̽Xڕ%G&���&���i� lO��۸��eT0��q3dLp4 �+1�`��0C���~]nE��`����۸��F_Y��f�I4������0O�/��g��`���C�CTq��I�'饯�11�s�5..`&d�|�.���5}�.�F�'+<���)�a���N*��ͼ0��4''�(�&@>�KB^��=HU���4�G[���\�s˅�f�"�[oK�C�H �%�얡 �"�.��B�s���b:�]~@�/(��� �P���V�ZR�\���C딫r��;�3�ᅄ��Q����g��,�-]�g ���5���~�`����(7� �@���@�T/�k���� ���,��%��E9�=&R?B�z���F5��W���*{�9G/�AN��@c�f�J�k]C��y�V�-t�ub��a !���V*��nn҃\�M����Ya��R?Sl!95�_X8��B���`�� ���(�>�B��`b�n�/��Ed>Pa2���0!4�6i�]�$��]�JbGz���+F�Ku!g�X��B0�:@�Bĝ|�yW��$����'��~ �,�5��S'��h;ʎ���A`v띺��e��H}�SG��B������}�_�ʪ�n[i�L�P�������7�(ʬ���:�Հ�}h��8,!,�G����x&�L��z���Mm&��p�=>�eT��]6�A� X�{�a �����tД�v�+L�\�a6H����q����1_pG8�tq�hB�����:�:+ia�#E�jl0[��|s���{cWxu�^#�X~�:Za��|�ж9�=�3m~]�bJ�{H�`=�f��4��σY�k�d� � ��H[O����5��F"���Ղ��эJ�F�Iͥ�npҭ��z�)o�l��f51�Z�����tX�d^���|5ȸ�&[o����/�(N1� �~n���K�m�. $ �6J��x!lT: SL<��kh]�uL��k��S ��B��(O��+�:�0mw�Ǔ,h1�mꦛOZ+Q<`�T��$*GS��۷1I-^?;$���� n�8�E���@���T��f�M~��:/z�����.���QpIy�/Pg<�q"�Ɯ�q]=�|&�,�a�9�>�n���v�ߞ���*V������m�����:���@���&���_P����c���V�p3��z�a8!�;lM�|/B�"@��o�W`�Wx]��v���%����:��V�G`�K����O�,�-�b�}�ߦ�st}�9�[�]����`K� g�5��̙!<4�Ճ:�kU�b�l�?�q�~�M��3pt�ޅ��A�?�_+P�����j+t���v)W. e��A��Ф�חb�t�T�Q��b��LuJ�P��E��Gi!2ϋ�i��L-B�o*�!��^�G����E� J�E$^b(1X�6�x���k`��z�}��5�P���������s��o�V���]�"�ݎ8o���x��������E��E��!�1ؠU�zO���N�;� �N��ܮ�E�<���h�,�띋; ����&cX�����6�\�a�PV�i�����)=fh��M}@,,LC�����0�$!�ӆ��Z�E��¥�^a�̱��cB�=�0�x�P��a0f�o�k�]��㝕���</;��ITx�7^���'�!����~��BJ�,��MZ�A�.�A[}[� (� �<�. �!�4��)}!���?�&g��|�����F��?����39��XD`ݠ w���m�P�W;'�`BX>�k������:P]eJ����o��3�ߍO&۾�%�ͳM�z��Y�b����y����>(o�9�A�R)x��>��#XL8Ú�M�]c^|P�`���7���U�������)H>!�ŵd�N�A��=�:x���͙P�8����&ԾǛ|�-��\zbA���dn�Q�V���[�����L�����I��'.ͫ8��{�^����6] &|t)8U'��-�'b��6��[_XUX���J�X� Ho�oW��ˋ(ɘ� e ?��_� ' �Pb���8��I�۴�~�wO�@���Ճ����)�W�=��tr���:��Ӄ�{�Wh'�y,B���;� ���K/�F�\�S�T�U�!Պ�쵄�D3&�� �-44,2�G=^����{�������#-(FI��̛�>�4�<�cT��{�|�[�!��C�[D�d�z�427������4Kݞ�� '���v�}�d��3����nm�i� �/-�v3��2����֨���y~7���������o#Gt��~1�<v�91�\T�ާy�s�)h�vON��8�+�B7�&����}�a�~��{��a!��Mz��AZ��P��!��;N��p41�AP8Z���If�h�qb��,t��!�zq�D/�^�]64�0���N��!T,�Ȟ�m?���+�<Z�u*��1N�R�P׆;��oT����[��?��o}�Z:j,��۟����+�9 ��ҋv����7�kWd�������e�$�'����#=�W8S�*'�q!pQ��U'=�7��Bh7VC��1ИK�Ql� >�mZ�@�q���t%] ���l�h_�"�;AwjH?�GӁa<�ɞ��k �q�Іf � �(��j��B��2��\�Ś��&�Ǻ��$ jB���q�*l� ��#>�G;]��s�%~ �kG9��n���<>����1oLv5� �g���t"�Pz�S=v]M���Cj9n0j. T�e��?�D�A3��D����w�X�P!t��r�Z'k҉װA!����$:�z����G��Npeb&}!���u����4���W� Y�]&/��ﺸO5��\��%?�-� !Р0�w|M�F�q� /X����k/֝'4�B��|�&��W �͌��(��CpɿOB8�Hf���|Ï��XP��`����Hb0�M]�"Ns����e4��$O/_n�3O���<;ԏ�3E�� ���'~�����Wt�6�wR���0H�=�$�Q4{��jo+�8"!d��G��9�|��i(Ȅ�#�Q�9#��eG�P��^�8�ec�|�j� �����'&��U�h�Aok{Pj�kQ�Ӡ+�4�5��z��3PĈFf0�5%�b�\��*䉥�~�z�q=�<Bh"���;J�?�Tޱ45��~#����� s�u��6H�$]P��\$i���8?�D0���X�N{�G0��������7��g�[�X�� o39 Q=ZB�(����l�2�A6��:���y'B ���-oq���S�a[6٩\�y�C����I�(��eT&��j��@�ʘ5��, f�s�wE�ã�(Fg�٠�$A���[��W;� ��l�AzA�@ ���W1T��g��c�+U��u(v�y�P`@='� �8ߜ�`/W8��a->}m��� ��� �S�~ю�{�IJ���>p�����c�g�֮�.�Ś�U뽽]�3!<��5�P|Jg�;b�=ϱ���a�������� ��!�7�* m[�k�]�YڧQas��R��B%2�O�H�XSj���!Ti����H��l���*HD���X��`�3��M=�{����L8,ZT�2���Z��[E�����F��0�S�������#��M�bJ��K�7e�`����%WX&V$��߹G�@�O�C��LPh�%nj��zQASV� '=�D�QO�Vu�*.�K+ X�a��;I��"��" !��E��A� �jʿ����������3�j����-�E�%.���CB��9�u�ZB��J.5y�<aL��*D�k�t�hO��Q�,7�t?+�<1����q�v�����}�с�`N]L֒Ꝅp'��ia�+�F�2:qD�~yL���e�C��i6a��mK2��+���X��VyM��G]hM����}��� ��Ԯ H�zv���8���G�Z/�rtO�u�5G�n��W»_��2�քPx�2�-�/%�[��~��_nX�(�:"R?��r ��'Me���������$� 3l0*Ԙ�'�C�,����-����0�'4SQ����#�撔�a!u�}Q� ���w4� Mr�@b�tZ '��%l� )d� �����[�r҃ ���p�:oR'`�*��q�A��[ b����#����v���#�.#i-���6.!:j�Q�����@&\��ߋ�)��z{3�bS{�(���������|YZ�7��$�~�K?�k���#$�`"�#��,�u |2!�t}P��O��\J8�(�%��(�j�|p�c�Tp ���g��I�6X���ݷ�E?���=�6�/��B� U]��R�;��| R���м�����V�-o+]��� ��9���\{&] ;L̛��Z��/�RD���Bn�?Ž3�SQb��xdr5�-�m'�]��o�r���;\�_@y��k�l�wE��B���� k����E&oL,so���N�L�`o PG3#x�%���Z�\+�����ho�u ���\��C Gg�N��K��+{��6�-�M�����]&c��ఄ��l��p4-$J6z�����>�,��f��lH4�R�� ��=� �]aXl��W�u�_��!�T�9)�WU�V�= ��l�k���-��;��vԿ`XٓZ�����gN8��\����`�pՓ��ԋ����mn_g�u��s�����1��B$ԷL:��@ �<���ppB�<�&�g��P��W��儣'"Am'/~�H���G��<!1hqX6�ނ�0���v~kk�n�zQ���u��%�ې��W��9D��E� �d�4�u>O��plQ�oo[�[�uo�@#D��E�?�S����@�����M)U�C&���lBD�|D��Y�uRWU��iu�aM���).�w6������B�i����!<�\S7���S�Zl�f����?MA׀��T�h�=���M�>�(�,�Q�-�� J���S� 1](vѬUg�y�N� � �E_uy��Kx�@�L�F����}M����$� T/1�Q� � ��Qe����=e�SMM� ˢ�k�Q�3u�'�!f���O48�z a+ZK��'T�Ed�'��wk� ZΠӣ��3����p�dBH����W�Ek�ShwS���0��6�Lh�y j-���_��[8���� y�?6h��"R�����d̰.X��TM�8FIxk�h���=��lX��?�fP�D��b����X ��˟0'�R@;������1�գ�'{���x��kڲv���ˋ���'��nIg�� z���֗���P�G�'�t�TjH&B�&`�rx�"R;�l'!���)S���� ^N���&b8wm�z�&�P����}�ă�b���ꎙ�t�㨵�wL�Z���xxWBXC�D˔k�D�~)�i�%�x��}�o�i8���[�(��4����m�e^��p��к���s*�Y�}vA�;�MZTEc�14��<}vT���<�YO��խ�V���@�P�?�mK%ؙau8Q`s�BNL�N�S�� =1� �qn����IU�l'!�_�!�$=� �R�:��ێ��a�P��{dA���Jm�� ��PnP& �bme<黺� T�4��q��T$��d�g��Ӆm���<����)�ΈP[ߚ�$�!��~��aZ����DЛ�4��������O-{{7t���M�>�C9�.�_5I�O� �����7�'D��f��t�s � 3����:�3��(R� qV�9�NB8ȯ �-ı�rI��YI?:?�ZƪZ[��$�����ؼNS�)r� GQ�x G���B�-����OZ{��33�苃z�ri(7=��_�� (�9Ճո@6Xz�a� LnE<v����V�� .T�bY`�'�'u@�@�:�~��C���d>a��^,X@���]�����zN���u� ���ԣ��f��D�L���R3���"Wb��P����) �iԌ�9�ɐ����fp�Ah ����b���ӻ�����l�Y���r�VI<plk��M¡M G�x���> �V���kE��3�Ʃ�Iw��ƴ Z�m�P�Qz�M�<��.�`��^�Tb� ؐa�W����$�F�pt�$>8��A�K��ELR���b���a�Ɗ�e<xQ��ȥ��!�@~�>����w����z1ްA��X � �E}�O����Ѱ�Ա�1�:r���n�H79n<�%��p�_Ⱥ�&��5�P\�gX$M@Ͻ=/]c�T�RP����o�T'$Û�.�)�� �R��4l$�W`�"�lK�j�{�)�@���-Ӆ��`���~�2��]��^a3���=J�L�W z�.H p�� Z�TU��%�$P���J��A*#Źz�K����,�E�X��j&�n���a�N���x@�I3j���7�� �ΰ�Š�����y�rq20x�l '!��[�]=)�c�\3.ﹷi���&:ׅ��dT�Vf���D)�E� {��#����- &k��8�ȳ�f��&����y��6!@%zC[Nۼ�~���xv]^8:�v�\� m^>�&�J�XcX�E��],�$��&/��礇���-f��4��K�Y�x�$#-��B�G�-,ȝD�!���#��I{ŕ�vMvk@K��{no� �}>ʏ�;���=r!��gj�0U��O���ŷ'�>�.��i�#X�:��H��#/ ۤ[����X��f��jCՃl�W�wh�XF8������&Ae�@[�bp�s�������Y8d�e�Z[Y�q�و�� �b�2i �1�a� R�� ϗ�� �]�NX�d����R��H��#[=r<�1���T=��&=X��&!��{j��ʖO���pJ��c�3:�� G���͂�k ��^�i�����{��8����U�y�?c�i��R�V Љސxl�Wط�`��6������Ӆ���+�z���ϾV���Q��%�g5��W,<c S.p$�k���IV��a9fE���� QD I��w�A�'\ޅ���p�x`{8 a(�v��r���/#��䄡6��Ϗ�������͆9��$���A��Jm�3�� �t+P��WΏaᨗ����g�,Bez��q���.���ep{�پ�'��~��*O�n�<nÖ?k�˾�1}P8��#�9��I0�8�a�5��y��Pݴ�}�}XC����r�-�D��f��� !�T�< <����0����h�&ӤE��:;�Q�6'ޕM� pF�V��C{��vr4���{b tb�k�j� -�k�0M����p�Ҟab0�ۭ�G=��ƸS f�$\���V���J�G� ��%v_��a� �me��[H8��r`I��y�L�ߦ�U�[���aF[�>�k=�f`���fF&��$׀�l�r�nh�g[�x�h�(�� ^̕������l��z��9$��������?�S� 3U��#��9 a�Gݾ(5X��VA4��g-���{�':�@�]:4r���O�:�� �&d�^'B��ۏ��V\tE��$��� F�hG��G8�� ޗ}��8�pƸS��Nk��ބ+��Z�,}�1F�(�G�G�]q�oI��) �^B8��ώmE�w�,��0���6�`�_�:�? �زq �#k�����.N�� f�/(�&�U�x �Q�LI��ep�R}TA5/T9�*A)5JU�Ϧ���P?R6��$�@��rc��&6X>��50�ަ��S��|Jdݺu��ӳ�t�K�5 � �7_�I��g�%����:�ફ�odP����*#8�q�a ��Np����B�dK�l��fO�+c|���S}a�q�O�/�y�����@�Zq����"5���Yf!(���3���"��iC.A��y�U�6K;����x��fx�a�y��V �H�J���Hm����ʣ��%VH�`6�m�5e2u���V�a�sBE�z�9L�!��uF���!��x4�J_kj�n��_�q(T �w�� �Sn�";�O�a� ;c�iP"U��r{ �ōoIB���2�̗� C��39�R�pԼ\-# ����LP�2��w��G��I�?�'ɇY<�-f�M s�O�>�!e��Ň��0����%V���w� Y� :_�ϣ�I�y%�g��S@�a)ky���������9���{�{�$�m脩��&�4w�:v2�Z�R����}��y;�Xs�WJJ-\H�N֍!��=��d�-�6�8 � �\^�ƣn�d�2=�Ձ2��G4���-j~��"Ӡp4j?�9N�1 9������!�r�)���6)�8�(�8����\��).��]ozb}���E���2����*�b��J(�n�q����Z���Bi�~J����|Ã/���֦�I]p���5o}]|u���%�:B0���A]�>�8@���}���� ���Pq�@a�hy�)�A�� ������Y����QXR��-U)?~��T���Ebb+�u��NQ"��~�(�Jz�)��v��X�2{�Ġf�Ж|r�����H�r�Z�@t�_4K4O4�8�@UX�����+`�0�!�4<2����[LK��*�O���U�_I�&pB��W��LՌ�ER �ٴ��ZH��?��mpbqD��U�}�!91�R�Ы@�F�#X�2�A�#�l�����D ��tS'����[�����O��8+e�᰻?K��+�J,&�����M��P=!�=�%`5`]'h�� 7�O� j5�# �.��d!#)�d#*��^�gJp"�_�z������+2xo�y����'��n&��)=�J��\�v�D�aN��$�.8Vb6�,�u���i��H�v;A�a �3�»Ӂ+�B{72b�Q�n��PR1V8*qS9�Ǯ�m�|N�d�'\�m1��EM��rM\^a|�V 7r��}>�H���!�l���;�`xn��T�(�Ac�o�Ix��S��%ت>�F��`J���[���fOc���NH��-��[1U]��̏�hKؤ���2� N)�@%�IL�_xv��@�y����H$��F���p�v2k`ck��<-F_^�M|�◶c���j���^�}����_03os��ɵ�86�d_�$������L�!�CI�f�>ł�X����>F8�xy�)�"��<�g��^�X��KN�&�5X�~1��R�:)�&Q�H���ro'DI9�BD�^1�N�б�V�����@|Pi����D�l�Fj�j�Wr=��Z(�k�1�*�Oq�AW$�Ӆ�ʬ�-�=E��9IB����F^�%�#8���}�#h.�L�r�jlb�`~(s�@z�L5��c��¬qi�~@��Du��4�-I ����NaevQ��ӎty^�������!�����%�E�Du��6����:�Q��m�)VV�VH6i:�hg�hO-6OL��~���A��; !A��c.ڰA3 +X�� ��r(D*ۮ��/*;�**���nj��c�I�˟�7V���3='!<�-LD��(��҃X�o�!�۾-3�$�p����$V�t|t�Gq�|D>��w )5�Te7�h�'V��"ܪ��~����7�Pל�C�g���Q�PC�Xu[H��w6h8�c��s���o<��鳭��`��$�'��ӭj�Ta�� �D&�wm���+փ��+k���R"��|Fw2`�/�Q�싷�f|7�Gp��c�J&����̣b�v�8�t6H����&n Uƒؐg'4�3�|כ�̺�6��������\�� �8�{��o���\ۄ��:��";���yt���7���lj�>��9p���_������C��^��I�Hw�E��r`��.� ��i�/�C��Im����K��h��`s9��P˯k�.��/����G���5�]`-��$e���^����+};}�;E�L$�hVЇ��}��ι� ��E�A��o��ˉ!��~Q"Uv����S`� 7��+�F�} �� ®0,�V��,�� "@��x�u��2�>�5�]�A�\ �D�S��y9�M������m�&d��.B�=È�r�prFC�{���qP[�u3�'<�_<x�}���ʽ�`�$��>:]8:�w��Ol6��d<!d=�Qsquq&����/�ID*�.Ь�F�Ev5�-_UC4�}t���Q��Y��LP~�+��s���I�(Z���}}�i^Ę�"�z-�<����X��N�?m ��Qy��A�OV����aiʉ� I��S������$�'������b�dv��pt�;�x�m���H��5���(#���l�$�3�q'�Cb����("EZX�̌+H#"Flx��:F;� !�^��M��+V6�t�J�"ZŚ�w#����;!}:uR�N%a���G{�J@5 � �(�"gW����;��0�!4P��bؕ~K+1iƜ�#�7��8,!�ƚ}b=<~�����o�V��e��7�Y871^���04E�Fl�%]�V$˃�<�f�^���R��B�KbK�f%Y�Ч�E.Ǜ"�][�Fy��_��N��Ӄ%*jg#F/�p���X��E�'�I@�.����W����m����9�I���q��Rb��=��H�h��`����dbQp��rnM�D�-������K�L:2m�(Z��]>tX6ȶ�f��Zr�L�<z� �B��s`���BD�p�D!����ٝҗ�tA���>g��o����%!��1��0<��_ [%Z��>*cz�_|oRwZN�.�1W�#�tMۻ�"j]hcK�]���! G-�y{B���c!ج ��T�[cʈ<��P\I�1���7P,���j�{ F@�?���2�A�{������fS��Wt���}al����i��~3��֏9��x���{�B1YL�jc��ۯ�7���o�q@x�8p��J4��F�k�v�fFR��*�&���˗o!��-�?.>�}��G2��Ǚ����[�_�`�[����\�z:5���&d2�{j���xr% �2�_�7�ބ�9�"%W�$�e~�L�0e:���Ys�����S����HN։���H��䧀dAئ�t[�O�� �U�O�R�Zރz$0�Á� '�/E��گ��n�w�K *����Z�����HT�glܝ��O���Tɨ�]�Y�ߘm�� G�ݮ �j��`N��m̹\V8���K]yN�+���9��h&�@�4uU�_�K8�ͱ0�Gd 3x�����&�:e� ᚗ��f��Ճ���Ҿ]Kb u.�s3���-�_7�����4jP�B��<fq{x�-a���1����b�Le�� �|K�y0S����j��a �����M�Ĵ�l���L\����3���m�G���O� �<���x`�6��c���?�i��fS��Mb��Wt�|'�~��h�v^����hH��nv��Pq�|#�S�I��ysBxU� �eYA�� �m��d����5��x�+b���9�p�[�f�l������c�h;`��q�{���\��J�,]>��k+�?��$�b,�_�)Ő�.On�9� Q�� r���X**���I����9X�K�O8�(��z���v���>���q�(6�H/�^���N)�+`����I��pW<�z�|���A�}ե�S7b��'!�T��$�X��<�bK�O':d����l�U>"��K��3'v)/����Q��T�C%g2��â��$�\�6��脔��j��j4�.vLik<�5jB8��g�U�v���ý�^x�i5���B��2��l����P���DUTCDs�T%�ȇ�<�8�{�pt��xB��_�N{ҹt���c֥��@����,�Y������sq�&�R=,��F ���PAp'�� |�:�$��Ir��R'�+�� V\��vH�c+�O0�P�մ;)0��n �c�_�c���H�m�L�@vQ-ŗU�����$pk8QY�%�e%6��t�k6�$��qV�ץ3Pu�lZ^���L�̪ѷ�J��@=.��odE��QY04/�?�$p��P�>��3�qP��7���i�O�"��5��ΰpTŽ�#ab0��yc�h��D��_4��uu7`zP��1� lY�N��^>�s�5!�b����%%����|%�B|�μ΄ ���%E�9 �r XXx��~=CF��O|�6 3 ɵ�s�t>:�Ӏ�^^��L�W�5�yFI�N !�g=����5��/��L)>Fc�ϦZS6=�V�x� ���r�H���'