Skip to content

Commit c9ab127

Browse files
committed
Release 1.4.0
* Add "Copy once" option for custom fields. * Add warning for nested serialization
1 parent 30909f6 commit c9ab127

5 files changed

Lines changed: 32 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 1.4.0
2+
3+
## Improvements
4+
5+
* Add "Copy once" option for custom fields.
6+
17
# 1.3.1
28

39
## Bugfix

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Multilingual Tools
22

3-
![Latest Stable Version](https://img.shields.io/badge/stable-1.3.1-green.svg?style=flat-squar)
3+
![Latest Stable Version](https://img.shields.io/badge/stable-1.4.0-green.svg?style=flat-squar)
44
![License](https://img.shields.io/badge/license-GPLv2-red.svg?style=flat-squar)
55

66

inc/wpml-compatibility-test-tools.functions.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,13 @@ function wpml_ctt_options_list_ajax() {
109109
$data = ["{$option}" => 'No way Jose!'];
110110
break;
111111
}
112+
112113
// Dealing with bad nested serialization.
113-
$data[$option] = maybe_unserialize( get_option( $option ) );
114+
if ( ! is_serialized( get_option( $option ) ) ) {
115+
$data[ $option ] = get_option( $option );
116+
} else {
117+
$data[ $option ] = '*** WARNING: NESTED SERIALIZATION DETECTED, WILL NOT WORK WITH WPML! ***';
118+
}
114119
}
115120

116121
echo json_encode( $data );
@@ -290,6 +295,7 @@ function wpml_ctt_options_list() {
290295
function wpml_ctt_validate_radio( $value ) {
291296
$allowed = array(
292297
'translate',
298+
'copy-once',
293299
'ignore',
294300
'copy',
295301
'file',

menus/settings/generator.php

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@
107107
<?php _e( "Don't translate", 'wpml-compatibility-test-tools' )?>
108108
</th>
109109
<th>
110-
<?php _e( "Copy from original to translation", 'wpml-compatibility-test-tools' )?>
110+
<?php _e( "Copy", 'wpml-compatibility-test-tools' )?>
111+
</th>
112+
<th>
113+
<?php _e( "Copy once", 'wpml-compatibility-test-tools' )?>
111114
</th>
112115
<th>
113116
<?php _e( "Translate", 'wpml-compatibility-test-tools' )?>
@@ -118,6 +121,7 @@
118121
<th><a id="cf_0" class="toggle" href="#">Toggle all</a></th>
119122
<th><a id="cf_1" class="toggle" href="#">Toggle all</a></th>
120123
<th><a id="cf_2" class="toggle" href="#">Toggle all</a></th>
124+
<th><a id="cf_3" class="toggle" href="#">Toggle all</a></th>
121125
</tr>
122126
</thead>
123127
<tbody class="wctt">
@@ -131,11 +135,14 @@
131135
<td title="<?php _e("Don't translate", 'wpml-compatibility-test-tools')?>">
132136
<input id="cf_0" type="radio" name="cf[<?php echo $custom_field->meta_key ?>]" value="ignore" <?php checked( ! isset( $_POST['_cf'][$custom_field->meta_key] ) || $_POST['cf'][$custom_field->meta_key] == 'ignore' ) ?>/>
133137
</td>
134-
<td title="<?php _e("Copy from original to translation", 'wpml-compatibility-test-tools')?>">
138+
<td title="<?php _e("Copy", 'wpml-compatibility-test-tools')?>">
135139
<input id="cf_1" type="radio" name="cf[<?php echo $custom_field->meta_key ?>]" value="copy" <?php checked( isset( $_POST['_cf'][$custom_field->meta_key] ) && $_POST['cf'][$custom_field->meta_key] == 'copy' ) ?>/>
136140
</td>
141+
<td title="<?php _e("Copy once", 'wpml-compatibility-test-tools')?>">
142+
<input id="cf_2" type="radio" name="cf[<?php echo $custom_field->meta_key ?>]" value="copy-once" <?php checked( isset( $_POST['_cf'][$custom_field->meta_key] ) && $_POST['cf'][$custom_field->meta_key] == 'copy-once' ) ?>/>
143+
</td>
137144
<td title="<?php _e("Translate", 'wpml-compatibility-test-tools')?>">
138-
<input id="cf_2" type="radio" name="cf[<?php echo $custom_field->meta_key ?>]" value="translate" <?php checked( isset( $_POST['_cf'][$custom_field->meta_key] ) && $_POST['cf'][$custom_field->meta_key] == 'translate' ) ?>/>
145+
<input id="cf_3" type="radio" name="cf[<?php echo $custom_field->meta_key ?>]" value="translate" <?php checked( isset( $_POST['_cf'][$custom_field->meta_key] ) && $_POST['cf'][$custom_field->meta_key] == 'translate' ) ?>/>
139146
</td>
140147
</tr>
141148
<?php endforeach; ?>
@@ -146,6 +153,7 @@
146153
<th><a id="cf_0" class="toggle" href="#">Toggle all</a></th>
147154
<th><a id="cf_1" class="toggle" href="#">Toggle all</a></th>
148155
<th><a id="cf_2" class="toggle" href="#">Toggle all</a></th>
156+
<th><a id="cf_3" class="toggle" href="#">Toggle all</a></th>
149157
</tr>
150158
<tr>
151159
<th>
@@ -155,7 +163,10 @@
155163
<?php _e( "Don't translate", 'wpml-compatibility-test-tools' )?>
156164
</th>
157165
<th>
158-
<?php _e( "Copy from original to translation", 'wpml-compatibility-test-tools' )?>
166+
<?php _e( "Copy", 'wpml-compatibility-test-tools' )?>
167+
</th>
168+
<th>
169+
<?php _e( "Copy once", 'wpml-compatibility-test-tools' )?>
159170
</th>
160171
<th>
161172
<?php _e( "Translate", 'wpml-compatibility-test-tools' )?>
@@ -165,7 +176,7 @@
165176
<?php else : ?>
166177
<thead>
167178
<tr>
168-
<th colspan="3"><?php _e( 'Custom fields', 'wpml-compatibility-test-tools' ); ?></th>
179+
<th colspan="5"><?php _e( 'Custom fields', 'wpml-compatibility-test-tools' ); ?></th>
169180
</tr>
170181
</thead>
171182
<tbody class="wctt">

multilingual-tools.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
Description: Set of tools to test themes and plugins multilingual compatibility.
66
Author: OnTheGoSystems
77
Author URI: http://wpml.org
8-
Version: 1.3.1
8+
Version: 1.4.0
99
*/
1010

11-
define( 'WPML_CTT_VERSION' , '1.3.1' );
11+
define( 'WPML_CTT_VERSION' , '1.4.0' );
1212
define( 'WPML_CTT_PATH' , dirname( __FILE__ ) );
1313
define( 'WPML_CTT_ABS_PATH' , plugin_dir_path( __FILE__ ) );
1414
define( 'WPML_CTT_FOLDER' , basename( WPML_CTT_PATH ) );

0 commit comments

Comments
 (0)