: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
alert('<?php echo esc_js(__('Done', 'sitepress')) ?>');
response_element.fadeOut();
assign_translation_status_to_duplicates_loader.fadeOut(function() {
assign_translation_status_to_duplicates_element.remove(assign_translation_status_to_duplicates_loader);
assign_translation_status_to_duplicates_element.removeAttr('disabled');
error: function (xhr, status, error) {
var parsed_response = parse_xhr_error(xhr, status, error);
response_element.text('');
response_element.html(parsed_response);
assign_translation_status_to_duplicates_loader.fadeOut(function() {
assign_translation_status_to_duplicates_element.remove(assign_translation_status_to_duplicates_loader);
assign_translation_status_to_duplicates_element.attr('disabled', 'disabled');
jQuery('#icl_add_missing_lang').click(function () {
self.attr('disabled', 'disabled');
self.after(icl_ajxloaderimg);
jQuery.post(location.href + '&debug_action=icl_ts_add_missing_language&nonce=<?php echo wp_create_nonce('icl_ts_add_missing_language'); ?>', function () {
self.removeAttr('disabled');
alert('<?php echo esc_js(__('Done', 'sitepress')) ?>');
jQuery('#icl_fix_collation').click(function () {
jQuery(this).attr('disabled', 'disabled');
jQuery(this).after(icl_ajxloaderimg);
jQuery.post(location.href + '&debug_action=icl_fix_collation&nonce=<?php echo wp_create_nonce('icl_fix_collation'); ?>', function () {
jQuery('#icl_fix_collation').removeAttr('disabled');
alert('<?php echo esc_js(__('Done', 'sitepress')) ?>');
jQuery('#icl_fix_collation').next().fadeOut();
jQuery('#icl_fix_terms_count').click(function () {
self.attr('disabled', 'disabled');
self.after(icl_ajxloaderimg);
jQuery.post(location.href + '&debug_action=icl_fix_terms_count&nonce=<?php echo wp_create_nonce('icl_fix_terms_count'); ?>', function () {
self.removeAttr('disabled');
alert('<?php echo esc_js(__('Done', 'sitepress')) ?>');
jQuery('#icl_remove_st_db_cache_logs').click(function () {
self.attr('disabled', 'disabled');
self.after(icl_ajxloaderimg);
jQuery.post(location.href + '&debug_action=icl_remove_st_db_cache_logs&nonce=<?php echo wp_create_nonce('icl_remove_st_db_cache_logs'); ?>', function () {
self.removeAttr('disabled');
alert('<?php echo esc_js(__('Done', 'sitepress')) ?>');
<div class="icl_cyan_box">
<h3><?php _e( 'Advanced settings', 'sitepress' ) ?></h3>
<p id="otgs_twig_cache_enable">
$twig_cache_disabled = (bool) get_option( $otgs_twig_cache_disable_key, false );
$twig_cache_new_value = ! $twig_cache_disabled;
$twig_cache_label = __( 'Disable cache for language switcher templates' , 'sitepress' );
if ( $twig_cache_disabled ) {
$twig_cache_label = __( 'Enable cache for language switcher templates' , 'sitepress' );
<input type="hidden" id="otgs_twig_cache_new_value" class="otgs_twig_cache_new_value" value="<?php echo $twig_cache_new_value; ?>"/>
<input type="button" class="button-secondary" value="<?php echo $twig_cache_label; ?>"/><br/>
<div class="icl_cyan_box">
<h3><?php _e( 'Clean up', 'sitepress' ) ?></h3>
<p class="icl_form_errors" style="padding:6px;"><?php _e( 'Please make backup of your database before using this.', 'sitepress' ) ?></p>
<?php if ( !SitePress_Setup::languages_complete() ){ ?>
<label><input type="checkbox" onchange="if(jQuery(this).prop('checked')){jQuery('#icl_fix_languages').prop('disabled', false);}else{jQuery('#icl_fix_languages').prop('disabled', true);}">
<?php _e("This operation will reset WPML's language tables and reinstall it. Any custom languages that you added will be removed.", 'sitepress') ?></label><br /><br />
<input disabled="disabled" id="icl_fix_languages" type="button" class="button-secondary" value="<?php _e( 'Clear language information and repopulate languages', 'sitepress' ) ?>"/><br/><br />
<small style="margin-left:10px;"><?php _e( "This operation will remove WPML's language table and recreate it. You should use it if you just installed WPML and you're not seeing a complete list of available languages.", 'sitepress' ) ?></small>
<?php if(SitePress_Setup::setup_complete()) { ?>
<?php do_action('wpml_troubleshooting_after_setup_complete_cleanup_begin'); ?>
<?php do_action('before_setup_complete_troubleshooting_functions'); ?>
<select name="wpml_post_type">
<?php foreach ( $sitepress->get_translatable_documents() as $key => $translatable_document ) : ?>
<option value="<?php echo esc_attr( $key ); ?>"><?php echo esc_html( $translatable_document->label ); ?></option>
<input id="wpml_sync_posts_taxonomies" type="button" class="button-secondary" value="<?php esc_html_e( 'Synchronize posts taxonomies', 'sitepress' ); ?>"/> <span class="wpml-notice"></span><br/>
<small style="margin-left:10px;"><?php esc_html_e( 'This will assign the same taxonomy terms as the source for each post translation.', 'sitepress' ); ?></small>
<input id="icl_cache_clear" type="button" class="button-secondary" value="<?php _e( 'Clear the cache in WPML', 'sitepress' ) ?>"/><br/>
<small style="margin-left:10px;"><?php _e( 'This may solve issues like missing languages in the language switcher.', 'sitepress' ) ?></small>
<input id="icl_remove_ghost" type="button" class="button-secondary" value="<?php _e( 'Remove ghost entries from the translation tables', 'sitepress' ) ?>"/><br/>
<small style="margin-left:10px;"><?php _e( 'Removes entries from the WPML tables that are not linked properly. Cleans the table off entries left over upgrades, bug fixes or undetermined factors.', 'sitepress' ) ?></small>
<input id="icl_fix_collation" type="button" class="button-secondary" value="<?php _e( 'Fix element_type collation', 'sitepress' ) ?>"/><br/>
<small style="margin-left:10px;"><?php _e( 'Fixes the collation of the element_type column in icl_translations in case this setting changed for your posts.post_type column.', 'sitepress' ) ?></small>
<?php do_action( 'wpml_troubleshooting_after_fix_element_type_collation' ); ?>
<?php if(class_exists('TranslationManagement')){ ?>
<input id="assign_translation_status_to_duplicates" type="button" class="button-secondary" value="<?php _e( 'Assign translation status to duplicated content', 'sitepress' ) ?>"/><span id="assign_translation_status_to_duplicates_resp"></span><br/>
<small style="margin-left:10px;"><?php _e( 'Sets the translation status to DUPLICATE in the icl_translation_status table, for posts that are marked as duplicated.', 'sitepress' ) ?> </small>
<input id="icl_add_missing_lang" type="button" class="button-secondary" value="<?php _e( 'Set language information', 'sitepress' ) ?>"/><br/>
<small style="margin-left:10px;"><?php _e( 'Adds language information to posts and taxonomies that are missing this information.', 'sitepress' ) ?></small>
<input id="icl_fix_terms_count" type="button" class="button-secondary" value="<?php _e( 'Fix terms count', 'sitepress' ) ?>"/><br/>
<small style="margin-left:10px;"><?php _e( 'Correct terms count in case something went wrong with translated contents.', 'sitepress' ) ?></small>
<input id="icl_fix_post_types" type="button" class="button-secondary" value="<?php _e( 'Fix post type assignment for translations', 'sitepress' ) ?>"/><br/>
<small style="margin-left:10px;"><?php _e( 'Correct post type assignment for translations of custom post types in case something went wrong.', 'sitepress' ) ?></small>
<?php if( get_option( 'wpml-st-persist-errors' ) ) { ?>
<input id="icl_remove_st_db_cache_logs" type="button" class="button-secondary" value="<?php _e( 'Remove debug logs of String Translation cache', 'sitepress' ) ?>"/><br/>
<small style="margin-left:10px;"><?php _e( 'Removes invalid rows stored in option and hide admin notice.', 'sitepress' ) ?></small>
<?php _e( 'Translatable custom posts linking', 'sitepress' ); ?><br/>
<small style="margin-left:10px;"><?php _e( 'Allows linking existing translations after changing custom posts definition (name) ', 'sitepress' ) ?></small>
$translatable_posts = $sitepress->get_translatable_documents();
$wpdb->prepare("SELECT DISTINCT element_type FROM {$wpdb->prefix}icl_translations WHERE element_type LIKE %s",
array( wpml_like_escape('post_') . '%' ) ) );
echo '<table class="widefat" style="width:300px;">';
foreach ( $res as $row ) {
$post_type = preg_replace( '#^post_#', '', $row );
if ( $post_type == 'nav_menu_item' )
echo '<td>' . $post_type . '</td>';
if ( isset( $translatable_posts[ $post_type ] ) ) {
echo '<td>' . __( 'linked to: ', 'sitepress' ) . $translatable_posts[ $post_type ]->labels->name . '</td>';
echo '<select onchange="wpml_ts_link_post_type(jQuery(this), \'' . $post_type . '\')">';
echo '<option value="">' . __( '--select--', 'sitepress' ) . '</option>';
foreach ( $translatable_posts as $name => $type ) {
echo '<option value="' . $name . '">' . $type->labels->name . '(' . $name . ')' . '</option>';
echo __( 'Note: if you edited the custom post declaration you may need to re-configure WPML to mark it as translatable.', 'sitepress' );
<?php _e( 'Translatable taxonomies linking', 'sitepress' ) ?><br/>
<small style="margin-left:10px;"><?php _e( 'Allows linking existing translations after changing custom taxonomies definition (name) ', 'sitepress' ) ?></small>
global $wp_post_types, $wp_taxonomies;
$translatable_taxs = array();
foreach ( $wp_post_types as $name => $post_type ) {
$translatable_taxs = array_merge( $translatable_taxs, $sitepress->get_translatable_taxonomies( true, $name ) );
$translatable_taxs = array_unique( $translatable_taxs );
$wpdb->prepare("SELECT DISTINCT element_type FROM {$wpdb->prefix}icl_translations WHERE element_type LIKE %s",
array( wpml_like_escape('tax_') . '%' ) ) );
echo '<table class="widefat" style="width:300px;">';
foreach ( $res as $row ) {
$tax = preg_replace( '#^tax_#', '', $row );
if ( $tax == 'link_category' || $tax == 'nav_menu' )
echo '<td>' . $tax . '</td>';
if ( in_array( $tax, $translatable_taxs ) ) {
echo '<td>' . __( 'linked to: ', 'sitepress' ) . $wp_taxonomies[ $tax ]->labels->name . '</td>';
echo '<select onchange="wpml_ts_link_taxonomy(jQuery(this), \'' . $tax . '\')">';
echo '<option value="">' . __( '--select--', 'sitepress' ) . '</option>';
foreach ( $translatable_taxs as $name ) {
echo '<option value="' . $name . '">' . $wp_taxonomies[ $name ]->labels->name . '(' . $name . ')' . '</option>';
echo __( 'Note: if you edited the custom taxonomy declaration you may need to re-configure WPML to mark it as translatable.', 'sitepress' );
<?php do_action('wpml_troubleshooting_after_setup_complete_cleanup_end'); ?>
<?php do_action('after_setup_complete_troubleshooting_functions'); ?>
//TODO: [WPML 3.3] we should use the new hooks to add elements to the troubleshooting page
echo WPML_Troubleshooting_Terms_Menu::display_terms_with_suffix();
<div class="icl_cyan_box">
echo '<h3 id="wpml-settings"> ' . __( 'Reset', 'sitepress' ) . '</h3>';
<?php if ( function_exists( 'is_multisite' ) && is_multisite() ) { ?>
<p><?php _e( 'This function is available through the Network Admin section.', 'sitepress' ); ?></p>
<?php if ( current_user_can( 'manage_sites' ) ) { ?>
<a href="<?php echo esc_url(
network_admin_url( 'admin.php?page=' . WPML_PLUGIN_FOLDER . '/menu/network.php' )
) ?>"><?php _e( 'Go to WPML Network settings.', 'sitepress' ) ?></a>
<p><small><?php _e( 'Note: WPML must be activated on the primary site or must be network activated.', 'sitepress' ); ?></small></p>
<i><?php _e( 'You are not allowed to manage the WPML Network settings.', 'sitepress' ) ?></i>
echo '<form method="post" onsubmit="return confirm(\'' . __(
'Are you sure you want to reset all translation and language data? This operation cannot be reversed!',
wp_nonce_field( 'icl_reset_all', 'icl_reset_allnonce' );
echo '<p class="error" style="padding:6px;">';
_e( "The 'Reset' action will deactivate the WPML plugin after it deletes the WPML tables (tables with the 'icl_' prefix) from the database.
The action will NOT delete any content (posts, taxonomy terms etc.).
It only affects translation and language information that WPML associates with each content type.", 'sitepress' );
echo '<p class="error" style="padding:6px;">';
_e( "Please note that all translations you have sent to remote translation services will be lost if you reset WPML's data. They cannot be recovered later.", 'sitepress' );
echo '<p class="error" style="padding:6px;">';
_e( "If you are using the Advanced Translation Editor, you will lose the translations that are in progress, as well as the existing translation memory and glossary. You will also lose access to purchases, invoices, and history related to your work with the Advanced Translation Editor.", 'sitepress' );
echo '<label><input type="checkbox" name="icl-reset-all" ';
if ( !function_exists( 'is_super_admin' ) || is_super_admin() ) {
echo 'onchange="if(this.checked) jQuery(\'#reset-all-but\').removeAttr(\'disabled\'); else jQuery(\'#reset-all-but\').attr(\'disabled\',\'disabled\');"';
echo ' /> ' . __( 'I am about to reset all translation and language data.', 'sitepress' ) . '</label><br /><br />';
echo '<input id="reset-all-but" type="submit" disabled="disabled" class="button-primary" value="' . __(
'Reset and deactivate WPML',
<?php do_action( 'icl_menu_footer' ); ?>