PATH:
var
/
www
/
clients
/
client1
/
web1
/
web
/
wp-content
/
sitepress-multilingual-cms
/
classes
/
upgrade
/
commands
<?php /** * Some sites were not properly upgraded in 4.2.0. * In that case the old option was not deleted * and new site IDs were wrongly created. */ class WPML_Upgrade_WPML_Site_ID_Remaining implements IWPML_Upgrade_Command { /** * @var string * * @see WPML_TM_ATE::SITE_ID_SCOPE */ const SCOPE_ATE = 'ate'; /** * @return bool */ public function run() { if ( $this->old_and_new_options_exist() ) { $value_from_old_option = get_option( WPML_Site_ID::SITE_ID_KEY, null ); $value_from_new_option = get_option( WPML_Site_ID::SITE_ID_KEY . ':' . WPML_Site_ID::SITE_SCOPES_GLOBAL, null ); // 1. We update the global option with the old value. update_option( WPML_Site_ID::SITE_ID_KEY . ':' . WPML_Site_ID::SITE_SCOPES_GLOBAL, $value_from_old_option, false ); // 2. If the ate option has the same value as the new global, we also update it. if ( $this->option_exists( WPML_Site_ID::SITE_ID_KEY . ':' . self::SCOPE_ATE ) ) { $ate_uuid = get_option( WPML_Site_ID::SITE_ID_KEY . ':' . self::SCOPE_ATE, null ); if ( $ate_uuid === $value_from_new_option ) { update_option( WPML_Site_ID::SITE_ID_KEY . ':' . self::SCOPE_ATE, $value_from_old_option, false ); } } return delete_option( WPML_Site_ID::SITE_ID_KEY ); } return true; } /** * @return bool */ protected function old_and_new_options_exist() { return $this->option_exists( WPML_Site_ID::SITE_ID_KEY ) && $this->option_exists( WPML_Site_ID::SITE_ID_KEY . ':' . WPML_Site_ID::SITE_SCOPES_GLOBAL ); } /** * @param string $key * * @return bool */ private function option_exists( $key ) { get_option( $key, null ); $notoptions = wp_cache_get( 'notoptions', 'options' ); return false === $notoptions || ! array_key_exists( $key, $notoptions ); } /** * Runs in admin pages. * * @return bool */ public function run_admin() { return $this->run(); } /** * Unused. * * @return null */ public function run_ajax() { return null; } /** * Unused. * * @return null */ public function run_frontend() { return null; } /** * Unused. * * @return null */ public function get_results() { return null; } }
[-] AddAteSyncCountToTranslationJob.php
[edit]
[-] AddCountryColumnToLanguages.php
[edit]
[-] class-wpml-upgrade-add-location-column-to-strings.php
[edit]
[-] class-wpml-upgrade-fix-non-admin-cap.php
[edit]
[-] class-wpml-tm-add-tp-revision-and-ts-status-columns-to-core-status.php
[edit]
[-] class-wpml-upgrade-media-duplication-in-core.php
[edit]
[-] class-wpml-upgrade-add-editor-column-to-icl-translate-job.php
[edit]
[-] class-wpml-tm-add-tp-revision-and-ts-status-columns-to-translation-status.php
[edit]
[-] class-wpml-add-uuid-column-to-translation-status.php
[edit]
[-] class-wpml-tm-upgrade-wpml-site-id-ate.php
[edit]
[-] class-wpml-upgrade-media-without-language.php
[edit]
[-] ResetTranslatorOfAutomaticJobs.php
[edit]
[+]
SynchronizeSourceIdOfATEJobs
[-] class-wpml-upgrade-add-wrap-column-to-strings.php
[edit]
[-] class-wpml-tm-add-tpid-column-to-translation-status.php
[edit]
[-] AddTranslationManagerCapToAdmin.php
[edit]
[-] AddContextIndexToStrings.php
[edit]
[-] class-wpml-upgrade-wpml-site-id-remaining.php
[edit]
[-] DropCodeLocaleIndexFromLocaleMap.php
[edit]
[-] class-wpml-upgrade-table-translate-job-for-3-9-0.php
[edit]
[-] AddAteCommunicationRetryColumnToTranslationStatus.php
[edit]
[-] AddStatusIndexToStringTranslations.php
[edit]
[-] class-disable-options-autoloading.php
[edit]
[+]
abstracts
[-] AddTMAllowedOption.php
[edit]
[-] AddReviewStatusColumnToTranslationStatus.php
[edit]
[-] class-wpml-upgrade-element-type-length-and-collation.php
[edit]
[-] AddStringPackageIdtIndexToStrings.php
[edit]
[-] class-wpml-tm-upgrade-service-redirect-to-field.php
[edit]
[-] wpml-upgrade-admin-users-languages.php
[edit]
[-] CreateAteDownloadQueueTable.php
[edit]
[-] RemoveRestDisabledNotice.php
[edit]
[-] AddAutomaticColumnToIclTranslateJob.php
[edit]
[-] class-wpml-tm-upgrade-translation-priorities-for-posts.php
[edit]
[-] class-wpml-tm-upgrade-default-editor-for-old-jobs.php
[edit]
[-] MigrateAteRepository.php
[edit]
[-] class-wpml-upgrade-add-word-count-column-to-strings.php
[edit]
[-] class-wpml-upgrade-remove-translation-services-transient.php
[edit]
[-] class-wpml-upgrade-display-mode-for-posts.php
[edit]
[-] wpml-tm-upgrade-cancel-orphan-jobs.php
[edit]
[+]
..
[-] AddPrimaryKeyToLocaleMap.php
[edit]
[-] ATEProxyUpdateRewriteRules.php
[edit]
[-] class-wpml-upgrade-wpml-site-id.php
[edit]
[-] class-wpml-upgrade-add-wrap-column-to-translate.php
[edit]
[-] wpml-upgrade-chinese-flags.php
[edit]
[-] RefreshTranslationServices.php
[edit]