Plugin Directory

Changeset 3403469


Ignore:
Timestamp:
11/26/2025 03:08:53 PM (3 weeks ago)
Author:
RavanH
Message:

commit 5.6

Location:
xml-sitemap-feed/trunk
Files:
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • xml-sitemap-feed/trunk/inc/admin/class-fields.php

    r3334262 r3403469  
    4848
    4949        $disabled   = (array) \get_option( 'xmlsf_disabled_providers', \XMLSF\get_default_settings( 'disabled_providers' ) );
    50         $public_tax = \get_taxonomies( array( 'public' => true ) );
     50        $public_tax = \get_taxonomies( array( 'publicly_queryable' => true ) );
    5151        $users_args = array(
    5252            'fields'              => 'ID',
     
    102102    public static function taxonomies_field() {
    103103        $taxonomies = (array) \get_option( 'xmlsf_taxonomies', array() );
    104         $public_tax = (array) \get_taxonomies( array( 'public' => true ) );
     104        $public_tax = (array) \get_taxonomies( array( 'publicly_queryable' => true ), 'objects' );
    105105
    106106        // The actual fields for data entry.
     
    205205     * Quick edit fields allows to add HTML in Quick Edit.
    206206     *
    207      * @since 5.7
     207     * @since 5.5
    208208     *
    209209     * @param string $column_name Column name.
     
    219219     * Bulk edit fields allows to add HTML in Quick Edit.
    220220     *
    221      * @since 5.7
     221     * @since 5.5
    222222     *
    223223     * @param string $column_name Column name.
     
    230230        }
    231231    }
     232
     233    /**
     234     * Sitemap notifier field.
     235     *
     236     * @since 5.6
     237     */
     238    public static function sitemap_notifier_field() {
     239        // The actual fields for data entry.
     240        include XMLSF_DIR . '/views/admin/field-sitemap-notifier.php';
     241    }
    232242}
  • xml-sitemap-feed/trunk/inc/admin/class-main.php

    r3334262 r3403469  
    2525
    2626        // Shared Admin pages sidebar actions.
    27         \add_action( 'xmlsf_admin_sidebar', array( __CLASS__, 'admin_sidebar_help' ) );
    28         \add_action( 'xmlsf_admin_sidebar', array( __CLASS__, 'admin_sidebar_contribute' ), 20 );
     27        \add_action(
     28            'xmlsf_admin_sidebar',
     29            function () {
     30                include XMLSF_DIR . '/views/admin/sidebar-help.php';
     31            }
     32        );
     33        \add_action(
     34            'xmlsf_admin_sidebar',
     35            function () {
     36                include XMLSF_DIR . '/views/admin/sidebar-contribute.php';
     37            },
     38            20
     39        );
    2940
    3041        if ( \XMLSF\sitemaps_enabled( 'sitemap' ) ) {
     
    237248
    238249    /**
    239      * Clear settings
    240      */
    241     public static function clear_settings() {
    242         // TODO reset Settings > Reading options here...
    243 
    244         \add_settings_error(
    245             'notice_clear_settings',
    246             'notice_clear_settings',
    247             __( 'Settings reset to the plugin defaults.', 'xml-sitemap-feed' ),
    248             'updated'
    249         );
    250     }
    251 
    252     /**
    253      * Admin sidbar help section
    254      */
    255     public static function admin_sidebar_help() {
    256         include XMLSF_DIR . '/views/admin/sidebar-help.php';
    257     }
    258 
    259     /**
    260      * Admin sidbar contribute section
    261      */
    262     public static function admin_sidebar_contribute() {
    263         include XMLSF_DIR . '/views/admin/sidebar-contribute.php';
    264     }
    265 
    266     /**
    267250     * Admin notices actions
    268251     */
  • xml-sitemap-feed/trunk/inc/admin/class-sitemap-news.php

    r3397682 r3403469  
    4040
    4141    /**
    42      * Clear settings
    43      */
    44     public static function clear_settings() {
    45         // Update to defaults.
    46         \update_option( 'xmlsf_news_tags', \XMLSF\get_default_settings( 'news_tags' ) );
    47 
    48         \do_action( 'xmlsf_clear_news_settings' );
    49     }
    50 
    51     /**
    52      * Tools actions
    53      */
    54     public static function tools_actions() {
    55         // Skip if doing ajax or no valid nonce.
    56         if ( \wp_doing_ajax() || ! isset( $_POST['_xmlsf_help_nonce'] ) || ! \wp_verify_nonce( sanitize_key( $_POST['_xmlsf_help_nonce'] ), XMLSF_BASENAME . '-help' ) ) {
    57             return;
    58         }
    59 
    60         if ( isset( $_POST['xmlsf-flush-rewrite-rules'] ) ) {
    61             // Flush rewrite rules.
    62             \flush_rewrite_rules( false );
    63             \add_settings_error(
    64                 'flush_admin_notice',
    65                 'flush_admin_notice',
    66                 __( 'WordPress rewrite rules have been flushed.', 'xml-sitemap-feed' ),
    67                 'success'
    68             );
    69         }
    70 
    71         if ( isset( $_POST['xmlsf-check-conflicts'] ) ) {
    72             // Reset ignored warnings.
    73             \delete_user_meta( \get_current_user_id(), 'xmlsf_dismissed' );
    74 
    75             // Check static file.
    76             $slug = \is_object( \xmlsf()->sitemap_news ) ? \xmlsf()->sitemap_news->slug() : 'sitemap-news';
    77 
    78             if ( \file_exists( \trailingslashit( \get_home_path() ) . $slug . '.xml' ) ) {
    79                 \add_settings_error(
    80                     'static_files_notice',
    81                     'static_file_' . $slug,
    82                     \sprintf( /* translators: %1$s file name, %2$s is XML Sitemap (linked to options-reading.php) */
    83                         \esc_html__( 'A conflicting static file has been found: %1$s. Either delete it or disable the corresponding %2$s.', 'xml-sitemap-feed' ),
    84                         \esc_html( $slug . '.xml' ),
    85                         '<a href="' . \esc_url( \admin_url( 'options-reading.php' ) ) . '#xmlsf_sitemaps">' . \esc_html__( 'XML Sitemap', 'xml-sitemap-feed' ) . '</a>'
    86                     ),
    87                     'warning'
    88                 );
    89             } else {
    90                 \add_settings_error(
    91                     'static_files_notice',
    92                     'static_files',
    93                     \esc_html__( 'No conflicting static files found.', 'xml-sitemap-feed' ),
    94                     'success'
    95                 );
    96             }
    97         }
    98 
    99         if ( isset( $_POST['xmlsf-clear-settings'] ) ) {
    100             self::clear_settings();
    101             \add_settings_error(
    102                 'notice_clear_settings',
    103                 'notice_clear_settings',
    104                 __( 'Settings reset to the plugin defaults.', 'xml-sitemap-feed' ),
    105                 'updated'
    106             );
    107         }
    108     }
    109 
    110     /**
    11142     * Compare versions to known compatibility.
    11243     */
     
    13263
    13364        // Google News Advanced incompatibility notice.
    134         if ( ! self::compatible_with_advanced() && ! \in_array( 'xmlsf_advanced_news', (array) get_user_meta( get_current_user_id(), 'xmlsf_dismissed' ), true ) ) {
     65        if ( ! self::compatible_with_advanced() && ! \in_array( 'xmlsf_advanced_news', (array) get_user_meta( get_current_user_id(), 'xmlsf_dismissed', false ), true ) ) {
    13566            include XMLSF_DIR . '/views/admin/notice-xmlsf-advanced-news.php';
    13667        }
     
    16293     */
    16394    public static function meta_box( $post ) {
    164         // Use nonce for verification.
    165         \wp_nonce_field( XMLSF_BASENAME, '_xmlsf_news_nonce' );
    166 
    167         // Use get_post_meta to retrieve an existing value from the database and use the value for the form.
    168         $exclude  = 'private' === $post->post_status || \get_post_meta( $post->ID, '_xmlsf_news_exclude', true );
    169         $disabled = 'private' === $post->post_status;
     95        $post_id     = $post->ID;
     96        $post_status = $post->post_status;
    17097
    17198        // The actual fields for data entry.
     
    206133            'manage_options',
    207134            'xmlsf_news',
    208             array( __CLASS__, 'settings_page' )
     135            array( __NAMESPACE__ . '\Sitemap_News_Settings', 'settings_page' )
    209136        );
    210137
    211         // Settings hooks.
    212         \add_action( 'xmlsf_news_add_settings', array( __CLASS__, 'add_settings' ) );
    213 
    214         // Tools actions.
    215         \add_action( 'load-' . $screen_id, array( __CLASS__, 'tools_actions' ) );
    216 
    217         // Help tab.
    218         \add_action( 'load-' . $screen_id, array( __CLASS__, 'help_tab' ) );
    219     }
    220 
    221     /**
    222      * Options page callback
    223      */
    224     public static function settings_page() {
    225         global $wp_rewrite;
    226 
    227         $active_tab = isset( $_GET['tab'] ) ? \sanitize_key( $_GET['tab'] ) : 'general'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    228 
    229         \do_action( 'xmlsf_news_add_settings', $active_tab );
    230 
    231         // Sidebar actions.
    232         \add_action(
    233             'xmlsf_admin_sidebar',
    234             function () {
    235                 include XMLSF_DIR . '/views/admin/sidebar-news-links.php';
    236             },
    237             9
    238         );
    239 
    240         include XMLSF_DIR . '/views/admin/page-sitemap-news.php';
    241     }
    242 
    243     /**
    244      * Add settings sections and fields.
    245      *
    246      * @param string $active_tab The active tab slug.
    247      */
    248     public static function add_settings( $active_tab = '' ) {
    249         switch ( $active_tab ) {
    250             case 'advanced':
    251                 // ADVANCED SECTION.
    252                 \add_settings_section(
    253                     'news_sitemap_advanced_section',
    254                     '',
    255                     '',
    256                     'xmlsf_news_advanced'
    257                 );
    258                 // Hierarchical post types.
    259                 \add_settings_field(
    260                     'xmlsf_news_hierarchical',
    261                     __( 'Hierarchical post types', 'xml-sitemap-feed' ),
    262                     function () {
    263                         include XMLSF_DIR . '/views/admin/field-news-hierarchical.php';
    264                     },
    265                     'xmlsf_news_advanced',
    266                     'news_sitemap_advanced_section'
    267                 );
    268                 // Keywords.
    269                 \add_settings_field(
    270                     'xmlsf_news_keywords',
    271                     __( 'Keywords', 'xml-sitemap-feed' ),
    272                     function () {
    273                         include XMLSF_DIR . '/views/admin/field-news-keywords.php';
    274                     },
    275                     'xmlsf_news_advanced',
    276                     'news_sitemap_advanced_section'
    277                 );
    278                 // Stock tickers.
    279                 \add_settings_field(
    280                     'xmlsf_news_stock_tickers',
    281                     __( 'Stock tickers', 'xml-sitemap-feed' ),
    282                     function () {
    283                         include XMLSF_DIR . '/views/admin/field-news-stocktickers.php';
    284                     },
    285                     'xmlsf_news_advanced',
    286                     'news_sitemap_advanced_section'
    287                 );
    288                 // Sitemap notifier.
    289                 \add_settings_field(
    290                     'xmlsf_news_sitemap_notifier',
    291                     __( 'Sitemap notifier', 'xml-sitemap-feed' ),
    292                     function () {
    293                         include XMLSF_DIR . '/views/admin/field-news-notifier.php';
    294                     },
    295                     'xmlsf_news_advanced',
    296                     'news_sitemap_advanced_section'
    297                 );
    298                 \add_action( 'xmlsf_news_settings_before', array( __CLASS__, 'section_advanced_intro' ) );
    299                 break;
    300 
    301             case 'general':
    302             default:
    303                 // GENERAL SECTION.
    304                 \add_settings_section(
    305                     'news_sitemap_general_section',
    306                     '',
    307                     '',
    308                     'xmlsf_news_general'
    309                 );
    310 
    311                 // SETTINGS.
    312                 \add_settings_field(
    313                     'xmlsf_news_name',
    314                     '<label for="xmlsf_news_name">' . \__( 'Publication name', 'xml-sitemap-feed' ) . '</label>',
    315                     function () {
    316                         include XMLSF_DIR . '/views/admin/field-news-name.php';
    317                     },
    318                     'xmlsf_news_general',
    319                     'news_sitemap_general_section'
    320                 );
    321                 \add_settings_field(
    322                     'xmlsf_news_post_type',
    323                     __( 'Post types', 'xml-sitemap-feed' ),
    324                     function () {
    325                         include XMLSF_DIR . '/views/admin/field-news-post-type.php';
    326                     },
    327                     'xmlsf_news_general',
    328                     'news_sitemap_general_section'
    329                 );
    330 
    331                 global $wp_taxonomies;
    332 
    333                 $options        = (array) \get_option( 'xmlsf_news_tags', array() );
    334                 $news_post_type = isset( $options['post_type'] ) && ! empty( $options['post_type'] ) ? (array) $options['post_type'] : array( 'post' );
    335                 $post_types     = ( isset( $wp_taxonomies['category'] ) ) ? $wp_taxonomies['category']->object_type : array();
    336 
    337                 foreach ( $news_post_type as $post_type ) {
    338                     if ( \in_array( $post_type, $post_types, true ) ) {
    339                         \add_settings_field(
    340                             'xmlsf_news_categories',
    341                             \translate( 'Categories' ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    342                             function () {
    343                                 include XMLSF_DIR . '/views/admin/field-news-categories.php';
    344                             },
    345                             'xmlsf_news_general',
    346                             'news_sitemap_general_section'
    347                         );
    348                         break;
    349                     }
    350                 }
    351 
    352                 // Source labels - deprecated.
    353                 \add_settings_field(
    354                     'xmlsf_news_labels',
    355                     __( 'Content labels', 'xml-sitemap-feed' ),
    356                     function () {
    357                         include XMLSF_DIR . '/views/admin/field-news-labels.php';
    358                     },
    359                     'xmlsf_news_general',
    360                     'news_sitemap_general_section'
    361                 );
    362         }
     138        // Load settings.
     139        \add_action( 'load-' . $screen_id, array( __NAMESPACE__ . '\Sitemap_News_Settings', 'load' ) );
    363140    }
    364141
     
    370147            'xmlsf_news_general',
    371148            'xmlsf_news_tags',
    372             array( 'sanitize_callback' => array( __CLASS__, 'sanitize_news_tags' ) )
     149            array( 'sanitize_callback' => array( __NAMESPACE__ . '\Sitemap_News_Settings', 'sanitize_news_tags' ) )
    373150        );
    374151
     
    379156        );
    380157    }
    381 
    382     /**
    383      * Advanced section intro
    384      *
    385      * @param string $active_tab Active tab.
    386      */
    387     public static function section_advanced_intro( $active_tab = '' ) {
    388         if ( 'advanced' === $active_tab && ! is_plugin_active( 'xml-sitemap-feed-advanced-news/xml-sitemap-advanced-news.php' ) ) {
    389             include XMLSF_DIR . '/views/admin/section-advanced-intro.php';
    390         }
    391     }
    392 
    393     /**
    394      * Help tab
    395      */
    396     public static function help_tab() {
    397         $screen     = \get_current_screen();
    398         $active_tab = isset( $_GET['tab'] ) ? sanitize_key( $_GET['tab'] ) : 'general'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    399 
    400         \ob_start();
    401         include XMLSF_DIR . '/views/admin/help-tab-news.php';
    402         include XMLSF_DIR . '/views/admin/help-tab-support.php';
    403         $content = \ob_get_clean();
    404 
    405         $screen->add_help_tab(
    406             array(
    407                 'id'      => 'sitemap-news-settings',
    408                 'title'   => \__( 'Google News Sitemap', 'xml-sitemap-feed' ),
    409                 'content' => $content,
    410             )
    411         );
    412 
    413         switch ( $active_tab ) {
    414             case 'general':
    415                 // Publication name.
    416                 \ob_start();
    417                 include XMLSF_DIR . '/views/admin/help-tab-news-name.php';
    418                 include XMLSF_DIR . '/views/admin/help-tab-support.php';
    419                 $content = \ob_get_clean();
    420                 $screen->add_help_tab(
    421                     array(
    422                         'id'      => 'sitemap-news-name',
    423                         'title'   => \__( 'Publication name', 'xml-sitemap-feed' ),
    424                         'content' => $content,
    425                     )
    426                 );
    427                 // Post types.
    428                 \ob_start();
    429                 include XMLSF_DIR . '/views/admin/help-tab-news-post-types.php';
    430                 include XMLSF_DIR . '/views/admin/help-tab-support.php';
    431                 $content = \ob_get_clean();
    432                 $screen->add_help_tab(
    433                     array(
    434                         'id'      => 'sitemap-news-post-types',
    435                         'title'   => \__( 'Post types', 'xml-sitemap-feed' ),
    436                         'content' => $content,
    437                     )
    438                 );
    439                 // Categories.
    440                 \ob_start();
    441                 include XMLSF_DIR . '/views/admin/help-tab-news-categories.php';
    442                 include XMLSF_DIR . '/views/admin/help-tab-support.php';
    443                 $content = \ob_get_clean();
    444                 $screen->add_help_tab(
    445                     array(
    446                         'id'      => 'sitemap-news-categories',
    447                         'title'   => \translate( 'Categories' ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    448                         'content' => $content,
    449                     )
    450                 );
    451                 break;
    452 
    453             case 'advanced':
    454                 // Hierarchical post types.
    455                 \ob_start();
    456                 include XMLSF_DIR . '/views/admin/help-tab-news-hierarchical.php';
    457                 include XMLSF_DIR . '/views/admin/help-tab-support.php';
    458                 $content = \ob_get_clean();
    459                 $screen->add_help_tab(
    460                     array(
    461                         'id'      => 'sitemap-news-post-types',
    462                         'title'   => \__( 'Hierarchical post types', 'xml-sitemap-feed' ),
    463                         'content' => $content,
    464                     )
    465                 );
    466                 // Keywords.
    467                 \ob_start();
    468                 include XMLSF_DIR . '/views/admin/help-tab-news-keywords.php';
    469                 include XMLSF_DIR . '/views/admin/help-tab-support.php';
    470                 $content = \ob_get_clean();
    471                 $screen->add_help_tab(
    472                     array(
    473                         'id'      => 'sitemap-news-keywords',
    474                         'title'   => \__( 'Keywords', 'xml-sitemap-feed' ),
    475                         'content' => $content,
    476                     )
    477                 );
    478                 // Stock tickers.
    479                 \ob_start();
    480                 include XMLSF_DIR . '/views/admin/help-tab-news-stocktickers.php';
    481                 include XMLSF_DIR . '/views/admin/help-tab-support.php';
    482                 $content = \ob_get_clean();
    483                 $screen->add_help_tab(
    484                     array(
    485                         'id'      => 'sitemap-news-stocktickers',
    486                         'title'   => \__( 'Stock tickers', 'xml-sitemap-feed' ),
    487                         'content' => $content,
    488                     )
    489                 );
    490                 // Sitemap notifier.
    491                 \ob_start();
    492                 include XMLSF_DIR . '/views/admin/help-tab-news-notifier.php';
    493                 include XMLSF_DIR . '/views/admin/help-tab-support.php';
    494                 $content = \ob_get_clean();
    495                 $screen->add_help_tab(
    496                     array(
    497                         'id'      => 'sitemap-news-notifier',
    498                         'title'   => \__( 'Sitemap notifier', 'xml-sitemap-feed' ),
    499                         'content' => $content,
    500                     )
    501                 );
    502         }
    503 
    504         // Hook for additional/advanced help tab.
    505         \do_action( 'xmlsf_news_help_tabs', $screen, $active_tab );
    506 
    507         \ob_start();
    508         include XMLSF_DIR . '/views/admin/help-tab-news-sidebar.php';
    509         $content = \ob_get_clean();
    510 
    511         $screen->set_help_sidebar( $content );
    512     }
    513 
    514     /**
    515      * Sanitize news tag settings
    516      *
    517      * @param array $save Settings array.
    518      *
    519      * @return array
    520      */
    521     public static function sanitize_news_tags( $save ) {
    522         $sanitized = \is_array( $save ) ? $save : array();
    523 
    524         // At least one, default post type.
    525         if ( empty( $sanitized['post_type'] ) || ! \is_array( $sanitized['post_type'] ) ) {
    526             $sanitized['post_type'] = array( 'post' );
    527             // Add settings error.
    528             \add_settings_error(
    529                 'xmlsf_news_tags',
    530                 'xmlsf_news_post_type_error',
    531                 __( 'At least one post type must be selected. Defaulting to "Posts".', 'xml-sitemap-feed' ),
    532                 'error'
    533             );
    534         }
    535 
    536         // If there are categories selected, then test.
    537         // If we have post types selected that do not use the post category taxonomy.
    538         if ( ! empty( $sanitized['categories'] ) ) {
    539             global $wp_taxonomies;
    540             $post_types = ( isset( $wp_taxonomies['category'] ) ) ? $wp_taxonomies['category']->object_type : array();
    541 
    542             $disabled = false;
    543             foreach ( $sanitized['post_type'] as $post_type ) {
    544                 if ( ! \in_array( $post_type, $post_types, true ) ) {
    545                     $disabled = true;
    546                     break;
    547                 }
    548             }
    549             // Suppress category selection.
    550             if ( $disabled ) {
    551                 unset( $sanitized['categories'] );
    552             }
    553         }
    554 
    555         return $sanitized;
    556     }
    557158}
  • xml-sitemap-feed/trunk/inc/admin/class-sitemap.php

    r3378863 r3403469  
    100100        // Set transients for flushing.
    101101        set_transient( 'xmlsf_server_updated', true );
    102     }
    103 
    104     /**
    105      * Maybe server option was updated.
    106      *
    107      * Checks $_GET['settings-updated'] and transient 'xmlsf_server_updated'. Hooked into settings page load actions.
    108      */
    109     public static function maybe_server_updated() {
    110         if ( ! empty( $_GET['settings-updated'] ) && \delete_transient( 'xmlsf_server_updated' ) ) {
    111             // Flush rewrite rules.
    112             \flush_rewrite_rules( false );
    113 
    114             // Check static file.
    115             $slug = \is_object( \xmlsf()->sitemap ) ? \xmlsf()->sitemap->slug() : 'sitemap';
    116 
    117             if ( \file_exists( \trailingslashit( \get_home_path() ) . $slug . '.xml' ) ) {
    118                 \add_settings_error(
    119                     'static_files_notice',
    120                     'static_file_' . $slug,
    121                     \sprintf( /* translators: %1$s file name, %2$s is XML Sitemap (linked to options-reading.php) */
    122                         \esc_html__( 'A conflicting static file has been found: %1$s. Either delete it or disable the corresponding %2$s.', 'xml-sitemap-feed' ),
    123                         \esc_html( $slug . '.xml' ),
    124                         '<a href="' . \esc_url( \admin_url( 'options-reading.php' ) ) . '#xmlsf_sitemaps">' . \esc_html__( 'XML Sitemap', 'xml-sitemap-feed' ) . '</a>'
    125                     ),
    126                     'warning'
    127                 );
    128             }
    129         }
    130102    }
    131103
     
    213185
    214186    /**
    215      * Tools actions
    216      */
    217     public static function tools_actions() {
    218         if ( ! isset( $_POST['_xmlsf_help_nonce'] ) || ! \wp_verify_nonce( \sanitize_key( $_POST['_xmlsf_help_nonce'] ), XMLSF_BASENAME . '-help' ) ) {
    219             return;
    220         }
    221 
    222         if ( isset( $_POST['xmlsf-flush-rewrite-rules'] ) ) {
    223             // Flush rewrite rules.
    224             \flush_rewrite_rules( false );
    225             \add_settings_error(
    226                 'flush_admin_notice',
    227                 'flush_admin_notice',
    228                 __( 'WordPress rewrite rules have been flushed.', 'xml-sitemap-feed' ),
    229                 'success'
    230             );
    231         }
    232 
    233         if ( isset( $_POST['xmlsf-check-conflicts'] ) ) {
    234             // Reset ignored warnings.
    235             \delete_user_meta( \get_current_user_id(), 'xmlsf_dismissed' );
    236 
    237             // Check static file.
    238             $slug = \is_object( \xmlsf()->sitemap ) ? \xmlsf()->sitemap->slug() : 'sitemap';
    239 
    240             if ( \file_exists( \trailingslashit( \get_home_path() ) . $slug . '.xml' ) ) {
    241                 \add_settings_error(
    242                     'static_files_notice',
    243                     'static_file_' . $slug,
    244                     \sprintf( /* translators: %1$s file name, %2$s is XML Sitemap (linked to options-reading.php) */
    245                         \esc_html__( 'A conflicting static file has been found: %1$s. Either delete it or disable the corresponding %2$s.', 'xml-sitemap-feed' ),
    246                         \esc_html( $slug . '.xml' ),
    247                         '<a href="' . \esc_url( \admin_url( 'options-reading.php' ) ) . '#xmlsf_sitemaps">' . \esc_html__( 'XML Sitemap', 'xml-sitemap-feed' ) . '</a>'
    248                     ),
    249                     'warning'
    250                 );
    251             } else {
    252                 \add_settings_error(
    253                     'static_files_notice',
    254                     'static_files',
    255                     \esc_html__( 'No conflicting static files found.', 'xml-sitemap-feed' ),
    256                     'success'
    257                 );
    258             }
    259         }
    260 
    261         if ( isset( $_POST['xmlsf-clear-settings'] ) ) {
    262             self::clear_settings();
    263             \add_settings_error(
    264                 'notice_clear_settings',
    265                 'notice_clear_settings',
    266                 \esc_html__( 'Settings reset to the plugin defaults.', 'xml-sitemap-feed' ),
    267                 'updated'
    268             );
    269         }
    270 
    271         if ( isset( $_POST['xmlsf-clear-term-meta'] ) ) {
    272             // Remove terms metadata.
    273             \delete_metadata( 'term', 0, 'term_modified', '', true );
    274 
    275             \add_settings_error(
    276                 'clear_meta_notice',
    277                 'clear_meta_notice',
    278                 \esc_html__( 'Sitemap term meta cache has been cleared.', 'xml-sitemap-feed' ),
    279                 'success'
    280             );
    281         }
    282 
    283         if ( isset( $_POST['xmlsf-clear-user-meta'] ) ) {
    284             // Remove terms metadata.
    285             \delete_metadata( 'user', 0, 'user_modified', '', true );
    286 
    287             \add_settings_error(
    288                 'clear_meta_notice',
    289                 'clear_meta_notice',
    290                 \esc_html__( 'Sitemap author meta cache has been cleared.', 'xml-sitemap-feed' ),
    291                 'success'
    292             );
    293         }
    294 
    295         if ( isset( $_POST['xmlsf-clear-post-meta'] ) ) {
    296             // Remove metadata.
    297             \delete_metadata( 'post', 0, '_xmlsf_image_attached', '', true );
    298             \delete_metadata( 'post', 0, '_xmlsf_image_featured', '', true );
    299             \set_transient( 'xmlsf_images_meta_primed', array() );
    300 
    301             \delete_metadata( 'post', 0, '_xmlsf_comment_date_gmt', '', true );
    302             \set_transient( 'xmlsf_comments_meta_primed', array() );
    303 
    304             \add_settings_error(
    305                 'clear_meta_notice',
    306                 'clear_meta_notice',
    307                 \esc_html__( 'Sitemap post meta caches have been cleared.', 'xml-sitemap-feed' ),
    308                 'updated'
    309             );
    310         }
    311     }
    312 
    313     /**
    314187     * Compare versions to known compatibility.
    315188     */
     
    335208
    336209        // XML Sitemap Advanced incompatibility notice.
    337         if ( ! self::compatible_with_advanced() && ! \in_array( 'xmlsf_advanced', (array) \get_user_meta( \get_current_user_id(), 'xmlsf_dismissed' ), true ) ) {
     210        if ( ! self::compatible_with_advanced() && ! \in_array( 'xmlsf_advanced', (array) \get_user_meta( \get_current_user_id(), 'xmlsf_dismissed', false ), true ) ) {
    338211            include XMLSF_DIR . '/views/admin/notice-xmlsf-advanced.php';
    339212        }
     
    372245     */
    373246    public static function meta_box( $post ) {
    374         // Use nonce for verification.
    375         \wp_nonce_field( XMLSF_BASENAME, '_xmlsf_nonce' );
    376 
    377         // Use get_post_meta to retrieve an existing value from the database and use the value for the form.
    378         $exclude  = \get_post_meta( $post->ID, '_xmlsf_exclude', true );
    379         $priority = \get_post_meta( $post->ID, '_xmlsf_priority', true );
    380 
    381         // value prechecks to prevent "invalid form control not focusable" when meta box is hidden.
    382         $priority = \is_numeric( $priority ) ? \XMLSF\sanitize_number( $priority ) : '';
    383 
    384         $description = sprintf(
    385             /* translators: Settings admin menu name, XML Sitemap admin page name */
    386             \esc_html__( 'Leave empty for automatic Priority as configured on %1$s > %2$s.', 'xml-sitemap-feed' ),
    387             \esc_html( \translate( 'Settings' ) ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    388             '<a href="' . \admin_url( 'options-general.php' ) . '?page=xmlsf">' . \esc_html__( 'XML Sitemap', 'xml-sitemap-feed' ) . '</a>'
    389         );
     247        $post_id = $post->ID;
    390248
    391249        // The actual fields for data entry.
     
    433291            'manage_options',
    434292            'xmlsf',
    435             array( __CLASS__, 'settings_page' )
    436         );
    437 
    438         // Settings hooks.
    439         \add_action( 'xmlsf_add_settings', array( __CLASS__, 'add_settings' ) );
    440 
    441         // Tools actions.
    442         \add_action( 'load-' . $screen_id, array( __CLASS__, 'tools_actions' ) );
    443 
    444         // Help tabs.
    445         \add_action( 'load-' . $screen_id, array( __CLASS__, 'help_tabs' ) );
    446     }
    447 
    448     /**
    449      * Options page callback
    450      */
    451     public static function settings_page() {
    452         $active_tab = isset( $_GET['tab'] ) ? \sanitize_key( \wp_unslash( $_GET['tab'] ) ) : 'general'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    453 
    454         \do_action( 'xmlsf_add_settings', $active_tab );
    455 
    456         // prepare sitemap link url.
    457         $sitemap_url = \xmlsf()->sitemap->get_sitemap_url();
    458 
    459         // Sidebar actions.
    460         \add_action(
    461             'xmlsf_admin_sidebar',
    462             function () {
    463                 include XMLSF_DIR . '/views/admin/sidebar-links.php';
    464             },
    465             9
    466         );
    467 
    468         $disabled = \get_option( 'xmlsf_disabled_providers', \XMLSF\get_default_settings( 'disabled_providers' ) );
    469 
    470         // The actual settings page.
    471         include XMLSF_DIR . '/views/admin/page-sitemap.php';
    472     }
    473 
    474     /**
    475      * Add settings sections and fields.
    476      *
    477      * @param string $active_tab The active tab slug.
    478      */
    479     public static function add_settings( $active_tab = '' ) {
    480         switch ( $active_tab ) {
    481             case 'post_types':
    482                 /** POST TYPES */
    483                 \add_settings_section(
    484                     'xml_sitemap_post_types_section',
    485                     '',
    486                     '',
    487                     'xmlsf_post_types'
    488                 );
    489 
    490                 \add_settings_field(
    491                     'xmlsf_sitemap_post_types_limit',
    492                     \translate( 'General' ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    493                     array( __NAMESPACE__ . '\Fields', 'post_types_general_fields' ),
    494                     'xmlsf_post_types',
    495                     'xml_sitemap_post_types_section'
    496                 );
    497 
    498                 $post_types = \get_post_types( array( 'public' => true ) );
    499                 // Make sure post types are allowed and publicly viewable.
    500                 $post_types = \array_diff( $post_types, \xmlsf()->disabled_post_types() );
    501                 $post_types = \array_filter( $post_types, 'is_post_type_viewable' );
    502 
    503                 if ( \is_array( $post_types ) && ! empty( $post_types ) ) {
    504                     foreach ( $post_types as $post_type ) {
    505                         $obj = \get_post_type_object( $post_type );
    506                         if ( ! \is_object( $obj ) ) {
    507                             continue;
    508                         }
    509                         \add_settings_field(
    510                             'xmlsf_post_type_' . $obj->name,
    511                             $obj->label,
    512                             array( __NAMESPACE__ . '\Fields', 'post_type_fields' ),
    513                             'xmlsf_post_types',
    514                             'xml_sitemap_post_types_section',
    515                             $post_type
    516                         );
    517                         // Note: (ab)using section name parameter to pass post type name.
    518                     }
    519                 }
    520                 break;
    521 
    522             case 'taxonomies':
    523                 /** TAXONOMIES */
    524                 \add_settings_section(
    525                     'xml_sitemap_taxonomies_section',
    526                     '',
    527                     '',
    528                     'xmlsf_taxonomies'
    529                 );
    530                 \add_settings_field(
    531                     'xmlsf_taxonomy_settings',
    532                     translate( 'General' ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    533                     array( __NAMESPACE__ . '\Fields', 'taxonomy_settings_field' ),
    534                     'xmlsf_taxonomies',
    535                     'xml_sitemap_taxonomies_section'
    536                 );
    537                 \add_settings_field(
    538                     'xmlsf_taxonomies',
    539                     __( 'Taxonomies', 'xml-sitemap-feed' ),
    540                     array( __NAMESPACE__ . '\Fields', 'taxonomies_field' ),
    541                     'xmlsf_taxonomies',
    542                     'xml_sitemap_taxonomies_section'
    543                 );
    544                 break;
    545 
    546             case 'authors':
    547                 /** AUTHORS */
    548                 \add_settings_section(
    549                     'xml_sitemap_authors_section',
    550                     '',
    551                     '',
    552                     'xmlsf_authors'
    553                 );
    554                 \add_settings_field(
    555                     'xmlsf_author_settings',
    556                     translate( 'General' ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    557                     array( __NAMESPACE__ . '\Fields', 'author_settings_field' ),
    558                     'xmlsf_authors',
    559                     'xml_sitemap_authors_section'
    560                 );
    561                 \add_settings_field(
    562                     'xmlsf_authors',
    563                     __( 'Authors', 'xml-sitemap-feed' ),
    564                     array( __NAMESPACE__ . '\Fields', 'authors_field' ),
    565                     'xmlsf_authors',
    566                     'xml_sitemap_authors_section'
    567                 );
    568                 break;
    569 
    570             case 'advanced':
    571                 /** ADVANCED */
    572                 \add_settings_section(
    573                     'xml_sitemap_advanced_section',
    574                     '',
    575                     '',
    576                     'xmlsf_advanced'
    577                 );
    578                 // custom name.
    579                 \add_settings_field(
    580                     'xmlsf_sitemap_name',
    581                     '<label for="xmlsf_sitemap_name">' . __( 'XML Sitemap URL', 'xml-sitemap-feed' ) . '</label>',
    582                     array( __NAMESPACE__ . '\Fields', 'xmlsf_sitemap_slug_field' ),
    583                     'xmlsf_advanced',
    584                     'xml_sitemap_advanced_section'
    585                 );
    586                 // custom urls.
    587                 \add_settings_field(
    588                     'xmlsf_urls',
    589                     __( 'External web pages', 'xml-sitemap-feed' ),
    590                     array( __NAMESPACE__ . '\Fields', 'urls_settings_field' ),
    591                     'xmlsf_advanced',
    592                     'xml_sitemap_advanced_section'
    593                 );
    594                 // custom sitemaps.
    595                 \add_settings_field(
    596                     'xmlsf_custom_sitemaps',
    597                     __( 'External XML Sitemaps', 'xml-sitemap-feed' ),
    598                     array( __NAMESPACE__ . '\Fields', 'custom_sitemaps_settings_field' ),
    599                     'xmlsf_advanced',
    600                     'xml_sitemap_advanced_section'
    601                 );
    602                 break;
    603 
    604             case 'general':
    605             default:
    606                 /** GENERAL */
    607                 // Sections.
    608                 \add_settings_section(
    609                     'general', // Section ID.
    610                     '', // Title.
    611                     '', // Intro callback.
    612                     'xmlsf_general' // Page slug.
    613                 );
    614                 // Fields.
    615                 \add_settings_field(
    616                     'server',
    617                     \translate( 'Server' ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    618                     array( __NAMESPACE__ . '\Fields', 'server_field' ),
    619                     'xmlsf_general',
    620                     'general'
    621                 );
    622                 \add_settings_field(
    623                     'disabled_providers',
    624                     \esc_html__( 'Disable sitemaps', 'xml-sitemap-feed' ),
    625                     array( __NAMESPACE__ . '\Fields', 'disable_fields' ),
    626                     'xmlsf_general',
    627                     'general'
    628                 );
    629         }
     293            array( __NAMESPACE__ . '\Sitemap_Settings', 'settings_page' )
     294        );
     295
     296        // Load settings.
     297        \add_action( 'load-' . $screen_id, array( __NAMESPACE__ . '\Sitemap_Settings', 'load' ) );
    630298    }
    631299
     
    696364        \add_action( 'update_option_xmlsf_disabled_providers', array( __CLASS__, 'update_disabled_providers' ), 10, 2 );
    697365        \add_action( 'update_option_xmlsf_post_types', array( __CLASS__, 'update_post_types' ), 10, 2 );
    698 
    699         // Check server updated.
    700         \add_action( 'load-settings_page_xmlsf', array( __CLASS__, 'maybe_server_updated' ) );
    701     }
    702 
    703     /**
    704      * Help tabs
    705      */
    706     public static function help_tabs() {
    707         $screen     = \get_current_screen();
    708         $active_tab = isset( $_GET['tab'] ) ? \sanitize_key( $_GET['tab'] ) : 'general'; // phpcs:ignore WordPress.Security.NonceVerification.Recommended
    709 
    710         \ob_start();
    711         include XMLSF_DIR . '/views/admin/help-tab-sitemaps.php';
    712         include XMLSF_DIR . '/views/admin/help-tab-support.php';
    713         $content = \ob_get_clean();
    714 
    715         $screen->add_help_tab(
    716             array(
    717                 'id'      => 'sitemap-settings',
    718                 'title'   => __( 'XML Sitemap', 'xml-sitemap-feed' ),
    719                 'content' => $content,
    720             )
    721         );
    722 
    723         switch ( $active_tab ) {
    724             case 'general':
    725                 // Server.
    726                 $content  = '<p>' . \esc_html__( 'Select your XML Sitemap generator here.', 'xml-sitemap-feed' ) . '</p>';
    727                 $content .= '<p><strong>' . \esc_html( \translate( 'WordPress' ) ) . '</strong></p>'; // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    728                 $content .= '<p>' . \esc_html__( 'The default sitemap server is light-weight, effective and compatible with most installations. But it is also limited. The XML Sitemaps & Google News plugin adds some essential features and options to the default sitemap generator but if these are not enough, try the plugin sitemap server.', 'xml-sitemap-feed' ) . '</p>';
    729                 $content .= '<p><strong>' . \esc_html( \translate( 'Plugin' ) ) . '</strong></p>'; // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    730                 $content .= '<p>' . \esc_html__( 'The plugin sitemap server generates the sitemap in a different way, allowing some additional features and configuration options. However, it is not guaranteed to be compatible with your specific WordPress installation.', 'xml-sitemap-feed' ) . '</p>';
    731                 $screen->add_help_tab(
    732                     array(
    733                         'id'      => 'sitemap-general-server',
    734                         'title'   => \translate( 'Server' ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    735                         'content' => $content,
    736                     )
    737                 );
    738                 // Disable.
    739                 $content  = '<p>' . \esc_html__( 'By default, all public content types, taxonomy archives and author archives are included in the XML Sitemap index. If you wish to exclude any content or archive types, you can disable them here.', 'xml-sitemap-feed' ) . '</p>';
    740                 $content .= '<p>' . sprintf( /* translators: %1$s Taxonomies, %2$s Taxonomies linked to the respective tab */
    741                     \esc_html__( 'Select %1$s here to exclude then all taxonomy archives from the sitemap index. To exclude only a particular taxonomy, please go to the %2$s tab.', 'xml-sitemap-feed' ),
    742                     '<strong>' . \esc_html__( 'Taxonomies', 'xml-sitemap-feed' ) . '</strong>',
    743                     '<a href="?page=xmlsf&tab=taxonomies">' . \esc_html__( 'Taxonomies', 'xml-sitemap-feed' ) . '</a>'
    744                 ) . '</p>';
    745                 $content .= '<p>' . sprintf( /* translators: %1$s Authors, %2$s Authors linked to the respective tab  */
    746                     \esc_html__( 'Select %1$s here to exclude all author archives from the sitemap index. To exclude only a particular author or user group, please go to the %2$s tab.', 'xml-sitemap-feed' ),
    747                     '<strong>' . \esc_html__( 'Authors', 'xml-sitemap-feed' ) . '</strong>',
    748                     '<a href="?page=xmlsf&tab=authors">' . \esc_html__( 'Authors', 'xml-sitemap-feed' ) . '</a>'
    749                 ) . '</p>';
    750                 $screen->add_help_tab(
    751                     array(
    752                         'id'      => 'sitemap-general-disable',
    753                         'title'   => \esc_html__( 'Disable sitemaps', 'xml-sitemap-feed' ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    754                         'content' => $content,
    755                     )
    756                 );
    757                 break;
    758 
    759             case 'post_types':
    760                 \ob_start();
    761                 include XMLSF_DIR . '/views/admin/help-tab-post-types-general.php';
    762                 $content = \ob_get_clean();
    763                 // General Settings.
    764                 $screen->add_help_tab(
    765                     array(
    766                         'id'      => 'sitemap-settings-post-type-general',
    767                         'title'   => \translate( 'General' ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    768                         'content' => $content,
    769                     )
    770                 );
    771 
    772                 \ob_start();
    773                 include XMLSF_DIR . '/views/admin/help-tab-post-types.php';
    774                 $content = \ob_get_clean();
    775                 // Post type options.
    776                 $screen->add_help_tab(
    777                     array(
    778                         'id'      => 'sitemap-settings-post-types',
    779                         'title'   => __( 'Post types', 'xml-sitemap-feed' ),
    780                         'content' => $content,
    781                     )
    782                 );
    783                 break;
    784 
    785             case 'taxonomies':
    786                 // Settings.
    787                 \ob_start();
    788                 include XMLSF_DIR . '/views/admin/help-tab-taxonomies.php';
    789                 $content = \ob_get_clean();
    790                 $screen->add_help_tab(
    791                     array(
    792                         'id'      => 'sitemap-settings-taxonomies-general',
    793                         'title'   => \translate( 'General' ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    794                         'content' => $content,
    795                     )
    796                 );
    797                 // Taxonomies.
    798                 $content  = '<p><strong>' . \esc_html__( 'Include these taxonomies', 'xml-sitemap-feed' ) . '</strong></p>';
    799                 $content .= '<p>' . \esc_html__( 'Select the taxonomies to include in the sitemap index. Select none to automatically include all public taxonomies.', 'xml-sitemap-feed' ) . '</p>';
    800                 $screen->add_help_tab(
    801                     array(
    802                         'id'      => 'sitemap-settings-taxonomies',
    803                         'title'   => __( 'Taxonomies', 'xml-sitemap-feed' ),
    804                         'content' => $content,
    805                     )
    806                 );
    807                 break;
    808 
    809             case 'authors':
    810                 \ob_start();
    811                 include XMLSF_DIR . '/views/admin/help-tab-authors.php';
    812                 $content = \ob_get_clean();
    813                 $screen->add_help_tab(
    814                     array(
    815                         'id'      => 'sitemap-settings-authors-general',
    816                         'title'   => \translate( 'General' ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    817                         'content' => $content,
    818                     )
    819                 );
    820                 // Authors.
    821                 $content  = '<p><strong>' . \esc_html__( 'Include these authors', 'xml-sitemap-feed' ) . '</strong></p>';
    822                 $content .= '<p>' . \esc_html__( 'Select the authors to include in the author sitemap. Select none to automatically include all authors.', 'xml-sitemap-feed' ) . '</p>';
    823                 $screen->add_help_tab(
    824                     array(
    825                         'id'      => 'sitemap-settings-authors',
    826                         'title'   => __( 'Authors', 'xml-sitemap-feed' ),
    827                         'content' => $content,
    828                     )
    829                 );
    830                 break;
    831 
    832             case 'advanced':
    833                 \ob_start();
    834                 include XMLSF_DIR . '/views/admin/help-tab-advanced.php';
    835                 $content = \ob_get_clean();
    836                 // Add help tab.
    837                 $screen->add_help_tab(
    838                     array(
    839                         'id'      => 'sitemap-settings-advanced',
    840                         'title'   => \translate( 'Advanced' ), // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    841                         'content' => $content,
    842                     )
    843                 );
    844                 break;
    845         }
    846 
    847         // Hook for additional/advanced help tab.
    848         \do_action( 'xmlsf_sitemap_help_tabs', $screen, $active_tab );
    849 
    850         \ob_start();
    851         include XMLSF_DIR . '/views/admin/help-tab-sidebar.php';
    852         $content = \ob_get_clean();
    853 
    854         $screen->set_help_sidebar( $content );
    855366    }
    856367
  • xml-sitemap-feed/trunk/inc/class-xmlsitemapfeed.php

    r3334262 r3403469  
    164164        }
    165165
     166        // Prepare GSC Connector.
     167        \add_action( 'init', array( $this, 'gsc_connect' ) );
     168
    166169        // Register rewrites.
    167170        \add_action( 'init', array( $this, 'register_rewrites' ) );
     
    169172        // Sitemap generator msg output.
    170173        \add_action( 'xmlsf_generator', array( $this, 'generator' ) );
     174    }
     175
     176    /**
     177     * Prepare GSC Connector.
     178     */
     179    public function gsc_connect() {
     180        $options = (array) get_option( 'xmlsf_gsc_connect', array() );
     181
     182        // Prepare onboarding if not connected.
     183        if ( empty( $options['google_refresh_token'] ) ) {
     184            // Prepare onboarding.
     185            add_action( 'admin_menu', array( __NAMESPACE__ . '\GSC_Connect', 'add_options_page' ) );
     186            add_action( 'admin_init', array( __NAMESPACE__ . '\GSC_Connect', 'register_settings' ) );
     187
     188            // Prepare for OAuth callback.
     189            add_filter( 'query_vars', array( __NAMESPACE__ . '\GSC_Connect', 'query_vars' ) );
     190            add_action( 'parse_request', array( __NAMESPACE__ . '\GSC_Connect', 'parse_request' ) );
     191        }
    171192    }
    172193
  • xml-sitemap-feed/trunk/readme.txt

    r3397682 r3403469  
    66Requires PHP: 5.6
    77Tested up to: 6.9
    8 Stable tag: 5.5.9
     8Stable tag: 5.6
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    143143== Upgrade Notice ==
    144144
     145= 5.6 =
     146Google Search Console connection with sitemap reports and submission.
     147
     148== Changelog ==
     149
     150= 5.6 =
     151
     152Date: 202511
     153* Google Search Console sitemap reports
     154* Sitemap submission from admin
     155* Knowledge base link in admin help sections
     156
    145157= 5.5.9 =
    146 Prepare advanced sitemap notification feature.
    147 
    148 == Changelog ==
    149 
    150 = 5.5.9 =
     158
    151159Date: 20251118
    152160* Prepare advanced sitemap notification feature.
    153161
    154162= 5.5.8 =
     163
    155164Date: 20251014
    156165* Drop unused news tags & stylesheet columns
     
    159168
    160169= 5.5.7 =
     170
    161171Date: 20250915
    162172* FIX: WPML Compatibility missing valid callback, thanks @linusbenknerkk
    163173
    164174= 5.5.6 =
     175
    165176Date: 20250717
    166177* FIX: Possible excessively long URL on admin post search, thanks @leedxw
     
    168179
    169180= 5.5.5 =
     181
    170182Date: 20250625
    171183* Polylang index lastmods per language in core sitemap
     
    176188
    177189= 5.5.4 =
     190
    178191Date: 20250427
    179192* Improved WPML compatibility
     
    183196
    184197= 5.5.3 =
     198
    185199Date: 20250402
    186200* FIX: missing exclude/priority meta box
     
    190204
    191205= 5.5 =
     206
    192207Date: 20250331
    193 * NEW: Exclude option in Quick Editor
    194 * NEW: Filter xmlsf_taxonomies_query_args
    195 * NEW: Filter xmlsf_news_hours_old
    196 * NEW: custom urls sitemap for core server
    197 * NEW: external sitemaps for core server
     208* Exclude option in Quick Editor
     209* Filter xmlsf_taxonomies_query_args
     210* Filter xmlsf_news_hours_old
     211* custom urls sitemap for core server
     212* external sitemaps for core server
    198213* Namespacing & autoloading
    199214* Admin notices for Slim SEO, Squirrly SEO, Jetpack Sitemaps & XML Sitemaps Manager
     
    209224
    210225= 5.4.9 =
     226
    211227Date: 20240506
    212228* FIX: Unauthenticated file inclusion - CVE-2024-4441 reported by Foxyyy
    213229
    214230= 5.4.8 =
     231
    215232Date: 20240329
    216 * NEW: post types max number
     233* post types max number
    217234* FIX: blog_public can be integer when object cache is used
    218235* FIX: compatibility date redirect warning when using core server
     
    221238
    222239= 5.4.5 =
     240
    223241Date: 20240221
    224242* FIX: wp-cli disable plugin incompatibility
     
    231249
    232250= 5.4 =
     251
    233252Date: 20240219
    234 * NEW: Switch between Plugin or WP core sitemap server for sitemap generation
    235 * NEW: xmlsf_generator action hook
    236 * NEW: xmlsf_sitemap_index_pre and xmlsf_sitemap_index_post action hooks
    237 * NEW: xmlsf_author_has_published_posts filter
     253* Switch between Plugin or WP core sitemap server for sitemap generation
     254* xmlsf_generator action hook
     255* xmlsf_sitemap_index_pre and xmlsf_sitemap_index_post action hooks
     256* xmlsf_author_has_published_posts filter
    238257* Dropping all Ping Services (no longer supported)
    239258* Dropping allowed domains filtering
     
    246265
    247266= 5.3.6 =
     267
    248268Date: 20230810
    249269* FIX: Work around get_users() fatal error in WP 6.3
     
    251271
    252272= 5.3.5 =
     273
    253274Date: 20230629
    254275* FIX: Forced Status 200 response conflict with Etag/If-None-Match headers, thanks @revolutionnaire
    255276
    256277= 5.3.4 =
     278
    257279Date: 20230530
    258280* FIX: File not found error on invalid sitemap requests
     
    260282
    261283= 5.3.3 =
     284
    262285Date: 20230528
    263286* FIX: Undefined variable + Invalid argument supplied for foreach(), thanks @yankyaw09
    264287
    265288= 5.3.2 =
     289
    266290* FIX: Bing ping 410 error response
    267291* FIX: Outdated help & forum links
    268292
    269293= 5.3.1 =
     294
    270295* FIX: Restore wp-sitemap.xml rewrite rules after deactivation
    271296* FIX: Call to undefined function xmlsf_get_archives()
     
    273298
    274299= 5.3 =
    275 * NEW: Author sitemap
    276 * NEW: allow custom theme templates and stylesheets
    277 * NEW: request filters `xmlsf_request` and `xmlsf_news_request`
    278 * NEW: news template filters `xmlsf_news_publication_name` and `xmlsf_news_title`
    279 * NEW: sitemap template action hook `xmlsf_url`
    280 * NEW: sitemap template action hooks `xmlsf_news_url` and `xmlsf_news_tags_inner`
    281 * NEW: `xmlsf_index_url_args` filter
    282 * NEW: All in One SEO Pack incompatibility message and instructions
    283 * NEW: The SEO Framework incompatibility message and instructions
     300
     301* Author sitemap
     302* allow custom theme templates and stylesheets
     303* request filters `xmlsf_request` and `xmlsf_news_request`
     304* news template filters `xmlsf_news_publication_name` and `xmlsf_news_title`
     305* sitemap template action hook `xmlsf_url`
     306* sitemap template action hooks `xmlsf_news_url` and `xmlsf_news_tags_inner`
     307* `xmlsf_index_url_args` filter
     308* All in One SEO Pack incompatibility message and instructions
     309* The SEO Framework incompatibility message and instructions
    284310* Moved news template action hook `xmlsf_news_tags_after` to after closing </news:news> tag
    285311* Less DB queries, smaller memory footprint
     
    294320
    295321= 5.2.7 =
    296 20191111
    297 * NEW: Ad Inserter compatibility check
    298 * NEW: xmlsf_urlset and xmlsf_news_urlset action hooks, thanks to Stanislav Khromov (@khromov)
     322
     323Date: 20191111
     324* Ad Inserter compatibility check
     325* xmlsf_urlset and xmlsf_news_urlset action hooks, thanks to Stanislav Khromov (@khromov)
    299326* Exclude hierarchical post types from news sitemap
    300327
    301328= 5.2.6 =
    302 20191009
    303 * NEW: xmlsf_tags_after, xmlsf_url_after and xmlsf_news_url_after action hooks
     329
     330Date: 20191009
     331* xmlsf_tags_after, xmlsf_url_after and xmlsf_news_url_after action hooks
    304332* Make stylesheet paths relative to prevent exclusion when using different language domains
    305333* FIX: Taxonomy selection not available to new installs
    306334
    307335= 5.2.4 =
    308 20190917
     336
     337Date: 20190917
    309338* NEW Rank Math incompatibility admin warnings
    310339* FIX undefined index
     
    312341
    313342= 5.2.3 =
     343
    314344* FIX Cannot use return value in write context
    315345* FIX issue #30 for sql_mode=ONLY_FULL_GROUP_BY, thanks @silvios
     
    317347
    318348= 5.2.2 =
     349
    319350* FIX invalid date format on some PHP versions
    320351* FIX Can't use function return value in write context
     
    323354
    324355= 5.2 =
    325 20190429
     356
     357Date: 20190429
    326358* Image query optimization and meta caching
    327359* Last comment date meta caching
     
    340372
    341373= 5.1.2 =
     374
    342375* FIX: admin notice dismiss button failing
    343376* FIX: date archive redirect notice showing for inactive post types
     
    345378
    346379= 5.1.1 =
     380
    347381* FIX options page not found
    348382* FIX news sitemap only ping
    349383
    350384= 5.1 =
    351 20190313
     385
     386Date: 20190313
    352387* SEOPress and Catch Box incompatibility admin messages
    353388* FIX bbPress incompatibility
     
    364399
    365400= 5.0.7 =
    366 20181025
     401
     402Date: 20181025
    367403* Allowed domains back to Settings > Reading
    368404* FIX static files check on activation
     
    378414
    379415= 5.0 =
    380 20180908
     416
     417Date: 20180908
    381418* Complete code restructure and cleanup: MVC and JIT inclusion
    382419* Fewer DB queries, much smaller memory footprint on normal queries
     
    398435
    399436= 4.9.4 =
     437
    400438* FIX: missing featured images, thanks @flyerua
    401439* FIX: double content type response header filtering
    402440
    403441= 4.9.3 =
     442
    404443* Reinstate filter_no_news_limits, allowing post type array
    405444* Improved language handling and new language filter xmlsf_post_language
     
    407446
    408447= 4.9.2 =
     448
    409449* FactCheck genre causes error in Search Console
    410450
    411451= 4.9.1 =
     452
    412453* FIX: double genre terms on upgrade from 4.4,  thanks @mouhalves
    413454* FIX: wp_count_posts uncached and too heavy on large sites, thanks @carlalexander
     
    416457
    417458= 4.9 =
    418 20180507
     459
     460Date: 20180507
    419461* Code cleanup
    420 * NEW: FactCheck genre
     462* FactCheck genre
    421463* Changefreq tag dropped
    422 * NEW: translation strings for genres
     464* translation strings for genres
    423465* FIX: zlib.output_compression compatibility, thanks @alicewondermiscreations
    424466* FIX: permalink issue with Woocommerce account page endpoints
     
    426468
    427469= 4.8.3 =
     470
    428471* fix get_lastpostdate array/string
    429472* restore pre PHP 5.4 compatibility (popular request)
    430473
    431474= 4.8 =
    432 20180316
    433 * NEW: Conditional functions is_sitemap() and is_news()
     475
     476Date: 20180316
     477* Conditional functions is_sitemap() and is_news()
    434478* code cleanup and annotation
    435479* new google ping URL
     
    439483
    440484= 4.7.6 =
     485
    441486* FIX Open_BaseDir issue on IIS server
    442487
    443488= 4.7.5 =
    444 20161207
     489
     490Date: 20161207
    445491* FIX: On cache_flush purge also the respective time_key cache entry,
    446492props @e2robert https://wordpress.org/support/topic/object-cache-issue-results-in-outdated-last-modified-values-on-index-sitemap/
     
    449495
    450496= 4.7.4 =
     497
    451498* Another WPML compat issue fixed, special thanks to hermes3por3
    452499
    453500= 4.7.3 =
    454 * NEW: xmlsf_excluded filter
     501
     502* xmlsf_excluded filter
    455503* IMPROVEMENT: Polylang and WPML compatibility issues
    456504* FIX: "Only variables should be passed by reference" strict warning
     
    458506
    459507= 4.7 =
    460 20160506
     508
     509Date: 20160506
    461510* WPML compatibility
    462511* FIX: News Sitemap chinese language tag
     
    464513
    465514= 4.6.3 =
    466 * NEW: filter xmlsf_custom_sitemaps
     515
     516* filter xmlsf_custom_sitemaps
    467517* BUGFIX: empty custom urls sitemap
    468518
    469519= 4.6.2 =
    470 * NEW: filter xmlsf_custom_urls
     520
     521* filter xmlsf_custom_urls
    471522* More cleanup
    472523* BUGFIX: broken Polylang compatibility reported by @zesseb
    473524
    474525= 4.6.1 =
    475 20160407
     526
     527Date: 20160407
    476528* Code cleanup
    477529* POT file update
     
    479531
    480532= 4.6 =
    481 * NEW: xmlsf_news_tags_after action hook
     533
     534* xmlsf_news_tags_after action hook
    482535* Attempt to remove static sitemap files left over by other sitemap plugins
    483536
    484537= 4.5.1 =
     538
    485539* fix Persistent/Stored XSS vulnerability on admin page, thanks to Sneha Rajguru @Sneharajguru
    486540
    487541= 4.5 =
     542
    488543* Set Google News access tag per post
    489544* Exclude posts from Google News sitemap
    490545* News Sitemap stylesheet text/links update
    491546* FIX: cache_delete cached key instead of cache_flush as suggested by Jeremy Clarke https://wordpress.org/support/topic/please-stop-running-wp_cache_flush-whenever-posts-are-edited
    492 * NEW: Nginx Helper compatibility to purge cache sitemap URLs from FastCGI Cache or Redis
     547* Nginx Helper compatibility to purge cache sitemap URLs from FastCGI Cache or Redis
    493548
    494549= 4.4.1 =
     550
    495551* BUGFIX contribution by alejandra.aranibar: multiple news post types makes get_lastdate return oldest instead of newest date
    496552* BUGFIX plugins_url filter not working, reported by Michael
     
    500556
    501557= 4.4 =
     558
    502559* Pings max once per hour (5 minutes for news sitemap)
    503560* Seperate ping for Google News Sitemap
     
    514571
    515572= 4.3.2 =
     573
    516574* Italian translation
    517575* BUGFIX: html esc / filter image title and caption tags
     
    520578
    521579= 4.3 =
     580
    522581* Google News sitemap settings section
    523582* Google News tags: access, genres, keywords, geo_locations
     
    536595
    537596= 4.2.4 =
    538 * NEW: Image tags
     597
     598* Image tags
    539599* Rearranged settings section
    540600* FIX: replace permalink, title and bloginfo rss filter hooks with own
    541601
    542602= 4.2.3 =
     603
    543604* BUGFIX: Empty ping options after disabling the main sitemap
    544605* BUGFIX: Empty language tag for Google News tags in posts sitemap
    545606* Small back end changes
    546 * NEW: Custom post types split by year/month
     607* Custom post types split by year/month
    547608
    548609= 4.2 =
    549 * NEW: Image & News tags
    550 * NEW: Exclude pages/posts
     610
     611* Image & News tags
     612* Exclude pages/posts
    551613
    552614= 4.1.4 =
     615
    553616* BUGFIX: Pass by reference fatal error in PHP 5.4
    554617* BUGFIX: issue with Polylang language code in pretty permalinks setting
     
    558621
    559622= 4.1 =
    560 * NEW: Ping Google and Bing on new publications
    561 * NEW: Set priority per post
    562 * NEW: Priority calculation options
    563 * NEW: Option to split posts by year or month for faster generation of each sitemap
     623
     624* Ping Google and Bing on new publications
     625* Set priority per post
     626* Priority calculation options
     627* Option to split posts by year or month for faster generation of each sitemap
    564628* Reduced queries to increase performance
    565629* Improved Lastmod and Changefreq calculations
     
    570634
    571635= 4.0.1 =
    572 * NEW: Dutch and French translations
     636
     637* Dutch and French translations
    573638* BUGFIX: Non public sites still have sitemap by default
    574639* BUGFIX: Invalid argument supplied for foreach() when all post types are off
     
    576641
    577642= 4.0.0 =
     643
    578644* Moved to sitemap index and seperated post/page sitemaps
    579 * NEW: options to dswitch off sitemap and news sitemap
    580 * NEW: select which post types to include
    581 * NEW: select which taxonomies to include
    582 * NEW: set additional robots.txt rules
    583 * NEW: Translation POT catalogue
     645* options to dswitch off sitemap and news sitemap
     646* select which post types to include
     647* select which taxonomies to include
     648* set additional robots.txt rules
     649* Translation POT catalogue
    584650* Improved Polylang support
    585651* Dropped xLanguage support
     
    587653
    588654= 3.9.2 =
     655
    589656* Basic Google News feed stylesheet
    590657* improvement on XSS vulnerability fix
     
    592659
    593660= 3.9.1 =
     661
    594662* SECURITY: XSS vulnerability in sitemap.xsl.php
    595663
    596664= 3.9 =
     665
    597666* Google News Sitemap
    598667* Memory limit error workaround (for most sites)
    599668
    600669= 3.8.8 =
     670
    601671* BUGFIX: PHP4 compatibility
    602672* BUGFIX: stylesheet URL when installed in mu-plugins
     
    605675
    606676= 3.8.5 =
     677
    607678* **xLanguage support** based on code and testing by **Daniele Pelagatti**
    608679* new FILTER HOOK `robotstxt_sitemap_url` for any translate and url changing plugins.
     
    610681
    611682= 3.8.3 =
     683
    612684* filter out external URLs inserted by plugins like Page Links To (thanks, Francois)
    613685* minify sitemap and stylesheet output
     
    615687
    616688= 3.8 =
     689
    617690* **qTranslate support**
    618691* no more Sitemap reference in robots.txt on non-public blogs
    619692
    620693= 3.7.4 =
     694
    621695* switch from `add_feed` (on init) to the `do_feed_$feed` hook
    622696* BUGFIX: `is_404()` condition TRUE and Response Header 404 on sites without posts
     
    626700
    627701= 3.7 =
     702
    628703* massive changefreq calculation improvement
    629704* further priority calulation improvement taking last comment date into account
    630705
    631706= 3.6.1 =
     707
    632708* BUGFIX: wrong date calculation on blogs less than 1 year old
    633709
    634710= 3.6 =
     711
    635712* massive priority calculation improvement
    636713
    637714= 3.5 =
     715
    638716* complete rewrite of plugin internals
    639717* speed improvements
     
    641719
    642720= 3.4 =
     721
    643722* BUGFIX: use home instead of siteurl for blog url for sitemap reference in robots.txt
    644723* code streamline and cleanup
    645724
    646725= 3.3 =
     726
    647727* automatic exclusion of tags blog in wpmu
    648728
    649729= 3.2 =
     730
    650731* rewrite and add_feed calls improvements
    651732* BUGFIX: double entry when static page is frontpage
    652733
    653734= 3.0 =
     735
    654736* added styling to the xml feed to make it human readable
    655737
    656738= 2.1 =
     739
    657740* BUGFIX: lastmod timezone offset displayed wrong (extra space and missing double-colon)
    658741
    659742= 2.0 =
     743
    660744* priority calculation based on comments and age
    661745* changefreq based on comments
    662746
    663747= 1.0 =
     748
    664749* changed feed template location to avoid the need to relocate files outside the plugins folder
    665750* BUGFIX: `get_post_modified_time` instead of `get_post_time`
    666751
    667752= 0.1 =
     753
    668754* rework from Patrick Chia's [Standard XML Sitemaps](http://wordpress.org/plugins/standard-xml-sitemap/)
    669755* increased post urls limit from 100 to 1000 (of max. 50,000 allowed by the Sitemap protocol)
  • xml-sitemap-feed/trunk/uninstall.php

    r3317913 r3403469  
    8585    delete_option( 'xmlsf_authors' );
    8686    delete_option( 'xmlsf_post_type_settings' );
     87    delete_option( 'xmlsf_gsc_connect' );
    8788
    8889    // Remove old transient.
     
    9091    delete_transient( 'xmlsf_comments_meta_primed' );
    9192    delete_transient( 'xmlsf_static_files' );
     93    delete_transient( 'gsc_connect_origin' );
     94    delete_transient( 'sitemap_notifier_access_token' );
     95    delete_transient( 'sitemap_notifier_submission' );
     96    delete_transient( 'sitemap_notifier_submission_news' );
    9297
    9398    // Flush rules.
  • xml-sitemap-feed/trunk/views/admin/field-meta-box-news.php

    r3334262 r3403469  
    66 */
    77
     8// Use nonce for verification.
     9\wp_nonce_field( XMLSF_BASENAME, '_xmlsf_news_nonce' );
     10
     11// Use get_post_meta to retrieve an existing value from the database and use the value for the form.
     12$exclude  = 'private' === $post_status || \get_post_meta( $post_id, '_xmlsf_news_exclude', true );
     13$disabled = 'private' === $post_status;
    814?>
    915<p>
  • xml-sitemap-feed/trunk/views/admin/field-meta-box.php

    r3334262 r3403469  
    55 * @package XML Sitemap & Google News
    66 */
     7
     8// Use nonce for verification.
     9\wp_nonce_field( XMLSF_BASENAME, '_xmlsf_nonce' );
     10
     11// Use get_post_meta to retrieve an existing value from the database and use the value for the form.
     12$exclude  = \get_post_meta( $post_id, '_xmlsf_exclude', true );
     13$priority = \get_post_meta( $post_id, '_xmlsf_priority', true );
     14
     15// value prechecks to prevent "invalid form control not focusable" when meta box is hidden.
     16$priority = \is_numeric( $priority ) ? \XMLSF\sanitize_number( $priority ) : '';
    717
    818?>
  • xml-sitemap-feed/trunk/views/admin/field-news-categories.php

    r3378863 r3403469  
    4444    </legend>
    4545    <p>
    46         <?php esc_html_e( 'Limit to posts in these post categories:', 'xml-sitemap-feed' ); ?>
     46        <?php esc_html_e( 'Include posts from these categories, or select none to automaticly include posts from all categories:', 'xml-sitemap-feed' ); ?>
    4747    </p>
    48     <style>ul.cat-checklist{height:auto;max-height:48em}ul.children{padding-left:1em}</style>
     48    <style>ul.cat-checklist{height:auto;max-height:24em}ul.children{padding-left:1em}</style>
    4949    <ul class="cat-checklist">
    5050        <?php echo $cat_list; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
  • xml-sitemap-feed/trunk/views/admin/field-news-notifier.php

    r3397682 r3403469  
    1717
    1818    <p class="description">
    19         <?php esc_html_e( 'Notify Google by automaticly resubmitting your news sitemap to Google Search Console upon each new publication.', 'xml-sitemap-feed' ); ?>
     19        <?php printf( /* translators: %s: Google New Sitemap */ esc_html__( 'Notify Google by automaticly resubmitting your %s to Google Search Console upon each new publication.', 'xml-sitemap-feed' ), esc_html__( 'Google News Sitemap', 'xml-sitemap-feed' ) ); ?>
    2020        <?php printf( /* Translators: %s: Google News Advanced (with link) */ esc_html__( 'Available in %s.', 'xml-sitemap-feed' ), '<a href="https://premium.status301.com/downloads/google-news-advanced/" target="_blank">' . esc_html__( 'Google News Advanced', 'xml-sitemap-feed' ) . '</a>' ); ?>
    2121    </p>
  • xml-sitemap-feed/trunk/views/admin/field-sitemap-authors.php

    r3334262 r3403469  
    1414        <?php esc_html_e( 'Include these authors, or select none to automaticly include all authors with published posts:', 'xml-sitemap-feed' ); ?>
    1515    </p>
    16     <style>ul.cat-checklist{height:auto;max-height:48em}ul.children{padding-left:1em}</style>
     16    <style>ul.cat-checklist{height:auto;max-height:24em}ul.children{padding-left:1em}</style>
    1717    <ul class="cat-checklist">
    1818            <?php
  • xml-sitemap-feed/trunk/views/admin/field-sitemap-post-types.php

    r3334262 r3403469  
    1414        <?php esc_html_e( 'Include these post types, or select none to automaticly include all public post types:', 'xml-sitemap-feed' ); ?>
    1515    </p>
    16     <!--<style>ul.cat-checklist{height:auto;max-height:48em}ul.children{padding-left:1em}</style>-->
    1716    <ul>
    1817        <?php
  • xml-sitemap-feed/trunk/views/admin/field-sitemap-taxonomies.php

    r3334262 r3403469  
    1616    <style>ul.cat-checklist{height:auto;max-height:48em}ul.children{padding-left:1em}</style>
    1717    <ul class="cat-checklist">
    18             <?php
    19             foreach ( $public_tax as $name ) {
    20                 $label = get_taxonomy( $name )->label;
    21                 ?>
     18    <?php
     19    foreach ( $public_tax as $obj ) {
     20        $count = wp_count_terms( $obj->name );
     21        // Adjust the count for Post Formats (to exclude the Standard type).
     22        if ( 'post_format' === $obj->name ) {
     23            --$count;
     24        }
     25        ?>
    2226        <li>
    2327            <label>
    24                 <input type="checkbox" name="xmlsf_taxonomies[]" id="xmlsf_taxonomies_<?php echo esc_attr( $name ); ?>" value="<?php echo esc_attr( $name ); ?>" <?php checked( in_array( $name, (array) $taxonomies, true ) ); ?>/>
    25                 <?php echo esc_html( $label ); ?> (<?php echo esc_html( wp_count_terms( $name ) ); ?>)
     28                <input type="checkbox" name="xmlsf_taxonomies[]" id="xmlsf_taxonomies_<?php echo esc_attr( $obj->name ); ?>" value="<?php echo esc_attr( $obj->name ); ?>" <?php checked( in_array( $obj->name, (array) $taxonomies, true ) ); ?>/>
     29                <?php echo esc_html( $obj->label ); ?> (<?php echo esc_html( $count ); ?>)
    2630            </label>
    2731        </li>
    28         <?php } ?>
     32        <?php
     33    }
     34    ?>
    2935    </ul>
    3036</fieldset>
  • xml-sitemap-feed/trunk/views/admin/help-tab-support.php

    r3334262 r3403469  
    1919    <?php
    2020    printf(
     21        /* translators: %s Knowledge Base (linked to https://premium.status301.com/knowledge-base/xml-sitemap-google-news/) */
     22        esc_html__( 'Documentation on various related subjects can be found in our %s.', 'xml-sitemap-feed' ),
     23        '<a href="https://premium.status301.com/knowledge-base/xml-sitemap-google-news/" target="_blank">' . esc_html__( 'Knowledge Base', 'xml-sitemap-feed' ) . '</a>'
     24    );
     25    ?>
     26    <?php
     27    printf(
    2128        /* translators: Review page and Translation page on WordPress.org */
    2229        esc_html__( 'If you would like to contribute and share with the rest of the WordPress community, please consider writing a quick %1$s or help out with %2$s!', 'xml-sitemap-feed' ),
  • xml-sitemap-feed/trunk/views/admin/page-sitemap-news.php

    r3378863 r3403469  
    88?>
    99<style type="text/css">
    10 <?php include XMLSF_DIR . '/assets/admin.css'; ?>
     10<?php require XMLSF_DIR . '/assets/admin.css'; ?>
    1111</style>
    1212<div class="wrap">
     
    1919
    2020    <nav class="nav-tab-wrapper">
    21         <a href="?page=xmlsf_news&tab=general" class="nav-tab <?php echo 'general' === $active_tab ? 'nav-tab-active' : ''; ?>"><?php echo esc_html( translate( 'General' ) ); ?></a>
    22         <a href="?page=xmlsf_news&tab=advanced" class="nav-tab <?php echo 'advanced' === $active_tab ? 'nav-tab-active' : ''; ?>"><?php echo esc_html( translate( 'Advanced' ) ); ?></a>
     21        <a href="?page=xmlsf_news&tab=general" class="nav-tab <?php echo 'general' === $active_tab ? 'nav-tab-active' : ''; ?>"><?php echo esc_html( translate( 'General' ) ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction ?></a>
     22        <a href="?page=xmlsf_news&tab=advanced" class="nav-tab <?php echo 'advanced' === $active_tab ? 'nav-tab-active' : ''; ?>"><?php echo esc_html( translate( 'Advanced' ) ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction ?></a>
    2323        <?php do_action( 'xmlsf_news_nav_tabs', $active_tab ); ?>
    2424    </nav>
     
    4242    <div class="sidebar">
    4343        <?php
    44         if ( ! self::compatible_with_advanced() ) {
     44        if ( ! XMLSF\Admin\Sitemap_News::compatible_with_advanced() ) {
    4545            echo '<div style="background:rgb(252, 229, 231); margin-left: -14px; padding: 5px 10px; border: 4px solid rgb(214, 73, 54); border-radius: 3px; margin-bottom: 20px; font-weight: bold;">';
    4646            include XMLSF_DIR . '/views/admin/section-advanced-news-compat-message.php';
     
    4949        ?>
    5050
    51         <h3><span class="dashicons dashicons-welcome-view-site"></span> <?php echo esc_html( translate( 'View' ) ); ?></h3>
     51        <h3><span class="dashicons dashicons-welcome-view-site"></span> <?php echo esc_html( translate( 'View' ) ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction ?></h3>
    5252        <p>
    5353            <?php
     
    6060        </p>
    6161
    62         <h3><span class="dashicons dashicons-admin-tools"></span> <?php echo esc_html( translate( 'Tools' ) ); ?></h3>
    63         <form action="" method="post">
    64             <?php wp_nonce_field( XMLSF_BASENAME . '-help', '_xmlsf_help_nonce' ); ?>
    65             <p>
    66                 <input type="submit" name="xmlsf-flush-rewrite-rules" class="button button-small" value="<?php esc_html_e( 'Flush rewrite rules', 'xml-sitemap-feed' ); ?>" />
    67             </p>
    68             <p>
    69                 <input type="submit" name="xmlsf-check-conflicts" class="button button-small" value="<?php esc_html_e( 'Check for conflicts', 'xml-sitemap-feed' ); ?>" />
    70             </p>
    71             <p>
    72                 <input type="submit" name="xmlsf-clear-settings" class="button button-small button-link-delete" value="<?php esc_attr_e( 'Reset settings', 'xml-sitemap-feed' ); ?>" onclick="javascript:return confirm( '<?php echo esc_js( __( 'This will revert ALL your Google News sitemap settings to the plugin defaults.', 'xml-sitemap-feed' ) ); ?>\n\n<?php echo esc_js( translate( 'Are you sure you want to do this?' ) ); ?>' )" />
    73             </p>
    74         </form>
    75 
    7662        <?php do_action( 'xmlsf_admin_sidebar', 'news' ); ?>
    7763
     
    8066</div>
    8167<script>
    82 document.addEventListener('DOMContentLoaded', function () {
    83     var mainform, isSubmitting = false;
    84     jQuery(document).ready(function () {
    85         mainform = jQuery('#xmlsf-settings-form');
    86         mainform.submit(function(){
    87             isSubmitting = true
    88         })
    89         mainform.data('initial-state', mainform.serialize());
    90         jQuery(window).on('beforeunload', function(event) {
    91             if (!isSubmitting && mainform.length && mainform.serialize() != mainform.data('initial-state')){
    92                 event.preventDefault();
    93                 return "<?php esc_html_e( 'The changes you made will be lost if you navigate away from this page.' ); ?>";
    94             }
    95         });
    96     });
    97 }, false );
     68<?php require XMLSF_DIR . '/assets/admin.js'; ?>
    9869</script>
  • xml-sitemap-feed/trunk/views/admin/page-sitemap.php

    r3334262 r3403469  
    88?>
    99<style type="text/css">
    10 <?php include XMLSF_DIR . '/assets/admin.css'; ?>
     10<?php require XMLSF_DIR . '/assets/admin.css'; ?>
    1111</style>
    1212<div class="wrap">
     
    1919
    2020    <nav class="nav-tab-wrapper">
    21         <a class="nav-tab<?php echo 'general' === $active_tab ? ' nav-tab-active' : '" href="?page=xmlsf&tab=general'; ?>"><?php echo esc_html( translate( 'General' ) ); ?></a>
     21        <a class="nav-tab<?php echo 'general' === $active_tab ? ' nav-tab-active' : '" href="?page=xmlsf&tab=general'; ?>"><?php echo esc_html( translate( 'General' ) ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction ?></a>
    2222        <a class="nav-tab<?php echo 'post_types' === $active_tab ? ' nav-tab-active' : '" href="?page=xmlsf&tab=post_types'; ?>"><?php esc_attr_e( 'Post types', 'xml-sitemap-feed' ); ?></a>
    2323        <?php
     
    3333        }
    3434        ?>
    35         <a class="nav-tab<?php echo 'advanced' === $active_tab ? ' nav-tab-active' : '" href="?page=xmlsf&tab=advanced'; ?>"><?php echo esc_html( translate( 'Advanced' ) ); ?></a>
     35        <a class="nav-tab<?php echo 'advanced' === $active_tab ? ' nav-tab-active' : '" href="?page=xmlsf&tab=advanced'; ?>"><?php echo esc_html( translate( 'Advanced' ) ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction ?></a>
    3636        <?php do_action( 'xmlsf_sitemap_nav_tabs', $active_tab ); ?>
    3737    </nav>
     
    5555    <div class="sidebar">
    5656        <?php
    57         if ( ! self::compatible_with_advanced() ) {
     57        if ( ! \XMLSF\Admin\Sitemap::compatible_with_advanced() ) {
    5858            echo '<div style="background:rgb(252, 229, 231); margin-left: -14px; padding: 5px 10px; border: 4px solid rgb(214, 73, 54); border-radius: 3px; margin-bottom: 20px; font-weight: bold;">';
    5959            include XMLSF_DIR . '/views/admin/section-advanced-compat-message.php';
     
    6262        ?>
    6363
    64         <h3><span class="dashicons dashicons-welcome-view-site"></span> <?php echo esc_html( translate( 'View' ) ); ?></h3>
     64        <h3><span class="dashicons dashicons-welcome-view-site"></span> <?php echo esc_html( translate( 'View' ) ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction ?></h3>
    6565        <p>
    6666            <?php
     
    7373        </p>
    7474
    75         <h3><span class="dashicons dashicons-admin-tools"></span> <?php echo esc_html( translate( 'Tools' ) ); ?></h3>
    76         <form action="" method="post">
    77             <?php wp_nonce_field( XMLSF_BASENAME . '-help', '_xmlsf_help_nonce' ); ?>
    78             <p>
    79                 <input type="submit" name="xmlsf-flush-rewrite-rules" class="button button-small" value="<?php esc_attr_e( 'Flush rewrite rules', 'xml-sitemap-feed' ); ?>" />
    80                 <input type="submit" name="xmlsf-check-conflicts" class="button button-small" value="<?php esc_attr_e( 'Check for conflicts', 'xml-sitemap-feed' ); ?>" />
    81             </p>
    82             <p>
    83                 <?php // TODO add button(s) to prime medadata. ?>
    84                 <input type="submit" name="xmlsf-clear-post-meta" class="button button-small" value="<?php esc_attr_e( 'Clear post cache', 'xml-sitemap-feed' ); ?>" />
    85                 <input type="submit" name="xmlsf-clear-term-meta" class="button button-small" value="<?php esc_attr_e( 'Clear term cache', 'xml-sitemap-feed' ); ?>" />
    86                 <input type="submit" name="xmlsf-clear-user-meta" class="button button-small" value="<?php esc_attr_e( 'Clear user cache', 'xml-sitemap-feed' ); ?>" />
    87             </p>
    88             <p>
    89                 <input type="submit" name="xmlsf-clear-settings" class="button button-small button-link-delete" value="<?php esc_attr_e( 'Reset settings', 'xml-sitemap-feed' ); ?>" onclick="javascript:return confirm('<?php echo esc_js( __( 'This will revert ALL your sitemap settings to the plugin defaults.', 'xml-sitemap-feed' ) ); ?>\n\n<?php echo esc_js( translate( 'Are you sure you want to do this?' ) ); ?>')" />
    90             </p>
    91         </form>
    92 
    9375        <?php do_action( 'xmlsf_admin_sidebar' ); ?>
    9476
     
    9779</div>
    9880<script>
    99 document.addEventListener('DOMContentLoaded', function () {
    100     var mainform, isSubmitting = false;
    101     jQuery(document).ready(function () {
    102         mainform = jQuery('#xmlsf-settings-form');
    103         mainform.submit(function(){
    104             isSubmitting = true
    105         })
    106         mainform.data('initial-state', mainform.serialize());
    107         jQuery(window).on('beforeunload', function(event) {
    108             if (!isSubmitting && mainform.length && mainform.serialize() != mainform.data('initial-state')){
    109                 event.preventDefault();
    110                 return "<?php esc_html_e( 'The changes you made will be lost if you navigate away from this page.' ); ?>";
    111             }
    112         });
    113     });
    114 }, false );
     81<?php require XMLSF_DIR . '/assets/admin.js'; ?>
    11582</script>
  • xml-sitemap-feed/trunk/views/admin/sidebar-help.php

    r3334262 r3403469  
    77
    88?>
    9 <h3><span class="dashicons dashicons-sos"></span> <?php echo esc_html( translate( 'Help' ) ); ?></h3>
     9<h3><span class="dashicons dashicons-sos"></span> <?php echo esc_html( translate( 'Help' ) ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction ?></h3>
    1010<p>
    1111    <?php
    1212    printf(
    13         /* translators: %1$s Help tab, %2$s Support forum (linked to https://wordpress.org/support/plugin/xml-sitemap-feed) */
    14         esc_html__( 'You can find instructions on the %1$s above. If you still have questions, please go to the %2$s.', 'xml-sitemap-feed' ),
    15         '<strong>' . esc_html__( 'Help tab', 'xml-sitemap-feed' ) . '</strong>',
     13        /* translators: %s: Help tab */
     14        esc_html__( 'For help on the plugin options, open the %s above.', 'xml-sitemap-feed' ),
     15        '<a href="#wpbody-content" onclick="javascript:jQuery(\'#contextual-help-link\').trigger(\'click\');">' . esc_html__( 'Help tab', 'xml-sitemap-feed' ) . '</a>'
     16    );
     17    ?>
     18    <?php
     19    printf(
     20        /* translators: %s Knowledge Base (linked to https://premium.status301.com/knowledge-base/xml-sitemap-google-news/) */
     21        esc_html__( 'Documentation on various related subjects can be found in our %s.', 'xml-sitemap-feed' ),
     22        '<a href="https://premium.status301.com/knowledge-base/xml-sitemap-google-news/" target="_blank">' . esc_html__( 'Knowledge Base', 'xml-sitemap-feed' ) . '</a>'
     23    );
     24    ?>
     25    <?php
     26    printf(
     27        /* translators: %s Support forum (linked to https://wordpress.org/support/plugin/xml-sitemap-feed) */
     28        esc_html__( 'If you still have questions, please refer to the %s.', 'xml-sitemap-feed' ),
    1629        '<a href="https://wordpress.org/support/plugin/xml-sitemap-feed" target="_blank">' . esc_html__( 'Support forum', 'xml-sitemap-feed' ) . '</a>'
    1730    );
  • xml-sitemap-feed/trunk/xml-sitemap.php

    r3397682 r3403469  
    44 * Plugin URI: https://status301.net/wordpress-plugins/xml-sitemap-feed/
    55 * Description: Feed the hungry spiders in compliance with the XML Sitemap and Google News protocols.
    6  * Version: 5.5.9
     6 * Version: 5.6-alpha20
    77 * Text Domain: xml-sitemap-feed
    88 * Requires at least: 4.4
     
    4747defined( 'WPINC' ) || die;
    4848
    49 define( 'XMLSF_VERSION', '5.5.9' );
     49define( 'XMLSF_VERSION', '5.6' );
    5050define( 'XMLSF_ADV_MIN_VERSION', '0.1' );
    5151define( 'XMLSF_NEWS_ADV_MIN_VERSION', '1.4' );
Note: See TracChangeset for help on using the changeset viewer.