boolean|string The key where the cache is stored on. False if the key could not be generated. */ private function get_storage_key( $type = null, $page = 1, $html = false ) { $type = is_null( $type ) ? '1' : $type; $filename = self::STORAGE_KEY_PREFIX . md5( "{$type}_{$page}_" . home_url() ) . '.' . ( $html ? 'html' : 'xml' ); return $filename; } /** * Get cache directory. * * @return string */ public static function get_cache_directory() { $dir = wp_upload_dir(); $default = $dir['basedir'] . '/rank-math'; /** * Filter XML sitemap cache directory. * * @param string $unsigned Default cache directory */ $filtered = apply_filters( 'rank_math/sitemap/cache_directory', $default ); if ( ! is_string( $filtered ) || '' === $filtered ) { $filtered = $default; } return trailingslashit( $filtered ); } /** * Read/Write cached files. * * @param mixed $value Pass null to get option, * Pass false to delete option, * Pass value to update option. * @param string $type Sitemap type. * @return mixed */ public static function cached_files( $value = null, $type = '' ) { if ( '' !== $type ) { $options = Helper::option( 'sitemap_cache_files' ); $options[ $value ] = $type; return Helper::option( 'sitemap_cache_files', $options ); } return Helper::option( 'sitemap_cache_files', $value ); } /** * Invalidate sitemap cache. * * @param null|string $type The type to get the key for. Null for all caches. */ public static function invalidate_storage( $type = null ) { /** * Filter: 'rank_math/sitemap/invalidate_storage' - Allow developers to disable sitemap cache invalidation. */ if ( ! apply_filters( 'rank_math/sitemap/invalidate_storage', true, $type ) ) { return; } $wp_filesystem = Helper::get_filesystem(); if ( is_null( $wp_filesystem ) ) { return; } $directory = self::get_cache_directory(); if ( is_null( $type ) ) { $wp_filesystem->delete( $directory, true ); wp_mkdir_p( $directory ); self::clear_transients(); self::cached_files( false ); Helper::clear_cache( 'sitemap' ); return; } $data = []; $files = self::cached_files(); foreach ( $files as $file => $sitemap_type ) { if ( $type !== $sitemap_type ) { $data[ $file ] = $sitemap_type; continue; } $wp_filesystem->delete( $directory . $file ); } self::clear_transients( $type ); self::cached_files( $data ); Helper::clear_cache( 'sitemap/' . $type ); /** * Action: 'rank_math/sitemap/invalidated_storage' - Runs after sitemap cache invalidation. */ do_action( 'rank_math/sitemap/invalidated_storage', $type ); } /** * Reset ALL transient caches. * * @param null|string $type The type to get the key for. Null for all caches. */ private static function clear_transients( $type = null ) { if ( is_null( $type ) ) { return Database::table( 'options' ) ->whereLike( 'option_name', '_transient_sitemap_' ) ->delete(); } return Database::table( 'options' ) ->whereLike( 'option_name', '_transient_sitemap_' . $type ) ->delete(); } }
Fatal error: Uncaught Error: Class 'RankMath\Sitemap\Cache' not found in /home/candoodesigncom/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/html-sitemap/class-sitemap.php:49 Stack trace: #0 /home/candoodesigncom/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/class-sitemap.php(54): RankMath\Sitemap\Html\Sitemap->__construct() #1 /home/candoodesigncom/public_html/wp-content/plugins/seo-by-rank-math/includes/module/class-manager.php(487): RankMath\Sitemap\Sitemap->__construct() #2 /home/candoodesigncom/public_html/wp-content/plugins/seo-by-rank-math/includes/module/class-manager.php(467): RankMath\Module\Manager->load_module('sitemap', Object(RankMath\Module\Module)) #3 /home/candoodesigncom/public_html/wp-includes/class-wp-hook.php(324): RankMath\Module\Manager->load_modules('') #4 /home/candoodesigncom/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #5 /home/candoodesigncom/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(A in /home/candoodesigncom/public_html/wp-content/plugins/seo-by-rank-math/includes/modules/sitemap/html-sitemap/class-sitemap.php on line 49