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.

Our next available supporter will start replying to tickets in about 11.58 hours from now. Thank you for your understanding.

This topic contains 14 replies, has 3 voices.

Last updated by natasjaZ 5 months, 1 week ago.

Assigned support staff: Jamal.

Author Posts
April 30, 2019 at 3:10 am #3707749

julianL-7

Hello,

I cannot use the wp cli after activating wpml:

bitnami@xxx:~$ wp plugin list
Warning: Some code is trying to do a URL redirect. Backtrace:
#0  WP_CLI\Utils\wp_redirect_handler(<em><u>hidden link</u></em>) called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-hook.php:288]
#1  WP_Hook->apply_filters(<em><u>hidden link</u></em>, Array ([0] => <em><u>hidden link</u></em>; => 302)) called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/plugin.php:208]
#2  apply_filters(wp_redirect, <em><u>hidden link</u></em>, 302) called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/pluggable.php:1216]
#3  wp_redirect(<em><u>hidden link</u></em>, 302, WordPress) called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/pluggable.php:1356]
#4  wp_safe_redirect(<em><u>hidden link</u></em>, 302) called at [/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php:728]
#5  WPML_WP_API->wp_safe_redirect(<em><u>hidden link</u></em>) called at [/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/request-handling/class-wpml-frontend-redirection.php:43]
#6  WPML_Frontend_Redirection->maybe_redirect() called at [/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php:540]
#7  SitePress->maybe_set_this_lang() called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-hook.php:286]
#8  WP_Hook->apply_filters(, Array ([0] => )) called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-hook.php:310]
#9  WP_Hook->do_action(Array ([0] => )) called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/plugin.php:465]
#10 do_action(wp_loaded) called at [/opt/bitnami/apps/wordpress/htdocs/wp-settings.php:526]
#11 require(/opt/bitnami/apps/wordpress/htdocs/wp-settings.php) called at [<em><u>hidden link</u></em>;
#12 WP_CLI\Runner->load_wordpress() called at [<em><u>hidden link</u></em>;
#13 WP_CLI\Runner->start() called at [<em><u>hidden link</u></em>;
#14 WP_CLI\Bootstrap\LaunchRunner->process(WP_CLI\Bootstrap\BootstrapState Object ([WP_CLI\Bootstrap\BootstrapStatestate] => Array ())) called at [<em><u>hidden link</u></em>;
#15 WP_CLI\bootstrap() called at [<em><u>hidden link</u></em>;
#16 include(<em><u>hidden link</u></em>) called at [<em><u>hidden link</u></em>;
#17 include(<em><u>hidden link</u></em>) called at [/opt/bitnami/apps/wordpress/bin/wp-cli.phar:4]

If I skip it, it works (though I get warnings):

bitnami@xxx:~$ wp plugin list --skip-plugins=sitepress-multilingual-cms
PHP Warning:  Use of undefined constant ICL_SITEPRESS_VERSION - assumed 'ICL_SITEPRESS_VERSION' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/wp-seo-multilingual/plugin.php on line 15
Warning: Use of undefined constant ICL_SITEPRESS_VERSION - assumed 'ICL_SITEPRESS_VERSION' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/wp-seo-multilingual/plugin.php on line 15
+-------------------------------------+--------+--------+---------+
| name                                | status | update | version |
+-------------------------------------+--------+--------+---------+
| amp                                 | active | none   | 1.1.1   |
| classic-editor                      | active | none   | 1.4     |
| stops-core-theme-and-plugin-updates | active | none   | 8.0.5   |

What can I do to make wp cli work?

Thank you
Julian

April 30, 2019 at 10:09 am #3710265

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Thank you for contacting WPML Support. I will be glad to help with this.

My suggestion would be to skip Yoast Multilingual as it is trying to access the constant "ICL_SITEPRESS_VERSION " that should be defined by WPML, it was not defined because WPML was skipped. So your command will be.


