Skip to content

Commit 16acb29

Browse files
Merge pull request #535 from Smartling/WP-902-block-related-items
add acf image_aspect_ratio_crop as related item (WP-902)
2 parents a81a559 + d4078fa commit 16acb29

10 files changed

Lines changed: 304 additions & 279 deletions

File tree

changelog.txt

Lines changed: 260 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,263 @@
1+
= 2.16.7 =
2+
* Added Beaver Builder 2.6 to supported versions
3+
4+
= 2.16.6 =
5+
* Changed handling of related items: plugin will now honor the changes in registered custom post types and taxonomies by ExportedApi::FILTER_SMARTLING_REGISTER_CUSTOM_POST_TYPE and ExportedApi::FILTER_SMARTLING_REGISTER_CUSTOM_TAXONOMY when sending related items for translation
6+
7+
= 2.16.5 =
8+
* Tested compatibility with WP 6.1
9+
10+
= 2.16.4 =
11+
* Changed related assets handling. The plugin will treat unknown post types as the default 'attachment' post type when working with related content
12+
13+
= 2.16.3 =
14+
* Fixed locked serialized metadata fields becoming corrupt after translation is applied
15+
16+
= 2.16.2 =
17+
* Improved logging when discovering related assets
18+
* PHP 7.4 will stop receiving security updates on 28th of November! Refactored code to remove known E_DEPRECATED notices, next major release expected to require at least PHP 8.1
19+
20+
= 2.16.1 =
21+
* Fixed Gutenberg block rules with JSON paths in nested Gutenberg blocks
22+
23+
= 2.16.0 =
24+
* Removed ACF and manual relation handling obsolete expert settings. The behaviours controlled by these options have been reverted to the default values
25+
26+
= 2.15.1 =
27+
* Added options to prevent plugin from escaping post content and metadata before saving. This is useful if there are other plugins that hook on the "post content" or "save metadata" and add extra escaping slashes to them
28+
29+
= 2.15.0 =
30+
* The plugin will no longer automatically fail submissions based on content type not registered in WordPress
31+
32+
= 2.14.9 =
33+
* Added support for Elementor global widgets translation using the related items translation interface
34+
35+
= 2.14.8 =
36+
* Improved supported for nested ACF in Gutenberg block fields (e.g. repeater blocks)
37+
38+
= 2.14.7 =
39+
* Added debugging for related content replacer
40+
* Added diagnostic message for WordPress not in multisite mode
41+
* Fixed critical error with locking when metadata was null
42+
* Improved detection of active AIOSEO pack, Beaver Builder and Elementor plugins when running with limited capabilities
43+
44+
= 2.14.6 =
45+
* Added Beaver Builder plugin support
46+
47+
= 2.14.5 =
48+
* Fix scoping to avoid conflict with Symfony\Polyfill\Intl\Idn
49+
50+
= 2.14.4 =
51+
* Fixed post content not being sent for translation when Elementor is active, but not used for a specific post
52+
53+
= 2.14.3 =
54+
* Fixed errors when saving metadata by improving the escaping process
55+
56+
= 2.14.2 =
57+
* Fixed issue where content without Elementor data was unable to be sent for translation
58+
59+
= 2.14.1 =
60+
* Added sending related attachments for translation along with Elementor plugin content
61+
62+
= 2.14.0 =
63+
* Added Elementor plugin support
64+
65+
= 2.13.6 =
66+
* Improved AIOSEO pack plugin translation for fields that contain tags
67+
68+
= 2.13.5 =
69+
* Fixed upload queue length appearing stuck
70+
71+
= 2.13.4 =
72+
* Added actions to alter translated content or do other actions just before translation gets saved
73+
* Fixed block level locking for nested Gutenberg blocks
74+
75+
= 2.13.3 =
76+
* Added support for sending related items from within ACF Gutenberg blocks
77+
78+
= 2.13.2 =
79+
* Fixed AIOSEO pack plugin translation using wrong fieldset when translating taxonomies
80+
81+
= 2.13.1 =
82+
* Added display of error messages when widget uploads fail
83+
* Fixed check/uncheck all links in widgets affecting all Smartling checkboxes on a page
84+
* Fixed source title detection for taxonomy submissions
85+
86+
= 2.13.0 =
87+
* Added support for AIOSEO pack
88+
* Fixed shortcodes with no attributes preventing content uploads
89+
* Fixed widget uploads broken when an audit log record could not be created
90+
91+
= 2.12.9 =
92+
* Fixed broken content in ACF fields after translation
93+
94+
= 2.12.8 =
95+
* Fixed cloning affecting fully locked submissions
96+
97+
= 2.12.7 =
98+
* Fixed terms meta values stored as array instead of scalar values
99+
100+
= 2.12.6 =
101+
* Added purge upload queue action (sets all NEW submissions to CANCELLED)
102+
* Fixed smartlingLockId attribute being sent for translation
103+
104+
= 2.12.5 =
105+
* Fixed taxonomy page widget not downloading content
106+
107+
= 2.12.4 =
108+
* Fixed parent page not being sent for translation when sending content one or two levels deep
109+
110+
= 2.12.3 =
111+
* Added support for nested attributes via JSON path in fine-tuning
112+
113+
= 2.12.2 =
114+
* Fixed related content not being sent for translation from the post based content UI
115+
116+
= 2.12.1 =
117+
* Fixed issue where ACF blocks couldn't be decoded and were missing in translated submissions
118+
119+
= 2.12.0 =
120+
* Fixed regression where media duplication occured and/or related item ids were not changed when cloning items. This release majorly changes the handling of related items while cloning, from this release onwards only the items directly sent for cloning (including cloning one or two levels deep) should be cloned, without any related submissions.
121+
122+
= 2.11.5 =
123+
* Cloned submissions are excluded from status check background job. This change fixes cloned submissions changing status from completed to failed after time passes
124+
125+
= 2.11.4 =
126+
* Fixed upload widget not uploading content
127+
128+
= 2.11.3 =
129+
* Fixed content not sent for translation when no related content is present
130+
131+
= 2.11.2 =
132+
* Fixed relations to second level content not changed in target blog when cloning two levels deep
133+
134+
= 2.11.1 =
135+
* Fixed media library attachments duplication when cloning
136+
137+
= 2.11.0 =
138+
* Added test run. Test run submits posts and pages to a new blog for "pseudo" translation. This should help quickly check compatibility between your content and the plugin.
139+
140+
= 2.10.0 =
141+
* Changed media attachment rules to Gutenberg block rules. It is now possible to copy a block attribute value instead of translating it, or exclude it entirely. This is set up in the Fine-Tuning section.
142+
143+
= 2.9.0 =
144+
* Added retries for communication with external locking service
145+
146+
= 2.8.4 =
147+
* Fixed submissions not being deleted on media attachments deletion. It is now easier to resubmit missing media attachments when translating related content.
148+
* Added display of status messages when running cron jobs manually
149+
150+
= 2.8.3 =
151+
* Fixed reference to image in core/image Gutenberg block's inner HTML class on translation to prevent WordPress notice at translated post edit page
152+
* Changed serialization to prevent php built-in serialize function vulnerabilities
153+
154+
= 2.8.2 =
155+
* Added escaping for job names in Translation Progress screen
156+
* Submissions get deleted when content they reference is deleted. For example, this will allow easy resubmission of related content that was deleted on the target site
157+
158+
= 2.8.1 =
159+
* Added new action in Translation Progress screen to check status and fail submissions for which no corresponding Smartling locale exists
160+
* Fixed nested Gutenberg blocks losing their attributes after translation
161+
* Disabled loading of external entities in libxml
162+
163+
= 2.8.0 =
164+
* Scoped dependencies to prevent conflicts with other installed versions of GuzzleHttp and Symfony libraries
165+
* Fixed content not being added to upload from post widget
166+
167+
= 2.7.1 =
168+
* Fixed relations not changed in target blog when cloning
169+
170+
= 2.7.0 =
171+
* Switched from database to external service locking for cron jobs. It avoids the issue when hosting doesn't allow SQL `SELECT ... FOR UPDATE`
172+
173+
= 2.6.0 =
174+
* Added two levels deep cloning/translation to post widget
175+
* Fixed menu items not being submitted for translation when using bulk submit to upload menus
176+
177+
= 2.5.3 =
178+
* Fixed downloads failing if translated content has html anchors
179+
180+
= 2.5.2 =
181+
* Fixed block locking UI not visible when a blog is both a source and a target for translation
182+
* Fixed overly strict language mappings validation in profile configuration
183+
184+
= 2.5.1 =
185+
* Fixed WordPress fatal error on plugin activation
186+
187+
= 2.5.0 =
188+
* Added support for MultilingualPress3. On creating submissions Smartling connector will also add content relations for MLP3.
189+
190+
= 2.4.14 =
191+
* Visual changes in the locking sidebar
192+
193+
= 2.4.13 =
194+
* Fixed misconfiguration
195+
196+
= 2.4.12 =
197+
* Gutenberg block level locking ids now created on every visual editor operation instead of on saving content
198+
* Added replacing of relative links in A tags to other post based content
199+
200+
= 2.4.11 =
201+
* Fixed Gutenberg block level locking frontend not working with WordPress 5.7 and above
202+
203+
= 2.4.10 =
204+
* Added validation to language mappings in profile configuration to prevent undefined behaviour when a single Smartling locale was mapped to multiple target blogs
205+
206+
= 2.4.9 =
207+
* Added expert setting to disable automatic generation of Gutenberg blocks locking ids (defaults to OFF)
208+
* Fixed critical wordpress error when cloning from Bulk Submit page
209+
210+
= 2.4.8 =
211+
* Add locking for Gutenberg blocks in the Gutenberg visual editor based on block ids. Block ids will be generated randomly for all Gutenberg blocks on saving content. After new content is sent for translation and downloaded, a new sidebar block "Smartling lock" will become available for blocks with generated ids. Previous location based method for locking is now obsolete, please re-lock the required blocks in the visual editor, as the support for location-based locking will be disabled in a future release.
212+
213+
= 2.4.7 =
214+
* Added job name search to search field in `Translation Progress`
215+
216+
= 2.4.6 =
217+
* Fixed delivery of Gutenberg blocks where attributes have nested objects. Before appropriate escaping was done only for attributes on the top level only
218+
219+
= 2.4.5 =
220+
* Improve job link in translations progress
221+
222+
= 2.4.4 =
223+
* Added escaping to HTML output to prevent xss injections
224+
225+
= 2.4.3 =
226+
* Fixed an issue when job links were not displayed on `Translation Progress` after submitting content for translation for the first time
227+
228+
= 2.4.2 =
229+
* Fixed an issue where image attachments in ACF blocks do not get uploaded
230+
231+
= 2.4.1 =
232+
* Fixed an issue with downloads when the post has links to images that are not attachments
233+
234+
= 2.4.0 =
235+
* Added ability to lock inner Gutenberg blocks
236+
237+
= 2.3.1 =
238+
* Fixed menu translation when menu item is a link to related content
239+
240+
= 2.3.0 =
241+
* Added ability to use all registered post types for references in Gutenberg blocks
242+
* Fixed menu translation when menu items consisted of post types or taxonomies
243+
244+
= 2.2.1 =
245+
* Fixed critical wordpress error on new profile creation
246+
247+
= 2.2.0 =
248+
* Added more publish options for delivering translated posts. Now you can choose what post status to set after delivering: don't change existing status; set to `draft`; set to `published`
249+
250+
= 2.1.0 =
251+
* Minimum required PHP version is now 7.4!
252+
* Added a link to the most recent job for submissions on Translation Progress screen
253+
254+
= 2.0.1 =
255+
* Fixed extra slashes being added when using fine tuning forms
256+
257+
= 2.0.0 =
258+
* Minimum required PHP version is now 7.2! The next plugin release will require PHP 7.4.
259+
* Added ability to lock translation for some of the Gutenberg blocks in post content. The lock will preserve translated blocks, unless there are changes to the parents' post structure of blocks, such as blocks reordering, or adding new blocks.
260+
1261
= 1.15.7 =
2262
* Added media attachments rules user interface in Fine Tune section. It allows to specify paths to media attachments inside Gutenberg blocks. The plugin will link the attachment ids for known paths between source and target sites
3263

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "smartling/wordpress-connector",
33
"license": "GPL-2.0-or-later",
4-
"version": "3.9.3",
4+
"version": "3.9.4",
55
"description": "",
66
"type": "wordpress-plugin",
77
"repositories": [

inc/Smartling/Extensions/Acf/AcfDynamicSupport.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ public function getReferencedTypeByKey($key): string
499499

500500
switch ($type) {
501501
case 'image':
502+
case 'image_aspect_ratio_crop':
502503
case 'file':
503504
case 'gallery':
504505
return self::REFERENCED_TYPE_MEDIA;

inc/Smartling/Helpers/RelativeLinkedAttachmentCoreHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,8 @@ private function getReplacerForAcfGutenbergBlock(string $block): PairReplacerHel
321321
}
322322
}
323323
}
324-
} catch (\Exception) {
325-
$this->getLogger()->debug("Failed to decode block $block, skipping id replacements");
324+
} catch (\Exception $e) {
325+
$this->getLogger()->debug("Failed to decode block $block, skipping id replacements: " . $e->getMessage());
326326
}
327327
return $result;
328328
}

