';
foreach($titles_meta_subtabs as $tab_key => $tab_caption){
$active_class = ($current_tab === $tab_key) ? ' nav-tab-active' : '';
echo'
' . esc_html($tab_caption) . '';
}
echo'
';
self::image_seo();
echo'
';
self::advanced();
echo'
';
self::appearance();
echo'
';
self::security();
echo'
';
self::breadcrumbs();
echo'
';
self::toc_tab();
echo'
';
self::robots_tab();
echo'
';
self::htaccess();
echo'
';
siteseo_submit_button(__('Save changes', 'siteseo'));
echo'';
}
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['adavnced_attachments_file']) ? $options['adavnced_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'
Image SEO
Images can generate a lot of traffic to your site. Make sure to always add alternative texts, optimize their file size, filename etc..
';
}
static function advanced(){
global $siteseo;
if(!empty($_POST['submit'])){
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_bring_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'] : '';
echo'
Advanced
Advanced SEO options for advanced users.
| Add WP Editor to taxonomy description textarea |
|
| Remove /category/ in URL |
e.g. "https://example.com/category/my-post-category/" => "https://example.com/my-post-category/"
|
| Remove product category base from permalinks |
'.wp_kses_post(__('You need to enable WooCommerce to apply these settings.', 'siteseo')).'
|
| Remove noreferrer link attribute in post content |
Useful for affiliate links (eg: Amazon).
|
| Remove WordPress meta generator tag |
|
| Remove hentry post class |
|
| Remove author URL |
|
| Remove website field from comment form |
|
| Add "nofollow noopener noreferrer" rel attributes to the comments form link |
' . esc_html('https://www.example.com/my-blog-post/#respond') . '
|
| Remove WordPress shortlink meta tag |
|
| Remove Windows Live Writer meta tag |
|
| Remove RSD meta tag |
WordPress Site Health feature will return a HTTPS warning if you enable this option. This is a false positive of course.
|
| Google site verification |
If your site is already verified in Google Search Console, you can leave this field empty.
|
| Bing site verification |
If your site is already verified in Bing Webmaster tools, you can leave this field empty.
|
| Pinterest site verification |
|
| Yandex site verification |
|
';
}
static function appearance(){
global $siteseo;
if(!empty($_POST['submit'])){
self::save_settings();
}
$appearance_fields =[
'metaboxes'=>'Metaboxes',
'Admin-bar'=>'Admin bar',
'SEO-Dashbord' => 'SEO Dashbord',
'Columns' => 'Columns',
'Misc' =>'Misc',
];
echo'
';
}
static function security(){
global $siteseo;
if(!empty($_POST['submit'])){
self::save_settings();
}
echo'
Security
';
}
static function breadcrumbs(){
if(!empty($_POST['submit'])){
siteseo_save_advanced_settings();
}
$options = get_option('siteseo_advanced_option_name', []);
$enabled = !empty($options) && isset($options['breadcrumbs_enable']);
$separators = ['-', '|', '/', '←', '→', '↠', '⇒', '►', '—', '•', '»', '›', '–'];
$separator = !empty($options['breadcrumbs_seperator']) ? $options['breadcrumbs_seperator'] : '';
$custom_separator = !empty($options['breadcrumbs_custom_seperator']) ? $options['breadcrumbs_custom_seperator'] : '';
$hide_home = isset($options['breadcrumbs_home']) ? $options['breadcrumbs_home'] : false;
$home_label = !empty($options['breadcrumb_home_label']) ? $options['breadcrumb_home_label'] : __('Home', 'siteseo');
$prefix = !empty($options['breadcrumb_prefix']) ? $options['breadcrumb_prefix'] : '';
echo'
' . esc_html__('Breadcrumbs work as a navigation tool for users, helping them know their current location and providing quick links to their previous browsing path, which improves the user experience.', 'siteseo') . '
';
}
static function robots_tab(){
global $siteseo;
if(!empty($_POST['submit'])){
self::save_settings();
}
echo'
'. esc_html__('Manage your robots.txt file here. Adjust settings according to your SEO requirements.', 'siteseo') . '
';
echo'
';
return;
}
$robots_txt = file_exists(ABSPATH . 'robots.txt') ? file_get_contents(ABSPATH . 'robots.txt') : '';
echo'
| '.esc_html__('robots.txt File', 'siteseo').' |
|
|
|
';
}
static function htaccess(){
global $siteseo;
$home_path = get_home_path();
$htaccess_file = $home_path . '.htaccess';
if(!empty($_POST['submit'])){
self::save_settings();
}
echo'
htaccess
'.esc_html('Edit your .htaccess file to configure advanced settings for your site','siteseo').'
';
if(!file_exists($htaccess_file) || !is_writable($htaccess_file)){
echo '
'.esc_html__('The .htaccess file does not exist or You do not have permission to edit the .htaccess file', 'siteseo').'
|
';
return;
}
echo'
';
$htaccess_code = file_get_contents($htaccess_file);
echo'
';
}
static function toc_tab(){
global $siteseo;
if(!empty($_POST['submit'])){
self::save_settings();
}
$options = get_option('siteseo_advanced_option_name');
$option_enable_toc = isset($options['toc_enable']) ? $options['toc_enable'] : '';
$option_toc_label = isset($options['toc_label']) ? $options['toc_label'] : '';
$option_toc_heading_type = isset($options['toc_heading_type']) ? $options['toc_heading_type'] : '';
$option_toc_excluded_headings = isset($options['toc_excluded_headings']) ? $options['toc_excluded_headings'] : '';
echo'
Table of Contents
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.
';
echo'
To use Table of Content on your pages, you can use this shortcode
';
}
static function save_settings(){
global $siteseo;
check_admin_referer('siteseo_advance_settings');
if(!current_user_can('manage_options') || !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['adavnced_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_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(wp_unslash($_POST['siteseo_options']['google_meta_value'])) : '';
$options['advanced_bing'] = isset($_POST['siteseo_options']['bring_meta_value']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['bring_meta_value'])) : '';
$options['advanced_pinterest'] = isset($_POST['siteseo_options']['pinterest_meta_value']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['pinterest_meta_value'])) : '';
$options['advanced_yandex'] = isset($_POST['siteseo_options']['yandex_meta_value']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['yandex_meta_value'])) : '';
}
if(isset($_POST['siteseo_options']['toc_tab'])){
$options['toc_enable'] = isset($options['siteseo_options']['enable_toc']);
$options['toc_label'] = isset($options['siteseo_options']['toc_label']);
$options['toc_heading_type'] = isset($options['siteseo_options']['list_type']) ? sanitize_text_field(wp_unslash($_POST['siteseo_options']['list_type'])) : '';
}
update_option('siteseo_advanced_option_name', $options);
}
}