Changeset 3403469
- Timestamp:
- 11/26/2025 03:08:53 PM (3 weeks ago)
- Location:
- xml-sitemap-feed/trunk
- Files:
-
- 1 deleted
- 19 edited
-
inc/admin/class-fields.php (modified) (5 diffs)
-
inc/admin/class-main.php (modified) (2 diffs)
-
inc/admin/class-sitemap-news.php (modified) (6 diffs)
-
inc/admin/class-sitemap.php (modified) (6 diffs)
-
inc/class-xmlsitemapfeed.php (modified) (2 diffs)
-
readme.txt (modified) (45 diffs)
-
uninstall.php (modified) (2 diffs)
-
views/admin/field-meta-box-news.php (modified) (1 diff)
-
views/admin/field-meta-box.php (modified) (1 diff)
-
views/admin/field-news-categories.php (modified) (1 diff)
-
views/admin/field-news-labels.php (deleted)
-
views/admin/field-news-notifier.php (modified) (1 diff)
-
views/admin/field-sitemap-authors.php (modified) (1 diff)
-
views/admin/field-sitemap-post-types.php (modified) (1 diff)
-
views/admin/field-sitemap-taxonomies.php (modified) (1 diff)
-
views/admin/help-tab-support.php (modified) (1 diff)
-
views/admin/page-sitemap-news.php (modified) (6 diffs)
-
views/admin/page-sitemap.php (modified) (7 diffs)
-
views/admin/sidebar-help.php (modified) (1 diff)
-
xml-sitemap.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
xml-sitemap-feed/trunk/inc/admin/class-fields.php
r3334262 r3403469 48 48 49 49 $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 ) ); 51 51 $users_args = array( 52 52 'fields' => 'ID', … … 102 102 public static function taxonomies_field() { 103 103 $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' ); 105 105 106 106 // The actual fields for data entry. … … 205 205 * Quick edit fields allows to add HTML in Quick Edit. 206 206 * 207 * @since 5. 7207 * @since 5.5 208 208 * 209 209 * @param string $column_name Column name. … … 219 219 * Bulk edit fields allows to add HTML in Quick Edit. 220 220 * 221 * @since 5. 7221 * @since 5.5 222 222 * 223 223 * @param string $column_name Column name. … … 230 230 } 231 231 } 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 } 232 242 } -
xml-sitemap-feed/trunk/inc/admin/class-main.php
r3334262 r3403469 25 25 26 26 // 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 ); 29 40 30 41 if ( \XMLSF\sitemaps_enabled( 'sitemap' ) ) { … … 237 248 238 249 /** 239 * Clear settings240 */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 section254 */255 public static function admin_sidebar_help() {256 include XMLSF_DIR . '/views/admin/sidebar-help.php';257 }258 259 /**260 * Admin sidbar contribute section261 */262 public static function admin_sidebar_contribute() {263 include XMLSF_DIR . '/views/admin/sidebar-contribute.php';264 }265 266 /**267 250 * Admin notices actions 268 251 */ -
xml-sitemap-feed/trunk/inc/admin/class-sitemap-news.php
r3397682 r3403469 40 40 41 41 /** 42 * Clear settings43 */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 actions53 */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 /**111 42 * Compare versions to known compatibility. 112 43 */ … … 132 63 133 64 // 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 ) ) { 135 66 include XMLSF_DIR . '/views/admin/notice-xmlsf-advanced-news.php'; 136 67 } … … 162 93 */ 163 94 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; 170 97 171 98 // The actual fields for data entry. … … 206 133 'manage_options', 207 134 'xmlsf_news', 208 array( __ CLASS__, 'settings_page' )135 array( __NAMESPACE__ . '\Sitemap_News_Settings', 'settings_page' ) 209 136 ); 210 137 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' ) ); 363 140 } 364 141 … … 370 147 'xmlsf_news_general', 371 148 'xmlsf_news_tags', 372 array( 'sanitize_callback' => array( __ CLASS__, 'sanitize_news_tags' ) )149 array( 'sanitize_callback' => array( __NAMESPACE__ . '\Sitemap_News_Settings', 'sanitize_news_tags' ) ) 373 150 ); 374 151 … … 379 156 ); 380 157 } 381 382 /**383 * Advanced section intro384 *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 tab395 */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.Recommended399 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.LowLevelTranslationFunction448 '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 settings516 *517 * @param array $save Settings array.518 *519 * @return array520 */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 }557 158 } -
xml-sitemap-feed/trunk/inc/admin/class-sitemap.php
r3378863 r3403469 100 100 // Set transients for flushing. 101 101 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 }130 102 } 131 103 … … 213 185 214 186 /** 215 * Tools actions216 */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 /**314 187 * Compare versions to known compatibility. 315 188 */ … … 335 208 336 209 // 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 ) ) { 338 211 include XMLSF_DIR . '/views/admin/notice-xmlsf-advanced.php'; 339 212 } … … 372 245 */ 373 246 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; 390 248 391 249 // The actual fields for data entry. … … 433 291 'manage_options', 434 292 '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' ) ); 630 298 } 631 299 … … 696 364 \add_action( 'update_option_xmlsf_disabled_providers', array( __CLASS__, 'update_disabled_providers' ), 10, 2 ); 697 365 \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 tabs705 */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.Recommended709 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.LowLevelTranslationFunction728 $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.LowLevelTranslationFunction730 $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.LowLevelTranslationFunction735 '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.LowLevelTranslationFunction754 '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.LowLevelTranslationFunction768 '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.LowLevelTranslationFunction794 '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.LowLevelTranslationFunction817 '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.LowLevelTranslationFunction841 '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 );855 366 } 856 367 -
xml-sitemap-feed/trunk/inc/class-xmlsitemapfeed.php
r3334262 r3403469 164 164 } 165 165 166 // Prepare GSC Connector. 167 \add_action( 'init', array( $this, 'gsc_connect' ) ); 168 166 169 // Register rewrites. 167 170 \add_action( 'init', array( $this, 'register_rewrites' ) ); … … 169 172 // Sitemap generator msg output. 170 173 \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 } 171 192 } 172 193 -
xml-sitemap-feed/trunk/readme.txt
r3397682 r3403469 6 6 Requires PHP: 5.6 7 7 Tested up to: 6.9 8 Stable tag: 5. 5.98 Stable tag: 5.6 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 143 143 == Upgrade Notice == 144 144 145 = 5.6 = 146 Google Search Console connection with sitemap reports and submission. 147 148 == Changelog == 149 150 = 5.6 = 151 152 Date: 202511 153 * Google Search Console sitemap reports 154 * Sitemap submission from admin 155 * Knowledge base link in admin help sections 156 145 157 = 5.5.9 = 146 Prepare advanced sitemap notification feature. 147 148 == Changelog == 149 150 = 5.5.9 = 158 151 159 Date: 20251118 152 160 * Prepare advanced sitemap notification feature. 153 161 154 162 = 5.5.8 = 163 155 164 Date: 20251014 156 165 * Drop unused news tags & stylesheet columns … … 159 168 160 169 = 5.5.7 = 170 161 171 Date: 20250915 162 172 * FIX: WPML Compatibility missing valid callback, thanks @linusbenknerkk 163 173 164 174 = 5.5.6 = 175 165 176 Date: 20250717 166 177 * FIX: Possible excessively long URL on admin post search, thanks @leedxw … … 168 179 169 180 = 5.5.5 = 181 170 182 Date: 20250625 171 183 * Polylang index lastmods per language in core sitemap … … 176 188 177 189 = 5.5.4 = 190 178 191 Date: 20250427 179 192 * Improved WPML compatibility … … 183 196 184 197 = 5.5.3 = 198 185 199 Date: 20250402 186 200 * FIX: missing exclude/priority meta box … … 190 204 191 205 = 5.5 = 206 192 207 Date: 20250331 193 * NEW:Exclude option in Quick Editor194 * NEW:Filter xmlsf_taxonomies_query_args195 * NEW:Filter xmlsf_news_hours_old196 * NEW:custom urls sitemap for core server197 * NEW:external sitemaps for core server208 * 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 198 213 * Namespacing & autoloading 199 214 * Admin notices for Slim SEO, Squirrly SEO, Jetpack Sitemaps & XML Sitemaps Manager … … 209 224 210 225 = 5.4.9 = 226 211 227 Date: 20240506 212 228 * FIX: Unauthenticated file inclusion - CVE-2024-4441 reported by Foxyyy 213 229 214 230 = 5.4.8 = 231 215 232 Date: 20240329 216 * NEW:post types max number233 * post types max number 217 234 * FIX: blog_public can be integer when object cache is used 218 235 * FIX: compatibility date redirect warning when using core server … … 221 238 222 239 = 5.4.5 = 240 223 241 Date: 20240221 224 242 * FIX: wp-cli disable plugin incompatibility … … 231 249 232 250 = 5.4 = 251 233 252 Date: 20240219 234 * NEW:Switch between Plugin or WP core sitemap server for sitemap generation235 * NEW:xmlsf_generator action hook236 * NEW:xmlsf_sitemap_index_pre and xmlsf_sitemap_index_post action hooks237 * NEW:xmlsf_author_has_published_posts filter253 * 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 238 257 * Dropping all Ping Services (no longer supported) 239 258 * Dropping allowed domains filtering … … 246 265 247 266 = 5.3.6 = 267 248 268 Date: 20230810 249 269 * FIX: Work around get_users() fatal error in WP 6.3 … … 251 271 252 272 = 5.3.5 = 273 253 274 Date: 20230629 254 275 * FIX: Forced Status 200 response conflict with Etag/If-None-Match headers, thanks @revolutionnaire 255 276 256 277 = 5.3.4 = 278 257 279 Date: 20230530 258 280 * FIX: File not found error on invalid sitemap requests … … 260 282 261 283 = 5.3.3 = 284 262 285 Date: 20230528 263 286 * FIX: Undefined variable + Invalid argument supplied for foreach(), thanks @yankyaw09 264 287 265 288 = 5.3.2 = 289 266 290 * FIX: Bing ping 410 error response 267 291 * FIX: Outdated help & forum links 268 292 269 293 = 5.3.1 = 294 270 295 * FIX: Restore wp-sitemap.xml rewrite rules after deactivation 271 296 * FIX: Call to undefined function xmlsf_get_archives() … … 273 298 274 299 = 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 284 310 * Moved news template action hook `xmlsf_news_tags_after` to after closing </news:news> tag 285 311 * Less DB queries, smaller memory footprint … … 294 320 295 321 = 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 323 Date: 20191111 324 * Ad Inserter compatibility check 325 * xmlsf_urlset and xmlsf_news_urlset action hooks, thanks to Stanislav Khromov (@khromov) 299 326 * Exclude hierarchical post types from news sitemap 300 327 301 328 = 5.2.6 = 302 20191009 303 * NEW: xmlsf_tags_after, xmlsf_url_after and xmlsf_news_url_after action hooks 329 330 Date: 20191009 331 * xmlsf_tags_after, xmlsf_url_after and xmlsf_news_url_after action hooks 304 332 * Make stylesheet paths relative to prevent exclusion when using different language domains 305 333 * FIX: Taxonomy selection not available to new installs 306 334 307 335 = 5.2.4 = 308 20190917 336 337 Date: 20190917 309 338 * NEW Rank Math incompatibility admin warnings 310 339 * FIX undefined index … … 312 341 313 342 = 5.2.3 = 343 314 344 * FIX Cannot use return value in write context 315 345 * FIX issue #30 for sql_mode=ONLY_FULL_GROUP_BY, thanks @silvios … … 317 347 318 348 = 5.2.2 = 349 319 350 * FIX invalid date format on some PHP versions 320 351 * FIX Can't use function return value in write context … … 323 354 324 355 = 5.2 = 325 20190429 356 357 Date: 20190429 326 358 * Image query optimization and meta caching 327 359 * Last comment date meta caching … … 340 372 341 373 = 5.1.2 = 374 342 375 * FIX: admin notice dismiss button failing 343 376 * FIX: date archive redirect notice showing for inactive post types … … 345 378 346 379 = 5.1.1 = 380 347 381 * FIX options page not found 348 382 * FIX news sitemap only ping 349 383 350 384 = 5.1 = 351 20190313 385 386 Date: 20190313 352 387 * SEOPress and Catch Box incompatibility admin messages 353 388 * FIX bbPress incompatibility … … 364 399 365 400 = 5.0.7 = 366 20181025 401 402 Date: 20181025 367 403 * Allowed domains back to Settings > Reading 368 404 * FIX static files check on activation … … 378 414 379 415 = 5.0 = 380 20180908 416 417 Date: 20180908 381 418 * Complete code restructure and cleanup: MVC and JIT inclusion 382 419 * Fewer DB queries, much smaller memory footprint on normal queries … … 398 435 399 436 = 4.9.4 = 437 400 438 * FIX: missing featured images, thanks @flyerua 401 439 * FIX: double content type response header filtering 402 440 403 441 = 4.9.3 = 442 404 443 * Reinstate filter_no_news_limits, allowing post type array 405 444 * Improved language handling and new language filter xmlsf_post_language … … 407 446 408 447 = 4.9.2 = 448 409 449 * FactCheck genre causes error in Search Console 410 450 411 451 = 4.9.1 = 452 412 453 * FIX: double genre terms on upgrade from 4.4, thanks @mouhalves 413 454 * FIX: wp_count_posts uncached and too heavy on large sites, thanks @carlalexander … … 416 457 417 458 = 4.9 = 418 20180507 459 460 Date: 20180507 419 461 * Code cleanup 420 * NEW:FactCheck genre462 * FactCheck genre 421 463 * Changefreq tag dropped 422 * NEW:translation strings for genres464 * translation strings for genres 423 465 * FIX: zlib.output_compression compatibility, thanks @alicewondermiscreations 424 466 * FIX: permalink issue with Woocommerce account page endpoints … … 426 468 427 469 = 4.8.3 = 470 428 471 * fix get_lastpostdate array/string 429 472 * restore pre PHP 5.4 compatibility (popular request) 430 473 431 474 = 4.8 = 432 20180316 433 * NEW: Conditional functions is_sitemap() and is_news() 475 476 Date: 20180316 477 * Conditional functions is_sitemap() and is_news() 434 478 * code cleanup and annotation 435 479 * new google ping URL … … 439 483 440 484 = 4.7.6 = 485 441 486 * FIX Open_BaseDir issue on IIS server 442 487 443 488 = 4.7.5 = 444 20161207 489 490 Date: 20161207 445 491 * FIX: On cache_flush purge also the respective time_key cache entry, 446 492 props @e2robert https://wordpress.org/support/topic/object-cache-issue-results-in-outdated-last-modified-values-on-index-sitemap/ … … 449 495 450 496 = 4.7.4 = 497 451 498 * Another WPML compat issue fixed, special thanks to hermes3por3 452 499 453 500 = 4.7.3 = 454 * NEW: xmlsf_excluded filter 501 502 * xmlsf_excluded filter 455 503 * IMPROVEMENT: Polylang and WPML compatibility issues 456 504 * FIX: "Only variables should be passed by reference" strict warning … … 458 506 459 507 = 4.7 = 460 20160506 508 509 Date: 20160506 461 510 * WPML compatibility 462 511 * FIX: News Sitemap chinese language tag … … 464 513 465 514 = 4.6.3 = 466 * NEW: filter xmlsf_custom_sitemaps 515 516 * filter xmlsf_custom_sitemaps 467 517 * BUGFIX: empty custom urls sitemap 468 518 469 519 = 4.6.2 = 470 * NEW: filter xmlsf_custom_urls 520 521 * filter xmlsf_custom_urls 471 522 * More cleanup 472 523 * BUGFIX: broken Polylang compatibility reported by @zesseb 473 524 474 525 = 4.6.1 = 475 20160407 526 527 Date: 20160407 476 528 * Code cleanup 477 529 * POT file update … … 479 531 480 532 = 4.6 = 481 * NEW: xmlsf_news_tags_after action hook 533 534 * xmlsf_news_tags_after action hook 482 535 * Attempt to remove static sitemap files left over by other sitemap plugins 483 536 484 537 = 4.5.1 = 538 485 539 * fix Persistent/Stored XSS vulnerability on admin page, thanks to Sneha Rajguru @Sneharajguru 486 540 487 541 = 4.5 = 542 488 543 * Set Google News access tag per post 489 544 * Exclude posts from Google News sitemap 490 545 * News Sitemap stylesheet text/links update 491 546 * 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 * N EW: Nginx Helper compatibility to purge cache sitemap URLs from FastCGI Cache or Redis547 * Nginx Helper compatibility to purge cache sitemap URLs from FastCGI Cache or Redis 493 548 494 549 = 4.4.1 = 550 495 551 * BUGFIX contribution by alejandra.aranibar: multiple news post types makes get_lastdate return oldest instead of newest date 496 552 * BUGFIX plugins_url filter not working, reported by Michael … … 500 556 501 557 = 4.4 = 558 502 559 * Pings max once per hour (5 minutes for news sitemap) 503 560 * Seperate ping for Google News Sitemap … … 514 571 515 572 = 4.3.2 = 573 516 574 * Italian translation 517 575 * BUGFIX: html esc / filter image title and caption tags … … 520 578 521 579 = 4.3 = 580 522 581 * Google News sitemap settings section 523 582 * Google News tags: access, genres, keywords, geo_locations … … 536 595 537 596 = 4.2.4 = 538 * NEW: Image tags 597 598 * Image tags 539 599 * Rearranged settings section 540 600 * FIX: replace permalink, title and bloginfo rss filter hooks with own 541 601 542 602 = 4.2.3 = 603 543 604 * BUGFIX: Empty ping options after disabling the main sitemap 544 605 * BUGFIX: Empty language tag for Google News tags in posts sitemap 545 606 * Small back end changes 546 * NEW:Custom post types split by year/month607 * Custom post types split by year/month 547 608 548 609 = 4.2 = 549 * NEW: Image & News tags 550 * NEW: Exclude pages/posts 610 611 * Image & News tags 612 * Exclude pages/posts 551 613 552 614 = 4.1.4 = 615 553 616 * BUGFIX: Pass by reference fatal error in PHP 5.4 554 617 * BUGFIX: issue with Polylang language code in pretty permalinks setting … … 558 621 559 622 = 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 564 628 * Reduced queries to increase performance 565 629 * Improved Lastmod and Changefreq calculations … … 570 634 571 635 = 4.0.1 = 572 * NEW: Dutch and French translations 636 637 * Dutch and French translations 573 638 * BUGFIX: Non public sites still have sitemap by default 574 639 * BUGFIX: Invalid argument supplied for foreach() when all post types are off … … 576 641 577 642 = 4.0.0 = 643 578 644 * Moved to sitemap index and seperated post/page sitemaps 579 * NEW:options to dswitch off sitemap and news sitemap580 * NEW:select which post types to include581 * NEW:select which taxonomies to include582 * NEW:set additional robots.txt rules583 * NEW:Translation POT catalogue645 * 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 584 650 * Improved Polylang support 585 651 * Dropped xLanguage support … … 587 653 588 654 = 3.9.2 = 655 589 656 * Basic Google News feed stylesheet 590 657 * improvement on XSS vulnerability fix … … 592 659 593 660 = 3.9.1 = 661 594 662 * SECURITY: XSS vulnerability in sitemap.xsl.php 595 663 596 664 = 3.9 = 665 597 666 * Google News Sitemap 598 667 * Memory limit error workaround (for most sites) 599 668 600 669 = 3.8.8 = 670 601 671 * BUGFIX: PHP4 compatibility 602 672 * BUGFIX: stylesheet URL when installed in mu-plugins … … 605 675 606 676 = 3.8.5 = 677 607 678 * **xLanguage support** based on code and testing by **Daniele Pelagatti** 608 679 * new FILTER HOOK `robotstxt_sitemap_url` for any translate and url changing plugins. … … 610 681 611 682 = 3.8.3 = 683 612 684 * filter out external URLs inserted by plugins like Page Links To (thanks, Francois) 613 685 * minify sitemap and stylesheet output … … 615 687 616 688 = 3.8 = 689 617 690 * **qTranslate support** 618 691 * no more Sitemap reference in robots.txt on non-public blogs 619 692 620 693 = 3.7.4 = 694 621 695 * switch from `add_feed` (on init) to the `do_feed_$feed` hook 622 696 * BUGFIX: `is_404()` condition TRUE and Response Header 404 on sites without posts … … 626 700 627 701 = 3.7 = 702 628 703 * massive changefreq calculation improvement 629 704 * further priority calulation improvement taking last comment date into account 630 705 631 706 = 3.6.1 = 707 632 708 * BUGFIX: wrong date calculation on blogs less than 1 year old 633 709 634 710 = 3.6 = 711 635 712 * massive priority calculation improvement 636 713 637 714 = 3.5 = 715 638 716 * complete rewrite of plugin internals 639 717 * speed improvements … … 641 719 642 720 = 3.4 = 721 643 722 * BUGFIX: use home instead of siteurl for blog url for sitemap reference in robots.txt 644 723 * code streamline and cleanup 645 724 646 725 = 3.3 = 726 647 727 * automatic exclusion of tags blog in wpmu 648 728 649 729 = 3.2 = 730 650 731 * rewrite and add_feed calls improvements 651 732 * BUGFIX: double entry when static page is frontpage 652 733 653 734 = 3.0 = 735 654 736 * added styling to the xml feed to make it human readable 655 737 656 738 = 2.1 = 739 657 740 * BUGFIX: lastmod timezone offset displayed wrong (extra space and missing double-colon) 658 741 659 742 = 2.0 = 743 660 744 * priority calculation based on comments and age 661 745 * changefreq based on comments 662 746 663 747 = 1.0 = 748 664 749 * changed feed template location to avoid the need to relocate files outside the plugins folder 665 750 * BUGFIX: `get_post_modified_time` instead of `get_post_time` 666 751 667 752 = 0.1 = 753 668 754 * rework from Patrick Chia's [Standard XML Sitemaps](http://wordpress.org/plugins/standard-xml-sitemap/) 669 755 * 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 85 85 delete_option( 'xmlsf_authors' ); 86 86 delete_option( 'xmlsf_post_type_settings' ); 87 delete_option( 'xmlsf_gsc_connect' ); 87 88 88 89 // Remove old transient. … … 90 91 delete_transient( 'xmlsf_comments_meta_primed' ); 91 92 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' ); 92 97 93 98 // Flush rules. -
xml-sitemap-feed/trunk/views/admin/field-meta-box-news.php
r3334262 r3403469 6 6 */ 7 7 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; 8 14 ?> 9 15 <p> -
xml-sitemap-feed/trunk/views/admin/field-meta-box.php
r3334262 r3403469 5 5 * @package XML Sitemap & Google News 6 6 */ 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 ) : ''; 7 17 8 18 ?> -
xml-sitemap-feed/trunk/views/admin/field-news-categories.php
r3378863 r3403469 44 44 </legend> 45 45 <p> 46 <?php esc_html_e( ' Limit to posts in these postcategories:', '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' ); ?> 47 47 </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> 49 49 <ul class="cat-checklist"> 50 50 <?php echo $cat_list; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> -
xml-sitemap-feed/trunk/views/admin/field-news-notifier.php
r3397682 r3403469 17 17 18 18 <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' ) ); ?> 20 20 <?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>' ); ?> 21 21 </p> -
xml-sitemap-feed/trunk/views/admin/field-sitemap-authors.php
r3334262 r3403469 14 14 <?php esc_html_e( 'Include these authors, or select none to automaticly include all authors with published posts:', 'xml-sitemap-feed' ); ?> 15 15 </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> 17 17 <ul class="cat-checklist"> 18 18 <?php -
xml-sitemap-feed/trunk/views/admin/field-sitemap-post-types.php
r3334262 r3403469 14 14 <?php esc_html_e( 'Include these post types, or select none to automaticly include all public post types:', 'xml-sitemap-feed' ); ?> 15 15 </p> 16 <!--<style>ul.cat-checklist{height:auto;max-height:48em}ul.children{padding-left:1em}</style>-->17 16 <ul> 18 17 <?php -
xml-sitemap-feed/trunk/views/admin/field-sitemap-taxonomies.php
r3334262 r3403469 16 16 <style>ul.cat-checklist{height:auto;max-height:48em}ul.children{padding-left:1em}</style> 17 17 <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 ?> 22 26 <li> 23 27 <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 ); ?>) 26 30 </label> 27 31 </li> 28 <?php } ?> 32 <?php 33 } 34 ?> 29 35 </ul> 30 36 </fieldset> -
xml-sitemap-feed/trunk/views/admin/help-tab-support.php
r3334262 r3403469 19 19 <?php 20 20 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( 21 28 /* translators: Review page and Translation page on WordPress.org */ 22 29 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 8 8 ?> 9 9 <style type="text/css"> 10 <?php include XMLSF_DIR . '/assets/admin.css'; ?>10 <?php require XMLSF_DIR . '/assets/admin.css'; ?> 11 11 </style> 12 12 <div class="wrap"> … … 19 19 20 20 <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> 23 23 <?php do_action( 'xmlsf_news_nav_tabs', $active_tab ); ?> 24 24 </nav> … … 42 42 <div class="sidebar"> 43 43 <?php 44 if ( ! self::compatible_with_advanced() ) {44 if ( ! XMLSF\Admin\Sitemap_News::compatible_with_advanced() ) { 45 45 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;">'; 46 46 include XMLSF_DIR . '/views/admin/section-advanced-news-compat-message.php'; … … 49 49 ?> 50 50 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> 52 52 <p> 53 53 <?php … … 60 60 </p> 61 61 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 76 62 <?php do_action( 'xmlsf_admin_sidebar', 'news' ); ?> 77 63 … … 80 66 </div> 81 67 <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'; ?> 98 69 </script> -
xml-sitemap-feed/trunk/views/admin/page-sitemap.php
r3334262 r3403469 8 8 ?> 9 9 <style type="text/css"> 10 <?php include XMLSF_DIR . '/assets/admin.css'; ?>10 <?php require XMLSF_DIR . '/assets/admin.css'; ?> 11 11 </style> 12 12 <div class="wrap"> … … 19 19 20 20 <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> 22 22 <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> 23 23 <?php … … 33 33 } 34 34 ?> 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> 36 36 <?php do_action( 'xmlsf_sitemap_nav_tabs', $active_tab ); ?> 37 37 </nav> … … 55 55 <div class="sidebar"> 56 56 <?php 57 if ( ! self::compatible_with_advanced() ) {57 if ( ! \XMLSF\Admin\Sitemap::compatible_with_advanced() ) { 58 58 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;">'; 59 59 include XMLSF_DIR . '/views/admin/section-advanced-compat-message.php'; … … 62 62 ?> 63 63 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> 65 65 <p> 66 66 <?php … … 73 73 </p> 74 74 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 93 75 <?php do_action( 'xmlsf_admin_sidebar' ); ?> 94 76 … … 97 79 </div> 98 80 <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'; ?> 115 82 </script> -
xml-sitemap-feed/trunk/views/admin/sidebar-help.php
r3334262 r3403469 7 7 8 8 ?> 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> 10 10 <p> 11 11 <?php 12 12 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' ), 16 29 '<a href="https://wordpress.org/support/plugin/xml-sitemap-feed" target="_blank">' . esc_html__( 'Support forum', 'xml-sitemap-feed' ) . '</a>' 17 30 ); -
xml-sitemap-feed/trunk/xml-sitemap.php
r3397682 r3403469 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. 5.96 * Version: 5.6-alpha20 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. 5.9' );49 define( 'XMLSF_VERSION', '5.6' ); 50 50 define( 'XMLSF_ADV_MIN_VERSION', '0.1' ); 51 51 define( 'XMLSF_NEWS_ADV_MIN_VERSION', '1.4' );
Note: See TracChangeset
for help on using the changeset viewer.