Please make sure to update to WPML 4.3.6 and check our list of Known Issues before reporting

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This thread is resolved. Here is a description of the problem and solution.

Problem:
WPML in multisite does not show up in the admin menu of the main website.

Solution:
Search for "_wpml_inactive" within your database.
Once you find it update manually from 1 to 0 and save.
The menu will then show up in your wp-admin.

You can find the "_wpml_inactive" with this query (changing wp_ to your prefix):

SELECT * FROM `wp_options` WHERE option_name = '_wpml_inactive'

This topic contains 12 replies, has 2 voices.

Last updated by Patrick 3 years, 8 months ago.

Assigned support staff: Bobby.

Author Posts
May 4, 2016 at 12:37 pm #875094

Patrick

I am trying to:
Use WPML in a multisite

URL of (my) website where problem appears:
Not available publicly

I expected to see:
WPML in the admin menu for the main website

Instead, I got:
Nothing

Steps to duplicate the issue:
Visit the admin page of the default website in my multi-site setup.

---

See the attached screenshot. The main website in my multisite is on the left, a secondary site is on the right. I have the same plugins and theme installed on both.

I have tried following the post here: https://wpml.org/forums/topic/do-not-have-permission-to-access-wpml-in-multisite/page/2/#post-798144 but to no avail.

I also added all of the wp_icl_* tables that were missing for the default site (I only had wp_2_icl_*, wp_3_icl_*, etc.).

I also tried copying the content icl_sitepress_settings in the wp_options table from my secondary site to the primary site, but to no avail.

May 4, 2016 at 4:38 pm #875344

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Just to verify you have tried with a clean install like mentioned in the post you have been following correct? (default theme ex.twenty15 and deactivated 3rd party plugins)

please, turn on your WordPress debug.
From this page:
http://wpml.org/documentation/support/debugging-wpml/

Go in your wp-config.php file and look for define(‘WP_DEBUG’, false);. Change it to:
define('WP_DEBUG', true);

Edit your wp-config.php file and add these lines, just before it says 'stop editing here':

ini_set('log_errors',TRUE);
ini_set('error_reporting', E_ALL);
ini_set('error_log', dirname(__FILE__) . '/error_log.txt');

This will create an error_log.txt file in your site's root directory. Please send me its contents.

May 5, 2016 at 12:30 pm #875996

Patrick

Hello,

I have not yet tried a default theme with plugins disabled. My secondary site has the same plugins and theme installed, so I expect that is not the issue. It seems more likely not enough incremental updates, like the other post.

Here is the error log, lines 4-7 seem to be ther pertinent ones:

Edit: I got rid of the error in line 4 (HTTPS) and line 7 (end_item).

[05-May-2016 12:21:49 UTC] PHP Notice:  wpdb::escape is <strong>deprecated</strong> since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3663
[05-May-2016 12:21:49 UTC] PHP Notice:  get_currentuserinfo est <strong>déprécié</strong> depuis la version 4.5! Utilisez wp_get_current_user() à la place. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3658
[05-May-2016 12:21:49 UTC] PHP Warning:  session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/user/domains/example.com/public_html/wp-includes/functions.php:3663) in /home/user/domains/example.com/public_html/wp-content/plugins/custom-sidebars/inc/class-custom-sidebars-explain.php on line 55
[05-May-2016 12:21:49 UTC] PHP Notice:  Undefined index: HTTPS in /home/user/domains/example.com/public_html/wp-content/themes/my-theme/functions.php on line 310
[05-May-2016 12:21:49 UTC] PHP Notice:  Use of undefined constant ICL_LANGUAGE_CODE - assumed 'ICL_LANGUAGE_CODE' in /home/user/domains/example.com/public_html/wp-content/themes/my-theme/header.php on line 142
[05-May-2016 12:21:49 UTC] PHP Notice:  Use of undefined constant ICL_LANGUAGE_CODE - assumed 'ICL_LANGUAGE_CODE' in /home/user/domains/example.com/public_html/wp-content/themes/my-theme/functions.php on line 1152
[05-May-2016 12:21:49 UTC] PHP Notice:  Undefined variable: end_item in /home/user/domains/example.com/public_html/wp-content/themes/my-theme/functions.php on line 1161
[05-May-2016 12:22:32 UTC] PHP Notice:  wpdb::escape is <strong>deprecated</strong> since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3663
[05-May-2016 12:22:33 UTC] PHP Notice:  get_currentuserinfo est <strong>déprécié</strong> depuis la version 4.5! Utilisez wp_get_current_user() à la place. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3658
[05-May-2016 12:23:00 UTC] PHP Notice:  wpdb::escape is <strong>deprecated</strong> since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3663
[05-May-2016 12:23:00 UTC] PHP Warning:  session_start() [<a href='function.session-start'>function.session-start</a>]: Cannot send session cache limiter - headers already sent (output started at /home/user/domains/example.com/public_html/wp-includes/functions.php:3663) in /home/user/domains/example.com/public_html/wp-content/plugins/custom-sidebars/inc/class-custom-sidebars-explain.php on line 55
[05-May-2016 12:23:00 UTC] PHP Notice:  get_currentuserinfo est <strong>déprécié</strong> depuis la version 4.5! Utilisez wp_get_current_user() à la place. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3658
[05-May-2016 12:23:01 UTC] PHP Notice:  wpdb::escape is <strong>deprecated</strong> since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3663
[05-May-2016 12:23:01 UTC] PHP Notice:  wpdb::escape is <strong>deprecated</strong> since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3663
[05-May-2016 12:23:01 UTC] PHP Notice:  get_currentuserinfo est <strong>déprécié</strong> depuis la version 4.5! Utilisez wp_get_current_user() à la place. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3658
[05-May-2016 12:23:01 UTC] PHP Notice:  wpdb::escape is <strong>deprecated</strong> since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3663
[05-May-2016 12:23:02 UTC] PHP Notice:  get_currentuserinfo est <strong>déprécié</strong> depuis la version 4.5! Utilisez wp_get_current_user() à la place. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3658
[05-May-2016 12:23:02 UTC] PHP Notice:  get_currentuserinfo est <strong>déprécié</strong> depuis la version 4.5! Utilisez wp_get_current_user() à la place. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3658
[05-May-2016 12:24:01 UTC] PHP Notice:  wpdb::escape is <strong>deprecated</strong> since version 3.6! Use wpdb::prepare() or esc_sql() instead. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3663
[05-May-2016 12:24:02 UTC] PHP Notice:  get_currentuserinfo est <strong>déprécié</strong> depuis la version 4.5! Utilisez wp_get_current_user() à la place. in /home/user/domains/example.com/public_html/wp-includes/functions.php on line 3658
May 5, 2016 at 4:39 pm #876250

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

