TranslatePress – Translate Multilingual sites - Version 1.6.7

Version Description

  • Improved the database update queries
  • Fixed an error in mysql regarding post_parent_id meta insert if no id was found
  • Added Rank Math support
  • Added SEO Press support
  • We now remove the trp-post-container before displaying the site
  • Removed Get add-on from add-ons page
  • Refactor support for SEO sitemaps so we don't add the language to their URL's
Download this release

Release Info

Developer madalin.ungureanu
Plugin Icon 128x128 TranslatePress – Translate Multilingual sites
Version 1.6.7
Comparing to
See all releases

Code changes from version 1.6.6 to 1.6.7

class-translate-press.php CHANGED
@@ -53,7 +53,7 @@ class TRP_Translate_Press{
53
  define( 'TRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
54
  define( 'TRP_PLUGIN_BASE', plugin_basename( __DIR__ . '/index.php' ) );
55
  define( 'TRP_PLUGIN_SLUG', 'translatepress-multilingual' );
56
- define( 'TRP_PLUGIN_VERSION', '1.6.6' );
57
 
58
  wp_cache_add_non_persistent_groups(array('trp'));
59
 
@@ -202,6 +202,7 @@ class TRP_Translate_Press{
202
  $this->loader->add_action( 'admin_menu', $this->error_manager, 'register_submenu_errors_page', 10 );
203
  $this->loader->add_action( 'trp_dismiss_notification', $this->error_manager, 'clear_notification_from_db', 10, 2 );
204
  $this->loader->add_filter( 'trp_machine_translation_sanitize_settings', $this->error_manager, 'clear_disable_machine_translation_notification_from_db', 10, 1 );
 
205
  $this->loader->add_filter( 'trp_error_manager_page_output', $this->error_manager, 'output_db_errors', 10, 1 );
206
 
207
  $this->loader->add_action( 'wp_ajax_nopriv_trp_get_translations_regular', $this->editor_api_regular_strings, 'get_translations' );
53
  define( 'TRP_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
54
  define( 'TRP_PLUGIN_BASE', plugin_basename( __DIR__ . '/index.php' ) );
55
  define( 'TRP_PLUGIN_SLUG', 'translatepress-multilingual' );
56
+ define( 'TRP_PLUGIN_VERSION', '1.6.7' );
57
 
58
  wp_cache_add_non_persistent_groups(array('trp'));
59
 
202
  $this->loader->add_action( 'admin_menu', $this->error_manager, 'register_submenu_errors_page', 10 );
203
  $this->loader->add_action( 'trp_dismiss_notification', $this->error_manager, 'clear_notification_from_db', 10, 2 );
204
  $this->loader->add_filter( 'trp_machine_translation_sanitize_settings', $this->error_manager, 'clear_disable_machine_translation_notification_from_db', 10, 1 );
205
+ $this->loader->add_filter( 'trp_error_manager_page_output', $this->error_manager, 'show_instructions_on_how_to_fix', 7, 1 );
206
  $this->loader->add_filter( 'trp_error_manager_page_output', $this->error_manager, 'output_db_errors', 10, 1 );
207
 
208
  $this->loader->add_action( 'wp_ajax_nopriv_trp_get_translations_regular', $this->editor_api_regular_strings, 'get_translations' );
includes/class-error-manager.php CHANGED
@@ -126,7 +126,7 @@ class TRP_Error_Manager{
126
 
127
  $message = '<p style="padding-right:30px;">' . $logged_notification['message'] . '</p>';
128
  //make sure to use the trp_dismiss_admin_notification arg
129
- $message .= '<a href="' . add_query_arg(array('trp_dismiss_admin_notification' => $notification_id)) . '" type="button" class="notice-dismiss" style="text-decoration: none;z-index:100;"><span class="screen-reader-text">' . __('Dismiss this notice.', 'translatepress-multilingual') . '</span></a>';
130
 
131
  $notifications->add_notification($notification_id, $message, 'trp-notice trp-narrow notice error is-dismissible', true, array('translate-press'), true);
132
  }
@@ -144,11 +144,15 @@ class TRP_Error_Manager{
144
  public function output_db_errors( $html_content ){
145
  $option = get_option( 'trp_db_errors', false );
146
  if ( $option !== false && isset($option['errors']) ) {
 
 
147
  $html_content .= '<table>';
 
148
  foreach ($option['errors'] as $count => $error) {
149
  $count = ( is_int( $count) ) ? $count + 1 : $count;
150
  $html_content .= '<tr><td>' . esc_html($count) . '</td></tr>';
151
  foreach( $error as $key => $error_detail ){
 
152
  $html_content .= '<tr><td><strong>' . esc_html($key ) . '</strong></td>' . '<td>' .esc_html( $error_detail ) . '</td></tr>';
153
  }
154
 
@@ -157,4 +161,37 @@ class TRP_Error_Manager{
157
  }
158
  return $html_content;
159
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  }
126
 
127
  $message = '<p style="padding-right:30px;">' . $logged_notification['message'] . '</p>';
128
  //make sure to use the trp_dismiss_admin_notification arg
129
+ $message .= '<a href="' . add_query_arg(array('trp_dismiss_admin_notification' => $notification_id)) . '" type="button" class="notice-dismiss" style="text-decoration: none;z-index:100;"><span class="screen-reader-text">' . esc_html__('Dismiss this notice.', 'translatepress-multilingual') . '</span></a>';
130
 
131
  $notifications->add_notification($notification_id, $message, 'trp-notice trp-narrow notice error is-dismissible', true, array('translate-press'), true);
132
  }
144
  public function output_db_errors( $html_content ){
145
  $option = get_option( 'trp_db_errors', false );
146
  if ( $option !== false && isset($option['errors']) ) {
147
+ $html_content .= '<h2>' . esc_html__('Logged errors', 'translatepress-multilingual') . '</h2>';
148
+ $html_content .= '<p>' . esc_html__('These are the most recent 5 errors logged by TranslatePress:', 'translatepress-multilingual' ) . '</p>';
149
  $html_content .= '<table>';
150
+ $option['errors'] = array_reverse($option['errors']);
151
  foreach ($option['errors'] as $count => $error) {
152
  $count = ( is_int( $count) ) ? $count + 1 : $count;
153
  $html_content .= '<tr><td>' . esc_html($count) . '</td></tr>';
154
  foreach( $error as $key => $error_detail ){
155
+ $error_detail = ($error_detail === true ) ? esc_html__('Yes', 'translatepress-multilingual') : $error_detail;
156
  $html_content .= '<tr><td><strong>' . esc_html($key ) . '</strong></td>' . '<td>' .esc_html( $error_detail ) . '</td></tr>';
157
  }
158
 
161
  }
162
  return $html_content;
163
  }
164
+
165
+ /**
166
+ * Hooked to trp_error_manager_page_output
167
+ *
168
+ * @param $html_content
169
+ * @return string
170
+ */
171
+ public function show_instructions_on_how_to_fix( $html_content ){
172
+ $html_content .= '<h2>' . esc_html__('Why are these errors occuring', 'translatepress-multilingual') . '</h2>';
173
+ $html_content .= '<p>' . esc_html__('If TranslatePress detects something wrong when executing queries on your database, it may disable the Automatic Translation feature in order to avoid any extra charging by Google/DeepL. Automatic Translation needs to be manually turned on, after you solve the issues.', 'translatepress-multilingual') . '</p>';
174
+ $html_content .= '<p>' . esc_html__('The SQL errors detected can occur for various reasons including missing tables, missing permissions for the SQL user to create tables or perform other operations, problems after site migration or changes to SQL server configuration.', 'translatepress-multilingual') . '</p>';
175
+
176
+ $html_content .= '<h2>' . esc_html__('What you can do in this situation', 'translatepress-multilingual') . '</h2>';
177
+
178
+ $html_content .= '<h4>' . esc_html__('Plan A.', 'translatepress-multilingual') . '</h4>';
179
+ $html_content .= '<p>' . esc_html__('Go to Settings -> TranslatePress -> General tab and Save Settings. This will regenerate the tables using your current SQL settings. Check if no more errors occur while browsing your website in a translated language. Look at the timestamps of the errors to make sure you are not seeing the old errors. Only the most recent 5 errors are displayed.', 'translatepress-multilingual') . '</p>';
180
+
181
+ $html_content .= '<h4>' . esc_html__('Plan B.', 'translatepress-multilingual') . '</h4>';
182
+ $html_content .= '<p>' . esc_html__('If your problem isn\'t solved, try the following steps:', 'translatepress-multilingual') . '</p>';
183
+ $html_content .= '<ol>';
184
+ $html_content .= '<li>' . esc_html__('Create a backup of your database', 'translatepress-multilingual') . '</li>';
185
+ $html_content .= '<li>' . esc_html__('Create a copy of each translation table where you encounter errors. You can copy the table within the same database (trp_dictionary_en_us_es_es_COPY for example) -- perform this step only if you want to keep the current translations', 'translatepress-multilingual') . '</li>';
186
+ $html_content .= '<li>' . esc_html__('Remove the trouble tables by executing the DROP function on them', 'translatepress-multilingual') . '</li>';
187
+ $html_content .= '<li>' . esc_html__('Go to Settings -> TranslatePress -> General tab and Save Settings. This will regenerate the tables using your current SQL server.', 'translatepress-multilingual') . '</li>';
188
+ $html_content .= '<li>' . esc_html__('Copy the relevant content from the duplicated tables (trp_dictionary_en_us_es_es_COPY for example) in the newly generated table (trp_dictionary_en_us_es_es) -- perform this step only if you want to keep the current translations', 'translatepress-multilingual') . '</li>';
189
+ $html_content .= '<li>' . esc_html__('Test it to see if everything is working. If something went wrong, you can restore the backup that you\'ve made at the first step. Check if no more errors occur while browsing your website in a translated language. Look at the timestamps of the errors to make sure you are not seeing the old errors. Only the most recent 5 errors are displayed.', 'translatepress-multilingual') . '</li>';
190
+ $html_content .= '</ol>';
191
+
192
+ $html_content .= '<h4>' . esc_html__('Plan C.', 'translatepress-multilingual') . '</h4>';
193
+ $html_content .= '<p>' . esc_html__('If your problem still isn\'t solved, try asking your hosting about your errors. The most common issue is missing permissions for the SQL user, such as the Create Tables permission.', 'translatepress-multilingual') . '</p>';
194
+
195
+ return $html_content;
196
+ }
197
  }
includes/class-query.php CHANGED
@@ -333,7 +333,7 @@ class TRP_Query{
333
  /*
334
  * select all string that are in the dictionary table and are not in the original tables and insert them in the original
335
  */
336
- $insert_records = $this->db->query( $this->db->prepare( "INSERT INTO `$originals_table` (original) SELECT DISTINCT ( BINARY t1.original ) FROM `$table_name` t1 LEFT JOIN `$originals_table` t2 on t2.original = BINARY t1.original WHERE t2.original IS NULL AND t1.id > %d AND t1.id <= %d", $inferior_limit, ($inferior_limit + $batch_size) ) );
337
 
338
  if (!empty($this->db->last_error)) {
339
  $this->error_manager->record_error(array('last_error_insert_original_strings' => $this->db->last_error));
@@ -455,27 +455,34 @@ class TRP_Query{
455
 
456
  if( !empty($strings_grouped) ){
457
  foreach ( $strings_grouped as $post_id => $original_ids ){
458
- /*
459
- * - select all id's that are in the meta already
460
- * - in php compare our $original_ids with the result and leave just the ones that are not in the db
461
- * - insert all the remaining ones
462
- */
463
-
464
- $existing_entries = $this->db->get_results( $this->db->prepare(
465
- "SELECT original_id FROM ".$this->get_table_name_for_original_meta()." WHERE meta_key = '". $this->get_meta_key_for_post_parent_id() ."' AND meta_value = '%1d' AND original_id IN ( %2s )",
466
- $post_id, implode( ', ', $original_ids )
467
- ), OBJECT_K );
468
-
469
- $existing_entries = array_keys( $existing_entries );
470
- $insert_this = array_unique( array_diff( $original_ids, $existing_entries ) );
471
-
472
- if( !empty( $insert_this ) ){
473
- $insert_values = array();
474
- foreach ( $insert_this as $missing_entry ) {
475
- $insert_values[] = $this->db->prepare( "( %d, %s, %d )", $missing_entry, $this->get_meta_key_for_post_parent_id(), $post_id );
 
 
 
 
 
 
 
 
476
  }
477
 
478
- $this->db->query( "INSERT INTO ".$this->get_table_name_for_original_meta()." ( original_id, meta_key, meta_value ) VALUES ". implode( ', ', $insert_values ) );
479
  }
480
 
481
  }
@@ -844,7 +851,7 @@ class TRP_Query{
844
  $results_ids = array();
845
  if( !empty( $results ) && !empty( $original_strings ) ){
846
  foreach( $original_strings as $string ){
847
- if( !empty( $results[$string] ) )
848
  $results_ids[] = $results[$string]->id;
849
  else
850
  $results_ids[] = null; //this should not happen but if it does we need to keep the same number of result ids as original_strings to have a correlation
333
  /*
334
  * select all string that are in the dictionary table and are not in the original tables and insert them in the original
335
  */
336
+ $insert_records = $this->db->query( $this->db->prepare( "INSERT INTO `$originals_table` (original) SELECT DISTINCT ( BINARY t1.original ) FROM `$table_name` t1 LEFT JOIN `$originals_table` t2 on t2.original = BINARY t1.original WHERE t2.original IS NULL AND t1.id > %d AND t1.id <= %d AND LENGTH(t1.original) < 20000", $inferior_limit, ($inferior_limit + $batch_size) ) );
337
 
338
  if (!empty($this->db->last_error)) {
339
  $this->error_manager->record_error(array('last_error_insert_original_strings' => $this->db->last_error));
455
 
456
  if( !empty($strings_grouped) ){
457
  foreach ( $strings_grouped as $post_id => $original_ids ){
458
+
459
+ //remove all empty values from original_ids just in case
460
+ $original_ids = array_filter($original_ids);
461
+ if( !empty( $original_ids ) ) {
462
+
463
+ /*
464
+ * - select all id's that are in the meta already
465
+ * - in php compare our $original_ids with the result and leave just the ones that are not in the db
466
+ * - insert all the remaining ones
467
+ */
468
+
469
+ $existing_entries = $this->db->get_results($this->db->prepare(
470
+ "SELECT original_id FROM " . $this->get_table_name_for_original_meta() . " WHERE meta_key = '" . $this->get_meta_key_for_post_parent_id() . "' AND meta_value = '%1d' AND original_id IN ( %2s )",
471
+ $post_id, implode(', ', $original_ids)
472
+ ), OBJECT_K);
473
+
474
+ $existing_entries = array_keys($existing_entries);
475
+ $insert_this = array_unique(array_diff($original_ids, $existing_entries));
476
+
477
+ if (!empty($insert_this)) {
478
+ $insert_values = array();
479
+ foreach ($insert_this as $missing_entry) {
480
+ $insert_values[] = $this->db->prepare("( %d, %s, %d )", $missing_entry, $this->get_meta_key_for_post_parent_id(), $post_id);
481
+ }
482
+
483
+ $this->db->query("INSERT INTO " . $this->get_table_name_for_original_meta() . " ( original_id, meta_key, meta_value ) VALUES " . implode(', ', $insert_values));
484
  }
485
 
 
486
  }
487
 
488
  }
851
  $results_ids = array();
852
  if( !empty( $results ) && !empty( $original_strings ) ){
853
  foreach( $original_strings as $string ){
854
+ if( !empty( $results[$string] ) && !empty($results[$string]->id) )
855
  $results_ids[] = $results[$string]->id;
856
  else
857
  $results_ids[] = null; //this should not happen but if it does we need to keep the same number of result ids as original_strings to have a correlation
includes/class-translation-render.php CHANGED
@@ -903,6 +903,11 @@ class TRP_Translation_Render{
903
  $string = preg_replace('/(<|&lt;)trp-wrap (.*?)(>|&gt;)/', '', $string);
904
  $string = preg_replace('/(<|&lt;)(\\\\)*\/trp-wrap(>|&gt;)/', '', $string);
905
  }
 
 
 
 
 
906
  return $string;
907
  }
908
 
903
  $string = preg_replace('/(<|&lt;)trp-wrap (.*?)(>|&gt;)/', '', $string);
904
  $string = preg_replace('/(<|&lt;)(\\\\)*\/trp-wrap(>|&gt;)/', '', $string);
905
  }
906
+
907
+ //remove post containers before outputting
908
+ $string = preg_replace( '/(<|&lt;)trp-post-container (.*?)(>|&gt;)/', '', $string );
909
+ $string = preg_replace( '/(<|&lt;)(\\\\)*\/trp-post-container(>|&gt;)/', '', $string );
910
+
911
  return $string;
912
  }
913
 
includes/class-url-converter.php CHANGED
@@ -98,19 +98,26 @@ class TRP_Url_Converter {
98
  * @param $path the path that is passed inside home_url
99
  * @return bool
100
  */
101
- public function is_sitemap_link( $path ) {
 
102
 
103
- //we first check in the $path
104
- if( !empty( $path ) ){
105
- if( strpos($path, 'sitemap') !== false && strpos($path, '.xml') !== false )
106
- return true;
107
- else
108
- return false;
109
  }
110
- else { //if the path is empty check the request URI
111
- global $wp_current_filter;
112
- if (strpos( $_SERVER['REQUEST_URI'], 'sitemap') !== false && strpos( $_SERVER['REQUEST_URI'], '.xml') !== false && !in_array( 'wpseo_sitemap_url', $wp_current_filter ) )
113
- return true;
 
 
 
 
 
 
 
 
 
 
114
  }
115
 
116
  return false;
@@ -201,6 +208,13 @@ class TRP_Url_Converter {
201
  }
202
 
203
  // actual logic of the function
 
 
 
 
 
 
 
204
  if ( $this->url_is_file($url) ){
205
  trp_bulk_debug($debug, array('url' => $url, 'abort' => 'is file'));
206
  wp_cache_set('get_url_for_language_' . $hash, $url . $trp_link_is_processed, 'trp');
98
  * @param $path the path that is passed inside home_url
99
  * @return bool
100
  */
101
+ public function is_sitemap_link( $path = '' ) {
102
+ global $wp_current_filter;
103
 
104
+ if( empty( $path ) || $path === '/' ){
105
+ $path = $_SERVER['REQUEST_URI'];
 
 
 
 
106
  }
107
+
108
+ //check if sitemap and .xml
109
+ if( strpos($path, 'sitemap') !== false &&
110
+ strpos($path, '.xml') !== false &&
111
+ !in_array( 'wpseo_sitemap_url', $wp_current_filter ) &&
112
+ !in_array( 'seopress_sitemaps_url', $wp_current_filter ) &&
113
+ !in_array( 'rank_math/sitemap/url', $wp_current_filter )
114
+ ){
115
+ return true;
116
+ }
117
+
118
+ // check if it's a stylesheet for xml. SEO Press uses it.
119
+ if (strpos( $path, 'sitemap') !== false && strpos( $path, '.xsl') !== false ){
120
+ return true;
121
  }
122
 
123
  return false;
208
  }
209
 
210
  // actual logic of the function
211
+
212
+ if ( $this->is_sitemap_link('') ){
213
+ trp_bulk_debug($debug, array('url' => $url, 'abort' => 'is file'));
214
+ wp_cache_set('get_url_for_language_' . $hash, $url . $trp_link_is_processed, 'trp');
215
+ return $url . $trp_link_is_processed; //abort for files
216
+ }
217
+
218
  if ( $this->url_is_file($url) ){
219
  trp_bulk_debug($debug, array('url' => $url, 'abort' => 'is file'));
220
  wp_cache_set('get_url_for_language_' . $hash, $url . $trp_link_is_processed, 'trp');
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: TranslatePress - Multilingual
4
  Plugin URI: https://translatepress.com/
5
  Description: Experience a better way of translating your WordPress site using a visual front-end translation editor, with full support for WooCommerce and site builders.
6
- Version: 1.6.6
7
  Author: Cozmoslabs, Razvan Mocanu, Madalin Ungureanu, Cristophor Hurduban
8
  Author URI: https://cozmoslabs.com/
9
  Text Domain: translatepress-multilingual
3
  Plugin Name: TranslatePress - Multilingual
4
  Plugin URI: https://translatepress.com/
5
  Description: Experience a better way of translating your WordPress site using a visual front-end translation editor, with full support for WooCommerce and site builders.
6
+ Version: 1.6.7
7
  Author: Cozmoslabs, Razvan Mocanu, Madalin Ungureanu, Cristophor Hurduban
8
  Author URI: https://cozmoslabs.com/
9
  Text Domain: translatepress-multilingual
languages/translatepress-multilingual.catalog.php CHANGED
@@ -41,6 +41,24 @@
41
  <?php __("<strong>TranslatePress</strong> encountered SQL errors. <a href=\"%s\" title=\"View TranslatePress SQL Errors\">Check out the errors</a>.", "translatepress-multilingual"); ?>
42
  <?php __("Automatic translation has been disabled.", "translatepress-multilingual"); ?>
43
  <?php __("Dismiss this notice.", "translatepress-multilingual"); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  <?php __("Automatic Translation", "translatepress-multilingual"); ?>
45
  <?php __("DeepL", "translatepress-multilingual"); ?>
46
  <?php __("You are not using a permalink structure! Please <a href=\"%s\">enable</a> one or install our <a href=\"%s\">\"Language by GET parameter\"</a> addon, so that TranslatePress can function properly.", "translatepress-multilingual"); ?>
@@ -170,9 +188,6 @@
170
  <?php __("Create translator accounts for new users or allow existing users <br/>that are not administrators to translate your website.", "translatepress-multilingual"); ?>
171
  <?php __("Navigate your website just like a particular user role would. <br/>Really useful for dynamic content or hidden content that appears for particular users.", "translatepress-multilingual"); ?>
172
  <?php __("Configure different menu items for different languages.", "translatepress-multilingual"); ?>
173
- <?php __("Free Addons", "translatepress-multilingual"); ?>
174
- <?php __("Extend your translation plugin with these free addons.", "translatepress-multilingual"); ?>
175
- <?php __("Use GET parameter to encode language in the url, replacing the language directory. </br> Your urls will look like this: www.example.com?lang=en", "translatepress-multilingual"); ?>
176
  <?php __("TranslatePress Advanced Settings", "translatepress-multilingual"); ?>
177
  <?php __("Save Changes", "translatepress-multilingual"); ?>
178
  <?php __("TranslatePress Errors", "translatepress-multilingual"); ?>
41
  <?php __("<strong>TranslatePress</strong> encountered SQL errors. <a href=\"%s\" title=\"View TranslatePress SQL Errors\">Check out the errors</a>.", "translatepress-multilingual"); ?>
42
  <?php __("Automatic translation has been disabled.", "translatepress-multilingual"); ?>
43
  <?php __("Dismiss this notice.", "translatepress-multilingual"); ?>
44
+ <?php __("Logged errors", "translatepress-multilingual"); ?>
45
+ <?php __("These are the most recent 5 errors logged by TranslatePress:", "translatepress-multilingual"); ?>
46
+ <?php __("Why are these errors occuring", "translatepress-multilingual"); ?>
47
+ <?php __("If TranslatePress detects something wrong when executing queries on your database, it may disable the Automatic Translation feature in order to avoid any extra charging by Google/DeepL. Automatic Translation needs to be manually turned on, after you solve the issues.", "translatepress-multilingual"); ?>
48
+ <?php __("The SQL errors detected can occur for various reasons including missing tables, missing permissions for the SQL user to create tables or perform other operations, problems after site migration or changes to SQL server configuration.", "translatepress-multilingual"); ?>
49
+ <?php __("What you can do in this situation", "translatepress-multilingual"); ?>
50
+ <?php __("Plan A.", "translatepress-multilingual"); ?>
51
+ <?php __("Go to Settings -> TranslatePress -> General tab and Save Settings. This will regenerate the tables using your current SQL settings. Check if no more errors occur while browsing your website in a translated language. Look at the timestamps of the errors to make sure you are not seeing the old errors. Only the most recent 5 errors are displayed.", "translatepress-multilingual"); ?>
52
+ <?php __("Plan B.", "translatepress-multilingual"); ?>
53
+ <?php __("If your problem isn't solved, try the following steps:", "translatepress-multilingual"); ?>
54
+ <?php __("Create a backup of your database", "translatepress-multilingual"); ?>
55
+ <?php __("Create a copy of each translation table where you encounter errors. You can copy the table within the same database (trp_dictionary_en_us_es_es_COPY for example) -- perform this step only if you want to keep the current translations", "translatepress-multilingual"); ?>
56
+ <?php __("Remove the trouble tables by executing the DROP function on them", "translatepress-multilingual"); ?>
57
+ <?php __("Go to Settings -> TranslatePress -> General tab and Save Settings. This will regenerate the tables using your current SQL server.", "translatepress-multilingual"); ?>
58
+ <?php __("Copy the relevant content from the duplicated tables (trp_dictionary_en_us_es_es_COPY for example) in the newly generated table (trp_dictionary_en_us_es_es) -- perform this step only if you want to keep the current translations", "translatepress-multilingual"); ?>
59
+ <?php __("Test it to see if everything is working. If something went wrong, you can restore the backup that you've made at the first step. Check if no more errors occur while browsing your website in a translated language. Look at the timestamps of the errors to make sure you are not seeing the old errors. Only the most recent 5 errors are displayed.", "translatepress-multilingual"); ?>
60
+ <?php __("Plan C.", "translatepress-multilingual"); ?>
61
+ <?php __("If your problem still isn't solved, try asking your hosting about your errors. The most common issue is missing permissions for the SQL user, such as the Create Tables permission.", "translatepress-multilingual"); ?>
62
  <?php __("Automatic Translation", "translatepress-multilingual"); ?>
63
  <?php __("DeepL", "translatepress-multilingual"); ?>
64
  <?php __("You are not using a permalink structure! Please <a href=\"%s\">enable</a> one or install our <a href=\"%s\">\"Language by GET parameter\"</a> addon, so that TranslatePress can function properly.", "translatepress-multilingual"); ?>
188
  <?php __("Create translator accounts for new users or allow existing users <br/>that are not administrators to translate your website.", "translatepress-multilingual"); ?>
189
  <?php __("Navigate your website just like a particular user role would. <br/>Really useful for dynamic content or hidden content that appears for particular users.", "translatepress-multilingual"); ?>
190
  <?php __("Configure different menu items for different languages.", "translatepress-multilingual"); ?>
 
 
 
191
  <?php __("TranslatePress Advanced Settings", "translatepress-multilingual"); ?>
192
  <?php __("Save Changes", "translatepress-multilingual"); ?>
193
  <?php __("TranslatePress Errors", "translatepress-multilingual"); ?>
languages/translatepress-multilingual.pot CHANGED
@@ -125,7 +125,7 @@ msgstr ""
125
  msgid "Advanced"
126
  msgstr ""
127
 
128
- #: ../translatepress/includes/class-advanced-tab.php:216, ../translatepress/partials/machine-translation-settings-page.php:13, ../translatepress/partials/machine-translation-settings-page.php:78, ../translatepress/partials/machine-translation-settings-page.php:111, ../translatepress/partials/main-settings-page.php:41, ../translatepress/partials/main-settings-page.php:54, ../translatepress/partials/main-settings-page.php:67
129
  msgid "Yes"
130
  msgstr ""
131
 
@@ -181,6 +181,78 @@ msgstr ""
181
  msgid "Dismiss this notice."
182
  msgstr ""
183
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  #: ../translatepress/includes/class-machine-translation-tab.php:22
185
  msgid "Automatic Translation"
186
  msgstr ""
@@ -697,18 +769,6 @@ msgstr ""
697
  msgid "Configure different menu items for different languages."
698
  msgstr ""
699
 
700
- #: ../translatepress/partials/addons-settings-page.php:78
701
- msgid "Free Addons"
702
- msgstr ""
703
-
704
- #: ../translatepress/partials/addons-settings-page.php:79
705
- msgid "Extend your translation plugin with these free addons."
706
- msgstr ""
707
-
708
- #: ../translatepress/partials/addons-settings-page.php:87
709
- msgid "Use GET parameter to encode language in the url, replacing the language directory. </br> Your urls will look like this: www.example.com?lang=en"
710
- msgstr ""
711
-
712
  #: ../translatepress/partials/advanced-settings-page.php:5
713
  msgid "TranslatePress Advanced Settings"
714
  msgstr ""
125
  msgid "Advanced"
126
  msgstr ""
127
 
128
+ #: ../translatepress/includes/class-advanced-tab.php:216, ../translatepress/includes/class-error-manager.php:155, ../translatepress/partials/machine-translation-settings-page.php:13, ../translatepress/partials/machine-translation-settings-page.php:78, ../translatepress/partials/machine-translation-settings-page.php:111, ../translatepress/partials/main-settings-page.php:41, ../translatepress/partials/main-settings-page.php:54, ../translatepress/partials/main-settings-page.php:67
129
  msgid "Yes"
130
  msgstr ""
131
 
181
  msgid "Dismiss this notice."
182
  msgstr ""
183
 
184
+ #: ../translatepress/includes/class-error-manager.php:147
185
+ msgid "Logged errors"
186
+ msgstr ""
187
+
188
+ #: ../translatepress/includes/class-error-manager.php:148
189
+ msgid "These are the most recent 5 errors logged by TranslatePress:"
190
+ msgstr ""
191
+
192
+ #: ../translatepress/includes/class-error-manager.php:172
193
+ msgid "Why are these errors occuring"
194
+ msgstr ""
195
+
196
+ #: ../translatepress/includes/class-error-manager.php:173
197
+ msgid "If TranslatePress detects something wrong when executing queries on your database, it may disable the Automatic Translation feature in order to avoid any extra charging by Google/DeepL. Automatic Translation needs to be manually turned on, after you solve the issues."
198
+ msgstr ""
199
+
200
+ #: ../translatepress/includes/class-error-manager.php:174
201
+ msgid "The SQL errors detected can occur for various reasons including missing tables, missing permissions for the SQL user to create tables or perform other operations, problems after site migration or changes to SQL server configuration."
202
+ msgstr ""
203
+
204
+ #: ../translatepress/includes/class-error-manager.php:176
205
+ msgid "What you can do in this situation"
206
+ msgstr ""
207
+
208
+ #: ../translatepress/includes/class-error-manager.php:178
209
+ msgid "Plan A."
210
+ msgstr ""
211
+
212
+ #: ../translatepress/includes/class-error-manager.php:179
213
+ msgid "Go to Settings -> TranslatePress -> General tab and Save Settings. This will regenerate the tables using your current SQL settings. Check if no more errors occur while browsing your website in a translated language. Look at the timestamps of the errors to make sure you are not seeing the old errors. Only the most recent 5 errors are displayed."
214
+ msgstr ""
215
+
216
+ #: ../translatepress/includes/class-error-manager.php:181
217
+ msgid "Plan B."
218
+ msgstr ""
219
+
220
+ #: ../translatepress/includes/class-error-manager.php:182
221
+ msgid "If your problem isn't solved, try the following steps:"
222
+ msgstr ""
223
+
224
+ #: ../translatepress/includes/class-error-manager.php:184
225
+ msgid "Create a backup of your database"
226
+ msgstr ""
227
+
228
+ #: ../translatepress/includes/class-error-manager.php:185
229
+ msgid "Create a copy of each translation table where you encounter errors. You can copy the table within the same database (trp_dictionary_en_us_es_es_COPY for example) -- perform this step only if you want to keep the current translations"
230
+ msgstr ""
231
+
232
+ #: ../translatepress/includes/class-error-manager.php:186
233
+ msgid "Remove the trouble tables by executing the DROP function on them"
234
+ msgstr ""
235
+
236
+ #: ../translatepress/includes/class-error-manager.php:187
237
+ msgid "Go to Settings -> TranslatePress -> General tab and Save Settings. This will regenerate the tables using your current SQL server."
238
+ msgstr ""
239
+
240
+ #: ../translatepress/includes/class-error-manager.php:188
241
+ msgid "Copy the relevant content from the duplicated tables (trp_dictionary_en_us_es_es_COPY for example) in the newly generated table (trp_dictionary_en_us_es_es) -- perform this step only if you want to keep the current translations"
242
+ msgstr ""
243
+
244
+ #: ../translatepress/includes/class-error-manager.php:189
245
+ msgid "Test it to see if everything is working. If something went wrong, you can restore the backup that you've made at the first step. Check if no more errors occur while browsing your website in a translated language. Look at the timestamps of the errors to make sure you are not seeing the old errors. Only the most recent 5 errors are displayed."
246
+ msgstr ""
247
+
248
+ #: ../translatepress/includes/class-error-manager.php:192
249
+ msgid "Plan C."
250
+ msgstr ""
251
+
252
+ #: ../translatepress/includes/class-error-manager.php:193
253
+ msgid "If your problem still isn't solved, try asking your hosting about your errors. The most common issue is missing permissions for the SQL user, such as the Create Tables permission."
254
+ msgstr ""
255
+
256
  #: ../translatepress/includes/class-machine-translation-tab.php:22
257
  msgid "Automatic Translation"
258
  msgstr ""
769
  msgid "Configure different menu items for different languages."
770
  msgstr ""
771
 
 
 
 
 
 
 
 
 
 
 
 
 
772
  #: ../translatepress/partials/advanced-settings-page.php:5
773
  msgid "TranslatePress Advanced Settings"
774
  msgstr ""
partials/addons-settings-page.php CHANGED
@@ -73,18 +73,4 @@
73
  </div>
74
  </div>
75
 
76
- <div class="grid feat-header">
77
- <div class="grid-cell">
78
- <h2><?php _e( 'Free Addons', 'translatepress-multilingual' );?></h2>
79
- <p><?php _e( 'Extend your translation plugin with these free addons.', 'translatepress-multilingual' );?></p>
80
- </div>
81
- </div>
82
-
83
- <div class="grid">
84
- <div class="grid-cell" style="overflow:hidden;">
85
- <a href="https://translatepress.com/docs/addons/language-get-parameter/" target="_blank"><img src="<?php echo esc_url( plugins_url('../assets/images/get_param_addon.jpg', __FILE__) ) ?>" alt="Language by GET parameter" style="float: left; margin: 0 1.5rem 1.5rem 0;"></a>
86
- <h3 id="language-by-get-parameter"><a href=" <?php echo trp_add_affiliate_id_to_link('https://translatepress.com/pricing/?utm_source=wpbackend&utm_medium=clientsite&utm_content=addons_tab&utm_campaign=tpfree') ?> " target="_blank"> Language by GET parameter </a></h3>
87
- <p><?php _e( 'Use GET parameter to encode language in the url, replacing the language directory. </br> Your urls will look like this: www.example.com?lang=en', 'translatepress-multilingual' );?></p>
88
- </div>
89
- </div>
90
  </div>
73
  </div>
74
  </div>
75
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  </div>
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: translate, translation, multilingual, automatic translation, bilingual, fr
5
  Requires at least: 3.1.0
6
  Tested up to: 5.3.2
7
  Requires PHP: 5.6.20
8
- Stable tag: 1.6.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -143,6 +143,15 @@ For more information please check out [TranslatePress - Multilingual plugin docu
143
 
144
 
145
  == Changelog ==
 
 
 
 
 
 
 
 
 
146
  = 1.6.6 =
147
  * Implemented Search functionality in translated languages
148
  * Added support for WooCommerce product search in translated languages
5
  Requires at least: 3.1.0
6
  Tested up to: 5.3.2
7
  Requires PHP: 5.6.20
8
+ Stable tag: 1.6.7
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
143
 
144
 
145
  == Changelog ==
146
+ = 1.6.7 =
147
+ * Improved the database update queries
148
+ * Fixed an error in mysql regarding post_parent_id meta insert if no id was found
149
+ * Added Rank Math support
150
+ * Added SEO Press support
151
+ * We now remove the trp-post-container before displaying the site
152
+ * Removed Get add-on from add-ons page
153
+ * Refactor support for SEO sitemaps so we don't add the language to their URL's
154
+
155
  = 1.6.6 =
156
  * Implemented Search functionality in translated languages
157
  * Added support for WooCommerce product search in translated languages