Changeset 3405317
- Timestamp:
- 11/28/2025 03:12:59 PM (2 weeks ago)
- Location:
- xml-sitemap-feed/trunk
- Files:
-
- 3 added
- 9 edited
-
inc/class-gsc-connect-settings.php (modified) (3 diffs)
-
inc/class-gsc-connect.php (modified) (3 diffs)
-
inc/class-xmlsitemapfeed.php (modified) (1 diff)
-
inc/translations.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
views/admin/section-gsc-data-news.php (modified) (2 diffs)
-
views/admin/section-gsc-data.php (modified) (2 diffs)
-
views/admin/section-gsc-oauth-intro.php (added)
-
views/admin/section-gsc-oauth-stage-1.php (added)
-
views/admin/section-gsc-oauth-stage-2.php (added)
-
views/admin/sidebar-gsc-connect.php (modified) (1 diff)
-
xml-sitemap.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
xml-sitemap-feed/trunk/inc/class-gsc-connect-settings.php
r3403470 r3405317 35 35 ?> 36 36 <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> 38 38 39 39 <form action="options.php" method="post"> … … 65 65 // Get existing data from DB. 66 66 $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 79 71 // 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 { 196 76 $redirect_uri = \site_url( 'index.php?' . self::$query_var ); 197 77 $oauth_url = \add_query_arg( … … 206 86 'https://accounts.google.com/o/oauth2/auth' 207 87 ); 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 } 230 92 } 231 93 -
xml-sitemap-feed/trunk/inc/class-gsc-connect.php
r3403470 r3405317 41 41 * Register settings used by the plugin. 42 42 */ 43 public static function add_ options_page() {43 public static function add_tools_page() { 44 44 \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' ) 51 51 ); 52 52 } … … 110 110 111 111 $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' ); 115 115 $redirect_url = \add_query_arg( 'settings-updated', 'true', $redirect_url ); 116 116 … … 208 208 */ 209 209 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 ); 211 211 } 212 212 -
xml-sitemap-feed/trunk/inc/class-xmlsitemapfeed.php
r3403469 r3405317 183 183 if ( empty( $options['google_refresh_token'] ) ) { 184 184 // 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' ) ); 186 186 add_action( 'admin_init', array( __NAMESPACE__ . '\GSC_Connect', 'register_settings' ) ); 187 187 -
xml-sitemap-feed/trunk/inc/translations.php
r3403614 r3405317 38 38 esc_html__( 'License key', 'xml-sitemap-feed' ); 39 39 __( 'Beta version', 'xml-sitemap-feed' ); 40 esc_html__( 'This option will allow you to update the plugin to the latest beta release.', 'xml-sitemap-feed' ); 40 41 esc_html__( 'Enter your license key.', 'xml-sitemap-feed' ); 41 42 esc_html__( 'Your license is active for this site.', 'xml-sitemap-feed' ); … … 91 92 '<a href="' . esc_url( admin_url( 'options-general.php' ) ) . '?page=xmlsf_news&tab=license">' . esc_html__( 'correct this issue', 'xml-sitemap-feed' ) . '</a>' 92 93 ); 94 95 esc_html_e( 'No log entries found.', 'xml-sitemap-feed' ); 96 esc_html_e( 'The 20 most recent sitemap notification request and related messages are logged here.', 'xml-sitemap-feed' ); 97 esc_html_e( 'Message', 'xml-sitemap-feed' ); 98 __( 'Sitemap Notification Log', 'xml-sitemap-feed' ); 99 esc_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 6 6 Requires PHP: 5.6 7 7 Tested up to: 6.9 8 Stable tag: 5.6. 18 Stable tag: 5.6.2 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 58 58 * Exclude posts and pages in the Bulk Editor. 59 59 * Optionally include empty taxonomy term and empty author archives 60 * Rank Math compatibility: exclude posts set to noindex60 * Yoast SEO and Rank Math compatibility: exclude posts set to noindex 61 61 62 62 **[Google News Advanced](https://premium.status301.com/downloads/google-news-advanced/)** -
xml-sitemap-feed/trunk/views/admin/section-gsc-data-news.php
r3403470 r3405317 12 12 ?> 13 13 <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' ) ); ?> 15 15 </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> 19 21 <?php 20 22 return; … … 25 27 26 28 ?> 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> 28 30 <?php 29 31 if ( isset( $result['success'] ) && $result['success'] && $result['data'] ) { -
xml-sitemap-feed/trunk/views/admin/section-gsc-data.php
r3403470 r3405317 12 12 ?> 13 13 <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' ) ); ?> 15 15 </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> 19 21 <?php 20 22 return; … … 25 27 26 28 ?> 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> 28 30 <?php 29 31 if ( isset( $result['success'] ) && $result['success'] && $result['data'] ) { -
xml-sitemap-feed/trunk/views/admin/sidebar-gsc-connect.php
r3403470 r3405317 17 17 ?> 18 18 <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' ) ); ?> 20 20 </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> 24 26 <?php 25 27 return; -
xml-sitemap-feed/trunk/xml-sitemap.php
r3403614 r3405317 4 4 * Plugin URI: https://status301.net/wordpress-plugins/xml-sitemap-feed/ 5 5 * Description: Feed the hungry spiders in compliance with the XML Sitemap and Google News protocols. 6 * Version: 5.6. 16 * Version: 5.6.2 7 7 * Text Domain: xml-sitemap-feed 8 8 * Requires at least: 4.4 … … 47 47 defined( 'WPINC' ) || die; 48 48 49 define( 'XMLSF_VERSION', '5.6. 1' );49 define( 'XMLSF_VERSION', '5.6.2' ); 50 50 define( 'XMLSF_ADV_MIN_VERSION', '1.0' ); 51 51 define( 'XMLSF_NEWS_ADV_MIN_VERSION', '1.4' );
Note: See TracChangeset
for help on using the changeset viewer.