+85+85+85o+85j)85)85)85)85)85)85)85)85e)85)85)85)85)85)85)85)85)85)85)85)85)85 )85`)85+(85)85)85)85)85!)85))850)857)85=)85L)85B)85S)85I)85P)85Z)85^)85b)85g)85n)85r)85w)85~)85)85)85s)85)85)85)85)85)85)85Ä)85߄)85U)85U)85)85)85)850a'85@d'85&85P&85*&85`&854(85)85)85)85)85')85)85)85&)85)85)85)85)85)85w(85)85)85)85 )85v(85 )85)85)85(85Q)85l)85)85#)85()85-)852)857)85<)85A)85E)85J)85O)85V)85[)85(85a)853(85)85)85)85)85)85)85)85&85F85&85F85PG#85&85P&85#685#685&85F85&85&85F85&85 &85BBBB CC#C8C 0 P   o(c85P85 w85 F P+85xn 85@ 85S o o ooooV 85okE Pb485 =85 E4854585=85 =850=8575F85:85K>85,>85=85585=85Ћ585@?85P=85y=85 W.85F85F85 F85p185Џ685P&:850X/85p?850/=8585G>85P185:85%085y<850qE8503>85?85385P|:85VE85I685=85@F85 685\75PF>85p/85 V685!=850=85$75 :85|:85@/85)=85F85Y85J>85:85F85=85o585E585`?85 \=85pe:85p:85 G85385PE485<85=85;85`#085F85;685p=85PD485 =850?85Pf=852:85s=85`s/8575>>8585p0=85T85,85I485P385G85p=850?>85=85p<085p=8575@;>85585PI>85@85P75:85_985P/85=85=85p;>85885/85/85`K>85 5?85 =85E>85F85385D085=85E>85p6:85D>85p585:85=85`<>85`/85?>8575XE85F85%85t:85F850K>8503854:85r=8585p085$75 850085=85L485Pr.85`085L>85pU685/85P5?85p085F85@+75H>85<>85`=8575@=85PF85->85 =85@850085`:850 =85|685F85 5685p=85<85C485@z=85=85p385G85185<>85P_985=8585 E085W85 085!085P1854:85?85UE85?85@=85v:85@/85?>85P:850385D085I>85D>85 385/85@'685l:85F85p>>85 7/85`70852>85pE5850a=85p=850=85 U85$75@985 E085y=85@=85F85F:851?85U685856:8503859:850M85#685)0858M85`M85hM85a = new WPSEO_Sitemap_Cache_Data(); $sitemap_data->set_sitemap( $sitemap ); $sitemap_data->set_status( $status ); return set_transient( $transient_key, $sitemap_data, DAY_IN_SECONDS ); } /** * Delete cache transients for index and specific type. * * Always deletes the main index sitemaps cache, as that's always invalidated by any other change. * * @since 1.5.4 * @since 3.2 Changed from function wpseo_invalidate_sitemap_cache() to method in this class. * * @param string $type Sitemap type to invalidate. * * @return void */ public static function invalidate( $type ) { self::clear( [ $type ] ); } /** * Helper to invalidate in hooks where type is passed as second argument. * * @since 3.2 * * @param int $unused Unused term ID value. * @param string $type Taxonomy to invalidate. * * @return void */ public static function invalidate_helper( $unused, $type ) { if ( WPSEO_Options::get( 'noindex-' . $type ) === false || WPSEO_Options::get( 'noindex-tax-' . $type ) === false ) { self::invalidate( $type ); } } /** * Invalidate sitemap cache for authors. * * @param int $user_id User ID. * * @return bool True if the sitemap was properly invalidated. False otherwise. */ public static function invalidate_author( $user_id ) { $user = get_user_by( 'id', $user_id ); if ( $user === false ) { return false; } if ( current_action() === 'user_register' ) { update_user_meta( $user_id, '_yoast_wpseo_profile_updated', time() ); } if ( empty( $user->roles ) || in_array( 'subscriber', $user->roles, true ) ) { return false; } self::invalidate( 'author' ); return true; } /** * Invalidate sitemap cache for the post type of a post. * * Don't invalidate for revisions. * * @since 1.5.4 * @since 3.2 Changed from function wpseo_invalidate_sitemap_cache_on_save_post() to method in this class. * * @param int $post_id Post ID to invalidate type for. * * @return void */ public static function invalidate_post( $post_id ) { if ( wp_is_post_revision( $post_id ) ) { return; } self::invalidate( get_post_type( $post_id ) ); } /** * Delete cache transients for given sitemaps types or all by default. * * @since 1.8.0 * @since 3.2 Moved from WPSEO_Utils to this class. * * @param array $types Set of sitemap types to delete cache transients for. * * @return void */ public static function clear( $types = [] ) { if ( ! self::$is_enabled ) { return; } // No types provided, clear all. if ( empty( $types ) ) { self::$clear_all = true; return; } // Always invalidate the index sitemap as well. if ( ! in_array( WPSEO_Sitemaps::SITEMAP_INDEX_TYPE, $types, true ) ) { array_unshift( $types, WPSEO_Sitemaps::SITEMAP_INDEX_TYPE ); } foreach ( $types as $type ) { if ( ! in_array( $type, self::$clear_types, true ) ) { self::$clear_types[] = $type; } } } /** * Invalidate storage for cache types queued to clear. */ public static function clear_queued() { if ( self::$clear_all ) { WPSEO_Sitemaps_Cache_Validator::invalidate_storage(); self::$clear_all = false; self::$clear_types = []; return; } foreach ( self::$clear_types as $type ) { WPSEO_Sitemaps_Cache_Validator::invalidate_storage( $type ); } self::$clear_types = []; } /** * Adds a hook that when given option is updated, the cache is cleared. * * @since 3.2 * * @param string $option Option name. * @param string $type Sitemap type. */ public static function register_clear_on_option_update( $option, $type = '' ) { self::$cache_clear[ $option ] = $type; } /** * Clears the transient cache when a given option is updated, if that option has been registered before. * * @since 3.2 * * @param string $option The option name that's being updated. * * @return void */ public static function clear_on_option_update( $option ) { if ( array_key_exists( $option, self::$cache_clear ) ) { if ( empty( self::$cache_clear[ $option ] ) ) { // Clear all caches. self::clear(); } else { // Clear specific provided type(s). $types = (array) self::$cache_clear[ $option ]; self::clear( $types ); } } } }