Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - -
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - -

Supporter timezone: Asia/Jerusalem (GMT+03:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Itamar 2 months, 3 weeks ago.

Assisted by: Itamar.

Author Posts
January 27, 2024 at 2:32 pm #15232827

timoM-10

We get the following console error:
[27-Jan-2024 14:24:09 UTC] PHP Fatal error: Uncaught WpOrg\Requests\Exception\InvalidArgument: WpOrg\Requests\Cookie::__construct(): Argument #1 ($name) must be of type string, integer given in /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-includes/Requests/src/Exception/InvalidArgument.php:29
Stack trace:
#0 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-includes/Requests/src/Cookie.php(84): WpOrg\Requests\Exception\InvalidArgument::create()
#1 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-includes/class-wp-http.php(472): WpOrg\Requests\Cookie->__construct()
#2 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-includes/class-wp-http.php(352): WP_Http::normalize_cookies()
#3 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-includes/class-wp-http.php(637): WP_Http->request()
#4 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-content/plugins/sitepress-multilingual-cms/classes/REST/Status.php(75): WP_Http->get()
#5 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-content/plugins/sitepress-multilingual-cms/classes/REST/Status.php(47): WPML\Core\REST\Status->pingRestEndpoint()
#6 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-content/plugins/sitepress-multilingual-cms/classes/REST/Status.php(62): WPML\Core\REST\Status->WPML\Core\REST\{closure}()
#7 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-content/plugins/sitepress-multilingual-cms/classes/REST/Status.php(45): WPML\Core\REST\Status->cacheInTransient()
#8 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-content/plugins/sitepress-multilingual-cms/classes/REST/Status.php(38): WPML\Core\REST\Status->is_rest_accessible()
#9 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-content/plugins/sitepress-multilingual-cms/inc/functions.php(813): WPML\Core\REST\Status->isEnabled()
#10 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-content/plugins/wpml-string-translation/classes/translations-file-scan/UI/Factory.php(27): wpml_is_rest_enabled()
#11 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-content/plugins/sitepress-multilingual-cms/classes/action-filter-loader/class-wpml-action-filter-loader.php(148): WPML\ST\MO\Scan\UI\Factory->create()
#12 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-content/plugins/sitepress-multilingual-cms/classes/action-filter-loader/class-wpml-action-filter-loader.php(125): WPML_Action_Filter_Loader->run_factory()
#13 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-includes/class-wp-hook.php(324): WPML_Action_Filter_Loader->deferred_loader()
#14 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()
#15 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-includes/plugin.php(517): WP_Hook->do_action()
#16 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-settings.php(643): do_action()
#17 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-config.php(69): require_once('...')
#18 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-load.php(50): require_once('...')
#19 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-admin/admin.php(34): require_once('...')
#20 /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-admin/plugins.php(10): require_once('...')
#21 {main}
thrown in /var/www/vhosts/codafish.net/httpdocs/codafish.net/wp-includes/Requests/src/Exception/InvalidArgument.php on line 29

When disabling WPML String Translation the website is back.

We are using PHP 8.1, also tried 8.2

issue on codafish.net an zoho.codafish.net. We have beta updates enabled. It is not the first time that string translation causes issues. we have disabled the plugin for now.

when trying to enter debug page, we get: There has been a critical error on this website. Please check your site admin email inbox for instructions.

January 28, 2024 at 4:09 pm #15234486

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

While I'm consulting our second-tier supporter, please.

A. Check our known issues page for issues with PHP 8.

https://wpml.org/known-issues/

B. If you need further help, provide access to your site.

If you need further help with this, please share the access details to your site with me.
I'm enabling a private message for the following reply.

Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

Thanks,
Itamar.

January 29, 2024 at 9:18 am #15236770

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

I have the response from our second-tier supporter. Here is what he explains and suggests to check.

This seems to be a server-related issue. According to the error, we can see that WPML is trying to read the cookie from $_COOKIE for a simple REST request, but this value is a boolean, not a string.

Due to this, the following question arose: Is there any restriction on the site?

Another suggestion is to check the wp-config.php file for any defined cookie path or cookie domain constant.

We hope that this information will be helpful to you in solving the problem.

Regards,
Itamar.

February 4, 2024 at 9:01 pm #15263933

timoM-10

I couldn't tell that there is something special. We use NGINX:

gzip on;
gzip_disable "MSIE [1-6].(?!.*SV1)";
gzip_proxied any;
gzip_comp_level 5;
gzip_types text/plain text/css application/javascript application/x-javascript text/xml application/xml application/rss+xml text/javascript image/x-icon image/bmp image/svg+xml;
gzip_vary on;

# CSP Policy
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header Content-Security-Polcy "default-src 'https'";
add_header Content-Security-Polcy "img-src 'self'; script-src 'self'; style-src 'self'; object-src: 'none';";

add_header Content-Security-Polcy upgrade-insecure-requests;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Content-Security-Policy "frame-ancestors 'self';";
add_header Content-Security-Policy "base-uri 'self';";

# Section 4
add_header Access-Control-Allow-Origin self;
add_header Referrer-Policy 'strict-origin; no-refferer';
add_header x-Content-Type-Options "nosniff";
add_header Cache-Control "no-cache; no-store; must-revalidate; max-age=0";
# /harden nginx

# BEGIN LEVERAGE BROWSER CACHING
location ~* .(js|jpg|webp|jpeg|gif|png|css|tgz|gz|rar|bz2|doc|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|woff|woff2|svg)$ {
expires 365d;
access_log off;
add_header Pragma "public";
add_header Cache-Control "max-age=31536000, public";
}

location = /favicon.ico {
log_not_found off;
access_log off;
}

location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}

# END LEVERAGE BROWSER CACHING

location ^~ /wp-login.php {
try_files $uri /index.php;
fastcgi_pass unix:/var/www/vhosts/system/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
include fastcgi_params;
}

location ~ ^(?!/(de|en|es|wp-admin|wp-content)) {
return 301 /$lang$uri;
}

location ~ / {
try_files $uri $uri/ /index.php?$args;
rewrite ^/(?!wp-admin|/wp-json)(.*)/$ /$1 permanent;
}

# START Nginx Rewrites for Rank Math Sitemaps
rewrite ^/sitemap_index.xml$ /index.php?sitemap=1 last;
rewrite ^/([^/]+?)-sitemap([0-9]+)?.xml$ /index.php?sitemap=$1&sitemap_n=$2 last;
# END Nginx Rewrites for Rank Math Sitemaps

Currently we are using the beta path.

When I try to fetch the debug information it results in the following error:
hidden link: 500

This error came up out of a sudden. Is there anything we might need to configure with regard to your last comment?

February 5, 2024 at 8:08 pm #15268312

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Thanks.

I'm consulting our second-tier supporter and will update you here when I have his reply.

Regards,
Itamar.

February 7, 2024 at 9:34 am #15275546

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+03:00)

Hi,

This is the response from our second-tier supporter.

I don't see anything in the rule that can cause this issue. However, we did not get an answer to this:

Also, ask to check wp-config.php if there is any defined cookie path or cookie domain constant.

Did you check the wp-config.php for any defined cookie path or cookie domain constant?

Regards,
Itamar.

The topic ‘[Closed] wpml-string-translation crashes website’ is closed to new replies.