Plugin Directory

Changeset 3405317


Ignore:
Timestamp:
11/28/2025 03:12:59 PM (2 weeks ago)
Author:
RavanH
Message:

commit 5.6.2

Location:
xml-sitemap-feed/trunk
Files:
3 added
9 edited

Legend:

Unmodified
Added
Removed
  • xml-sitemap-feed/trunk/inc/class-gsc-connect-settings.php

    r3403470 r3405317  
    3535        ?>
    3636        <div class="wrap">
    37             <h1><?php \esc_html_e( 'Google Search Console Connection', 'xml-sitemap-feed' ); ?></h1>
     37            <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>
    3838
    3939            <form action="options.php" method="post">
     
    6565        // Get existing data from DB.
    6666        $options = (array) \get_option( self::$option_group, array() );
    67         ?>
    68         <p>
    69             <?php \esc_html_e( 'To allow sitemap submission, a connection between your website and Google Search Console needs to be created. This will be set up in two stages: (1) Creating a Google Cloud Console project with OAuth credentials and (2) Authorizing the connection.', 'xml-sitemap-feed' ); ?>
    70             <?php
    71                 \printf(
    72                     /* translators: %s: Link to detailed documentation */
    73                     \esc_html__( 'For more detailed instructions, please refer to our %s.', 'xml-sitemap-feed' ),
    74                     '<a href="https://premium.status301.com/knowledge-base/xml-sitemap-google-news/automatically-notify-google-on-news-sitemap-updates/" target="_blank" rel="noopener noreferrer">' . \esc_html__( 'Knowledge Base', 'xml-sitemap-feed' ) . '</a>'
    75                 );
    76             ?>
    77         </p>
    78         <?php
     67
     68        // Intro.
     69        include XMLSF_DIR . '/views/admin/section-gsc-oauth-intro.php';
     70
    7971        // Check if the Google Client ID and Secret are set.
    80         if ( empty( $options['google_client_id'] ) || empty( $options['google_client_secret'] ) ) :
    81             ?>
    82             <h3><?php \esc_html_e( 'Stage 1/2. Create a Google Cloud Console project', 'xml-sitemap-feed' ); ?></h3>
    83             <p><?php \esc_html_e( 'Follow the steps below to create a Google Cloud Console project and obtain your credentials.', 'xml-sitemap-feed' ); ?> <?php \esc_html_e( 'Please use a Google account that has Full access to the site property in Google Search Console.', 'xml-sitemap-feed' ); ?></p>
    84             <ol>
    85                 <li>
    86                     <?php
    87                     \printf(
    88                         /* translators: %s: Link to Google Cloud Console */
    89                         \esc_html__( 'Go to the %s and either create a new project or select an existing one.', 'xml-sitemap-feed' ),
    90                         '<strong><a href="https://console.cloud.google.com/" target="_blank" rel="noopener noreferrer">' . \esc_html__( 'Google Cloud Console', 'xml-sitemap-feed' ) . '</a></strong>'
    91                     );
    92                     ?>
    93                 </li>
    94                 <li>
    95                     <?php
    96                     \printf(
    97                         /* translators: %1$s: API & Services, %2$s: OAuth consent screen */
    98                         \esc_html__( 'If you created a new project, navigate to %1$s > %2$s.', 'xml-sitemap-feed' ),
    99                         '<strong>' . \esc_html__( 'APIs & Services', 'xml-sitemap-feed' ) . '</strong>',
    100                         '<strong>' . \esc_html__( 'OAuth consent screen', 'xml-sitemap-feed' ) . '</strong>'
    101                     );
    102                     ?>
    103                     <ul>
    104                         <li>
    105                             <?php
    106                             \printf(
    107                                 /* translators: %1$s: Get started, %2$s: Create */
    108                                 \esc_html__( 'Click the %1$s button, give your App a name and follow the steps to finally reach %2$s.', 'xml-sitemap-feed' ),
    109                                 '<strong>' . \esc_html__( 'Get started', 'xml-sitemap-feed' ) . '</strong>',
    110                                 '<strong>' . \esc_html__( 'Create', 'xml-sitemap-feed' ) . '</strong>'
    111                             );
    112                             ?>
    113                         </li>
    114                         <li>
    115                             <?php
    116                             \printf(
    117                                 /* translators: %1$s: Audience, %2$s: Publish app */
    118                                 \esc_html__( 'Then navigate to %1$s and, if available, click %2$s.', 'xml-sitemap-feed' ),
    119                                 '<strong>' . \esc_html__( 'Audience', 'xml-sitemap-feed' ) . '</strong>',
    120                                 '<strong>' . \esc_html__( 'Publish app', 'xml-sitemap-feed' ) . '</strong>'
    121                             );
    122                             ?>
    123                         </li>
    124                     </ul>
    125                 </li>
    126                 <li>
    127                     <?php
    128                     \printf(
    129                         /* translators: %1$s: API & Services, %2$s: Library, %3$s Google Search Console API */
    130                         \esc_html__( 'Navigate to %1$s > %2$s. Search for %3$s and enable it for your project.', 'xml-sitemap-feed' ),
    131                         '<strong>' . \esc_html__( 'APIs & Services', 'xml-sitemap-feed' ) . '</strong>',
    132                         '<strong>' . \esc_html__( 'Library', 'xml-sitemap-feed' ) . '</strong>',
    133                         '<strong>' . \esc_html__( 'Google Search Console API', 'xml-sitemap-feed' ) . '</strong>'
    134                     );
    135                     ?>
    136                 </li>
    137                 <li>
    138                     <?php
    139                     \printf(
    140                         /* translators: %1$s: API & Services, %2$s: Credentials, %3$s + Create credentials */
    141                         \esc_html__( 'Go to %1$s > %2$s and click %3$s.', 'xml-sitemap-feed' ),
    142                         '<strong>' . \esc_html__( 'APIs & Services', 'xml-sitemap-feed' ) . '</strong>',
    143                         '<strong>' . \esc_html__( 'Credentials', 'xml-sitemap-feed' ) . '</strong>',
    144                         '<strong>' . \esc_html__( '+ Create credentials', 'xml-sitemap-feed' ) . '</strong>'
    145                     );
    146                     ?>
    147                     <ul>
    148                         <li>
    149                             <?php
    150                             \printf(
    151                                 /* translators: %1$s: OAuth client ID, %2$s: Web application */
    152                                 \esc_html__( 'Select %1$s and choose %2$s as the Application type.', 'xml-sitemap-feed' ),
    153                                 '<strong>' . \esc_html__( 'OAuth client ID', 'xml-sitemap-feed' ) . '</strong>',
    154                                 '<strong>' . \esc_html__( 'Web application', 'xml-sitemap-feed' ) . '</strong>'
    155                             );
    156                             ?>
    157                         </li>
    158                         <li>
    159                             <?php
    160                             \printf(
    161                                 /* translators: %1$s: Authorized redirect URIs, %2$s: The redirect URI to be registered in Google Cloud Console */
    162                                 \esc_html__( 'In the %1$s field, add the following exact URI: %2$s', 'xml-sitemap-feed' ),
    163                                 '<strong>' . \esc_html__( 'Authorized redirect URIs', 'xml-sitemap-feed' ) . '</strong>',
    164                                 '<code>' . \esc_url( \site_url( 'index.php?' . self::$query_var ) ) . '</code>' // This is your plugin's custom endpoint URL.
    165                             );
    166                             ?>
    167                         </li>
    168                         <li>
    169                             <?php
    170                             \printf(
    171                                 /* translators: %1$s: Create, %2$s: Client ID, %3$s: Client secret */
    172                                 \esc_html__( 'Click %1$s button and a popup dialog will then display your %2$s and %3$s. Copy each of these and paste them into their respective fields below.', 'xml-sitemap-feed' ),
    173                                 '<strong>' . \esc_html__( 'Create', 'xml-sitemap-feed' ) . '</strong>',
    174                                 '<strong>' . \esc_html__( 'Client ID', 'xml-sitemap-feed' ) . '</strong>',
    175                                 '<strong>' . \esc_html__( 'Client secret', 'xml-sitemap-feed' ) . '</strong>'
    176                             );
    177                             ?>
    178                         </li>
    179                     </ul>
    180                 </li>
    181             </ol>
    182             <p><strong><?php \esc_html_e( 'Important:', 'xml-sitemap-feed' ); ?></strong> <?php \esc_html_e( 'Ensure the Redirect URI is copied and pasted exactly as shown.', 'xml-sitemap-feed' ); ?></p>
    183             <p>
    184                 <?php
    185                 \printf(
    186                     /* translators: %s: Save Settings */
    187                     esc_html__( 'After filling the fields below and clicking %1$s a button %2$s will allow you to finalize the connection.', 'xml-sitemap-feed' ),
    188                     '<strong>' . \esc_html( \translate( 'Save Changes' ) ) . '</strong>', // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction
    189                     '<strong>' . \esc_html__( 'Connect to Google Search Console', 'xml-sitemap-feed' ) . '</strong>'
    190                 );
    191                 ?>
    192             </p>
    193             <hr>
    194             <?php
    195         else :
     72        if ( empty( $options['google_client_id'] ) || empty( $options['google_client_secret'] ) ) {
     73            // Stage 1.
     74            include XMLSF_DIR . '/views/admin/section-gsc-oauth-stage-1.php';
     75        } else {
    19676            $redirect_uri = \site_url( 'index.php?' . self::$query_var );
    19777            $oauth_url    = \add_query_arg(
     
    20686                'https://accounts.google.com/o/oauth2/auth'
    20787            );
    208             ?>
    209             <h3><?php \esc_html_e( 'Stage 2/2. Authorize the connection', 'xml-sitemap-feed' ); ?></h3>
    210             <a href="<?php echo \esc_url( $oauth_url ); ?>" class="button button-primary">
    211                 <?php \esc_html_e( 'Connect to Google Search Console', 'xml-sitemap-feed' ); ?>
    212             </a>
    213             <p class="description">
    214                 <?php \esc_html_e( 'You will be redirected to Google to authorize your site.', 'xml-sitemap-feed' ); ?> <?php \esc_html_e( 'Please use a Google account that has Full access to the site property in Google Search Console.', 'xml-sitemap-feed' ); ?>
    215                 <br>
    216                 <?php
    217                 \printf(
    218                     /* translators: %s the URL */
    219                     \esc_html__( 'The redirect URI for your Google Cloud Console OAuth 2.0 client configuration should be: %s', 'xml-sitemap-feed' ),
    220                     '<code>' . \esc_url( \site_url( 'index.php?' . self::$query_var ) ) . '</code>'
    221                 );
    222                 ?>
    223             </p>
    224             <p><?php \esc_html_e( 'After successful authorization, you will be able to configure the plugin settings and start submitting your sitemap to Google Search Console manually or automatically on content updates.', 'xml-sitemap-feed' ); ?></p>
    225             <hr>
    226             <p><?php \printf( /* translators: %1$s Client ID, %2$s Save Changes */ \esc_html__( 'To restart the setup process, clear the %1$s field and %2$s.', 'xml-sitemap-feed' ), \esc_html__( 'Client ID', 'xml-sitemap-feed' ), \esc_html( \translate( 'Save Changes' ) ) ); // phpcs:ignore WordPress.WP.I18n.LowLevelTranslationFunction ?>
    227             </p>
    228             <?php
    229         endif;
     88
     89            // Stage 2.
     90            include XMLSF_DIR . '/views/admin/section-gsc-oauth-stage-2.php';
     91        }
    23092    }
    23193
  • xml-sitemap-feed/trunk/inc/class-gsc-connect.php

    r3403470 r3405317  
    4141     * Register settings used by the plugin.
    4242     */
    43     public static function add_options_page() {
     43    public static function add_tools_page() {
    4444        \add_submenu_page(
    45             null, // Hides settings page but breaks stuff like admin_page_title().
    46             __( 'Google Search Console Connection', 'xml-sitemap-feed' ), // Page title.
    47             __( 'Google Search Console', 'xml-sitemap-feed' ), // Menu title.
    48             'manage_options', // Capability required.
    49             self::$page_slug, // Menu slug.
    50             array( __NAMESPACE__ . '\GSC_Connect_Settings', 'options_page_render' ) // Function to display the page.
     45            'tools.php',
     46            __( 'Google Search Console Connection', 'xml-sitemap-feed' ),
     47            __( 'Google Search Console', 'xml-sitemap-feed' ),
     48            'manage_options',
     49            self::$page_slug,
     50            array( __NAMESPACE__ . '\GSC_Connect_Settings', 'options_page_render' )
    5151        );
    5252    }
     
    110110
    111111            $origin = \get_transient( 'gsc_connect_origin' );
    112             $slug   = $origin ? $origin : ( sitemaps_enabled( 'sitemap' ) ? 'xmlsf' : ( sitemaps_enabled( 'sitemap' ) ? 'xmlsf_news' : false ) );
    113 
    114             $redirect_url = $slug ? \add_query_arg( 'page', $slug, \admin_url( 'options-general.php' ) ) : \admin_url( 'options-general.php' );
     112            $slug   = $origin ? $origin : ( sitemaps_enabled( 'sitemap' ) ? 'xmlsf' : ( sitemaps_enabled( 'sitemap-news' ) ? 'xmlsf_news' : false ) );
     113
     114            $redirect_url = $slug ? \add_query_arg( 'page', $slug, \admin_url( 'options-general.php' ) ) : \admin_url( 'options-reading.php#xmlsf_sitemaps' );
    115115            $redirect_url = \add_query_arg( 'settings-updated', 'true', $redirect_url );
    116116
     
    208208     */
    209209    public static function get_settings_url() {
    210         return \admin_url( 'options-general.php?page=' . self::$page_slug );
     210        return \admin_url( 'tools.php?page=' . self::$page_slug );
    211211    }
    212212
  • xml-sitemap-feed/trunk/inc/class-xmlsitemapfeed.php

    r3403469 r3405317  
    183183        if ( empty( $options['google_refresh_token'] ) ) {
    184184            // Prepare onboarding.
    185             add_action( 'admin_menu', array( __NAMESPACE__ . '\GSC_Connect', 'add_options_page' ) );
     185            add_action( 'admin_menu', array( __NAMESPACE__ . '\GSC_Connect', 'add_tools_page' ) );
    186186            add_action( 'admin_init', array( __NAMESPACE__ . '\GSC_Connect', 'register_settings' ) );
    187187
  • xml-sitemap-feed/trunk/inc/translations.php

    r3403614 r3405317  
    3838esc_html__( 'License key', 'xml-sitemap-feed' );
    3939__( 'Beta version', 'xml-sitemap-feed' );
     40esc_html__( 'This option will allow you to update the plugin to the latest beta release.', 'xml-sitemap-feed' );
    4041esc_html__( 'Enter your license key.', 'xml-sitemap-feed' );
    4142esc_html__( 'Your license is active for this site.', 'xml-sitemap-feed' );
     
    9192    '<a href="' . esc_url( admin_url( 'options-general.php' ) ) . '?page=xmlsf_news&tab=license">' . esc_html__( 'correct this issue', 'xml-sitemap-feed' ) . '</a>'
    9293);
     94
     95esc_html_e( 'No log entries found.', 'xml-sitemap-feed' );
     96esc_html_e( 'The 20 most recent sitemap notification request and related messages are logged here.', 'xml-sitemap-feed' );
     97esc_html_e( 'Message', 'xml-sitemap-feed' );
     98__( 'Sitemap Notification Log', 'xml-sitemap-feed' );
     99esc_html_e( 'Warning: The sitemap notifier depends on internal WordPress events but you seem to have WP Cron disabled. Make sure that you are using a reliable alternative to WP Cron, like a server cron job, to trigger events and that this is done on fairly short interval, e.g. once every minute. If the interval is longer, automatic notifications will suffer longer delays.', 'xml-sitemap-feed' );
     100
  • xml-sitemap-feed/trunk/readme.txt

    r3404482 r3405317  
    66Requires PHP: 5.6
    77Tested up to: 6.9
    8 Stable tag: 5.6.1
     8Stable tag: 5.6.2
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    5858* Exclude posts and pages in the Bulk Editor.
    5959* Optionally include empty taxonomy term and empty author archives
    60 * Rank Math compatibility: exclude posts set to noindex
     60* Yoast SEO and Rank Math compatibility: exclude posts set to noindex
    6161
    6262**[Google News Advanced](https://premium.status301.com/downloads/google-news-advanced/)**
  • xml-sitemap-feed/trunk/views/admin/section-gsc-data-news.php

    r3403470 r3405317  
    1212    ?>
    1313    <p>
    14         <?php esc_html_e( 'Connect to Google Search Console to allow sitemap data retrieval.', 'xml-sitemap-feed' ); ?>
     14        <?php printf( /* translators: %s: Google Search Console */ esc_html_x( 'Connect to %s for sitemap data retrieval and sitemap submissions.', 'Google Search Console connection', 'xml-sitemap-feed' ), esc_html__( 'Google Search Console', 'xml-sitemap-feed' ) ); ?>
    1515    </p>
    16     <a href="<?php echo esc_url( XMLSF\GSC_Connect::get_settings_url() ); ?>" class="button button-primary">
    17         <?php esc_html_e( 'Connect', 'xml-sitemap-feed' ); ?>
    18     </a>
     16    <p>
     17        <a href="<?php echo esc_url( add_query_arg( 'ref', 'xmlsf_news', XMLSF\GSC_Connect::get_settings_url() ) ); ?>" class="button button-primary">
     18            <?php esc_html_e( 'Connect', 'xml-sitemap-feed' ); ?>
     19        </a>
     20    </p>
    1921    <?php
    2022    return;
     
    2527
    2628?>
    27 <p><?php esc_html_e( 'Your sitemap data as reported by Google Search Console.', 'xml-sitemap-google-news' ); ?></p>
     29<p><?php esc_html_e( 'Your sitemap data as reported by Google Search Console.', 'xml-sitemap-feed' ); ?></p>
    2830<?php
    2931if ( isset( $result['success'] ) && $result['success'] && $result['data'] ) {
  • xml-sitemap-feed/trunk/views/admin/section-gsc-data.php

    r3403470 r3405317  
    1212    ?>
    1313    <p>
    14         <?php esc_html_e( 'Connect to Google Search Console to allow sitemap data retrieval.', 'xml-sitemap-feed' ); ?>
     14        <?php printf( /* translators: %s: Google Search Console */ esc_html_x( 'Connect to %s for sitemap data retrieval and sitemap submissions.', 'Google Search Console connection', 'xml-sitemap-feed' ), esc_html__( 'Google Search Console', 'xml-sitemap-feed' ) ); ?>
    1515    </p>
    16     <a href="<?php echo esc_url( XMLSF\GSC_Connect::get_settings_url() ); ?>" class="button button-primary">
    17         <?php esc_html_e( 'Connect', 'xml-sitemap-feed' ); ?>
    18     </a>
     16    <p>
     17        <a href="<?php echo esc_url( add_query_arg( 'ref', 'xmlsf', XMLSF\GSC_Connect::get_settings_url() ) ); ?>" class="button button-primary">
     18            <?php esc_html_e( 'Connect', 'xml-sitemap-feed' ); ?>
     19        </a>
     20    </p>
    1921    <?php
    2022    return;
     
    2527
    2628?>
    27 <p><?php esc_html_e( 'Your sitemap data as reported by Google Search Console.', 'xml-sitemap-google-news' ); ?></p>
     29<p><?php esc_html_e( 'Your sitemap data as reported by Google Search Console.', 'xml-sitemap-feed' ); ?></p>
    2830<?php
    2931if ( isset( $result['success'] ) && $result['success'] && $result['data'] ) {
  • xml-sitemap-feed/trunk/views/admin/sidebar-gsc-connect.php

    r3403470 r3405317  
    1717    ?>
    1818    <p>
    19         <?php esc_html_e( 'Connect to Google Search Console to get a sitemap report in your site admin.', 'xml-sitemap-feed' ); ?>
     19        <?php printf( /* translators: %s: Google Search Console */ esc_html_x( 'Connect to %s for sitemap data retrieval and sitemap submissions.', 'Google Search Console connection', 'xml-sitemap-feed' ), esc_html__( 'Google Search Console', 'xml-sitemap-feed' ) ); ?>
    2020    </p>
    21     <a href="<?php echo esc_url( $settings_page_url ); ?>" class="button button-primary">
    22         <?php esc_html_e( 'Connect', 'xml-sitemap-feed' ); ?>
    23     </a>
     21    <p>
     22        <a href="<?php echo esc_url( $settings_page_url ); ?>" class="button button-primary">
     23            <?php esc_html_e( 'Connect', 'xml-sitemap-feed' ); ?>
     24        </a>
     25    </p>
    2426    <?php
    2527    return;
  • xml-sitemap-feed/trunk/xml-sitemap.php

    r3403614 r3405317  
    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.6.1
     6 * Version: 5.6.2
    77 * Text Domain: xml-sitemap-feed
    88 * Requires at least: 4.4
     
    4747defined( 'WPINC' ) || die;
    4848
    49 define( 'XMLSF_VERSION', '5.6.1' );
     49define( 'XMLSF_VERSION', '5.6.2' );
    5050define( 'XMLSF_ADV_MIN_VERSION', '1.0' );
    5151define( 'XMLSF_NEWS_ADV_MIN_VERSION', '1.4' );
Note: See TracChangeset for help on using the changeset viewer.