CleanTalk - issue with setcookie method

Happy New Year!

That’s strange. I’m using CleanTalk (5.132.3) on two sites with php 7.2.25. I haven’t experienced the issue you mention. Are all your sites on the same server?

1 Like

Thank you for your answer.

Yes, I have re-checked, and I can confirm that the site is using PHP 7.4.

Thank you for sharing your experience.

This is interesting. Yes, my sites are on the same server.

I will attempt to remove CleanTalk and reinstall it on one of the sites, and see if it changes something.

Additional information: around the same time, I also got error messages regarding the plugins Guest Author and Feddzy RSS Lite - which I removed.

Try adding this to your child theme functions and tell me what it prints in the footer:

add_action( 'wp_footer', function() {
  var_dump( version_compare( phpversion(), '7.3.0', '>=' ) );
  var_dump( phpversion() );
});
1 Like

Here is the server info for the small site on which I am doing the testing.

serverinfo

I have done as instructed: here is what I can see in the footer:

bool(true) string(5) “7.4.1”

But I am about to reinstall CleanTalk on the website and see what happens.

Well thats odd, so that code should work.

Maybe its a bug in php 7.4? Have you tried switching to 7.3?

1 Like

Unfortunately, as soon as I reinstall it and activate it, the issue occurs again.

Well, as I mentioned, I had one site on PHP 7.2, and the same issue occurred.

And the site that is running WP 5 (on another server though) has CleanTalk working fine, with PHP 7.4 active…

Provided it has nothing to do with CP (and it seems it has nothing to do with it, contrarily to my initial assumptions), two possible answers left:

  1. A problem with hosting.

  2. A conflict with another plugin.

Since I cannot spend hours testing (I have already lost a day with that), I will ask my host if he sees any possible explanation with their configuration, since this might be the most likely explanation.

php 7.2 that block of code should NOT run, it should fall back to the regular setcookie() method.

1 Like

Thank you for your help.

As a subsitute, I have now activated Shield Security on that site. I do not know how far it covers exactly the same field as CleanTalk, but I assume that it will do the job.

Still, I will inquire from my host.

And let’s see if other users with CleanTalk will report similar issues.

This is a strange issue. We definitely haven’t made any changes to setcookie (we couldn’t if we tried, since as @Pross said, it’s a built-in PHP function).

Maybe a bug with your hosting environment? You can tell them something like this: “calling setcookie with an array parameter should work on PHP 7.3 and above, but on my site (running PHP 7.4.1) this generates a warning”

3 Likes

Thank you, James! I have just sent that question to the host, and I will keep you updated.

2 posts were split to a new topic: ClassicPress and PHP 7.4 compatibility

I have just received an answer from the hosting company: this was an issue with the hosting indeed!

Rough translation from French (French original below):

We have been able to reproduce the issue and to identify the cause.

The PHP protection/filtering of our hosting, which is used for preventing abuse of PHP commands by hackers, had not been updated for PHP 7.3 and 7.4. For this reason, the new parameters of some commands were not allowed.

We have corrected it this morning and the issue should not occur again.

Nous avons pu reproduire le problème que vous avez rencontré et avons pu en déterminer la cause.

Le module PHP de protection/filtering de nos hébergements, utilisé contre l’utilisation abusive de commandes PHP par des hackers n’était pas à jour pour les versions PHP 7.3 et 7.4. De ce fait les nouveaux paramètres de certaines commandes n’étaient pas autorisés.

Un correctif a été mis en place ce matin et le problème devrait ne plus apparaître.

I have to go to town now, but I will check that later today. I am confident that it will work properly again now.

Thanks to everybody on the forum for the kind help!

9 Likes

I have now tested it: I confirm that the correction done by the hosting company has solved the issue. Thus it had nothing to do with CP or with CleanTalk!

6 Likes

who is the host? just curious

For those CP sites, SwissCenter.
https://www.swisscenter.com/en/home

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.