This commit is contained in:
2026-03-11 15:57:27 +01:00
parent 481271c972
commit b4b460fd21
10775 changed files with 2071579 additions and 26409 deletions

View File

@@ -0,0 +1,55 @@
<?php
/**
* @var $args
*/
use GRIM_SG\Dashboard;
$languages = sgg_get_languages();
$wpml_languages = apply_filters( 'wpml_active_languages', array() );
$input_class = $args['input_class'] ?? '';
$input_label = $args['input_label'] ?? '';
$input_value = $args['input_value'] ?? '';
$input_name = $args['input_name'] ?? '';
$description = $args['description'] ?? '';
$button_id = $args['button_id'] ?? '';
$button_text = $args['button_text'] ?? '';
$button_name = $args['button_name'] ?? '';
$placeholder = $args['placeholder'] ?? '';
?>
<div class="grim-previews-url">
<p>
<?php
Dashboard::render(
'fields/input.php',
array(
'placeholder' => $placeholder,
'name' => $input_name,
'value' => $input_value,
'label' => $input_label,
'class' => $input_class,
)
);
?>
</p>
<div class="video-sitemap-depended">
<input type="hidden" name="<?php echo esc_attr( $button_name ); ?>" value="">
<button type="submit" id="<?php echo esc_attr( $button_id ); ?>" class="grim-button grim-submit white video-sitemap-depended">
<span>
<?php echo esc_html( $button_text ); ?>
</span>
</button>
</div>
</div>
<div class="<?php echo esc_attr( $args['class'] ?? '' ); ?>">
<?php echo esc_html( $args['label'] ?? '' ); ?>
<span class="grim-previews-url-desc <?php echo esc_attr( $args['input_class'] ?? '' ); ?>">
<?php
if ( ! empty( $description ) ) {
echo wp_kses_post( $description );
}
?>
</span>
</div>

View File

