t_update_themes', $clearThemeTranslations ); } /** * Clears existing translation cache for a given type. * * @since 4.0.0 * * @param string $type Project type. Either plugin or theme. * @return void */ public function cleanTranslationsCache( $type ) { $transientKey = 'translations_' . $this->slug . '_' . $type; $translations = aioseo()->core->networkCache->get( $transientKey ); if ( ! is_array( $translations ) ) { return; } // Don't delete the cache if the transient gets changed multiple times // during a single request. Set cache lifetime to maximum 15 seconds. $cacheLifespan = 15; $timeNotChanged = isset( $translations['_last_checked'] ) && ( time() - $translations['_last_checked'] ) > $cacheLifespan; if ( ! $timeNotChanged ) { return; } aioseo()->core->networkCache->delete( $transientKey ); } /** * Gets the translations for a given project. * * @since 4.0.0 * * @param string $type Project type. Either plugin or theme. * @param string $slug Project directory slug. * @param string $url Full GlotPress API URL for the project. * @return array Translation data. */ public function getTranslations( $type, $slug, $url ) { $transientKey = 'translations_' . $slug . '_' . $type; $translations = aioseo()->core->networkCache->get( $transientKey ); if ( null !== $translations && is_array( $translations ) ) { return $translations; } if ( ! is_array( $translations ) ) { $translations = []; } if ( isset( $translations[ $slug ] ) && is_array( $translations[ $slug ] ) ) { return $translations[ $slug ]; } $result = json_decode( wp_remote_retrieve_body( wp_remote_get( $url, [ 'timeout' => 2 ] ) ), true ); if ( ! is_array( $result ) ) { $result = []; } $translations[ $slug ] = $result; $translations['_last_checked'] = time(); aioseo()->core->networkCache->update( $transientKey, $translations, 0 ); return $result; } }
Fatal error: Uncaught Error: Class "AIOSEO\Plugin\Pro\Main\Translations" not found in /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php:265 Stack trace: #0 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(97): AIOSEO\Plugin\AIOSEO->load() #1 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(76): AIOSEO\Plugin\AIOSEO->init() #2 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php(414): AIOSEO\Plugin\AIOSEO::instance() #3 /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/all_in_one_seo_pack.php(96): aioseo() #4 /home/valigeria/public_html/wp-settings.php(517): include_once('/home/valigeria...') #5 /home/valigeria/public_html/wp-config.php(111): require_once('/home/valigeria...') #6 /home/valigeria/public_html/wp-load.php(50): require_once('/home/valigeria...') #7 /home/valigeria/public_html/wp-blog-header.php(13): require_once('/home/valigeria...') #8 /home/valigeria/public_html/index.php(17): require('/home/valigeria...') #9 {main} thrown in /home/valigeria/public_html/wp-content/plugins/all-in-one-seo-pack-pro/app/AIOSEO.php on line 265