Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Buildplan/Dockerfile-Jenkins
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:22.04
FROM ubuntu:24.04

ARG ACF_PRO_VERSION=latest
ARG WP_VERSION=latest
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "smartling/wordpress-connector",
"license": "GPL-2.0-or-later",
"version": "3.10.0",
"version": "4.0.0",
"description": "",
"type": "wordpress-plugin",
"repositories": [
Expand All @@ -13,7 +13,7 @@
"require": {
"galbar/jsonpath": "^2.0",
"vsolovei-smartling/retry": "^2.0.1",
"php": ">=8.0",
"php": ">=8.3",
"monolog/monolog": "~1",
"symfony/dependency-injection": "~2.8",
"symfony/expression-language": "~2.8",
Expand Down
2 changes: 1 addition & 1 deletion inc/Smartling/ApiWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ApiWrapper implements ApiWrapperInterface
{
use LoggerSafeTrait;

private const ADDITIONAL_HEADERS = ['X-SL-UseSecondaryDB' => 'true'];
private const array ADDITIONAL_HEADERS = ['X-SL-UseSecondaryDB' => 'true'];

private SettingsManager $settings;
private string $pluginName;
Expand Down
6 changes: 3 additions & 3 deletions inc/Smartling/ApiWrapperInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

interface ApiWrapperInterface
{
public const CREATE_JOB_RESPONSE = [
public const array CREATE_JOB_RESPONSE = [
'translationJobUid' => 'string',
'jobName' => 'string',
'jobNumber' => 'string',
Expand All @@ -38,8 +38,8 @@ interface ApiWrapperInterface
'referenceNumber' => 'string',
'customFields' => [],
];
public const DAILY_BUCKET_JOB_NAME_PREFIX = "Daily Bucket Job";
public const JOB_STATUSES_FOR_DAILY_BUCKET_JOB = [
public const string DAILY_BUCKET_JOB_NAME_PREFIX = "Daily Bucket Job";
public const array JOB_STATUSES_FOR_DAILY_BUCKET_JOB = [
JobStatus::AWAITING_AUTHORIZATION,
JobStatus::IN_PROGRESS,
JobStatus::COMPLETED,
Expand Down
4 changes: 2 additions & 2 deletions inc/Smartling/ApiWrapperWithRetries.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
class ApiWrapperWithRetries implements ApiWrapperInterface {
use LoggerSafeTrait;

public const RETRY_ATTEMPTS = 4;
private const RETRY_WAIT_SECONDS = 1;
public const int RETRY_ATTEMPTS = 4;
private const int RETRY_WAIT_SECONDS = 1;

public function __construct(private ApiWrapperInterface $base, private int $retryWaitSeconds = 1)
{
Expand Down
60 changes: 30 additions & 30 deletions inc/Smartling/Base/ExportedAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface ExportedAPI
* An action that is executed just after DI initialization
* @param ContainerBuilder
*/
public const ACTION_SMARTLING_BEFORE_INITIALIZE_EVENT = 'smartling_before_init';
public const string ACTION_SMARTLING_BEFORE_INITIALIZE_EVENT = 'smartling_before_init';

/**
* Is raised just before encoding to XML
Expand All @@ -39,7 +39,7 @@ interface ExportedAPI
* Only update of values is allowed.
* Will be changed to ArrayAccess implementation.
*/
public const EVENT_SMARTLING_BEFORE_SERIALIZE_CONTENT = 'smartling_before_serialize_content';
public const string EVENT_SMARTLING_BEFORE_SERIALIZE_CONTENT = 'smartling_before_serialize_content';

/**
* Is raised just after decoding from XML
Expand All @@ -54,55 +54,55 @@ interface ExportedAPI
* Only update of values is allowed.
* Will be changed to ArrayAccess implementation.
*/
public const EVENT_SMARTLING_AFTER_DESERIALIZE_CONTENT = 'smartling_after_deserialize_content';
public const string EVENT_SMARTLING_AFTER_DESERIALIZE_CONTENT = 'smartling_after_deserialize_content';

/**
* Action that prepares submission for upload and creates target placeholders
* @param SubmissionEntity
*/
public const ACTION_SMARTLING_PREPARE_SUBMISSION_UPLOAD = 'smartling_prepare_submission_upload';
public const string ACTION_SMARTLING_PREPARE_SUBMISSION_UPLOAD = 'smartling_prepare_submission_upload';

/**
* Action that sends given SubmissionEntity to smartling for translation
* @param UploadQueueItem
*/
public const ACTION_SMARTLING_SEND_FOR_TRANSLATION = 'smartling_send_for_translation';
public const string ACTION_SMARTLING_SEND_FOR_TRANSLATION = 'smartling_send_for_translation';

/**
* Action that clones content of given SubmissionEntity without translation
* @param SubmissionEntity
*/
public const ACTION_SMARTLING_CLONE_CONTENT = 'smartling_clone_content';
public const string ACTION_SMARTLING_CLONE_CONTENT = 'smartling_clone_content';

/**
* Action that downloads translation for given SubmissionEntity
* @param SubmissionEntity
*/
public const ACTION_SMARTLING_DOWNLOAD_TRANSLATION = 'smartling_download_translation';
public const string ACTION_SMARTLING_DOWNLOAD_TRANSLATION = 'smartling_download_translation';

/**
* Action regenerates thumbnails for translation by submission
* @param SubmissionEntity
*/
public const ACTION_SMARTLING_REGENERATE_THUMBNAILS = 'smartling_regenerate_thumbnails';
public const string ACTION_SMARTLING_REGENERATE_THUMBNAILS = 'smartling_regenerate_thumbnails';

/**
* Action for registration a content-type. Only one param is given:
* @param ContainerBuilder
*/
public const ACTION_SMARTLING_REGISTER_CONTENT_TYPE = 'smartling_register_content_type';
public const string ACTION_SMARTLING_REGISTER_CONTENT_TYPE = 'smartling_register_content_type';

/**
* Action for processing terms related to term / post-based content
* @param ProcessRelatedContentParams
*/
public const ACTION_SMARTLING_PROCESSOR_RELATED_CONTENT = 'smartling_processor_related_content';
public const string ACTION_SMARTLING_PROCESSOR_RELATED_CONTENT = 'smartling_processor_related_content';

/**
* Action that syncs attachment by submission
* @param SubmissionEntity
*/
public const ACTION_SMARTLING_SYNC_MEDIA_ATTACHMENT = 'smartling_sync_media_attachment';
public const string ACTION_SMARTLING_SYNC_MEDIA_ATTACHMENT = 'smartling_sync_media_attachment';

/**
* Filter to modify FileURI.
Expand All @@ -113,29 +113,29 @@ interface ExportedAPI
* Filter should return fileUri with length > 0
* otherwise generated fileURI is taken
*/
public const FILTER_SMARTLING_FILE_URI = 'smartling_file_uri';
public const string FILTER_SMARTLING_FILE_URI = 'smartling_file_uri';

/**
* Filter to modify the XML node that is going to be sent to smartling.
* @param TranslationStringFilterParameters
* @return TranslationStringFilterParameters
*/
public const FILTER_SMARTLING_TRANSLATION_STRING = 'smartling_translation_string_before_send';
public const string FILTER_SMARTLING_TRANSLATION_STRING = 'smartling_translation_string_before_send';

/**
* Filter to modify the translated XML node that is received from smartling.
* @param TranslationStringFilterParameters
* @return TranslationStringFilterParameters
*/
public const FILTER_SMARTLING_TRANSLATION_STRING_RECEIVED = 'smartling_translation_string_received';
public const string FILTER_SMARTLING_TRANSLATION_STRING_RECEIVED = 'smartling_translation_string_received';

/**
* Filter to modify meta value on translation
* @param mixed metadata field name
* @param mixed metadata field value
* @param SubmissionEntity
*/
public const FILTER_SMARTLING_METADATA_FIELD_PROCESS = 'smartling_metadata_string_process';
public const string FILTER_SMARTLING_METADATA_FIELD_PROCESS = 'smartling_metadata_string_process';

/**
* Filter to modify meta value on translation
Expand All @@ -144,90 +144,90 @@ interface ExportedAPI
* @param mixed field value
* @param array collected values
*/
public const FILTER_SMARTLING_METADATA_PROCESS_BEFORE_TRANSLATION = 'smartling_metadata_process_before_translation';
public const string FILTER_SMARTLING_METADATA_PROCESS_BEFORE_TRANSLATION = 'smartling_metadata_process_before_translation';

/**
* Filter processes given SubmissionEntity and creates corresponding target entity if it does not exist.
* Filter doesn't work for cloning
* @param SubmissionEntity
* @return SubmissionEntity
*/
public const FILTER_SMARTLING_PREPARE_TARGET_CONTENT = 'smartling_prepare_target_content';
public const string FILTER_SMARTLING_PREPARE_TARGET_CONTENT = 'smartling_prepare_target_content';

/**
* Filter allows to let smartling-connector know about shortcodes that are not registered
* when content is going to be sent for translation
* @param array
* @return array
*/
public const FILTER_SMARTLING_INJECT_SHORTCODE = 'smartling_inject_shortcode';
public const string FILTER_SMARTLING_INJECT_SHORTCODE = 'smartling_inject_shortcode';

/**
* Handler should add an array that defines a post type.
* @param array
* @return array
*/
public const FILTER_SMARTLING_REGISTER_CUSTOM_POST_TYPE = 'smartling_register_custom_type';
public const string FILTER_SMARTLING_REGISTER_CUSTOM_POST_TYPE = 'smartling_register_custom_type';

/**
* Handler should add an array that defines a taxonomy type.
* @param array
* @return array
*/
public const FILTER_SMARTLING_REGISTER_CUSTOM_TAXONOMY = 'smartling_register_custom_taxonomy';
public const string FILTER_SMARTLING_REGISTER_CUSTOM_TAXONOMY = 'smartling_register_custom_taxonomy';

/**
* Handler should add an array that defines a filter.
* @param array
* @return array
*/
public const FILTER_SMARTLING_REGISTER_FIELD_FILTER = 'smartling_register_field_filter';
public const string FILTER_SMARTLING_REGISTER_FIELD_FILTER = 'smartling_register_field_filter';

/**
* Filter fires for notifications
* @param NotificationParameters
*/
public const ACTION_SMARTLING_PUSH_LIVE_NOTIFICATION = 'smartling_push_notification';
public const string ACTION_SMARTLING_PUSH_LIVE_NOTIFICATION = 'smartling_push_notification';

/**
* Filter prepares contentId to later use with push live notification (Firebase specific)
* @param SubmissionEntity
*/
public const ACTION_SMARTLING_PLACE_RECORD_ID = 'smartling_place_record_id';
public const string ACTION_SMARTLING_PLACE_RECORD_ID = 'smartling_place_record_id';

/**
* @param SubmissionEntity
*/
public const ACTION_AFTER_TARGET_CONTENT_WRITTEN = 'smartling_action_after_target_content_written';
public const string ACTION_AFTER_TARGET_CONTENT_WRITTEN = 'smartling_action_after_target_content_written';

public const ACTION_AFTER_TARGET_METADATA_WRITTEN = 'smartling_action_after_target_metadata_written';
public const string ACTION_AFTER_TARGET_METADATA_WRITTEN = 'smartling_action_after_target_metadata_written';

/**
* @param SubmissionEntity
*/
public const ACTION_AFTER_TRANSLATION_APPLIED = 'smartling_action_after_translation_applied';
public const string ACTION_AFTER_TRANSLATION_APPLIED = 'smartling_action_after_translation_applied';

/**
* @param array content
* @param SubmissionEntity
* @return array content
*/
public const FILTER_BEFORE_CLONE_CONTENT_WRITTEN = 'smartling_filter_before_clone_content_written';
public const string FILTER_BEFORE_CLONE_CONTENT_WRITTEN = 'smartling_filter_before_clone_content_written';
/**
* @param array translation
* @param array lockedData
* @param SubmissionEntity
* @return array translation
*/
public const FILTER_BEFORE_TRANSLATION_APPLIED = 'smartling_filter_before_translation_applied';
public const string FILTER_BEFORE_TRANSLATION_APPLIED = 'smartling_filter_before_translation_applied';

/**
* @param array items
*/
public const FILTER_BULK_SUBMIT_PREPARE_ITEMS = 'smartling_filter_bulk_submit_prepare_items';
public const string FILTER_BULK_SUBMIT_PREPARE_ITEMS = 'smartling_filter_bulk_submit_prepare_items';

/**
* @param ConfigurationProfileEntity[]
*/
public const FILTER_ACTIVE_PROFILES = 'smartling_filter_active_profiles';
public const string FILTER_ACTIVE_PROFILES = 'smartling_filter_active_profiles';
}
Loading