$ wp plugin list --skip-plugins=sitepress-multilingual-cms,wp-seo-multilingual

Let me know what you get with this command.

Best regards,
Jamal
WPML Support

April 30, 2019 at 12:01 pm #3710807

julianL-7

Hello Jamal,

thank you for the fast reply. Is there a way to set this constant globally/systemwide, to not always have to skip plugins? Especially when the wp command is run via scripts or cron?

Thank you
Julian

May 1, 2019 at 8:53 am #3717059

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello Julian,

I approached our developers with the details of the warning. They assume you may have set $_SERVER['HTTP_HOST'] prior to where WPML tries to redirect.

In fact, I created a clean install that you can access with the link below, I could not reproduce the same error.
hidden link

See my results:

[helpless-quagga@w5 ~]$ wp cli info
PHP binary:     /opt/alt/php72/usr/bin/php
PHP version:    7.2.8
php.ini used:   /opt/alt/php72/etc/php.ini
WP-CLI root dir:        <em><u>hidden link</u></em>
WP-CLI packages dir:    /var/www/.wp-cli/packages/
WP-CLI global config:   /var/www/.wp-cli/config.yml
WP-CLI project config:
WP-CLI version: 1.1.0
[helpless-quagga@w5 ~]$ wp plugin list
+-----------------------------+----------+-----------+---------+
| name                        | status   | update    | version |
+-----------------------------+----------+-----------+---------+
| duplicator-pro              | active   | available | 3.8.2.1 |
| multilingual-tools-master   | inactive | none      | 2.1.0   |
| sandbox                     | active   | none      | 1.1.6   |
| woocommerce                 | inactive | none      | 3.6.2   |
| woocommerce-multilingual    | inactive | available | 4.6.2   |
| wpml-media-translation      | inactive | none      | 2.5.2   |
| sitepress-multilingual-cms  | active   | none      | 4.2.6   |
| wpml-string-translation     | inactive | none      | 2.10.4  |
| wpml-translation-management | inactive | none      | 2.8.5   |
+-----------------------------+----------+-----------+---------+
[helpless-quagga@w5 ~]$

Can you try to reproduce this error in this install, visit the Sandbox menu for ssh access? Maybe this warning is caused by something else! Theme, plugin, software version, I can only guess.

We will need more details to get the root cause of this warning. Looking forward to your reply.

Best regards,
Jamal

May 2, 2019 at 7:40 am #3722373

julianL-7

Hello Jamal,

thank you very much for the update. I will try to get a bigger machine and do the settings – I will get back to you next week latest.

Thank you
Julian

May 2, 2019 at 2:40 pm #3725721

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hi Julian,

Ok, I'll set the ticket as needing user feedback until you reply. I may also provide another server where you can clone your website. Let me know if you would like that.

Best regards,
Jamal

May 5, 2019 at 12:44 am #3741093

julianL-7

Hi Jamal,

I think I got it covered on AWS, but thank you! I will get back to you as soon as possible.

Best
Julian

May 6, 2019 at 2:57 am #3744621

julianL-7

Dear Jamal,

it seems to be the following:

All plugins activated but "wp-seo-multilingual" and "sitepress-multilingual-cms" is fine:

bitnami@wpmltest:~/apps/wordpress/htdocs$ wp plugin list
+-----------------------------+----------+--------+---------+
| name                        | status   | update | version |
+-----------------------------+----------+--------+---------+
| amp                         | active   | none   | 1.1.1   |
| classic-editor              | active   | none   | 1.4     |
| envato-market               | active   | none   | 2.0.1   |
| filebird                    | active   | none   | 1.8.1   |
| force-regenerate-thumbnails | active   | none   | 2.0.6   |
| glue-for-yoast-seo-amp      | active   | none   | 0.4.3   |
| hummingbird-performance     | active   | none   | 1.9.4.1 |
| media-cleaner               | active   | none   | 5.2.1   |
| meks-easy-instagram-widget  | active   | none   | 1.0.5   |
| meks-easy-maps              | active   | none   | 1.1.5   |
| meks-flexible-shortcodes    | active   | none   | 1.3.1   |
| meks-time-ago               | active   | none   | 1.1.5   |
| redux-framework             | active   | none   | 3.6.15  |
| webp-express                | active   | none   | 0.13.0  |
| static-html-output-plugin   | active   | none   | 6.6.5   |
| sitepress-multilingual-cms  | inactive | none   | 4.2.6   |
| wpml-sticky-links           | active   | none   | 1.5.0   |
| wpml-string-translation     | active   | none   | 2.10.4  |
| wp-ses                      | active   | none   | 1.0     |
| wp-seo-multilingual         | inactive | none   | 1.0.0   |
| wordpress-seo-premium       | active   | none   | 11.0    |
| advanced-cache.php          | dropin   | none   |         |
+-----------------------------+----------+--------+---------+

As soon as I enable "sitepress-multilingual-cms":

bitnami@wpmltest:~/apps/wordpress/htdocs$ wp plugin list
Warning: Some code is trying to do a URL redirect. Backtrace:
#0  WP_CLI\Utils\wp_redirect_handler(<em><u>hidden link</u></em>) called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-hook.php:288]
#1  WP_Hook->apply_filters(<em><u>hidden link</u></em>, Array ([0] => <em><u>hidden link</u></em>; => 302)) called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/plugin.php:208]
#2  apply_filters(wp_redirect, <em><u>hidden link</u></em>, 302) called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/pluggable.php:1216]
#3  wp_redirect(<em><u>hidden link</u></em>, 302, WordPress) called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/pluggable.php:1356]
#4  wp_safe_redirect(<em><u>hidden link</u></em>, 302) called at [/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/wpml-wp/class-wpml-wp-api.php:728]
#5  WPML_WP_API->wp_safe_redirect(<em><u>hidden link</u></em>) called at [/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/sitepress-multilingual-cms/classes/request-handling/class-wpml-frontend-redirection.php:43]
#6  WPML_Frontend_Redirection->maybe_redirect() called at [/opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/sitepress-multilingual-cms/sitepress.class.php:540]
#7  SitePress->maybe_set_this_lang() called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-hook.php:286]
#8  WP_Hook->apply_filters(, Array ([0] => )) called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/class-wp-hook.php:310]
#9  WP_Hook->do_action(Array ([0] => )) called at [/opt/bitnami/apps/wordpress/htdocs/wp-includes/plugin.php:465]
#10 do_action(wp_loaded) called at [/opt/bitnami/apps/wordpress/htdocs/wp-settings.php:526]
#11 require(/opt/bitnami/apps/wordpress/htdocs/wp-settings.php) called at [<em><u>hidden link</u></em>;
#12 WP_CLI\Runner->load_wordpress() called at [<em><u>hidden link</u></em>;
#13 WP_CLI\Runner->start() called at [<em><u>hidden link</u></em>;
#14 WP_CLI\Bootstrap\LaunchRunner->process(WP_CLI\Bootstrap\BootstrapState Object ([WP_CLI\Bootstrap\BootstrapStatestate] => Array ())) called at [<em><u>hidden link</u></em>;
#15 WP_CLI\bootstrap() called at [<em><u>hidden link</u></em>;
#16 include(<em><u>hidden link</u></em>) called at [<em><u>hidden link</u></em>;
#17 include(<em><u>hidden link</u></em>) called at [/opt/bitnami/apps/wordpress/bin/wp-cli.phar:4]

And as soon as I enable "wp-seo-multilingual":