**Before we proceed I recommend to please take FULL BACKUP of your database and your website.**
I often use the Duplicator plugin for this purpose See: http://wordpress.org/plugins/duplicator/

I would like to request temporary access (wp-admin and FTP) to your site to fix the issue.
(preferably to a test site where the problem has been replicated if possible)

You will find the needed fields for this below the comment area when you log in to leave your next reply.
The information you will enter is private which means only you and I can see and have access to it.

Thank you,
Bobby

May 14, 2016 at 12:48 am #882500

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for the Access Details !

May i kindly ask you to please add the following script

/* Function Added By WPML support for testing purpose */
function add_theme_caps() {
    // gets the author role
    $role = get_role( 'administrator' );
  
    $capabilities = array(
        'wpml_manage_translation_management',
        'wpml_manage_languages',
        'wpml_manage_theme_and_plugin_localization',
        'wpml_manage_support',
        'wpml_manage_woocommerce_multilingual',
        'wpml_operate_woocommerce_multilingual',
        'wpml_manage_media_translation',
        'wpml_manage_navigation',
        'wpml_manage_sticky_links',
        'wpml_manage_string_translation',
        'wpml_manage_translation_analytics',
        'wpml_manage_wp_menus_sync',
        'wpml_manage_taxonomy_translation',
        'wpml_manage_troubleshooting',
        'wpml_manage_translation_options',
    );
  
    foreach( $capabilities as $cap ) {
        $role->add_cap( $cap );
    }
  
}
add_action( 'admin_init', 'add_theme_caps');

Please let me know your results !

May 16, 2016 at 12:42 pm #883196

Patrick

Thank you! I'm not sure what results to expect, but nothing has changed. I still do not have the WPML menu on the left.

May 16, 2016 at 4:33 pm #883414

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hello,

Please try this script instead !

// THIS performs a reset on icl capabilities (run once in functions.php ):
// TO BE USED WHEN SOME WPML MENU IS NOT PRESENT OR AUTHORIZATION IS REQUIRED

function wpmlsupp_1706_reset_wpml_capabilities() {
if ( function_exists( 'icl_enable_capabilities' ) ) {
icl_enable_capabilities();
}
}
add_action( 'shutdown', 'wpmlsupp_1706_reset_wpml_capabilities' );

May 16, 2016 at 6:45 pm #883516

Patrick

Hello,

Thank you, but unfortunately there is still no change. I still am missing the WPML menu on the left, and if I visit /wp-admin/admin.php?page=sitepress-multilingual-cms%2Fmenu%2Flanguages.php I get the permissions denied error.

May 16, 2016 at 9:38 pm #883627

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for updating me !

I tried to login using the FTP but i realized that it auto expired , is it possible to update it for me so i can log in and take a closer look with the new script

Thank you,
Bobby

May 17, 2016 at 12:23 pm #884114

Patrick

Sorry about that - I made a mistake in my private post. It should be FTP not SFTP. Also, if the password is in all caps for you, that is incorrect. Let me know if that is the case so that I can send you the correct password.

May 17, 2016 at 5:25 pm #884397

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Thank you for confirming i was able to log in succesfully.

Is it possible to install "adminer" i would like to a look within your database.

I tried to install the plugin but i dont have access to the plugins at the moment to add a new one.

Thank you,
Bobby

May 17, 2016 at 6:08 pm #884418

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

The step that i will be taking with adminer is the following

Search for "_wpml_inactive" within your database

Once you find it update manually from 1 to 0 and save

The menu will then show up in your wp-admin.
(a different multisite was having the same issue with yours and i was able to resolve it with this solution above)

Kind Regards,
Bobby

May 19, 2016 at 11:59 am #886083

Patrick

Awesome, thank you! That resolved this issue. In case anyone else has the problem, you can find the "_wpml_inactive" with this query (changing wp_ to your prefix):

SELECT * FROM `wp_options` WHERE option_name = '_wpml_inactive'