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.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Bruno Kos 1 year, 7 months ago.

Assisted by: Bruno Kos.

Author Posts
July 22, 2023 at 4:01 am #14082545

markC-59

I am trying to: activate the WPML Multilingual CMS plugin, and I get some issues reported on the back end and front end when I do.

BACKEND
Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /customers/4/0/c/markcolclough.com/httpd.www/wp-includes/formatting.php on line 2809 Deprecated: rtrim(): Passing null to parameter #1 ($string) of type string is deprecated in /customers/4/0/c/markcolclough.com/httpd.www/wp-includes/formatting.php on line 2809

FRONTEND
Deprecated: Creation of dynamic property Whip_RequirementsChecker::$configuration is deprecated in /customers/4/0/c/markcolclough.com/httpd.www/wp-content/plugins/sitepress-multilingual-cms/vendor/yoast/whip/src/Whip_RequirementsChecker.php on line 37 Deprecated: Creation of dynamic property Whip_RequirementsChecker::$messageManager is deprecated in /customers/4/0/c/markcolclough.com/httpd.www/wp-content/plugins/sitepress-multilingual-cms/vendor/yoast/whip/src/Whip_RequirementsChecker.php on line 38 Warning: Cannot modify header information - headers already sent by (output started at /customers/4/0/c/markcolclough.com/httpd.www/wp-content/plugins/sitepress-multilingual-cms/vendor/yoast/whip/src/Whip_RequirementsChecker.php:37) in /customers/4/0/c/markcolclough.com/httpd.www/wp-content/plugins/onecom-vcache/vcaching.php on line 306

Link to a page where the issue can be seen:

hidden link
hidden link

Clipboard23.jpg
Clipboard18.jpg
Clipboard22.jpg
July 24, 2023 at 6:17 am #14085661

Bruno Kos
Supporter

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

Timezone: Europe/Zagreb (GMT+01:00)

Hi,

Thank you for contacting WPML support!

Can you please provide us with the debug information, so that we can get a better idea of your setup?

https://wpml.org/faq/provide-debug-information-faster-support/

Regards,
Bruno Kos

July 24, 2023 at 6:39 am #14085861

markC-59

Here it is

July 24, 2023 at 7:10 am #14086035

Bruno Kos
Supporter

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

Timezone: Europe/Zagreb (GMT+01:00)

Ok, can you check:
https://wpml.org/forums/topic/deprecated-rtrim-passing-null-to-parameter-1-string-php-8-1-2/#post-13670953

According to internal ticket, it is being worked on for the release of WPML 4.6.5., so the fix was not yet resolved in the current version.

In the meantime you can use the above workaround.

July 24, 2023 at 7:16 am #14086157

markC-59

My line 16 looks different that what that thread you linked to describes

Clipboard03.jpg
July 24, 2023 at 7:34 am #14086451

Bruno Kos
Supporter

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

Timezone: Europe/Zagreb (GMT+01:00)

But it looks the same to me? Just replace your public function filter_include_url( $result ) with:

public function filter_include_url( $result ) {
    if ( $result ) {
        $domains = wpml_get_setting_filter( array(), 'language_domains' );
        $domains = preg_replace( '#^(http(?:s?))://#', '', array_map( 'untrailingslashit', $domains ) );
        if ( (bool) $domains === true ) {
            $php_host_in_domain = wpml_parse_url( $result, PHP_URL_HOST );
            $domains[]          = wpml_parse_url( $this->get_unfiltered_home(), PHP_URL_HOST );
            foreach ( $domains as $dom ) {
                if ($php_host_in_domain) {
                    if ( strpos( trailingslashit( $php_host_in_domain ), trailingslashit( $dom ) ) === 0 ) {
                        $http_host_parts = explode( ':', $this->requested_host );
                        unset( $http_host_parts[1] );
                        $http_host_without_port = implode( $http_host_parts );
                        $result                 = str_replace( $php_host_in_domain, $http_host_without_port, $result );
                        break;
                    }
                }
            }
        }
    }
    return $result;
}