bitnami@wpmltest:~/apps/wordpress/htdocs$ wp plugin list
PHP Warning:  Use of undefined constant ICL_SITEPRESS_VERSION - assumed 'ICL_SITEPRESS_VERSION' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/wp-seo-multilingual/plugin.php on line 15
Warning: Use of undefined constant ICL_SITEPRESS_VERSION - assumed 'ICL_SITEPRESS_VERSION' (this will throw an Error in a future version of PHP) in /opt/bitnami/apps/wordpress/htdocs/wp-content/plugins/wp-seo-multilingual/plugin.php on line 15
+-----------------------------+----------+--------+---------+
| name                        | status   | update | version |
+-----------------------------+----------+--------+---------+
| amp                         | active   | none   | 1.1.1   |
| classic-editor              | active   | none   | 1.4     |
| envato-market               | active   | none   | 2.0.1   |
| filebird                    | active   | none   | 1.8.1   |
| force-regenerate-thumbnails | active   | none   | 2.0.6   |
| glue-for-yoast-seo-amp      | active   | none   | 0.4.3   |
| hummingbird-performance     | active   | none   | 1.9.4.1 |
| media-cleaner               | active   | none   | 5.2.1   |
| meks-easy-instagram-widget  | active   | none   | 1.0.5   |
| meks-easy-maps              | active   | none   | 1.1.5   |
| meks-flexible-shortcodes    | active   | none   | 1.3.1   |
| meks-time-ago               | active   | none   | 1.1.5   |
| redux-framework             | active   | none   | 3.6.15  |
| webp-express                | active   | none   | 0.13.0  |
| static-html-output-plugin   | active   | none   | 6.6.5   |
| sitepress-multilingual-cms  | inactive | none   | 4.2.6   |
| wpml-sticky-links           | active   | none   | 1.5.0   |
| wpml-string-translation     | active   | none   | 2.10.4  |
| wp-ses                      | active   | none   | 1.0     |
| wp-seo-multilingual         | active   | none   | 1.0.0   |
| wordpress-seo-premium       | active   | none   | 11.0    |
| advanced-cache.php          | dropin   | none   |         |
+-----------------------------+----------+--------+---------+

So I think we have two different and independent errors here.
Also it doesn't make a difference if I enable or disable any or all of the rest of the plugins.

Best
Julian

May 6, 2019 at 9:54 am #3746697

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Thank you for your feedback, I would like to escalate this for further troubleshooting by our experts or developers, for that I'll need either a Duplicator package of your website or that you clone it to one of our servers.
As I have expressed before, there is something that is interfering with $_SERVER['HTTP_HOST'].

Would you be ok with providing a Duplicator package or migrating your website to our platform? If you would build the Duplicator package please use filters to exclude wp-uploads folder, cache folder.
If you would like to clone your website to our platform, I'll create a new server and send you the procedure to migrate.

Looking forward to your reply.

Best regards,
Jamal

May 9, 2019 at 8:03 am #3773989

julianL-7

Hello Jamal,

yes, I can clone to your systems – please send me the instructions.

Best
Julian

May 9, 2019 at 12:36 pm #3776145

julianL-7

Dear Jamal,

I did as told – you should have my copy.

Best
Julian

May 9, 2019 at 1:48 pm #3776687

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Thank you for your effort. I logged to the server using ssh with the provided SFTP access and I could not reproduce the error.