@@ -0,0 +1,44 @@
<?php
/**
* @var $args
*/
$settings = $args['settings'] ?? new stdClass();
?>
<div class="grim-header">
<div class="grim-section grim-nav">
<div class="grim-nav-wrapper">
<div class="grim-nav-tab-wrapper">
<nav class="grim-nav-tab nav-tab-wrapper">
<a href="#" class="grim-nav-tab-item nav-tab nav-tab-active" data-id="general"><i class="grim-icon-home"></i><?php esc_html_e( 'General', 'xml-sitemap-generator-for-google' ); ?></a>
<a href="#" class="grim-nav-tab-item nav-tab" data-id="google-news"><i class="grim-icon-google"></i><?php esc_html_e( 'Google News', 'xml-sitemap-generator-for-google' ); ?></a>
<a href="#" class="grim-nav-tab-item nav-tab" data-id="image-sitemap"><i class="grim-icon-image"></i><?php esc_html_e( 'Image Sitemap', 'xml-sitemap-generator-for-google' ); ?></a>
<a href="#" class="grim-nav-tab-item nav-tab" data-id="video-sitemap"><i class="grim-icon-play-circle"></i><?php esc_html_e( 'Video Sitemap', 'xml-sitemap-generator-for-google' ); ?></a>
<a href="#" class="grim-nav-tab-item nav-tab" data-id="advanced"><i class="grim-icon-sliders-horizontal"></i><?php esc_html_e( 'Advanced', 'xml-sitemap-generator-for-google' ); ?></a>
</nav>
</div>
<div class="grim-settings-search">
<div class="grim-settings-search-input-wrapper">
<input type="search" class="grim-input" id="grim-settings-search-input" placeholder="<?php esc_attr_e( 'Search settings...', 'xml-sitemap-generator-for-google' ); ?>">
<div class="grim-settings-search-cancel grim-button white">
<span><?php esc_html_e( 'Cancel', 'xml-sitemap-generator-for-google' ); ?></span>
</div>
</div>
<div class="grim-search-results" id="grim-search-results">
<div class="grim-search-results-list"></div>
</div>
</div>
<div class="grim-nav-wrapper-actions">
<div class="grim-search-action">
<div class="grim-search-action-btn">
<i class="grim-icon-search"></i>
</div>
</div>
<button type="submit" name="submit" class="grim-button secondary">
<span><?php esc_html_e( 'Save changes', 'xml-sitemap-generator-for-google' ); ?></span>
</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,101 @@
<?php
/**
* @var $args
*/
use GRIM_SG\Dashboard;
$sitemap_type = $args['sitemap_type'] ?? 'sitemap_xml';
$sitemap_url = $args['sitemap_url'] ?? '';
$languages = sgg_get_languages( true );
$wpml_languages = apply_filters( 'wpml_active_languages', array() );
$input_class = $args['input_class'] ?? '';
$input_label = $args['input_label'] ?? '';
$input_value = $args['input_value'] ?? '';
$input_name = $args['input_name'] ?? '';
$notice_show = $args['notice_show'] ?? false;
?>
<div class="grim-previews-url">
<p>
<?php
Dashboard::render(
'fields/input.php',
array(
'name' => $input_name,
'value' => $input_value,
'label' => $input_label,
'class' => $input_class,
)
);
?>
</p>
<a href="<?php echo esc_url( sgg_get_sitemap_url( $sitemap_url, $sitemap_type ) ); ?>" class="grim-button white <?php echo esc_attr( $input_class ); ?>" target="_blank">
<span>
<?php esc_html_e( 'Preview', 'xml-sitemap-generator-for-google' ); ?>
</span>
</a>
</div>
<div class="<?php echo esc_attr( $args['class'] ?? '' ); ?>">
<?php echo esc_html( $args['label'] ?? '' ); ?>
<span class="grim-previews-url-desc">
<?php echo esc_url( sgg_get_sitemap_url( $sitemap_url, $sitemap_type ) ); ?>
</span>
<?php if ( ! empty( $languages ) || ! empty( $wpml_languages ) ) { ?>
<p class="<?php echo esc_attr( $args['class'] ?? '' ); ?> grim-preview-multilang grim-mt-10">
<span class="grim-preview-multilang-label"><?php echo esc_html( $args['languages_label'] ?? '' ); ?></span>
<?php
foreach ( $languages as $language ) {
?>
<br>
<a href="<?php echo esc_url( sgg_get_sitemap_url( "{$language}/{$sitemap_url}", $sitemap_type ) ); ?>" class="grim-mb-5" target="_blank">
<?php echo esc_url( sgg_get_sitemap_url( "{$language}/{$sitemap_url}", $sitemap_type ) ); ?>
</a>
<?php
}
if ( defined( 'ICL_SITEPRESS_VERSION' ) ) {
foreach ( $wpml_languages as $language ) {
if ( apply_filters( 'wpml_default_language', null ) === $language['code'] ) {
continue;
}
$url = strpos( $language['url'], '?lang=' ) !== false
? str_replace( '?lang=', "{$sitemap_url}?lang=", $language['url'] )
: trim( $language['url'], '/' ) . "/$sitemap_url";
?>
<br>
<a href="<?php echo esc_url( $url ); ?>" target="_blank" class="grim-mb-5">
<?php echo esc_url( $url ); ?>
</a>
<?php
}
}
?>
</p>
<?php if ( 'sitemap_xml' === $sitemap_type ) { ?>
<p class="<?php echo esc_attr( $args['class'] ?? '' ); ?> grim-preview-multilang">
<span class="grim-preview-multilang-label"><?php esc_html_e( 'Multilingual Sitemap Index:', 'xml-sitemap-generator-for-google' ); ?></span>
<br>
<a href="<?php echo esc_url( site_url( 'multilingual-sitemap.xml' ) ); ?>" target="_blank">
<?php echo esc_url( site_url( 'multilingual-sitemap.xml' ) ); ?>
</a>
</p>
<?php } ?>
<?php } ?>
<?php
if ( $notice_show ) {
Dashboard::render(
'partials/sitemap-detector.php',
array(
'sitemap_url' => $sitemap_url,
)
);
}
?>
</div>

View File

@@ -0,0 +1,8 @@
<div class="pro-title-badge">
<span class="pro-title-badge-title"><i class="grim-icon-base-tooltip"></i><?php esc_html_e( 'This feature is available on Premium version', 'xml-sitemap-generator-for-google' ); ?></span>
<a href="<?php echo esc_url( sgg_get_pro_url() ); ?>" class="grim-button secondary" target="_blank">
<span>
<?php esc_html_e( 'Get Now', 'xml-sitemap-generator-for-google' ); ?>
</span>
</a>
</div>