inc/Smartling/Tuner/CustomizationManagerAbstract.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ abstract class CustomizationManagerAbstract implements ManagerInterface, \Iterat
1111

1212
protected function generateId(int $length = 12): string
1313
{
14-
return substr(md5(microtime(true)), 0, $length);
14+
if ($length > 23) {
15+
throw new \RuntimeException("Length should be less than 24 characters");
16+
}
17+
18+
return substr(uniqid("", true), 0, $length);
1519
}
1620

1721
public function __construct($storageKey)

inc/config/media-attachment-rules.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ parameters:
44
- "@image.id.related.content"
55
- "@media-text.media-id.related.attachment"
66
- "@smartling.lock.id.copy"
7+
- "@acf.name"
8+
- "@wordpress.editor.mode"
79

810
services:
911
image.id.related.attachment:
@@ -33,3 +35,17 @@ services:
3335
- ".+"
3436
- "smartlingLockId"
3537
- "copy"
38+
39+
acf.name:
40+
class: Smartling\Helpers\GutenbergReplacementRule
41+
arguments:
42+
- "acf/.+"
43+
- "name"
44+
- "copy"
45+
46+
wordpress.editor.mode:
47+
class: Smartling\Helpers\GutenbergReplacementRule
48+
arguments:
49+
- "acf/.+"
50+
- "mode"
51+
- "copy"

0 commit comments

Comments
 (0)