[ugqbbjztjc]:public_html$ wp cli info
OS:     Linux 3.16.0-8-amd64 #1 SMP Debian 3.16.64-2 (2019-04-01) x86_64
Shell:  /usr/bin/mysecureshell
PHP binary:     /usr/bin/php7.0
PHP version:    7.0.32-1~dotdeb+8.1
php.ini used:   /etc/php/7.0/cli/php.ini
WP-CLI root dir:        <em><u>hidden link</u></em>
WP-CLI vendor dir:      <em><u>hidden link</u></em>
WP_CLI phar path:       /mnt/BLOCKSTORAGE/home/219772.cloudwaysapps.com/ugqbbjztjc/public_html
WP-CLI packages dir:
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 2.2.0
[ugqbbjztjc]:public_html$ wp plugin list
+-----------------------------+----------+------------------------------+---------+
| name                        | status   | update                       | version |
+-----------------------------+----------+------------------------------+---------+
| akismet                     | inactive | none                         | 4.1.1   |
| amp                         | active   | none                         | 1.1.1   |
| classic-editor              | active   | available                    | 1.4     |
| envato-market               | active   | none                         | 2.0.1   |
| filebird                    | active   | none                         | 1.8.1   |
| force-regenerate-thumbnails | active   | none                         | 2.0.6   |
| glue-for-yoast-seo-amp      | active   | none                         | 0.4.3   |
| hello                       | inactive | version higher than expected | 1.7.1   |
| hummingbird-performance     | active   | available                    | 1.9.4.1 |
| media-cleaner               | active   | none                         | 5.2.1   |
| meks-easy-instagram-widget  | active   | none                         | 1.0.5   |
| meks-easy-maps              | active   | none                         | 1.1.5   |
| meks-flexible-shortcodes    | active   | none                         | 1.3.1   |
| meks-time-ago               | active   | none                         | 1.1.5   |
| redux-framework             | active   | none                         | 3.6.15  |
| webp-express                | active   | none                         | 0.13.0  |
| static-html-output-plugin   | active   | none                         | 6.6.5   |
| sitepress-multilingual-cms  | active   | none                         | 4.2.6   |
| wpml-sticky-links           | active   | none                         | 1.5.0   |
| wpml-string-translation     | active   | none                         | 2.10.4  |
| wp-ses                      | active   | available                    | 1.0     |
| wp-seo-multilingual         | active   | none                         | 1.0.0   |
| wordpress-seo-premium       | active   | none                         | 11.0    |
+-----------------------------+----------+------------------------------+---------+
[ugqbbjztjc]:public_html$

This means that something in your server is causing that, I can only guess.

Best regards,
Jamal

May 10, 2019 at 11:52 am #3783865

julianL-7

Dear Jamal,

you must be right then. I will dig into my server config.
Just fyi: I have the same Problem on two machines, both on AWS with the bitnami installation.

Thank you very much
Julian

May 10, 2019 at 1:33 pm #3785031

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you Julian for your feedback. Let me know if there is anything I can do.

Best regards,
Jamal

May 20, 2019 at 2:26 pm #3847927

natasjaZ

A small update, in case anyone else has the same issue, or in case the wpml developers want to reproduce it:
We had the same issue in one of our sites. After deactivating every possible plugin, and establishing that it was only happening when sitepress was activated, and importing the database locally and managing to reproduce it, I started looking into differences between that site's settings and a clean install on the same server.
(The clean install was not presenting the problem).

After some digging around, I found out that in the clean install (where issues were not happening) had in the "Language URL format" the
- "Different languages in directories" selected
-- "Use directory for default language" checked
-- "HTML file" not checked
-- "A page" not checked.

While the site with the problem had:
- "Different languages in directories" selected
-- "Use directory for default language" checked
-- "HTML file" checked
-- "A page" not checked.

Trying the opossite (check "A page") was continuing the problem

Checking in the db, the options (after de-serializing and formatting the json) in the one that had the problem were:

  "urls": {
    "directory_for_default_language": true,
    "show_on_root": "page",
    "root_html_file_path": "https:\\/\\/www.greenpeace.org\\/canada\\/en\\/",
    "root_page": 7469,
    "hide_language_switchers": "1"
  },

While in the one that had no problem it was:

  "urls": {
    "directory_for_default_language": true,
    "show_on_root": false,
    "root_html_file_path": "",
    "root_page": 0,
    "hide_language_switchers": "1"
  },

I updated the options directly in the database (copied the whole icl_sitepress_settings value field, deserialised it to json, did my change, serialised it again, posted it), and the problem got solved.

WPML developers, could you possibly reproduce the error with these settings?