File manager - Edit - /home/aresglob/public_html/wp/wp-includes/images/smilies/settings.tar
Back
social.php 0000644 00000064505 15103634304 0006540 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); } } util.php 0000644 00000005511 15103634304 0006233 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SITSEO Team */ namespace SiteSEOPro\Settings; // Are we being accessed directly ? if(!defined('ABSPATH')){ die('Hacking Attempt !'); } class Util{ static function render_toggle($toggle_key, $toggle_state, $nonce, $label = false){ $is_active = $toggle_state ? 'active' : ''; $state_text = $toggle_state ? 'Click to disable this feature' : 'Click to enable this feature'; // for dashbord screen if($label){ echo'<div class="siteseo-toggleCnt"> <div class="siteseo-toggleSw '.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_pro_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-toggleCnt"> <div class="siteseo-toggleSw '.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_pro_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 get_logs(){ global $wpdb; $table_name = $wpdb->prefix . 'siteseo_redirect_logs'; self::maybe_create_404_table(); $results = $wpdb->get_results("SELECT * FROM $table_name ORDER BY timestamp DESC"); return ['items' => $results]; } static function maybe_create_404_table(){ global $wpdb; $charset_collate = $wpdb->get_charset_collate(); $sql = "CREATE TABLE IF NOT EXISTS `".$wpdb->prefix."siteseo_redirect_logs` ( id mediumint(9) NOT NULL AUTO_INCREMENT, url varchar(255) NOT NULL, ip_address varchar(46), timestamp datetime DEFAULT CURRENT_TIMESTAMP, user_agent text, referer varchar(255), hit_count int DEFAULT 1, PRIMARY KEY (id), KEY url (url) ) $charset_collate;"; require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); dbDelta($sql); } static function get_virtual_robots($output, $public){ $robots_path = ABSPATH . 'robots.txt'; if(file_exists($robots_path)){ return $output; } $virtual_content = get_option('siteseo_pro_virtual_robots_txt', ''); if(!empty($virtual_content)){ $output = wp_strip_all_tags($virtual_content) . PHP_EOL; } return $output; } } tools.php 0000644 00000012603 15103634304 0006416 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>'; } } analytics.php 0000644 00000166177 15103634304 0007265 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); } } onboarding.php 0000644 00000047706 15103634304 0007414 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>'; } } sitemap.php 0000644 00000047016 15103634304 0006726 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); } } instant.php 0000644 00000034044 15103634304 0006741 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); } } dashboard.php 0000644 00000035353 15103634304 0007214 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>'; } } titles.php 0000644 00000131264 15103634304 0006567 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); } } advanced.php 0000644 00000136571 15103634304 0007036 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); } } license.php 0000644 00000011457 15105363721 0006712 0 ustar 00 <?php /* * SITESEO * https://siteseo.io * (c) SITSEO Team */ namespace SiteSEOPro\Settings; // Are we being accessed directly ? if(!defined('ABSPATH')){ die('Hacking Attempt !'); } // license page display class License{ static function template(){ global $siteseo; // Add header if(function_exists('siteseo_admin_header')){ siteseo_admin_header(); } if(isset($_REQUEST['save_siteseo_pro_license'])){ self::save(); } echo '<div class="siteseo-license-tab"> <div class="siteseopro-setting-content"> <div class="siteseopro-tab-group"> <table class="wp-list-table fixed striped users siteseopro-license-table" cellspacing="1" border="0" width="78%" cellpadding="10" align="center"> <tbody> <tr> <th align="left" width="25%">' . esc_html__('Siteseo Version', 'siteseo-pro') . '</th> <td>' . (defined('SITESEO_PRO_VERSION') ? esc_html(SITESEO_PRO_VERSION) . ' (Pro Version)' : 'N/A') . '</td> </tr> <tr> <th align="left" valign="top">' . esc_html__('Siteseo License', 'siteseo-pro') . '</th> <td align="left"> <form method="post" action=""> <span style="color:red">' . (defined('SITESEO_PRO_VERSION') && empty($siteseo->license['active']) ? '<span style="color:red">Unlicensed</span> ' : '') . '</span> <input type="hidden" name="siteseo_pro_license_nonce" value="' . wp_create_nonce('siteseo_pro_license') . '"/> <input type="text" name="siteseo_pro_license" value="' . (empty($siteseo->license['license']) ? (empty($_POST['siteseo_pro_license']) ? '' : sanitize_text_field($_POST['siteseo_pro_license'])) : sanitize_text_field($siteseo->license['license'])) . '" size="30" placeholder="e.g. SITESEO-11111-22222-33333-44444" style="width:300px;"> <br><br><input name="save_siteseo_pro_license" class="siteseopro-btn siteseopro-btn-primary" value="Update License" type="submit"> </form>'; if(!empty($siteseo->license)){ $expires = $siteseo->license['expires']; $ex
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings