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
- 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 8:00 – 14:00 -
- 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 15:00 – 17:00 -

Supporter timezone: Europe/Madrid (GMT+02:00)

Tagged: 

This topic contains 26 replies, has 3 voices.

Last updated by Nigel 7 months, 3 weeks ago.

Assisted by: Nigel.

Author Posts
May 8, 2023 at 3:03 pm #13606991

Maarten

Thanks @Nigel, I've tested this, but it looks like get_current_user_id() is empty when it's called in get_all_notices(), probably because it's called before all the wordpress functions are loaded. So this solution doesn't seem to work just yet.

Also... it's still setting notices with every ajax call, when the user_id is 0 as well.

May 8, 2023 at 3:08 pm #13607029

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

OK, thanks for the feedback, I've shared it with my colleague, I'll see if he has any alternate suggestions, and will report back here.

May 9, 2023 at 8:17 am #13610981

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

OK, they additionally suggested making the following change (in the same file) to prevent the notices being updated on ajax requests:

private function save_notices() {
		$this->remove_notices();
		if ( ! has_action( 'shutdown', array( $this, 'save_to_option' ) ) && !wp_doing_ajax() ) {
			add_action( 'shutdown', array( $this, 'save_to_option' ), 1000 );
		}
	}

Other than that, we'll need to wait for the developers to fully resolve the problem.

August 9, 2023 at 12:57 pm #14175809

Maarten

Hey there, any update on this issue? It's still present in the latest WPML...

August 17, 2023 at 8:06 am #14243483

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

Sorry, it hasn't been fixed in development yet, and you will need to continue to apply the workaround.

November 26, 2023 at 8:20 pm #14925853

Maarten

Hey Nigel, it's been a while, any update on this? Issue is still existing. Thanks!

November 27, 2023 at 8:17 am #14927229

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

Sorry, I checked the internal tickets and it still isn't fixed yet.

It is on a bugs list along with some other confirmed issues. What tends to happen is these get worked on together in a dedicated bug-squashing sprint, but I can't say quite when that will be.

You will need to continue to apply the workarounds for now.

May 23, 2024 at 7:58 pm #15665102

Maarten

Hey there, don't want to be an annoying customer... but it's been more than a year now. Any progress?

My logs are still full of these messages...

Screenshot 2024-05-23 at 21.58.20.png
May 24, 2024 at 7:26 am #15665916

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

I'm really sorry Maarten, checking again I see no progress.

I have messaged the project manager directly to point out it has now been a year, let's see what they say.

August 1, 2024 at 1:37 pm #16029845

Maarten

Did you get a reply Nigel?

October 22, 2024 at 12:25 pm #16317312

Maarten

Since it's been 1.5 year... If anybody else has this issue and is tired of updating the plugin each time it gets updated.

```
// fix wpml notices
add_filter('pre_update_option', function ($value, $option, $old_value) {
// Specifically target wpml_notices option
if ($option === 'wpml_notices') {
// Return old value to prevent update
return '';
}

// Return value unchanged for all other options
return $value;
}, 10, 3);
```

October 22, 2024 at 1:02 pm #16317507

Nigel
WPML Supporter since 02/2016

Timezone: Europe/Madrid (GMT+02:00)

Sorry about the lack of progress. The team have been working exhaustively on the upcoming major 4.7 update for many months now, and somewhat peripheral issues like this have been scheduled for once that work completes.

Hopefully that won't be too long and they will be able to address this problem.