View File

@@ -0,0 +1,6 @@
<?php
/**
* @var $args
*/
?>
<div class="pro-overlay"></div>

View File

@@ -0,0 +1,35 @@
<?php
/**
* @var $args
*/
wp_enqueue_style( 'sgg-rate-banner' );
wp_enqueue_style( 'sgg-icons' );
?>
<div class="grim-container grim-rate-container notice <?php echo esc_attr( $args['wrapper_classes'] ?? '' ); ?>">
<div class="grim-section grim-rate grim-notice-data <?php echo esc_attr( $args['notice_class'] ?? '' ); ?>" data-notice="<?php echo esc_attr( $args['data_notice'] ); ?>">
<?php if ( ! empty( $args['label'] ) ) : ?>
<h3 class="grim-rate-title"><?php echo wp_kses_post( $args['label'] ); ?></h3>
<?php endif; ?>
<p class="grim-rate-description">
<?php echo wp_kses_post( $args['description'] ) ?? ''; ?>
</p>
<div class="grim-rate-actions">
<?php if( ! empty( $args['extra_btn_url'] ) ) : ?>
<a class="grim-button white <?php echo esc_attr( $args['extra_btn_class'] ); ?>" target="_blank" href="<?php echo esc_url( $args['extra_btn_url'] ); ?>">
<span><?php echo wp_kses_post( $args['extra_btn_text'] ); ?></span>
</a>
<?php else: ?>
<a class="grim-button white sgg-notice">
<span><?php esc_html_e( 'Dismiss', 'xml-sitemap-generator-for-google' ); ?></span>
</a>
<?php endif; ?>
<a href="<?php echo esc_url( $args['button_url'] ); ?>" target="_blank" class="grim-button secondary sgg-notice">
<span><?php echo esc_html( $args['button_text'] ) ?><i class="grim-icon-arrow-right"></i></span>
</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,225 @@
<?php
use GRIM_SG\Dashboard;
$settings = $args['settings'] ?? new stdClass();
$previews = array();
$tools = array();
// XML Sitemap
if ( $settings->enable_sitemap ) {
$previews[] = array(
'label' => __( 'XML Sitemap', 'xml-sitemap-generator-for-google' ),
'url' => sgg_get_sitemap_url( $settings->sitemap_url, 'sitemap_xml' ),
);
}
// HTML Sitemap (Pro)
if ( sgg_pro_enabled() && $settings->enable_html_sitemap ) {
$previews[] = array(
'label' => __( 'HTML Sitemap', 'xml-sitemap-generator-for-google' ),
'url' => sgg_get_sitemap_url( $settings->html_sitemap_url, 'sitemap_html' ),
);
}
// Google News
if ( $settings->enable_google_news ) {
$previews[] = array(
'label' => __( 'Google News', 'xml-sitemap-generator-for-google' ),
'url' => sgg_get_sitemap_url( $settings->google_news_url, 'google_news' ),
);
}
// Image Sitemap
if ( $settings->enable_image_sitemap ) {
$previews[] = array(
'label' => __( 'Image Sitemap', 'xml-sitemap-generator-for-google' ),
'url' => sgg_get_sitemap_url( $settings->image_sitemap_url, 'image_sitemap' ),
);
}
// Video Sitemap
if ( $settings->enable_video_sitemap ) {
$previews[] = array(
'label' => __( 'Video Sitemap', 'xml-sitemap-generator-for-google' ),
'url' => sgg_get_sitemap_url( $settings->video_sitemap_url, 'video_sitemap' ),
);
}
// IndexNow
if ( $settings->enable_indexnow ) {
$tools[] = array(
'name' => 'sgg-indexnow',
'label' => __( 'Ping IndexNow Protocol', 'xml-sitemap-generator-for-google' ),
'class' => 'white',
);
}
// Flush Rewrite Rules
$tools[] = array(
'name' => 'sgg-flush-rewrite-rules',
'label' => __( 'Flush Rewrite Rules', 'xml-sitemap-generator-for-google' ),
'class' => 'white',
);
// Clear Cache
if ( $settings->enable_cache ) {
$tools[] = array(
'name' => 'sgg-clear-cache',
'label' => __( 'Clear Sitemaps Cache', 'xml-sitemap-generator-for-google' ),
'class' => 'delete',
);
}
$plugin_links = array(
array(
'title' => esc_html__( 'Documentation', 'xml-sitemap-generator-for-google' ),
'icon' => 'grim-icon-file-text',
'link' => 'https://wpgrim.com/docs/google-xml-sitemaps-generator/?utm_source=sgg-plugin&utm_medium=documentation&utm_campaign=xml_sitemap',
),
array(
'title' => esc_html__( 'Support Forum', 'xml-sitemap-generator-for-google' ),
'icon' => 'grim-icon-help',
'link' => esc_url( sgg_get_support_url() ),
),
array(
'title' => sprintf(
/* translators: %s: Rating stars */
esc_html__( 'Rate %s', 'xml-sitemap-generator-for-google' ),
'<strong>' . esc_html__( '★★★★★', 'xml-sitemap-generator-for-google' ) . '</strong>'
),
'icon' => 'grim-icon-star',
'link' => esc_url( sgg_get_review_url() ),
'class' => 'grim-rate-button',
),
);
if ( sgg_pro_enabled() ) {
array_unshift(
$plugin_links,
array(
'title' => esc_html__( 'Account & Support', 'xml-sitemap-generator-for-google' ),
'icon' => 'grim-icon-user',
'link' => 'https://wpgrim.com/account?utm_source=sgg-plugin&utm_medium=account&utm_campaign=xml_sitemap',
)
);
}
$footer_links = array(
array(
'title' => esc_html__( 'Google Search Console', 'xml-sitemap-generator-for-google' ),
'link' => 'https://search.google.com/search-console',
),
array(
'title' => esc_html__( 'Google News Help Center', 'xml-sitemap-generator-for-google' ),
'link' => 'https://support.google.com/googlenews/',
),
array(
'title' => esc_html__( 'Show up in Google News', 'xml-sitemap-generator-for-google' ),
'link' => 'https://support.google.com/news/publisher-center/answer/9607025',
),
array(
'title' => esc_html__( 'IndexNow Protocol', 'xml-sitemap-generator-for-google' ),
'link' => 'https://www.indexnow.org/',
),
array(
'title' => esc_html__( 'Bing Webmaster Tools', 'xml-sitemap-generator-for-google' ),
'link' => 'https://www.bing.com/webmasters',
),
array(
'title' => esc_html__( 'Yandex Webmaster', 'xml-sitemap-generator-for-google' ),
'link' => 'https://webmaster.yandex.com/sites/',
),
array(
'title' => esc_html__( 'XML Sitemap Validator', 'xml-sitemap-generator-for-google' ),
'link' => 'https://www.xml-sitemaps.com/validate-xml-sitemap.html',
),
);
?>
<div class="grim-section">
<?php if ( ! empty( $tools ) ) : ?>
<div class="grim-sidebar-section grim-sidebar-actions">
<h3 class="grim-section-title"><?php esc_html_e( 'Tools', 'xml-sitemap-generator-for-google' ); ?></h3>
<div class="grim-sidebar-list">
<?php foreach ( $tools as $tool ) : ?>
<div class="grim-sidebar-list-item">
<div class="grim-button white <?php echo esc_attr( $tool['class'] ); ?>">
<input type="hidden" name="<?php echo esc_attr( $tool['name'] ); ?>" value="">
<input
type="submit"
id="<?php echo esc_attr( $tool['name'] ); ?>"
name="<?php echo esc_attr( $tool['name'] ); ?>-button"
value="<?php echo esc_attr( $tool['label'] ); ?>"
class="<?php echo esc_attr( $tool['class'] ); ?>"
>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php if ( ! empty( $previews ) ) : ?>
<div class="grim-sidebar-section">
<h3 class="grim-section-title"><?php esc_html_e( 'Preview', 'xml-sitemap-generator-for-google' ); ?></h3>
<div class="grim-sidebar-list">
<?php foreach ( $previews as $item ) : ?>
<div class="grim-sidebar-list-item">
<a href="<?php echo esc_url( $item['url'] ); ?>" class="grim-button white button-icon-right" target="_blank">
<span>
<?php echo wp_kses_post( $item['label'] ); ?>
<i class="grim-icon-external-link"></i>
</span>
</a>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<?php
if ( ! sgg_pro_enabled() ) {
Dashboard::render(
'partials/rate-banner.php',
array(
'description' => sprintf(
/* translators: %s: Pro version */
esc_html__( 'If you want to unlock more features, please check out our %s.', 'xml-sitemap-generator-for-google' ),
'<a href="' . esc_url( sgg_get_pro_url( 'notice' ) ) . '" target="_blank">' . esc_html__( 'Pro version', 'xml-sitemap-generator-for-google' ) . '</a>'
),
'button_text' => esc_html__( 'Read More', 'xml-sitemap-generator-for-google' ),
'button_url' => esc_url( sgg_get_pro_url( 'notice' ) ),
'data_notice' => 'sgg_buy_pro',
'notice_class' => 'grim-pro-notice grim-sidebar-notice',
)
);
}
?>
<div class="grim-sidebar-section grim-sidebar-actions">
<h3 class="grim-section-title"><?php esc_html_e( 'Useful', 'xml-sitemap-generator-for-google' ); ?></h3>
<?php foreach ( $plugin_links as $plugin_link ) : ?>
<div class="grim-sidebar-list-item grim-sidebar-actions-item">
<a class="grim-button white <?php echo ! empty( $plugin_link['class'] ) ? esc_attr( $plugin_link['class'] ) : ''; ?>" href="<?php echo esc_url( $plugin_link['link'] ); ?>" target="_blank">
<span>
<i class="<?php echo esc_attr( $plugin_link['icon'] ); ?>"></i><?php echo wp_kses_post( $plugin_link['title'] ); ?>
</span>
</a>
</div>
<?php endforeach; ?>
</div>
<div class="grim-sidebar-section">
<h3 class="grim-section-title"><?php esc_html_e( 'Links', 'xml-sitemap-generator-for-google' ); ?></h3>
<div class="grim-sidebar-links">
<?php foreach ( $footer_links as $footer_link ) : ?>
<a class="grim-sidebar-links-item" target="_blank" href="<?php echo esc_url( $footer_link['link'] ); ?>"><?php echo esc_html( $footer_link['title'] ); ?></a>
<?php endforeach; ?>
</div>
</div>
<hr>
<div class="grim-sidebar-section grim-sidebar-wrapper-info">
<div class="grim-sidebar-wrapper-info-logo">
<img src="<?php echo esc_url( plugins_url( 'assets/images/sgg-logo.svg', GRIM_SG_FILE ) ); ?>" alt="logo" width="60" height="60"/>
</div>
<div class="grim-sidebar-wrapper-info-title">
<a href="https://wpgrim.com/dynamic-xml-sitemaps-generator-for-google/?utm_source=sgg-plugin&utm_medium=footer&utm_campaign=xml_sitemap" target="_blank">Dynamic XML Sitemaps Generator For Google Pro</a>
</div>
</div>
</div>

View File

@@ -0,0 +1,28 @@
<?php
/**
* @var $args
*/
$sitemap_url = $args['sitemap_url'];
if ( file_exists( ABSPATH . $sitemap_url ) ) {
$notice_status = 'error';
$notice_message = esc_html__( 'Warning! Static Sitemap File was detected in this URL. Please remove this file from the WordPress Root Directory to use Dynamic Sitemap.', 'xml-sitemap-generator-for-google' );
} else {
$notice_status = 'success';
$notice_message = sprintf(
esc_html__( 'No static sitemap file was detected in this URL. %s', 'xml-sitemap-generator-for-google' ),
'<span>' . esc_html__( 'Above URL will open the awesome Dynamic Sitemap.', 'xml-sitemap-generator-for-google' ) . '</span>'
);
}
if ( ! empty( $sitemap_url ) && ! empty( $notice_message ) ) {
?>
<div class="grim-notice notice-<?php echo esc_html( $notice_status ); ?> inline sitemap-detector">
<i class="grim-icon-check-circle"></i>
<p>
<?php echo wp_kses_post( $notice_message ); ?>
</p>
</div>
<?php
}