Plugin Directory

Changeset 3441087


Ignore:
Timestamp:
01/16/2026 03:02:11 PM (3 months ago)
Author:
smartling
Message:

Update to v 5.2.0

Location:
smartling-connector/trunk
Files:
2 added
53 edited

Legend:

Unmodified
Added
Removed
  • smartling-connector/trunk/inc/Smartling/Base/SmartlingCore.php

    r3415470 r3441087  
    253253    }
    254254
    255     /**
    256      * @param ConfigurationProfileEntity $profile
    257      *
    258      * @return array
    259      */
    260     public function getProjectLocales(ConfigurationProfileEntity $profile)
    261     {
    262         $cacheKey = 'profile.locales.' . $profile->getId();
    263         $cached = $this->getCache()->get($cacheKey);
    264 
    265         if (false === $cached) {
    266             $cached = $this->getApiWrapper()->getSupportedLocales($profile);
    267             $this->getCache()->set($cacheKey, $cached);
    268         }
    269 
    270         return $cached;
    271     }
    272 
    273255    public function handleBadBlogId(SubmissionEntity $submission)
    274256    {
  • smartling-connector/trunk/inc/Smartling/Bootstrap.php

    r3415470 r3441087  
    1616use Smartling\Exception\SmartlingBootException;
    1717use Smartling\Exception\SmartlingConfigException;
    18 use Smartling\Extensions\Acf\AcfDynamicSupport;
    1918use Smartling\Helpers\DiagnosticsHelper;
    2019use Smartling\Helpers\MetaFieldProcessor\CustomFieldFilterHandler;
     
    430429        (new Taxonomies($di->getParameter('ignoredTypes')['taxonomies'] ?? []))->registerHookHandler();
    431430        (new PostTypes($di->getParameter('ignoredTypes')['posts'] ?? []))->registerHookHandler();
     431
     432        add_action('admin_enqueue_scripts', static function () {
     433            wp_enqueue_script('wp-element');
     434            wp_enqueue_script('wp-components');
     435            wp_enqueue_script('wp-date');
     436            wp_enqueue_script(
     437                'smartling-react-app',
     438                plugin_dir_url(__FILE__) . '../../js/app.js',
     439                ['wp-element', 'wp-components', 'wp-date'],
     440                static::$pluginVersion,
     441                true,
     442            );
     443            wp_enqueue_style('wp-components');
     444        });
    432445
    433446        $action = defined('DOING_CRON') && true === DOING_CRON ? 'wp_loaded' : 'admin_init';
  • smartling-connector/trunk/inc/Smartling/ContentTypes/CustomPostType.php

    r2932593 r3441087  
    8989        $di
    9090            ->register($tag, ContentEditJobController::class)
     91            ->addArgument($di->getDefinition('api.wrapper.with.retries'))
    9192            ->addArgument($di->getDefinition('multilang.proxy'))
    9293            ->addArgument($di->getDefinition('plugin.info'))
  • smartling-connector/trunk/inc/Smartling/ContentTypes/CustomTaxonomyType.php

    r2932593 r3441087  
    6868            $di
    6969                ->register($tag, TaxonomyWidgetController::class)
     70                ->addArgument($di->getDefinition('api.wrapper.with.retries'))
    7071                ->addArgument($di->getDefinition('multilang.proxy'))
    7172                ->addArgument($di->getDefinition('plugin.info'))
     
    8889        $di
    8990            ->register($tag, ContentEditJobController::class)
     91            ->addArgument($di->getDefinition('api.wrapper.with.retries'))
    9092            ->addArgument($di->getDefinition('multilang.proxy'))
    9193            ->addArgument($di->getDefinition('plugin.info'))
  • smartling-connector/trunk/inc/Smartling/ContentTypes/Elementor/ElementAbstract.php

    r3418195 r3441087  
    132132        $arrayHelper = new ArrayHelper();
    133133        $result = clone $this;
    134         $contentType = $content->getType() === ContentTypeHelper::CONTENT_TYPE_POST ?
    135             $externalContentElementor->getWpProxy()->get_post_type($content->getId()) :
    136             $content->getType();
     134
     135        $wpProxy = $externalContentElementor->getWpProxy();
     136        if ($content->getType() === ContentTypeHelper::CONTENT_TYPE_POST) {
     137            $contentType = $wpProxy->get_post_type($content->getId());
     138        } elseif ($content->getType() === ContentTypeHelper::CONTENT_TYPE_TAXONOMY) {
     139            $term = $wpProxy->getTerm($content->getId());
     140            $contentType = (is_array($term) && isset($term['taxonomy'])) ? $term['taxonomy'] : $content->getType();
     141        } else {
     142            $contentType = $content->getType();
     143        }
     144
    137145        if ($contentType === false) {
    138             $this->getLogger()->debug("Unable to get post type for contentId={$content->getId()}, proceeding with unknown type");
     146            $this->getLogger()->debug("Unable to get content type for contentId={$content->getId()}, proceeding with unknown type");
    139147            $contentType = ContentTypeHelper::CONTENT_TYPE_UNKNOWN;
    140148        }
  • smartling-connector/trunk/inc/Smartling/ContentTypes/Elementor/Elements/LoopCarousel.php

    r3380258 r3441087  
    44
    55use Smartling\ContentTypes\ContentTypeHelper;
    6 use Smartling\ContentTypes\ExternalContentElementor;
    76use Smartling\Models\Content;
    87use Smartling\Models\RelatedContentInfo;
    9 use Smartling\Submissions\SubmissionEntity;
    108
    119class LoopCarousel extends Unknown {
     
    2422        }
    2523
     24        foreach ($this->settings['post_query_include_term_ids'] ?? [] as $index => $termId) {
     25            if (is_numeric($termId)) {
     26                $return->addContent(new Content((int)$termId, ContentTypeHelper::CONTENT_TYPE_TAXONOMY), $this->id, "settings/post_query_include_term_ids/$index");
     27            }
     28        }
     29
    2630        return $return;
    2731    }
  • smartling-connector/trunk/inc/Smartling/ContentTypes/Elementor/Elements/Unknown.php

    r3418195 r3441087  
    1818    {
    1919        $return = new RelatedContentInfo();
    20         $keys = ['background_image/id'];
     20        $keys = [
     21            'background_image/id',
     22            'background_overlay_image/id',
     23            'background_overlay_image_mobile/id',
     24        ];
    2125        foreach ($this->elements as $element) {
    2226            if ($element instanceof Element) {
  • smartling-connector/trunk/inc/Smartling/DbAl/WordpressContentEntities/EntityAbstract.php

    r3338937 r3441087  
    125125                throw new \BadMethodCallException(sprintf("Method $method does not exists in class '%s'", get_class($this)));
    126126        }
     127    }
     128
     129    public function getEditLink(): ?string
     130    {
     131        return null;
    127132    }
    128133
  • smartling-connector/trunk/inc/Smartling/DbAl/WordpressContentEntities/PostEntityStd.php

    r3338937 r3441087  
    3939class PostEntityStd extends EntityAbstract implements EntityWithPostStatus, EntityWithMetadata
    4040{
    41     private WordpressFunctionProxyHelper $wordpressFunctionProxyHelper;
    4241    /**
    4342     * Standard 'post' content-type fields
     
    6968    ];
    7069
    71     public function __construct($type = 'post', array $related = [], ?WordpressFunctionProxyHelper $wordpressFunctionProxyHelper = null)
    72     {
     70    public function __construct(
     71        string $type = 'post',
     72        array $related = [],
     73        private ?WordpressFunctionProxyHelper $wordpressFunctionProxyHelper = null,
     74    ) {
    7375        parent::__construct();
    7476        $this->setType($type);
     
    98100    {
    99101        return 'post_type';
     102    }
     103
     104    public function getEditLink(): ?string
     105    {
     106        return $this->wordpressFunctionProxyHelper->get_edit_post_link($this->ID);
    100107    }
    101108
  • smartling-connector/trunk/inc/Smartling/DbAl/WordpressContentEntities/TaxonomyEntityStd.php

    r3338937 r3441087  
    3737
    3838    private WordpressFunctionProxyHelper $wordpressProxy;
     39
     40    public function getEditLink(): ?string
     41    {
     42        return $this->wordpressProxy->get_edit_term_link($this->getPK());
     43    }
    3944
    4045    public function getMetadata(): array
  • smartling-connector/trunk/inc/Smartling/Helpers/ContentHelper.php

    r3387552 r3441087  
    1212use Smartling\DbAl\WordpressContentEntities\VirtualEntityAbstract;
    1313use Smartling\Exception\EntityNotFoundException;
     14use Smartling\Exception\SmartlingInvalidFactoryArgumentException;
    1415use Smartling\Processors\ContentEntitiesIOFactory;
    1516use Smartling\Submissions\SubmissionEntity;
     
    8081    }
    8182
     83    /**
     84     * @throws SmartlingInvalidFactoryArgumentException
     85     */
    8286    public function getWrapper(string $contentType): EntityHandler
    8387    {
    84         $return = clone $this->getIoFactory()->getHandler($contentType);
    85         if (!$return instanceof EntityHandler) {
    86             throw new \RuntimeException("Handler for $contentType expected to be " . EntityHandler::class . ", factory returned " . get_class($return));
     88        try {
     89            $return = clone $this->getIoFactory()->getHandler($contentType);
     90            if (!$return instanceof EntityHandler) {
     91                throw new \RuntimeException("Handler for $contentType expected to be " . EntityHandler::class . ", factory returned " . get_class($return));
     92            }
     93        } catch (SmartlingInvalidFactoryArgumentException $e) {
     94            try {
     95                return $this->getHandler($contentType);
     96            } catch (\RuntimeException) {
     97                throw $e;
     98            }
    8799        }
    88100
    89101        return $return;
     102    }
     103
     104    public function getHandler(string $type): PostEntityStd|TaxonomyEntityStd
     105    {
     106        if ($this->wordpressFunctionProxyHelper->post_type_exists($type)) {
     107            return new PostEntityStd($type, wordpressFunctionProxyHelper: $this->wordpressFunctionProxyHelper);
     108        }
     109        if ($this->wordpressFunctionProxyHelper->taxonomy_exists($type)) {
     110            return new TaxonomyEntityStd($type, wordpressProxy: $this->wordpressFunctionProxyHelper);
     111        }
     112        throw new \RuntimeException("Unknown content type: $type");
    90113    }
    91114
  • smartling-connector/trunk/inc/Smartling/Helpers/FileUriHelper.php

    r3096059 r3441087  
    2222
    2323    public function __construct(
    24         private ContentEntitiesIOFactory $ioFactory,
     24        private ContentHelper $contentHelper,
    2525        private SiteHelper $siteHelper,
    2626    ) {
    2727    }
    2828
    29     /**
    30      * @throws SmartlingInvalidFactoryArgumentException
    31      * @throws SmartlingConfigException
    32      */
    3329    private function buildFileUri(Submission $submission): string {
    34         try {
    35             $wrapper = $this->ioFactory->getMapper($submission->getContentType());
    36         } catch (SmartlingInvalidFactoryArgumentException $e) {
    37             $this->getLogger()->notice(sprintf(
    38                 'ContentType=%s is not registered, expected one of %s',
    39                 $submission->getContentType(),
    40                 implode(',' , array_keys($this->ioFactory->getCollection()))
    41             ));
    42             throw $e;
    43         }
     30        $wrapper = $this->contentHelper->getHandler($submission->getContentType());
    4431        if ($wrapper instanceof TaxonomyEntityStd) {
    4532            $permalink = $this->preparePermalink(get_term_link($submission->getSourceId()), $submission->getSourceTitle());
     
    6047
    6148    /**
    62      * @throws SmartlingInvalidFactoryArgumentException
    6349     * @throws BlogNotFoundException
    64      * @throws SmartlingConfigException
    6550     * @throws SmartlingDirectRunRuntimeException
    6651     */
  • smartling-connector/trunk/inc/Smartling/Helpers/WordpressFunctionProxyHelper.php

    r3418195 r3441087  
    5252    }
    5353
     54    public function post_type_exists()
     55    {
     56        return post_type_exists(...func_get_args());
     57    }
     58
     59    public function taxonomy_exists()
     60    {
     61        return taxonomy_exists(...func_get_args());
     62    }
     63
    5464    public function get_post_types()
    5565    {
     
    160170    {
    161171        return get_term(...func_get_args());
     172    }
     173
     174    public function getTerm(int $termId): array|null|\WP_Error
     175    {
     176        return get_term($termId, '', ARRAY_A);
    162177    }
    163178
  • smartling-connector/trunk/inc/Smartling/Models/RelatedContentInfo.php

    r3377267 r3441087  
    4141    }
    4242
    43     /**
    44      * @return Content[]
    45      */
    4643    public function getRelatedContentList(): array
    4744    {
  • smartling-connector/trunk/inc/Smartling/Services/ContentRelationsDiscoveryService.php

    r3408250 r3441087  
    1616use Smartling\Exception\SmartlingGutenbergParserNotFoundException;
    1717use Smartling\Exception\SmartlingHumanReadableException;
    18 use Smartling\Exception\SmartlingInvalidFactoryArgumentException;
    1918use Smartling\Extensions\Acf\AcfDynamicSupport;
    2019use Smartling\Helpers\AbsoluteLinkedAttachmentCoreHelper;
     
    298297                }
    299298
    300                 try {
    301                     $submission->setFileUri($this->fileUriHelper->generateFileUri($submission));
    302                     $submission = $this->storeWithJobInfo($submission, $jobInfo, $request->getDescription());
    303                     $fileUris[] = $submission->getFileUri();
    304                     $queueIds[] = $submission->getId();
    305                 } catch (SmartlingInvalidFactoryArgumentException) {
    306                     $this->getLogger()->info("Skipping submission because no mapper was found: contentType={$submission->getContentType()} sourceBlogId={$submission->getSourceBlogId()}, sourceId={$submission->getSourceId()}, targetBlogId={$submission->getTargetBlogId()}");
    307                 }
     299                $submission->setFileUri($this->fileUriHelper->generateFileUri($submission));
     300                $submission = $this->storeWithJobInfo($submission, $jobInfo, $request->getDescription());
     301                $fileUris[] = $submission->getFileUri();
     302                $queueIds[] = $submission->getId();
    308303            }
    309304        }
     
    608603        }
    609604
    610         if (isset($references[self::TERM_BASED_PROCESSOR])) {
    611             $termTypeIds = $references[self::TERM_BASED_PROCESSOR];
    612             foreach ($termTypeIds as $termTypeId) {
    613                 $term = get_term($termTypeId, '', \ARRAY_A);
    614                 if (is_array($term)) {
    615                     $result[$term['taxonomy']][] = $termTypeId;
    616                 }
     605        foreach (array_merge($references[self::TERM_BASED_PROCESSOR] ?? [], $references[ContentTypeHelper::CONTENT_TYPE_TAXONOMY] ?? []) as $termTypeId) {
     606            $term = $this->wordpressProxy->getTerm((int)$termTypeId);
     607            if (is_array($term)) {
     608                $result[$term['taxonomy']][] = $termTypeId;
    617609            }
    618610        }
     
    652644    {
    653645        try {
    654             return $this->contentHelper->readSourceContent($submission)->getTitle();
     646            return $this->contentHelper->getHandler($submission->getContentType())->get($submission->getSourceId())
     647                ->getTitle();
    655648        } catch (\Exception $e) {
    656649            $this->getLogger()->notice(sprintf('Unable to get content title for submissionId=%d, sourceBlogId=%d, sourceId=%d, type="%s"', $submission->getId(), $submission->getSourceBlogId(), $submission->getSourceId(), $submission->getContentType()));
     
    778771                $thumbnailUrl = '';
    779772                try {
    780                     switch ($type) {
    781                         /** @noinspection PhpMissingBreakStatementInspection */
    782                         case 'attachment':
    783                             $thumbnailUrl = $this->wordpressProxy->wp_get_attachment_image_url($id) ?: '';
    784                             // fallthrough intentional
    785                         case 'page':
    786                         case 'post':
    787                             $post = $this->wordpressProxy->get_post($id);
    788                             if ($post === null) {
    789                                 continue 2;
    790                             }
    791                             $title = $this->wordpressProxy->get_post($id)->post_title;
    792                             $url = $this->wordpressProxy->get_edit_post_link($id);
    793                             break;
    794                         default:
    795                             $term = $this->wordpressProxy->get_term($id);
    796                             if ($term instanceof \WP_Term) {
    797                                 $title = $term->name;
    798                                 $url = $this->wordpressProxy->get_edit_term_link($id, $type);
    799                             } else {
    800                                 continue 2;
    801                             }
     773                    if ($type === 'attachment') {
     774                        $thumbnailUrl = $this->wordpressProxy->wp_get_attachment_image_url($id) ?: '';
     775                    }
     776
     777                    $handler = $this->contentHelper->getHandler($type);
     778                    try {
     779                        $entity = $handler->get($id);
     780                        $title = $entity->getTitle();
     781                        $url = $entity->getEditLink();
     782                    }
     783                    catch (EntityNotFoundException) {
     784                        continue;
    802785                    }
    803786                } catch (\Exception) {
  • smartling-connector/trunk/inc/Smartling/WP/Controller/AdminPage.php

    r2862047 r3441087  
    135135        }
    136136
    137         $this->setViewData(
    138             [
    139                 'shortcodes' => new ShortcodeTableClass(new ShortcodeManager()),
    140                 'filters' => new LocalizationRulesTableWidget(new FilterManager()),
    141                 'media' => new MediaAttachmentTableWidget($this->mediaAttachmentRulesManager, $this->replacerFactory),
    142             ]
    143         );
     137        $this->viewData = [
     138            'shortcodes' => new ShortcodeTableClass(new ShortcodeManager()),
     139            'filters' => new LocalizationRulesTableWidget(new FilterManager()),
     140            'media' => new MediaAttachmentTableWidget($this->mediaAttachmentRulesManager, $this->replacerFactory),
     141        ];
    144142        $this->renderScript();
    145143    }
  • smartling-connector/trunk/inc/Smartling/WP/Controller/BulkSubmitController.php

    r3338937 r3441087  
    2424    public function __construct(
    2525        private AcfDynamicSupport $acfDynamicSupport,
    26         private ApiWrapperInterface $apiWrapper,
     26        protected ApiWrapperInterface $api,
    2727        LocalizationPluginProxyInterface $connector,
    2828        PluginInfo $pluginInfo,
     
    3434        Cache $cache,
    3535    ) {
    36         parent::__construct($connector, $pluginInfo, $settingsManager, $siteHelper, $manager, $cache);
     36        parent::__construct($api, $connector, $pluginInfo, $settingsManager, $siteHelper, $manager, $cache);
    3737    }
    3838
     
    4747    public function wp_enqueue()
    4848    {
    49         $resPath = $this->getPluginInfo()->getUrl();
     49        $resPath = $this->pluginInfo->getUrl();
    5050        $jsPath = $resPath . 'js/';
    51         $ver = $this->getPluginInfo()->getVersion();
     51        $ver = $this->pluginInfo->getVersion();
    5252        wp_enqueue_script('jquery');
    5353        $jsFiles = [
     
    8484            $table = new BulkSubmitTableWidget(
    8585                $this->acfDynamicSupport,
    86                 $this->apiWrapper,
     86                $this->api,
    8787                $this->localizationPluginProxy,
    8888                $this->siteHelper,
    8989                $this->core,
    90                 $this->getManager(),
     90                $this->submissionManager,
    9191                $this->uploadQueueManager,
    9292                $profile
  • smartling-connector/trunk/inc/Smartling/WP/Controller/CheckStatusController.php

    r2521316 r3441087  
    1111use Smartling\WP\WPHookInterface;
    1212
    13 /**
    14  * Class CheckStatusController
    15  *
    16  * @package Smartling\WP\Controller
    17  */
    1813class CheckStatusController extends WPAbstract implements WPHookInterface
    1914{
     
    2419    public function wp_enqueue()
    2520    {
    26         wp_enqueue_script($this->getPluginInfo()->getName() . "submission", $this->getPluginInfo()
    27                 ->getUrl() . 'js/smartling-submissions-check.js', ['jquery'], $this->getPluginInfo()
     21        wp_enqueue_script($this->pluginInfo->getName() . "submission", $this->pluginInfo
     22                ->getUrl() . 'js/smartling-submissions-check.js', ['jquery'], $this->pluginInfo
    2823            ->getVersion(), false);
    2924    }
     
    7570    {
    7671        $result = [];
    77         $cache = $this->getCache();
    7872
    79         $cachedItems = $cache->get(self::SUBMISSION_CHECKED_KEY);
     73        $cachedItems = $this->cache->get(self::SUBMISSION_CHECKED_KEY);
    8074
    8175        $now = new \DateTime("now");
     
    10498        }
    10599
    106         $cache->set(self::SUBMISSION_CHECKED_KEY, $cachedItems, self::CACHE_EXPIRATION);
     100        $this->cache->set(self::SUBMISSION_CHECKED_KEY, $cachedItems, self::CACHE_EXPIRATION);
    107101
    108102        return $result;
  • smartling-connector/trunk/inc/Smartling/WP/Controller/ConfigurationProfileFormController.php

    r3338937 r3441087  
    66use Smartling\Exception\BlogNotFoundException;
    77use Smartling\Helpers\ArrayHelper;
     8use Smartling\Helpers\HtmlTagGeneratorHelper;
    89use Smartling\Helpers\SmartlingUserCapabilities;
    910use Smartling\Helpers\StringHelper;
     
    2021    public function wp_enqueue(): void
    2122    {
    22         $resPath = $this->getPluginInfo()->getUrl();
     23        $resPath = $this->pluginInfo->getUrl();
    2324        $jsPath = $resPath . 'js/';
    24         $ver = $this->getPluginInfo()->getVersion();
     25        $ver = $this->pluginInfo->getVersion();
    2526        wp_enqueue_script('jquery');
    2627        $jsFiles = [
     
    250251    }
    251252
     253    protected function renderLocales(
     254        array $locales,
     255        string $displayName,
     256        int $blogId,
     257        string $smartlingName,
     258        bool $enabled,
     259    ): string {
     260        $parts = [];
     261
     262        $checkboxProperties = [
     263            'type' => 'checkbox',
     264            'class' => 'mcheck',
     265            'name' => sprintf('smartling_settings[targetLocales][%s][enabled]', $blogId),
     266        ];
     267
     268        if (true === $enabled) {
     269            $checkboxProperties['checked'] = 'checked';
     270        }
     271
     272        $parts[] = HtmlTagGeneratorHelper::tag('input', '', $checkboxProperties);
     273        $parts[] = HtmlTagGeneratorHelper::tag('span', htmlspecialchars($displayName));
     274        $parts = [
     275            HtmlTagGeneratorHelper::tag('label', implode('', $parts), ['class' => 'radio-label']),
     276        ];
     277
     278        if (0 === count($locales)) {
     279            $sLocale = HtmlTagGeneratorHelper::tag(
     280                'input',
     281                '',
     282                [
     283                    'name' => sprintf('smartling_settings[targetLocales][%s][target]', $blogId),
     284                    'type' => 'text',
     285                ]);
     286        } else {
     287            $sLocale = HtmlTagGeneratorHelper::tag(
     288                'select',
     289                HtmlTagGeneratorHelper::renderSelectOptions(
     290                    $smartlingName,
     291                    $locales
     292                ),
     293                [
     294                    'name' => sprintf('smartling_settings[targetLocales][%s][target]', $blogId),
     295                ]);
     296        }
     297
     298        $parts = [
     299            HtmlTagGeneratorHelper::tag('td', implode('', $parts), ['style' => 'display:table-cell;']),
     300        ];
     301        $parts[] = HtmlTagGeneratorHelper::tag('td', $sLocale, [
     302            'style' => 'display:table-cell',
     303            'class' => 'targetLocaleSelectCell',
     304        ]);
     305
     306        return implode('', $parts);
     307    }
     308
    252309    private function validateTargetLocales(array $targetLocales): bool {
    253310        $values = array_count_values($targetLocales);
  • smartling-connector/trunk/inc/Smartling/WP/Controller/ConfigurationProfilesController.php

    r3351155 r3441087  
    3131
    3232    public function __construct(
    33         private ApiWrapperInterface $api,
     33        protected ApiWrapperInterface $api,
    3434        LocalizationPluginProxyInterface $connector,
    3535        PluginInfo $pluginInfo,
     
    4242        private WordpressFunctionProxyHelper $wpProxy,
    4343    ) {
    44         parent::__construct($connector, $pluginInfo, $settingsManager, $siteHelper, $manager, $cache);
     44        parent::__construct($api, $connector, $pluginInfo, $settingsManager, $siteHelper, $manager, $cache);
    4545    }
    4646
     
    4848    {
    4949        wp_enqueue_script(
    50             $this->getPluginInfo()->getName() . 'settings',
    51             $this->getPluginInfo()->getUrl() . 'js/smartling-connector-admin.js', ['jquery'],
    52             $this->getPluginInfo()->getVersion(),
     50            $this->pluginInfo->getName() . 'settings',
     51            $this->pluginInfo->getUrl() . 'js/smartling-connector-admin.js', ['jquery'],
     52            $this->pluginInfo->getVersion(),
    5353            false
    5454        );
    5555        wp_enqueue_script(
    56             $this->getPluginInfo()->getName() . 'settings-admin-footer',
    57             $this->getPluginInfo()->getUrl() . 'js/smartling-connector-gutenberg-lock-attributes.js',
     56            $this->pluginInfo->getName() . 'settings-admin-footer',
     57            $this->pluginInfo->getUrl() . 'js/smartling-connector-gutenberg-lock-attributes.js',
    5858            [],
    59             $this->getPluginInfo()->getVersion(),
     59            $this->pluginInfo->getVersion(),
    6060            false
    6161        );
    62         wp_localize_script($this->getPluginInfo()->getName() . 'settings-admin-footer', 'smartling', [
     62        wp_localize_script($this->pluginInfo->getName() . 'settings-admin-footer', 'smartling', [
    6363            'addLockIdAttributeOnSave' => GlobalSettingsManager::isGenerateLockIdsEnabled(),
    6464        ]);
    6565        wp_register_style(
    66             $this->getPluginInfo()->getName(),
    67             $this->getPluginInfo()->getUrl() . 'css/smartling-connector-admin.css', [],
    68             $this->getPluginInfo()->getVersion(), 'all'
    69         );
    70         wp_enqueue_style($this->getPluginInfo()->getName());
     66            $this->pluginInfo->getName(),
     67            $this->pluginInfo->getUrl() . 'css/smartling-connector-admin.css', [],
     68            $this->pluginInfo->getVersion(), 'all'
     69        );
     70        wp_enqueue_style($this->pluginInfo->getName());
    7171    }
    7272
     
    195195    {
    196196        $this->view([
    197             'profilesTable' => new ConfigurationProfilesWidget($this->getPluginInfo()->getSettingsManager()),
     197            'profilesTable' => new ConfigurationProfilesWidget($this->pluginInfo->getSettingsManager()),
    198198            'cnqTable' => new QueueManagerTableWidget(
    199199                $this->api,
    200200                $this->queue,
    201201                $this->settingsManager,
    202                 $this->getManager(),
     202                $this->submissionManager,
    203203                $this->uploadQueueManager,
    204204                $this->wpProxy,
  • smartling-connector/trunk/inc/Smartling/WP/Controller/ContentEditJobController.php

    r2862047 r3441087  
    1111use Smartling\Helpers\DiagnosticsHelper;
    1212use Smartling\Helpers\HtmlTagGeneratorHelper;
     13use Smartling\Helpers\SiteHelper;
    1314use Smartling\Helpers\SmartlingUserCapabilities;
     15use Smartling\Settings\SettingsManager;
    1416use Smartling\Vendor\Smartling\Jobs\JobStatus;
    1517use Smartling\WP\WPAbstract;
     
    6163    }
    6264
    63     public function initJobApiProxy()
     65    public function initJobApiProxy(): void
    6466    {
    6567        add_action('wp_ajax_' . self::SMARTLING_JOB_API_PROXY, function () {
    66 
    6768            $data =& $_POST;
    6869
     
    7172            ];
    7273
    73             $wrapper = Bootstrap::getContainer()->get('api.wrapper.with.retries');
    74             /**
    75              * @var ApiWrapper $wrapper
    76              */
    77 
    78             $siteHelper = Bootstrap::getContainer()->get('site.helper');
    79             /**
    80              * @var SiteHelper $siteHelper
    81              */
    82 
    83             $settingsManager = Bootstrap::getContainer()->get('manager.settings');
    84             /**
    85              * @var SettingsManager $settingsManager
    86              */
    87 
    88             $curSiteId = $siteHelper->getCurrentBlogId();
    89             $profile = $settingsManager->getSingleSettingsProfile($curSiteId);
     74            $profile = $this->settingsManager->getSingleSettingsProfile($this->siteHelper->getCurrentBlogId());
    9075            $params = &$data['params'];
    9176
    92             $validateRequires = function ($fieldName) use (&$result, $params) {
    93                 if (array_key_exists($fieldName, $params) && '' !== ($value = trim($params[$fieldName]))) {
    94                     return $value;
    95                 } else {
     77            $validateRequires = static function ($fieldName) use (&$result, $params) {
     78                $value = trim($params[$fieldName] ?? '');
     79
     80                if (!array_key_exists($fieldName, $params) || $value === '') {
    9681                    $msg = vsprintf('The field \'%s\' cannot be empty', [$fieldName]);
    9782                    Bootstrap::getLogger()->warning($msg);
     
    9984                    $result['message'][$fieldName] = $msg;
    10085                }
     86
     87                return $value;
    10188            };
    10289
     
    10491                switch ($data['innerAction']) {
    10592                    case 'list-jobs' :
    106                         $jobs = $wrapper->listJobs($profile, null, [
     93                        $jobs = $this->api->listJobs($profile, null, [
    10794                            JobStatus::AWAITING_AUTHORIZATION,
    10895                            JobStatus::IN_PROGRESS,
    10996                            JobStatus::COMPLETED,
    11097                        ]);
    111                         $preparcedJobs = [];
    112                         if (is_array($jobs) && array_key_exists('items', $jobs) &&
    113                             array_key_exists('totalCount', $jobs) && 0 < (int)$jobs['totalCount']) {
    114                             foreach ($jobs['items'] as $job) {
    115                                 if (!empty($job['dueDate'])) {
    116                                     $job['dueDate'] = \DateTime::createFromFormat('Y-m-d\TH:i:s\Z', $job['dueDate'])
    117                                         ->format(DateTimeHelper::DATE_TIME_FORMAT_JOB);
    118                                 }
    119 
    120                                 $preparcedJobs[] = $job;
     98                        $parsedJobs = [];
     99                        if (!array_key_exists('items', $jobs)) {
     100                            throw new \RuntimeException('Jobs api response is invalid.');
     101                        }
     102                        foreach ($jobs['items'] as $job) {
     103                            if (!empty($job['dueDate'])) {
     104                                $job['dueDate'] = \DateTime::createFromFormat('Y-m-d\TH:i:s\Z', $job['dueDate'])
     105                                    ->format(DateTimeHelper::DATE_TIME_FORMAT_JOB);
    121106                            }
    122                         }
    123                         $result['data'] = $preparcedJobs;
     107
     108                            $parsedJobs[] = $job;
     109                        }
     110                        $result['data'] = $parsedJobs;
    124111                        break;
    125112                    case 'create-job':
     
    131118                        $jobLocales = [];
    132119                        foreach ($jobLocalesRaw as $blogId) {
    133                             $jobLocales[] = $settingsManager->getSmartlingLocaleIdBySettingsProfile($profile, (int)$blogId);
    134                         }
    135                         $debug['status'] = $result['status'];
     120                            $jobLocales[] = $this->settingsManager->getSmartlingLocaleIdBySettingsProfile($profile, (int)$blogId);
     121                        }
    136122                        if ($result['status'] === 200) {
    137123                            try {
     
    140126
    141127                                if (!empty($jobDueDate)) {
    142                                     $utcDateTime = \DateTime::createFromFormat(DateTimeHelper::DATE_TIME_FORMAT_JOB, $jobDueDate, new DateTimeZone($timezone));
     128                                    $utcDateTime = \DateTime::createFromFormat('Y-m-d\TH:i', $jobDueDate, new DateTimeZone($timezone));
     129                                    if (!$utcDateTime) {
     130                                        throw new \RuntimeException('Invalid due date format.');
     131                                    }
    143132                                    $utcDateTime->setTimeZone(new DateTimeZone('UTC'));
    144133                                }
    145134
    146                                 $res = $wrapper->createJob($profile, [
     135                                $res = $this->api->createJob($profile, [
    147136                                    'name'        => $jobName,
    148137                                    'description' => $jobDescription,
     
    209198    public function wp_enqueue()
    210199    {
    211         $resPath = $this->getPluginInfo()->getUrl();
     200        $resPath = $this->pluginInfo->getUrl();
    212201        $jsPath = $resPath . 'js/';
    213202        $cssPath = $resPath . 'css/';
    214         $ver = $this->getPluginInfo()->getVersion();
     203        $ver = $this->pluginInfo->getVersion();
    215204
    216205        $jsFiles = [
  • smartling-connector/trunk/inc/Smartling/WP/Controller/ControllerAbstract.php

    r2862047 r3441087  
    2828    }
    2929
    30     private array $viewData;
    31 
    32     public function getViewData(): array
    33     {
    34         return $this->viewData;
    35     }
    36 
    37     public function setViewData(array $viewData): void
    38     {
    39         $this->viewData = $viewData;
    40     }
     30    protected array $viewData;
    4131
    4232    /**
  • smartling-connector/trunk/inc/Smartling/WP/Controller/DuplicateSubmissionsCleaner.php

    r2967105 r3441087  
    8787            $duplicateSets[] = new DuplicateSubmissions($this->contentHelper, $this->siteHelper, $this->submissionManager, $set, $nonce);
    8888        }
    89         $this->setViewData(['duplicates' => $duplicateSets]);
     89        $this->viewData = ['duplicates' => $duplicateSets];
    9090        $this->renderScript();
    9191    }
  • smartling-connector/trunk/inc/Smartling/WP/Controller/FilterForm.php

    r2862047 r3441087  
    3737    public function pageHandler(): void
    3838    {
    39         $this->setViewData(
    40             [
    41                 'manager' => new FilterManager(),
    42             ]
    43         );
     39        $this->viewData = [
     40            'manager' => new FilterManager(),
     41        ];
    4442        $this->renderScript();
    4543    }
  • smartling-connector/trunk/inc/Smartling/WP/Controller/PostBasedWidgetControllerStd.php

    r3338937 r3441087  
    33namespace Smartling\WP\Controller;
    44
    5 use Smartling\ApiWrapperInterface;
    65use Smartling\Base\ExportedAPI;
    76use Smartling\Base\SmartlingCore;
    87use Smartling\Bootstrap;
    9 use Smartling\DbAl\LocalizationPluginProxyInterface;
    108use Smartling\Exception\SmartlingDbException;
    119use Smartling\Extensions\Acf\AcfDynamicSupport;
    1210use Smartling\Helpers\ArrayHelper;
    13 use Smartling\Helpers\Cache;
    1411use Smartling\Helpers\CommonLogMessagesTrait;
    1512use Smartling\Helpers\DateTimeHelper;
    1613use Smartling\Helpers\DiagnosticsHelper;
    17 use Smartling\Helpers\PluginInfo;
    18 use Smartling\Helpers\SiteHelper;
    1914use Smartling\Helpers\SmartlingUserCapabilities;
    2015use Smartling\Jobs\JobEntityWithBatchUid;
    21 use Smartling\Settings\SettingsManager;
    2216use Smartling\Submissions\SubmissionEntity;
    23 use Smartling\Submissions\SubmissionManager;
    2417use Smartling\Vendor\Smartling\AuditLog\Params\CreateRecordParameters;
    2518use Smartling\WP\WPAbstract;
     
    6457        'attachment',
    6558    ];
    66 
    67     public function __construct(
    68         private ApiWrapperInterface $apiWrapper,
    69         LocalizationPluginProxyInterface $connector,
    70         PluginInfo $pluginInfo,
    71         SettingsManager $settingsManager,
    72         SiteHelper $siteHelper,
    73         private SubmissionManager $submissionManager,
    74         Cache $cache,
    75     ) {
    76         parent::__construct($connector, $pluginInfo, $settingsManager, $siteHelper, $submissionManager, $cache);
    77     }
    7859
    7960    private function isMuted()
     
    142123            $submissionIds = explode(',', $_POST['submissionIds']);
    143124            foreach ($submissionIds as $submissionId) {
    144                 $submission = $this->getManager()->getEntityById($submissionId);
     125                $submission = $this->submissionManager->getEntityById($submissionId);
    145126                if ($submission !== null) {
    146127                    $submissions[] = $submission;
     
    161142                try {
    162143                    $requestDescription = 'User request to download submissions';
    163                     $this->apiWrapper->createAuditLogRecord($profile, CreateRecordParameters::ACTION_TYPE_DOWNLOAD, $requestDescription, ['submissions' => $logSubmissions]);
     144                    $this->api->createAuditLogRecord($profile, CreateRecordParameters::ACTION_TYPE_DOWNLOAD, $requestDescription, ['submissions' => $logSubmissions]);
    164145                } catch (\Exception) {
    165146                    $this->getLogger()->error(sprintf('Failed to create audit log record actionType=%s, requestDescription="%s", submissions="%s"', CreateRecordParameters::ACTION_TYPE_DOWNLOAD, $requestDescription, json_encode($logSubmissions)));
     
    480461                    wp_enqueue_script(
    481462                        'smartling-block-sidebar',
    482                         $this->getPluginInfo()->getUrl() . 'js/smartling-block-sidebar.js',
     463                        $this->pluginInfo->getUrl() . 'js/smartling-block-sidebar.js',
    483464                        ['wp-blocks', 'wp-i18n', 'wp-element', 'wp-editor'],
    484                         $this->getPluginInfo()->getVersion(),
     465                        $this->pluginInfo->getVersion(),
    485466                        true
    486467                    );
  • smartling-connector/trunk/inc/Smartling/WP/Controller/ShortcodeForm.php

    r2862047 r3441087  
    3737    public function pageHandler(): void
    3838    {
    39         $this->setViewData(
    40             [
    41                 'manager' => new ShortcodeManager(),
    42             ]
    43         );
     39        $this->viewData = [
     40            'manager' => new ShortcodeManager(),
     41        ];
    4442        $this->renderScript();
    4543    }
  • smartling-connector/trunk/inc/Smartling/WP/Controller/SubmissionsPageController.php

    r2821492 r3441087  
    1818class SubmissionsPageController extends WPAbstract implements WPHookInterface
    1919{
    20     private ApiWrapperInterface $apiWrapper;
    21     private Queue $queue;
    22 
    23     public function __construct(ApiWrapperInterface $apiWrapper, LocalizationPluginProxyInterface $connector, PluginInfo $pluginInfo, SettingsManager $settingsManager, SiteHelper $siteHelper, SubmissionManager $manager, Cache $cache, Queue $queue)
    24     {
    25         parent::__construct($connector, $pluginInfo, $settingsManager, $siteHelper, $manager, $cache);
    26         $this->apiWrapper = $apiWrapper;
    27         $this->queue = $queue;
     20    public function __construct(
     21        protected ApiWrapperInterface $api,
     22        LocalizationPluginProxyInterface $connector,
     23        PluginInfo $pluginInfo,
     24        SettingsManager $settingsManager,
     25        SiteHelper $siteHelper,
     26        SubmissionManager $manager,
     27        Cache $cache,
     28        private Queue $queue,
     29    ) {
     30        parent::__construct($api, $connector, $pluginInfo, $settingsManager, $siteHelper, $manager, $cache);
    2831    }
    2932
     
    5760    public function renderPage(): void
    5861    {
    59         $table = new SubmissionTableWidget($this->apiWrapper, $this->localizationPluginProxy, $this->settingsManager, $this->siteHelper, $this->getManager(), $this->queue);
     62        $table = new SubmissionTableWidget(
     63            $this->api,
     64            $this->localizationPluginProxy,
     65            $this->settingsManager,
     66            $this->siteHelper,
     67            $this->submissionManager,
     68            $this->queue,
     69        );
    6070        $table->prepare_items();
    6171        $this->view($table);
  • smartling-connector/trunk/inc/Smartling/WP/Controller/TaxonomyLinksController.php

    r2821492 r3441087  
    33namespace Smartling\WP\Controller;
    44
     5use Smartling\ApiWrapperInterface;
    56use Smartling\DbAl\LocalizationPluginProxyInterface;
    67use Smartling\Helpers\ArrayHelper;
     
    1920class TaxonomyLinksController extends WPAbstract implements WPHookInterface
    2021{
    21     private $submissionManager;
    22     private $wordpressProxy;
    23 
    24     public function __construct(PluginInfo $pluginInfo, SettingsManager $settingsManager, LocalizationPluginProxyInterface $localizationPluginProxy, SiteHelper $siteHelper, SubmissionManager $submissionManager, WordpressFunctionProxyHelper $wordpressProxy, Cache $cache)
    25     {
    26         parent::__construct($localizationPluginProxy, $pluginInfo, $settingsManager, $siteHelper, $submissionManager, $cache);
    27         $this->submissionManager = $submissionManager;
    28         $this->wordpressProxy = $wordpressProxy;
     22    public function __construct(
     23        protected ApiWrapperInterface $api,
     24        PluginInfo $pluginInfo,
     25        SettingsManager $settingsManager,
     26        LocalizationPluginProxyInterface $localizationPluginProxy,
     27        SiteHelper $siteHelper,
     28        protected SubmissionManager $submissionManager,
     29        private WordpressFunctionProxyHelper $wordpressProxy,
     30        Cache $cache,
     31    )
     32    {
     33        parent::__construct($api, $localizationPluginProxy, $pluginInfo, $settingsManager, $siteHelper, $submissionManager, $cache);
    2934    }
    3035
     
    3742    {
    3843        wp_enqueue_script(
    39             $this->getPluginInfo()->getName() . 'settings',
    40             $this->getPluginInfo()->getUrl() . 'js/smartling-connector-taxonomy-links.js', ['jquery'],
    41             $this->getPluginInfo()->getVersion(),
     44            $this->pluginInfo->getName() . 'settings',
     45            $this->pluginInfo->getUrl() . 'js/smartling-connector-taxonomy-links.js', ['jquery'],
     46            $this->pluginInfo->getVersion(),
    4247            false
    4348        );
    4449        wp_enqueue_script(
    45             $this->getPluginInfo()->getName() . 'admin',
    46             $this->getPluginInfo()->getUrl() . 'js/smartling-connector-admin.js', ['jquery'],
    47             $this->getPluginInfo()->getVersion(),
     50            $this->pluginInfo->getName() . 'admin',
     51            $this->pluginInfo->getUrl() . 'js/smartling-connector-admin.js', ['jquery'],
     52            $this->pluginInfo->getVersion(),
    4853            false
    4954        );
    5055        wp_register_style(
    51             $this->getPluginInfo()->getName(),
    52             $this->getPluginInfo()->getUrl() . 'css/smartling-connector-admin.css', [],
    53             $this->getPluginInfo()->getVersion(), 'all'
    54         );
    55         wp_enqueue_style($this->getPluginInfo()->getName());
     56            $this->pluginInfo->getName(),
     57            $this->pluginInfo->getUrl() . 'css/smartling-connector-admin.css', [],
     58            $this->pluginInfo->getVersion(), 'all'
     59        );
     60        wp_enqueue_style($this->pluginInfo->getName());
    5661    }
    5762
  • smartling-connector/trunk/inc/Smartling/WP/Controller/TaxonomyWidgetController.php

    r3077564 r3441087  
    1414use Smartling\Helpers\WordpressContentTypeHelper;
    1515use Smartling\Submissions\SubmissionEntity;
     16use Smartling\Submissions\SubmissionManager;
    1617use Smartling\WP\WPAbstract;
    1718use Smartling\WP\WPHookInterface;
     
    101102
    102103                if (0 < count($applicableProfiles)) {
    103                     $submissions = $this->getManager()
     104                    $submissions = $this->submissionManager
    104105                        ->find([
    105106                                   SubmissionEntity::FIELD_SOURCE_BLOG_ID => $curBlogId,
  • smartling-connector/trunk/inc/Smartling/WP/Controller/TestRunController.php

    r3393007 r3441087  
    3939    public const SLUG = 'smartling_test_run';
    4040
    41     private ContentRelationsDiscoveryService $contentRelationDiscoveryService;
    42     private ApiWrapperInterface $apiWrapper;
    43     private SubmissionManager $submissionManager;
    4441    private int $uploadCronInterval;
    4542
     
    4845        LocalizationPluginProxyInterface $localizationPluginProxy,
    4946        SiteHelper $siteHelper,
    50         SubmissionManager $submissionManager,
     47        protected SubmissionManager $submissionManager,
    5148        Cache $cache,
    52         ContentRelationsDiscoveryService $contentRelationDiscoveryService,
    53         ApiWrapperInterface $apiWrapper,
     49        private ContentRelationsDiscoveryService $contentRelationDiscoveryService,
     50        protected ApiWrapperInterface $api,
    5451        SettingsManager $settingsManager,
    5552        string $uploadCronInterval
    5653    ) {
    57         parent::__construct($localizationPluginProxy, $pluginInfo, $settingsManager, $siteHelper, $submissionManager, $cache);
    58         $this->apiWrapper = $apiWrapper;
    59         $this->contentRelationDiscoveryService = $contentRelationDiscoveryService;
    60         $this->submissionManager = $submissionManager;
     54        parent::__construct($api, $localizationPluginProxy, $pluginInfo, $settingsManager, $siteHelper, $submissionManager, $cache);
    6155        if (!preg_match('~^\d+m$~', $uploadCronInterval)) {
    6256            throw new SmartlingConfigException('Upload job cron interval must be specified in minutes (e. g. 5m), with no extra symbols');
     
    9892    {
    9993        wp_enqueue_script(
    100             $this->getPluginInfo()->getName() . 'admin',
    101             $this->getPluginInfo()->getUrl() . 'js/smartling-connector-admin.js', ['jquery'],
    102             $this->getPluginInfo()->getVersion(),
     94            $this->pluginInfo->getName() . 'admin',
     95            $this->pluginInfo->getUrl() . 'js/smartling-connector-admin.js', ['jquery'],
     96            $this->pluginInfo->getVersion(),
    10397            false,
    10498        );
    10599        wp_register_style(
    106             $this->getPluginInfo()->getName(),
    107             $this->getPluginInfo()->getUrl() . 'css/smartling-connector-admin.css', [],
    108             $this->getPluginInfo()->getVersion(),
    109         );
    110         wp_enqueue_style($this->getPluginInfo()->getName());
     100            $this->pluginInfo->getName(),
     101            $this->pluginInfo->getUrl() . 'css/smartling-connector-admin.css', [],
     102            $this->pluginInfo->getVersion(),
     103        );
     104        wp_enqueue_style($this->pluginInfo->getName());
    111105    }
    112106
     
    205199    private function getJob(ConfigurationProfileEntity $profile): JobEntity
    206200    {
    207         $response = $this->apiWrapper->listJobs($profile, self::TEST_RUN_JOB_NAME, [
     201        $response = $this->api->listJobs($profile, self::TEST_RUN_JOB_NAME, [
    208202            JobStatus::AWAITING_AUTHORIZATION,
    209203            JobStatus::IN_PROGRESS,
     
    214208            $jobUId = $response['items'][0]['translationJobUid'];
    215209        } else {
    216             $result = $this->apiWrapper->createJob($profile, [
     210            $result = $this->api->createJob($profile, [
    217211                    'name' => self::TEST_RUN_JOB_NAME,
    218212                    'description' => 'Test run job',
  • smartling-connector/trunk/inc/Smartling/WP/Controller/TranslationLockController.php

    r3004164 r3441087  
    33namespace Smartling\WP\Controller;
    44
     5use Smartling\ApiWrapperInterface;
    56use Smartling\DbAl\LocalizationPluginProxyInterface;
    67use Smartling\Helpers\ArrayHelper;
     
    2122class TranslationLockController extends WPAbstract implements WPHookInterface
    2223{
    23     private ContentHelper $contentHelper;
    24 
    2524    public function __construct(
     25        protected ApiWrapperInterface $api,
    2626        LocalizationPluginProxyInterface $connector,
    2727        PluginInfo $pluginInfo,
     
    3030        SubmissionManager $manager,
    3131        Cache $cache,
    32         ContentHelper $contentHelper,
     32        private ContentHelper $contentHelper,
    3333    ) {
    34         parent::__construct($connector, $pluginInfo, $settingsManager, $siteHelper, $manager, $cache);
    35         $this->contentHelper = $contentHelper;
     34        parent::__construct($api, $connector, $pluginInfo, $settingsManager, $siteHelper, $manager, $cache);
    3635    }
    3736
     
    114113    private function getSubmission(int $postId, string $postType): ?SubmissionEntity
    115114    {
    116         return $this->getManager()->findOne([
     115        return $this->submissionManager->findOne([
    117116            SubmissionEntity::FIELD_TARGET_BLOG_ID => $this->siteHelper->getCurrentBlogId(),
    118117            SubmissionEntity::FIELD_TARGET_ID => $postId,
     
    146145            $submission->setLockedFields(array_keys($_POST['lockField'] ?? []));
    147146            $submission->setIsLocked(array_key_exists('lock_page', $_POST) ? 1 : 0);
    148             $this->getManager()->storeEntity($submission);
     147            $this->submissionManager->storeEntity($submission);
    149148        }
    150149    }
     
    180179        $submissionId = (int)$this->getQueryParam('submission', 0);
    181180        if (0 < $submissionId) {
    182             $searchResult = $this->getManager()->findByIds([$submissionId]);
     181            $searchResult = $this->submissionManager->findByIds([$submissionId]);
    183182            if (0 < count($searchResult)) {
    184183                /**
  • smartling-connector/trunk/inc/Smartling/WP/View/AdminPage.php

    r2862047 r3441087  
    99use Smartling\WP\Table\ShortcodeTableClass;
    1010
     11/**
     12 * @var AdminPage $this
     13 */
    1114?>
    1215<style>
     
    2023    <h3>Custom Shortcodes</h3>
    2124    <?php
    22     /**
    23      * @var ShortcodeTableClass $shortcodeTable
    24      */
    25     $shortcodeTable = $this->getViewData()['shortcodes'];
    26     /**
    27      * @var LocalizationRulesTableWidget $filterTable
    28      */
    29     $filterTable = $this->getViewData()['filters'];
    30     /**
    31      * @var MediaAttachmentTableWidget $mediaTable
    32      */
    33     $mediaTable = $this->getViewData()['media'];
     25    $shortcodeTable = $this->viewData['shortcodes'];
     26    assert($shortcodeTable instanceof ShortcodeTableClass);
     27    $filterTable = $this->viewData['filters'];
     28    assert($filterTable instanceof LocalizationRulesTableWidget);
     29    $mediaTable = $this->viewData['media'];
     30    assert($mediaTable instanceof MediaAttachmentTableWidget);
    3431
    3532    foreach ([$shortcodeTable, $filterTable, $mediaTable] as $widget) {
  • smartling-connector/trunk/inc/Smartling/WP/View/BulkSubmit.php

    r3025850 r3441087  
    22
    33use Smartling\Helpers\ArrayHelper;
     4use Smartling\WP\Controller\BulkSubmitController;
    45use Smartling\WP\Table\BulkSubmitTableWidget;
    56use Smartling\WP\WPAbstract;
    67
    7 $data = $this->getViewData();
    8 if (!$data instanceof BulkSubmitTableWidget) {
    9     throw new \LogicException(BulkSubmitTableWidget::class . ' expected');
    10 }
     8/**
     9 * @var BulkSubmitController $this
     10 */
     11$data = $this->viewData;
     12assert($data instanceof BulkSubmitTableWidget);
    1113$widgetName = 'bulk-submit-locales';
    1214
     
    5052        <?php $bulkSubmitTable->display() ?>
    5153        <div id="error-messages" class="tab"></div>
    52         <div class="postbox-container">
    53             <div id="panel-box" class="postbox hndle"><h2><span>Content actions</span></h2>
     54        <?php
     55        $locales = $data->getProfile()->getTargetLocales();
     56        ArrayHelper::sortLocales($locales);
     57        $localesData = array_map(function($locale) {
     58            return [
     59                'blogId' => $locale->getBlogId(),
     60                'label' => $locale->getLabel(),
     61                'smartlingLocale' => $locale->getSmartlingLocale(),
     62                'enabled' => $locale->isEnabled()
     63            ];
     64        }, array_filter($locales, fn($l) => $l->isEnabled()));
     65        ?>
     66        <div id="smartling-app"
     67             data-bulk-submit="true"
     68             data-content-type=""
     69             data-content-id="0"
     70             data-locales='<?= htmlspecialchars(json_encode(array_values($localesData), JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_HEX_TAG), ENT_QUOTES, 'UTF-8') ?>'
     71             data-ajax-url="<?= admin_url('admin-ajax.php') ?>"
     72             data-admin-url="<?= admin_url('admin-ajax.php') ?>"></div>
     73        <div class="postbox-container" style="display:none;">
     74            <div id="panel-box" class="postbox hndle">
    5475                <div class="inside">
    5576                    <div id="action-tabs">
     
    6081                        <div id="translate" class="tab">
    6182                            <?php
    62                             // Render job wizard.
    63                             $this->setViewData(
    64                                 [
    65                                     'profile'     => $bulkSubmitTable->getProfile(),
    66                                     'contentType' => '',
    67                                 ]
    68                             );
     83                            $this->viewData = [
     84                                'profile' => $bulkSubmitTable->getProfile(),
     85                                'contentType' => '',
     86                            ];
    6987                            $this->renderViewScript('ContentEditJob.php');
    7088                            ?>
  • smartling-connector/trunk/inc/Smartling/WP/View/ConfigurationProfileForm.php

    r3373443 r3441087  
    1313/**
    1414 * @var ConfigurationProfileFormController $this
    15  * @var SettingsManager $settingsManager
    1615 */
    17 $settingsManager = $this->getViewData();
    18 
    19 $pluginInfo = $this->getPluginInfo();
     16$settingsManager = $this->settingsManager;
     17
     18$pluginInfo = $this->pluginInfo;
    2019$domain = $pluginInfo->getDomain();
    2120
     
    473472                        <?php
    474473                        $targetLocales = $profile->getTargetLocales();
     474                        $supportedLocales = $this->api->getSupportedLocales($profile);
    475475                        foreach ($locales as $blogId => $label) {
    476476                            if ($blogId === $profile->getSourceLocale()
     
    480480                            }
    481481
    482                             $smartlingLocale = -1;
     482                            $smartlingLocale = '';
    483483                            $enabled = false;
    484484
     
    493493
    494494                            <tr>
    495                                 <?= WPAbstract::settingsPageTsargetLocaleCheckbox($profile, $label, $blogId,
    496                                                                                   $smartlingLocale, $enabled) ?>
     495                                <?= $this->renderLocales($supportedLocales, $label, $blogId, $smartlingLocale, $enabled) ?>
    497496                            </tr>
    498497                            <?php
  • smartling-connector/trunk/inc/Smartling/WP/View/ConfigurationProfiles.php

    r3333320 r3441087  
    1212 * @var ConfigurationProfilesController $this
    1313 */
    14 $data = $this->getViewData();
     14$data = $this->viewData;
    1515?>
    1616<div class="wrap">
  • smartling-connector/trunk/inc/Smartling/WP/View/ContentEditJob.php

    r3408250 r3441087  
    99use Smartling\Submissions\SubmissionEntity;
    1010use Smartling\WP\Controller\ContentEditJobController;
    11 use Smartling\WP\Table\BulkSubmitTableWidget;
    1211use Smartling\WP\WPAbstract;
    1312
    1413/**
    1514 * @var WPAbstract $this
    16  * @var BulkSubmitTableWidget $data
    17  * @var ConfigurationProfileEntity $profile
    1815 */
    19 $data = $this->getViewData();
     16$data = $this->viewData;
    2017$profile = $data['profile'];
     18assert($profile instanceof ConfigurationProfileEntity);
    2119$widgetName = 'bulk-submit-locales';
    2220
    23 ?>
     21$isBulkSubmitPage = get_current_screen()?->id === 'smartling_page_smartling-bulk-submit';
     22global $tag;
     23$needWrapper = ($tag instanceof WP_Term);
     24
     25$id = 0;
     26$baseType = 'unknown';
     27global $post;
     28if ($post instanceof WP_Post) {
     29    $id = $post->ID;
     30    $baseType = 'post';
     31} else {
     32    if ($tag instanceof WP_Term) {
     33        $id = $tag->term_id;
     34        $baseType = 'taxonomy';
     35    }
     36}
     37
     38$locales = $profile->getTargetLocales();
     39ArrayHelper::sortLocales($locales);
     40$localesData = array_map(function($locale) {
     41    return [
     42        'blogId' => $locale->getBlogId(),
     43        'label' => $locale->getLabel(),
     44        'smartlingLocale' => $locale->getSmartlingLocale(),
     45        'enabled' => $locale->isEnabled()
     46    ];
     47}, array_filter($locales, fn($l) => $l->isEnabled()));
     48
     49if (!$isBulkSubmitPage) : ?>
     50<?php if ($needWrapper) : ?>
     51<div class="postbox-container" style="width: 550px">
     52    <div id="panel-box" class="postbox hndle"><h2><span>Translate content</span></h2>
     53        <div class="inside">
     54<?php endif; ?>
     55            <div id="smartling-app"
     56                 data-bulk-submit="false"
     57                 data-content-type="<?= $data['contentType'] ?? $baseType ?>"
     58                 data-content-id="<?= $id ?>"
     59                 data-locales='<?= htmlspecialchars(json_encode(array_values($localesData), JSON_THROW_ON_ERROR | JSON_HEX_APOS | JSON_HEX_QUOT), ENT_QUOTES, 'UTF-8') ?>'
     60                 data-ajax-url="<?= admin_url('admin-ajax.php') ?>"
     61                 data-admin-url="<?= admin_url('admin-ajax.php') ?>"></div>
     62<?php if ($needWrapper) : ?>
     63        </div>
     64    </div>
     65</div>
     66<?php endif; ?>
     67<?php endif; ?>
     68
     69<div style="display:none;">
    2470<style>
    2571.relations-list {
     
    3682</style>
    3783<?php
    38 $isBulkSubmitPage = get_current_screen()?->id === 'smartling_page_smartling-bulk-submit';
    39 global $tag;
    40 $needWrapper = ($tag instanceof WP_Term);
    4184?>
    4285
     
    4891</script>
    4992
    50 <?php if ($needWrapper) : ?>
     93<?php if ($needWrapper && false) : ?>
    5194<div class="postbox-container" style="width: 550px">
    5295    <div id="panel-box" class="postbox hndle"><h2><span>Translate content</span></h2>
  • smartling-connector/trunk/inc/Smartling/WP/View/DuplicateSubmissionsCleaner.php

    r2967105 r3441087  
    11<?php
    22
     3use Smartling\WP\Controller\DuplicateSubmissionsCleaner;
    34use Smartling\WP\Table\DuplicateSubmissions;
    45
     6/**
     7 * @var DuplicateSubmissionsCleaner $this
     8 */
    59?>
    610<div class="wrap">
     
    1216    </ul>
    1317    <?php
    14     $duplicates = $this->getViewData()['duplicates'];
     18    $duplicates = $this->viewData['duplicates'];
    1519    foreach ($duplicates as $set) {
    1620        assert($set instanceof DuplicateSubmissions);
  • smartling-connector/trunk/inc/Smartling/WP/View/FilterForm.php

    r2862047 r3441087  
    1212    use Smartling\Tuner\FilterManager;
    1313    use Smartling\WP\Controller\FilterForm;
    14 
    15     $data = $this->getViewData();
    16 
     14    /**
     15     * @var FilterForm $this
     16     */
     17    $data = $this->viewData;
    1718
    1819    /**
  • smartling-connector/trunk/inc/Smartling/WP/View/PostBasedWidgetStd.php

    r1819304 r3441087  
    55/**
    66 * @var WPAbstract $this
    7  * @var WPAbstract self
    87 */
    98
    10 $this->setWidgetHeader(__('Download translation:'));
     9$this->widgetHeader = __('Download translation:');
    1110$this->renderViewScript('post-based-content-type.php');
  • smartling-connector/trunk/inc/Smartling/WP/View/ShortcodeForm.php

    r2862047 r3441087  
    1313    use Smartling\WP\Controller\ShortcodeForm;
    1414
    15     $data = $this->getViewData();
     15    /**
     16     * @var ShortcodeForm $this
     17     */
     18    $data = $this->viewData;
    1619
    1720    /**
  • smartling-connector/trunk/inc/Smartling/WP/View/SubmissionsPage.php

    r2567071 r3441087  
    33use Smartling\Helpers\DiagnosticsHelper;
    44use Smartling\Helpers\UiMessageHelper;
     5use Smartling\WP\Controller\SubmissionsPageController;
    56use Smartling\WP\Table\SubmissionTableWidget;
    6 use Smartling\WP\WPAbstract;
    77
    88/**
    9  * @var WPAbstract $this
     9 * @var SubmissionsPageController $this
    1010 */
    11 $data = $this->getViewData();
     11$data = $this->viewData;
    1212?>
    1313<?php if (!DiagnosticsHelper::isBlocked()) : ?>
  • smartling-connector/trunk/inc/Smartling/WP/View/TaxonomyLinks.php

    r2862047 r3441087  
    77 * @var TaxonomyLinksController $this
    88 */
    9 $blogs = $this->getViewData()['blogs'];
     9$blogs = $this->viewData['blogs'];
    1010?>
    1111<script>
    12     let submissions = <?= json_encode($this->getViewData()['submissions'])?>;
    13     const terms = <?= json_encode($this->getViewData()['terms'])?>;
     12    let submissions = <?= json_encode($this->viewData['submissions'], JSON_THROW_ON_ERROR)?>;
     13    const terms = <?= json_encode($this->viewData['terms'], JSON_THROW_ON_ERROR)?>;
    1414</script>
    1515<p>This section allows linking of taxonomy terms between different blogs to avoid target blog terms duplication upon translation.</p>
  • smartling-connector/trunk/inc/Smartling/WP/View/TaxonomyWidget.php

    r1344113 r3441087  
    55/**
    66 * @var WPAbstract $this
    7  * @var WPAbstract self
    87 */
    98
  • smartling-connector/trunk/inc/Smartling/WP/View/TestRun.php

    r3387552 r3441087  
    88/**
    99 * @var TestRunController $this
    10  * @var TestRunViewData $viewData
    1110 */
    12 $viewData = $this->getViewData();
     11$viewData = $this->viewData;
     12assert($viewData instanceof TestRunViewData);
    1313?>
    1414<h1>Test run</h1> <!--needed for admin notices-->
  • smartling-connector/trunk/inc/Smartling/WP/View/TranslationLock.php

    r3004164 r3441087  
    11<?php
     2
     3use Smartling\Helpers\HtmlTagGeneratorHelper;
     4use Smartling\Submissions\SubmissionEntity;
     5use Smartling\WP\Table\TranslationLockTableWidget;
     6
    27defined('IFRAME_REQUEST') || define('IFRAME_REQUEST', true);
    38defined('WP_ADMIN') || define('WP_ADMIN', true);
     
    5257    /**
    5358     * @var WPAbstract $this
    54      * @var WPAbstract self
    5559     */
    56     $data = $this->getViewData();
    57     /**
    58      * @var \Smartling\WP\Table\TranslationLockTableWidget $table
    59      */
     60    $data = $this->viewData;
    6061    $table = $data['table'];
    61     /**
    62      * @var \Smartling\Submissions\SubmissionEntity $submission
    63      */
     62    assert($table instanceof TranslationLockTableWidget);
    6463    $submission = $data['submission'];
     64    assert($submission instanceof SubmissionEntity);
    6565    ?>
    6666
     
    6868        <div>
    6969            <?=
    70             \Smartling\Helpers\HtmlTagGeneratorHelper::tag(
     70            HtmlTagGeneratorHelper::tag(
    7171                'label',
    7272                __('Lock all fields'),
     
    8989
    9090            <?=
    91             \Smartling\Helpers\HtmlTagGeneratorHelper::tag('input', '', $options);
     91            HtmlTagGeneratorHelper::tag('input', '', $options);
    9292            ?>
    9393        </div>
    9494
    95         <?= $table->display(); ?>
    96         <?= \Smartling\Helpers\HtmlTagGeneratorHelper::tag(
     95        <?php $table->display() ?>
     96        <?= HtmlTagGeneratorHelper::tag(
    9797            'input',
    9898            '',
  • smartling-connector/trunk/inc/Smartling/WP/View/post-based-content-type.php

    r2731800 r3441087  
    1212/**
    1313 * @var WPAbstract $this
    14  * @var WPAbstract self
    1514 */
    16 $data = $this->getViewData();
     15$data = $this->viewData;
    1716$widgetName = PostBasedWidgetControllerStd::WIDGET_DATA_NAME;
    1817
     
    4544    <div class="fields">
    4645
    47         <h3><?= $this->getWidgetHeader() ?></h3>
     46        <h3><?= $this->widgetHeader ?></h3>
    4847        <?= WPAbstract::checkUncheckBlock($widgetName) ?>
    4948        <div class="locale-list">
     
    8988                                $editUrl = WordpressContentTypeHelper::getEditUrl($item);
    9089                            }
    91                            
     90
    9291                            /**
    9392                             * Disable download checkbox for new state
  • smartling-connector/trunk/inc/Smartling/WP/View/taxonomy-based-content-type.php

    r2927786 r3441087  
    2828/**
    2929 * @var WPAbstract $this
    30  * @var WPAbstract self
    3130 */
    32 $data = $this->getViewData();
     31$data = $this->viewData;
    3332$widgetName = TaxonomyWidgetController::WIDGET_DATA_NAME;
    3433
  • smartling-connector/trunk/inc/Smartling/WP/WPAbstract.php

    r2821492 r3441087  
    33namespace Smartling\WP;
    44
    5 use Smartling\Base\SmartlingCore;
    6 use Smartling\Bootstrap;
     5use Smartling\ApiWrapperInterface;
    76use Smartling\DbAl\LocalizationPluginProxyInterface;
    87use Smartling\Exception\SmartlingIOException;
    98use Smartling\Helpers\Cache;
    109use Smartling\Helpers\HtmlTagGeneratorHelper;
     10use Smartling\Helpers\LoggerSafeTrait;
    1111use Smartling\Helpers\PluginInfo;
    1212use Smartling\Helpers\SiteHelper;
    1313use Smartling\Helpers\StringHelper;
    14 use Smartling\MonologWrapper\MonologWrapper;
    1514use Smartling\Settings\ConfigurationProfileEntity;
    1615use Smartling\Settings\SettingsManager;
    1716use Smartling\Submissions\SubmissionEntity;
    1817use Smartling\Submissions\SubmissionManager;
    19 use Smartling\Vendor\Psr\Log\LoggerInterface;
    2018
    2119class WPAbstract
    2220{
    23 
    24     /**
    25      * @var LoggerInterface
    26      */
    27     private $logger;
    28 
    29     /**
    30      * @var PluginInfo
    31      */
    32     private $pluginInfo;
    33 
    34     protected LocalizationPluginProxyInterface $localizationPluginProxy;
    35     protected SettingsManager $settingsManager;
    36     protected SiteHelper $siteHelper;
    37 
    38     /**
    39      * @var SubmissionManager
    40      */
    41     private $manager;
    42 
    43     /**
    44      * @var Cache
    45      */
    46     private $cache;
    47 
    48     /**
    49      * @var string
    50      */
    51     private $widgetHeader = '';
    52 
    53     /**
    54      * @var mixed
    55      */
    56     private $viewData;
    57 
    58     /**
    59      * @return mixed
    60      */
    61     public function getViewData()
    62     {
    63         return $this->viewData;
    64     }
    65 
    66     /**
    67      * @param mixed $viewData
    68      */
    69     public function setViewData($viewData)
    70     {
    71         $this->viewData = $viewData;
    72     }
    73 
    74 
    75     /**
    76      * @return string
    77      */
    78     public function getWidgetHeader()
    79     {
    80         return $this->widgetHeader;
    81     }
    82 
    83     /**
    84      * @param string $widgetHeader
    85      */
    86     public function setWidgetHeader($widgetHeader)
    87     {
    88         $this->widgetHeader = $widgetHeader;
    89     }
     21    use LoggerSafeTrait;
     22    protected mixed $viewData;
     23
     24    protected string $widgetHeader = '';
    9025
    9126    public function __construct(
    92         LocalizationPluginProxyInterface $connector,
    93         PluginInfo $pluginInfo,
    94         SettingsManager $settingsManager,
    95         SiteHelper $siteHelper,
    96         SubmissionManager $manager,
    97         Cache $cache
    98     )
    99     {
    100         $this->logger = MonologWrapper::getLogger(get_called_class());
    101         $this->localizationPluginProxy = $connector;
    102         $this->pluginInfo = $pluginInfo;
    103         $this->settingsManager = $settingsManager;
    104         $this->siteHelper = $siteHelper;
    105         $this->manager = $manager;
    106         $this->cache = $cache;
    107     }
    108 
    109     /**
    110      * @return Cache
    111      */
    112     public function getCache()
    113     {
    114         return $this->cache;
    115     }
    116 
    117     /**
    118      * @return SubmissionManager
    119      */
    120     public function getManager()
    121     {
    122         return $this->manager;
    123     }
    124 
    125     /**
    126      * @return LoggerInterface
    127      */
    128     public function getLogger()
    129     {
    130         return $this->logger;
    131     }
    132 
    133     /**
    134      * @return PluginInfo
    135      */
    136     public function getPluginInfo()
    137     {
    138         return $this->pluginInfo;
     27        protected ApiWrapperInterface $api,
     28        protected LocalizationPluginProxyInterface $localizationPluginProxy,
     29        protected PluginInfo $pluginInfo,
     30        protected SettingsManager $settingsManager,
     31        protected SiteHelper $siteHelper,
     32        protected SubmissionManager $submissionManager,
     33        protected Cache $cache
     34    ) {
    13935    }
    14036
     
    14743    }
    14844
    149     /**
    150      * @param mixed $data
    151      */
    152     public function view($data = null)
    153     {
    154         $this->setViewData($data);
    155         $class = get_called_class();
    156         $class = str_replace('Smartling\\WP\\Controller\\', '', $class);
    157 
    158         $class = str_replace('Controller', '', $class);
    159 
    160         $this->renderViewScript($class . '.php');
    161     }
    162 
    163     public function renderViewScript($script)
     45    public function view(mixed $data = null): void
     46    {
     47        $this->viewData = $data;
     48        $this->renderViewScript(str_replace(['Smartling\\WP\\Controller\\', 'Controller'], '', static::class) . '.php');
     49    }
     50
     51    public function renderViewScript($script): void
    16452    {
    16553        $filename = plugin_dir_path(__FILE__) . 'View/' . $script;
     
    16755        if (!file_exists($filename) || !is_file($filename) || !is_readable($filename)) {
    16856            throw new SmartlingIOException(vsprintf('Requested view file (%s) not found.', [$filename]));
    169         } else {
    170             /** @noinspection PhpIncludeInspection */
    171             require_once $filename;
    172         }
     57        }
     58
     59        require_once $filename;
    17360    }
    17461
     
    381268    }
    382269
    383     public static function settingsPageTsargetLocaleCheckbox(
    384         ConfigurationProfileEntity $profile,
    385         $displayName,
    386         $blogId,
    387         $smartlingName = '',
    388         $enabled = false
    389     )
    390     {
    391         $parts = [];
    392 
    393         $checkboxProperties = [
    394             'type'  => 'checkbox',
    395             'class' => 'mcheck',
    396             'name'  => vsprintf('smartling_settings[targetLocales][%s][enabled]', [$blogId]),
    397         ];
    398 
    399         if (true === $enabled) {
    400             $checkboxProperties['checked'] = 'checked';
    401         }
    402 
    403         $parts[] = HtmlTagGeneratorHelper::tag('input', '', $checkboxProperties);
    404 
    405         $parts[] = HtmlTagGeneratorHelper::tag('span', htmlspecialchars($displayName), []);
    406 
    407         $parts = [
    408             HtmlTagGeneratorHelper::tag('label', implode('', $parts), ['class' => 'radio-label']),
    409         ];
    410 
    411         /**
    412          * @var SmartlingCore $ep
    413          */
    414         $ep = Bootstrap::getContainer()->get('entrypoint');
    415 
    416         $locales = $ep->getProjectLocales($profile);
    417 
    418         if (0 === count($locales)) {
    419             $sLocale = HtmlTagGeneratorHelper::tag(
    420                 'input',
    421                 '',
    422                 [
    423                     'name' => vsprintf('smartling_settings[targetLocales][%s][target]', [$blogId]),
    424                     'type' => 'text',
    425                 ]);
    426         } else {
    427             $sLocale = HtmlTagGeneratorHelper::tag(
    428                 'select',
    429                 HtmlTagGeneratorHelper::renderSelectOptions(
    430                     $smartlingName,
    431                     $locales
    432                 ),
    433                 [
    434                     'name' => vsprintf('smartling_settings[targetLocales][%s][target]', [$blogId]),
    435                 ]);
    436         }
    437 
    438         $parts = [
    439             HtmlTagGeneratorHelper::tag('td', implode('', $parts), ['style' => 'display:table-cell;']),
    440         ];
    441         $parts[] = HtmlTagGeneratorHelper::tag('td', $sLocale, ['style' => 'display:table-cell', 'class' => 'targetLocaleSelectCell']);
    442 
    443         return implode('', $parts);
    444     }
    445 
    446270    protected function getQueryParam($paramName, $defaultValue = null)
    447271    {
  • smartling-connector/trunk/inc/config/logger.yml

    r2997020 r3441087  
    22  logger.buffer.limit: 1000
    33  logger.channel: default
    4   logger.filehandler.standard.filename.default: %%plugin.dir%%/logs/logfile
    5   logger.filehandler.standard.filename: %%plugin.dir%%/logs/logfile
     4  logger.filehandler.standard.filename.default: "%%plugin.dir%%/logs/logfile"
     5  logger.filehandler.standard.filename: "%%plugin.dir%%/logs/logfile"
    66  logger.filehandler.standard.loglevel: DEBUG
    77  logger.filehandler.standard.maxfiles: 1
  • smartling-connector/trunk/inc/config/plugin-info.yml

    r2997020 r3441087  
    11parameters:
    22  plugin.name: "wordpress-connector"
    3   plugin.url: "@=service('wp.proxy').plugin_dir_url(constant('SMARTLING_PLUGIN_DIR')~constant('DIRECTORY_SEPARATOR')~'..')"
    43  plugin.version: "auto updated"
    5   plugin.domain: %plugin.name%
     4  plugin.domain: "wordpress-connector"
  • smartling-connector/trunk/inc/config/services.yml

    r3415470 r3441087  
    263263    class: Smartling\Helpers\FileUriHelper
    264264    arguments:
    265       - "@factory.contentIO"
     265      - "@content.helper"
    266266      - "@site.helper"
    267267
     
    301301        - "%plugin.name%"
    302302        - "%plugin.version%"
    303         - "%plugin.url%"
     303        - "@=service('wp.proxy').plugin_dir_url(constant('SMARTLING_PLUGIN_DIR')~constant('DIRECTORY_SEPARATOR')~'..')"
    304304        - "%plugin.domain%"
    305305        - "@manager.settings"
     
    357357    class: Smartling\WP\Controller\ConfigurationProfileFormController
    358358    arguments:
     359      - "@api.wrapper.with.retries"
    359360      - "@multilang.proxy"
    360361      - "@plugin.info"
     
    379380    class: Smartling\WP\Controller\TaxonomyLinksController
    380381    arguments:
     382      - "@api.wrapper.with.retries"
    381383      - "@plugin.info"
    382384      - "@manager.settings"
     
    403405      class: Smartling\WP\Controller\CheckStatusController
    404406      arguments:
     407        - "@api.wrapper.with.retries"
    405408        - "@multilang.proxy"
    406409        - "@plugin.info"
     
    567570    class: Smartling\WP\Controller\TranslationLockController
    568571    arguments:
     572      - "@api.wrapper.with.retries"
    569573      - "@multilang.proxy"
    570574      - "@plugin.info"
  • smartling-connector/trunk/readme.txt

    r3418195 r3441087  
    33Tags: translation, localization, multilingual, internationalization, smartling
    44Requires at least: 5.5
    5 Tested up to: 6.6.2
     5Tested up to: 6.9
    66Requires PHP: 8.0
    7 Stable tag: 5.1.3
     7Stable tag: 5.2.0
    88License: GPLv2 or later
    99
     
    6363
    6464== Changelog ==
     65= 5.2.0 =
     66* Added support for Synced Patterns (Reusable blocks)
     67
     68= 5.1.4 =
     69* Removed caching of profile settings locales
     70* Updated UI
     71* Added support for Elementor video attachments
     72* Added support for Elementor loop carousel query tags
     73* Added support for Elementor widget background overlay image attachments
     74
    6575= 5.1.3 =
    6676* Reworked Elementor save hook to preserve dynamic widget settings
  • smartling-connector/trunk/smartling-connector.php

    r3418195 r3441087  
    1212 * Plugin URI:        https://www.smartling.com/products/automate/integrations/wordpress/
    1313 * Description:       Integrate your WordPress site with Smartling to upload your content and download translations.
    14  * Version:           5.1.3
     14 * Version:           5.2.0
    1515 * Author:            Smartling
    1616 * Author URI:        https://www.smartling.com
Note: See TracChangeset for help on using the changeset viewer.