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 4 replies, has 2 voices.

Last updated by Bigul 1 year, 10 months ago.

Assisted by: Bigul.

Author Posts
February 24, 2023 at 3:05 pm #13109557

paulW-38

Dear WPML support!

When I try to scan the following plugin „Customer Reviews for WooCommerce"
for strings the pop with the curly does not end.

Scanning all the other plugin’s work fine.
I also tried it on our integration environment which runs under PHP 7.4 and there the scan works also fine.
Just on production - which runs under PHP 8.1 - the scan does not work only for this plugin.

I also tired deleting this plugin and reinstalling it - same error.

In the logs I see the following error:

2023-02-24T15:01:27+00:00 CRITICAL Uncaught Error: Undefined constant "moderated" in /srv/www/www.magped.com/wp-content/plugins/wpml-string-translation/inc/potx.php:457
Stack trace:
#0 /srv/www/www.magped.com/wp-content/plugins/wpml-string-translation/inc/potx.php(457): constant('moderated')
#1 /srv/www/www.magped.com/wp-content/plugins/wpml-string-translation/inc/potx.php(185): _potx_find_t_calls_with_context('/srv/www/www.ma...', Array, '_nx', 'default')
#2 /srv/www/www.magped.com/wp-content/plugins/wpml-string-translation/inc/gettext/wpml-plugin-string-scanner.class.php(30): _potx_process_file('/srv/www/www.ma...', 0, Array, '_potx_save_vers...', 'default')
#3 /srv/www/www.magped.com/wp-content/plugins/wpml-string-translation/inc/gettext/wpml-plugin-string-scanner.class.php(18): WPML_Plugin_String_Scanner->scan_plugin_files()
#4 /srv/www/www.magped.com/wp-content/plugins/wpml-string-translation/classes/strings-scanning/class-wpml-st-theme-plugin-scan-files-ajax.php(33): WPML_Plugin_String_Scanner->scan()
#5 /srv/www/www.magped.com/wp-includes/class-wp-hook.php(308): WPML_ST_Theme_Plugin_Scan_Files_Ajax->scan('')
#6 /srv/www/www.magped.com/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
#7 /srv/www/www.magped.com/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#8 /srv/www/www.magped.com/wp-admin/admin-ajax.php(188): do_action('wp_ajax_wpml_st...')
#9 {main}
thrown in /srv/www/www.magped.com/wp-content/plugins/wpml-string-translation/inc/potx.php in Zeile 457

And in the browser console I see the following error:

February 26, 2023 at 3:53 pm #13117447

Bigul
Supporter

Languages: English (English )

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

Hello,

I can reproduce the issue on my local copy with PHP 8.1. So consulting with our team for expert opinion. We will get back to you as early as possible. Please wait.

This plugin is not included in our compatibility list for plugins - https://wpml.org/plugin

Therefore it will be great if you can request the plugin author to apply for our compatibility program. This collaboration will help us to avoid these types of issues in the future. Please refer to the following URL for more details.

https://wpml.org/documentation/support/go-global-program/

--
Thanks!

Bigul

February 28, 2023 at 3:52 pm #13137507

Bigul
Supporter

Languages: English (English )

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

Hello,

The issue is escalated to our second-tier team for further debugging. We will get back to you as early as possible. Please wait.

--
Thanks!

Bigul

March 1, 2023 at 4:15 pm #13146999

Bigul
Supporter

Languages: English (English )

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

Hello,

The issue is escalated to our developers for fixing. We will get back to you soon when we have an update from the developers. Please wait.

The workarounds, for now, are please switch to PHP 7.4 while scanning for the strings or make the following changes after a full site backup{mandatory}.

1) Go to *wp-content/plugins/wpml-string-translation/inc* folder
2) Open the potx.php file for editing and scroll down to line 457
3) Make the following change and save the file.

From

$constant_val = @constant( $_potx_tokens[ $ti + $context_offset ][ 1 ] );

To

$constant_val = $_potx_tokens[ $ti + $context_offset ][ 1 ];

--
Thanks!

Bigul

April 4, 2023 at 11:05 am #13399047

Bigul
Supporter

Languages: English (English )

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

Hello,

We have released a new version of WPML(4.6.3). It has included the fix for this bug. So please upgrade to the latest version after a full site backup{mandatory} and make sure you are getting the expected results or not.

May you have to visit Plugins>>Add New>>Commerical tab and click on the *Check for updates* button to get the WPML automatic upgrade links of the latest version. This step will help us refresh the WPML installer caches.

--
Thanks!

Bigul