model = &$polylang->model; add_filter( 'load_textdomain_mofile', array( $this, 'load_file' ) ); add_filter( 'load_script_translation_file', array( $this, 'load_file' ) ); add_filter( 'lang_dir_for_domain', array( $this, 'get_lang_dir_for_domain' ), 10, 3 ); add_action( 'pll_language_add_form_fields', array( $this, 'add_language_form_fields' ) ); add_action( 'pll_language_edit_form_fields', array( $this, 'edit_language_form_fields' ) ); add_filter( 'pll_language_metas', array( $this, 'add_locale_fallback_to_language_metas' ), 10, 2 ); // Updates plugins and themes translations files. add_filter( 'themes_update_check_locales', array( $this, 'update_check_locales' ) ); add_filter( 'plugins_update_check_locales', array( $this, 'update_check_locales' ) ); } /** * Adds the locale fallbacks to the language data. * * @since 3.4 * * @param mixed[] $add_data Data to add. * @param mixed[] $args { * Arguments used to create the language. * * @type string $name Language name (used only for display). * @type string $slug Language code (ideally 2-letters ISO 639-1 language code). * @type string $locale WordPress locale. If something wrong is used for the locale, the .mo files will * not be loaded... * @type int $rtl 1 if rtl language, 0 otherwise. * @type int $term_group Language order when displayed. * @type int $lang_id Optional, ID of the language to modify. An empty value means the language is * being created. * @type string $flag Optional, country code, {@see settings/flags.php}. * } * @return mixed[] */ public function add_locale_fallback_to_language_metas( $add_data, $args ) { if ( empty( $args['fallback'] ) || ! is_string( $args['fallback'] ) ) { // Empty new fallbacks. $new_fallbacks = array(); } else { $new_fallbacks = array_unique( array_map( 'trim', explode( ',', $args['fallback'] ) ) ); } $add_data['fallbacks'] = array(); foreach ( $new_fallbacks as $fallback ) { // Keep only valid locales. // @TODO Display an error message. if ( ! preg_match( '#^[a-z]{2,3}(?:_[A-Z]{2})?(?:_[a-z0-9]+)?$#', $fallback ) ) { continue; } /** @var non-empty-string $fallback */ $add_data['fallbacks'][] = $fallback; if ( current_user_can( 'install_languages' ) ) { require_once ABSPATH . 'wp-admin/includes/translation-install.php'; wp_download_language_pack( $fallback ); } } return $add_data; } /** * Attempts to load the translation in the fallback locale if it doesn't exist in the current locale. * * This method is used for translations loaded with `load_textdomain()` and `load_script_textdomain()`. * * @since 2.9 * * @param string|false $file Translation file name. * @return string|false */ public function load_file( $file ) { if ( empty( $file ) || ! is_string( $file ) ) { return $file; } $locale = is_admin() ? get_user_locale() : get_locale(); if ( empty( $locale ) ) { return $file; } $language = $this->model->get_language( $locale ); if ( empty( $language ) || empty( $language->fallbacks ) ) { return $file; } if ( is_readable( $file ) ) { return $file; } $parts = pathinfo( $file ); if ( empty( $parts['extension'] ) || ( 'mo' !== $parts['extension'] && 'json' !== $parts['extension'] ) ) { return $file; } if ( 'mo' === $parts['extension'] && is_readable( substr_replace( $file, '.l10n.php', - strlen( ".{$parts['extension']}" ) ) ) ) { return $file; } $locale = preg_quote( $locale, '@' ); foreach ( $language->fallbacks as $fallback ) { if ( empty( $fallback ) || ! is_string( $fallback ) ) { continue; } if ( 'mo' === $parts['extension'] ) { // Matches "fr_FR.mo" and "foobar-fr_FR.mo". $pattern = "@^(.+-)?{$locale}(\.mo)$@"; } else { // Matches "fr_FR-md5hash.json" and "foobar-fr_FR-md5hash.json". $pattern = "@^(.+-)?{$locale}(-[0-9a-f]{32}\.json)$@"; } $_file = $parts['dirname'] . '/' . preg_replace( $pa
Fatal error: Uncaught Error: Class "PLL_Locale_Fallback" not found in /home/sabokl/public_html/wp-content/plugins/polylang-pro/modules/locale-fallback/load.php:10 Stack trace: #0 /home/sabokl/public_html/wp-content/plugins/polylang-pro/include/pro.php(56): require_once() #1 /home/sabokl/public_html/wp-includes/class-wp-hook.php(324): PLL_Pro->init() #2 /home/sabokl/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #3 /home/sabokl/public_html/wp-includes/plugin.php(565): WP_Hook->do_action() #4 /home/sabokl/public_html/wp-content/plugins/polylang-pro/vendor/wpsyntex/polylang/include/class-polylang.php(272): do_action_ref_array() #5 /home/sabokl/public_html/wp-content/plugins/polylang-pro/vendor/wpsyntex/polylang/include/class-polylang.php(228): Polylang->init_context() #6 /home/sabokl/public_html/wp-includes/class-wp-hook.php(324): Polylang->init() #7 /home/sabokl/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters() #8 /home/sabokl/public_html/wp-includes/plugin.php(517): WP_Hook->do_action() #9 /home/sabokl/public_html/wp-settings.php(555): do_action() #10 /home/sabokl/public_html/wp-config.php(107): require_once('/home/sabokl/pu...') #11 /home/sabokl/public_html/wp-load.php(50): require_once('/home/sabokl/pu...') #12 /home/sabokl/public_html/wp-blog-header.php(13): require_once('/home/sabokl/pu...') #13 /home/sabokl/public_html/index.php(17): require('/home/sabokl/pu...') #14 {main} thrown in /home/sabokl/public_html/wp-content/plugins/polylang-pro/modules/locale-fallback/load.php on line 10

Fatal error: Uncaught wfWAFStorageFileException: Unable to save temporary file for atomic writing. in /home/sabokl/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php:34 Stack trace: #0 /home/sabokl/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php(658): wfWAFStorageFile::atomicFilePutContents() #1 [internal function]: wfWAFStorageFile->saveConfig() #2 {main} thrown in /home/sabokl/public_html/wp-content/plugins/wordfence/vendor/wordfence/wf-waf/src/lib/storage/file.php on line 34