/home/vianto5/cititower.mx/wp-content/plugins/sitepress-multilingual-cms/classes/ATE
NameSizeModeActions
API/-0755rm
auto-translate/-0755rm
Download/-0755rm
Hooks/-0755rm
JobSender/-0755rm
LanguageMapping/-0755rm
Loader/-0755rm
Log/-0755rm
models/-0755rm
proxies/-0755rm
REST/-0755rm
Retranslation/-0755rm
Retry/-0755rm
Review/-0755rm
sitekey/-0755rm
Sync/-0755rm
TranslateEverything/-0755rm
UpdateTranslation/-0755rm
ATEDashboardLoader.php26310644editdlrm
class-wpml-tm-ams-ate-factories.php8520644editdlrm
class-wpml-tm-ams-translator-activation-records.php10490644editdlrm
class-wpml-tm-ams-users.php5780644editdlrm
class-wpml-tm-ate-ams-endpoints.php144740644editdlrm
class-wpml-tm-ate-job.php2290644editdlrm
class-wpml-tm-ate-jobs.php43670644editdlrm
class-wpml-tm-ate-status.php9220644editdlrm
class-wpml-tm-ate.php27980644editdlrm
JobRecord.php7830644editdlrm
JobRecords.php44160644editdlrm
Jobs.php77910644editdlrm
Loader.php90090644editdlrm
NoCreditPopup.php17590644editdlrm
ReturnedJobs.php12990644editdlrm
StatusBar.php11460644editdlrm
StatusIcons.php17520644editdlrm
SyncLock.php5260644editdlrm
TranslateEverything.php41180644editdlrm
Edit: /home/vianto5/cititower.mx/wp-content/plugins/sitepress-multilingual-cms/classes/ATE/Loader.php (9009B)
backgroundTaskRepository = $backgroundTaskRepository; $this->translateEverything = $translateEverything; $this->markPreviouslyUnsupportedContentAsCompletedInTEA = $markDisplayedAsTranslatedPostTypesAsCompletedInTEA; } public function add_hooks() { if ( wpml_is_ajax() ) { // Prevent loading this for ajax calls. // All tasks of this class are not relevant for ajax requests. Currently it's loaded by the root plugin.php // which do not separate between ajax and non-ajax calls and loads this whenever is_admin() is true. // Problem: ALL ajax calls return true for is_admin() - also on the frontend and for non logged-in users. // TODO: Remove once wpmltm-4351 is done. return; } if ( UIPage::isTMJobs( $_GET ) ) { return; } $maybeLoadStatusBarAndATEConsole = Fns::tap( function () { StatusBar::add_hooks(); Hooks::onAction( 'in_admin_header' ) ->then( [ self::class, 'showAteConsoleContainer' ] ); } ); /** * The `MarkPreviouslyUnsupportedContentAsCompletedInTEA::run` migration must be run here, instead * of inside the regular Upgrade logic due to various reasons described in: wpmldev-3809. * * In short, the regular upgrade logic is run too early in WP lifecycle, and custom post types may not * be registered yet. Moreover, we need to aldo handle a case when a user temporarily disables ST, upgrades to WPML 4.7 * and AFTER that, he re-enables ST. In this case, we need to run ST migration logic later, when ST is enabled. */ Hooks::onAction( 'wp_loaded' ) ->then( [ $this->markPreviouslyUnsupportedContentAsCompletedInTEA, 'run' ] ) ->then( [ $this, 'getData' ] ) ->then( $maybeLoadStatusBarAndATEConsole ) ->then( Resources::enqueueApp( 'ate-jobs-sync' ) ) ->then( Fns::always( make( \WPML_TM_Scripts_Factory::class ) ) ) ->then( invoke( 'localize_script' )->with( 'wpml-ate-jobs-sync-ui' ) ); Hooks::onFilter( 'wpml_tm_get_wpml_auto_translate_container' ) ->then( [ self::class, 'getWpmlAutoTranslateContainer' ] ); } public function getData() { $ateTab = admin_url( UIPage::getTMATE() ); $isAteActive = \WPML_TM_ATE_Status::is_enabled_and_activated(); $defaultLanguage = Languages::getDefaultCode(); $getLanguages = pipe( Languages::class . '::getActive', CachedLanguageMappings::withCanBeTranslatedAutomatically(), CachedLanguageMappings::withMapping(), Fns::map( Obj::over( Obj::lensProp( 'mapping' ), Obj::prop( 'targetCode' ) ) ), Fns::map( Obj::addProp( 'is_default', Relation::propEq( 'code', $defaultLanguage ) ) ), Obj::values() ); /** @var Jobs $jobs */ $jobs = make( Jobs::class ); /** @var Scheduler */ $scheduler = make( Scheduler::class ); $data = [ 'name' => 'ate_jobs_sync', 'data' => [ 'endpoints' => self::getEndpoints(), 'urls' => self::getUrls( $ateTab ), 'jobIdPlaceHolder' => self::JOB_ID_PLACEHOLDER, 'languages' => $isAteActive ? $getLanguages() : [], 'isTranslationManager' => User::canManageTranslations(), 'isTranslatorOrHigher' => User::isTranslator() || User::canManageTranslations(), 'shouldTranslateEverything' => Option::shouldTranslateEverything() && ! $this->translateEverything->isEverythingProcessed( true ), 'isAutomaticTranslations' => Option::shouldTranslateEverything(), 'notEnoughCreditPopup' => self::getNotEnoughCreditPopup(), 'ateConsole' => self::getAteData(), 'isAteActive' => $isAteActive, 'editorMode' => Settings::pathOr( false, [ 'translation-management', 'doc_translation_method' ] ), 'shouldCheckForRetranslation' => $scheduler->shouldRun(), 'ateCallbacks' => [], // Should be used to add any needed ATE callbacks in JS side, refer to 'src/js/ate/retranslation/index.js' for example 'settings' => [ 'numberOfParallelDownloads' => defined('WPML_ATE_MAX_PARALLEL_DOWNLOADS') ? WPML_ATE_MAX_PARALLEL_DOWNLOADS : 2, ], ], ]; if ( UIPage::isTMDashboard( $_GET ) ) { $data['data']['anyJobsExist'] = $jobs->hasAny(); // any jobs, even including CTE jobs } return $data; } /** * @return string */ public static function getNotEnoughCreditPopup() { $isTranslationManager = User::canManageTranslations(); $primaryButton = $isTranslationManager ? '' : ''; return '
' . '

MESSAGE_TEXT

' . $primaryButton . '
'; } public static function showAteConsoleContainer() { echo '
'; } public static function getWpmlAutoTranslateContainer() { return ''; } private static function getAteData() { if ( User::canManageTranslations() ) { /** @var NoCreditPopup $noCreditPopup */ $noCreditPopup = make( NoCreditPopup::class ); return $noCreditPopup->getData(); } return false; } private static function getEndpoints() { return [ 'auto-translate' => AutoTranslate::class, 'translate-everything' => TranslateEverything::class, 'getCredits' => GetCredits::class, 'getAccountBalances' => GetAccountBalances::class, 'enableATE' => EnableATE::class, 'getATEJobsToSync' => GetATEJobsToSync::class, 'syncLock' => SyncLock::class, 'untranslatedCount' => UntranslatedCount::class, 'getJobsCount' => GetJobsCount::class, 'getJobsInfo' => GetJobsInfo::class, 'languages' => EndpointLanguages::class, 'assignToTranslation' => RetranslationEndpoint::class, 'invalidateLangMappingCache' => InvalidateCacheEndpoint::class, ]; } private static function getUrls( $ateTab ) { return [ 'editor' => \WPML_TM_Translation_Status_Display::get_link_for_existing_job( self::JOB_ID_PLACEHOLDER ), 'ateams' => $ateTab, 'automaticSettings' => \admin_url( UIPage::getSettings() ), 'translateAutomaticallyDoc' => DocPage::getTranslateAutomatically(), 'ateConsole' => make( NoCreditPopup::class )->getUrl(), 'translationQueue' => \add_query_arg( [ 'status' => ICL_TM_NEEDS_REVIEW ], \admin_url( UIPage::getTranslationQueue() ) ), 'currentUrl' => \WPML\TM\API\Jobs::getCurrentUrl(), 'editLanguages' => add_query_arg( [ 'trop' => 1 ], UIPage::getLanguages() ), ]; } }