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.

Our next available supporter will start replying to tickets in about 4.37 hours from now. Thank you for your understanding.

Tagged: 

This topic contains 22 replies, has 2 voices.

Last updated by arnoP-3 1 year, 5 months ago.

Assisted by: Nigel.

Author Posts
May 1, 2023 at 2:48 pm #13565609

arnoP-3

Hi,

I'm getting a lot of the below warnings in the WordPress log. Last time I checked WPML is logging this 15 times per hour.

"PHP Deprecated: usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in /wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115"

This was reported before and either not fixed yet or reintroduced:
https://wpml.org/forums/topic/returning-bool-from-comparison-function-is-deprecated-return-an-integer-less-th/

Kind regards,
Arno

May 2, 2023 at 11:33 am #13570275

Nigel
Supporter

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

Hi Arno

Do you have the full call stack from the error logs for those deprecation notices?

(Or steps to reproduce it, but I suspect you don't know what triggers those notices.)

The previous ticket says the issue was fixed, and that may be true, inasmuch as the error is reported by a utility function where the error is not in the utility function itself, it arises because of the arguments passed to the utility function, so there could be different points of failure.

The call stack would show where this was called from and should help pin down the cause.

May 2, 2023 at 11:46 am #13570327

arnoP-3

Hi Nigel,

The log doesn't contain anything else, apart from one line. Here's the log I downloaded yesterday:

[01-May-2023 12:34:29 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:34:50 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:35:55 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:37:23 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:38:06 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:38:38 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:42:00 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:42:08 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:44:24 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:44:53 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:45:18 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:45:34 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:46:29 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:48:18 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:48:50 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:50:17 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:52:19 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:54:37 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:54:53 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:55:16 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:57:40 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:58:20 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 12:58:43 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 13:35:02 UTC] Cron reschedule event error for hook: wf_scan_monitor, Error code: could_not_set, Error message: The cron event list could not be saved., Data: {"schedule":"wf_scan_monitor_interval","args":[],"interval":60}
[01-May-2023 14:33:14 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 14:35:03 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 14:35:58 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 14:36:44 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 14:37:11 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 14:40:10 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115
[01-May-2023 14:41:03 UTC] PHP Deprecated:  usort(): Returning bool from comparison function is deprecated, return an integer less than, equal to, or greater than zero in wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/Lst.php on line 115

Indeed I don't know what is triggering it. We weren't actively working with WPML around that time. We do have a remote translator working on translation jobs, but not around that time as far as I know. So it might be some WPML process that runs automatically. Or it's something that executes while working with English content, which is our default language.

Kind regards,
Arno

May 3, 2023 at 7:56 am #13575917

Nigel
Supporter

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

How you have enabled debugging?

By default WordPress will include the call stack in the debug.log file (if you activate it in wp-config.php as below):

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);

I need to see the call stack to be able to pin down the source of the problem.

If I can't get that from you I'll need a copy of your site to install locally to see if I can catch when such notices are issued, but if I can get details of the call stack I might not need that.

May 3, 2023 at 8:24 am #13576189

arnoP-3

Yes, debugging is enabled:

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', false);
define('WP_DEBUG_LOG', true);

I'll set WP_DEBUG_DISPLAY to true as well although I would not expect it to log more details then.

The only thing I noticed when I checked the log again this morning, is these 4 lines that appeared after a whole series of the original warning:

[03-May-2023 04:45:13 UTC] PHP Warning:  Attempt to read property "post_content" on null in /wp-content/plugins/sitepress-multilingual-cms/inc/translation-proxy/wpml-pro-translation.class.php on line 420
[03-May-2023 04:45:13 UTC] PHP Warning:  Attempt to read property "post_type" on null in /wp-content/plugins/sitepress-multilingual-cms/inc/translation-proxy/wpml-pro-translation.class.php on line 421
[03-May-2023 04:45:13 UTC] PHP Warning:  Attempt to read property "post_content" on null in /wp-content/plugins/sitepress-multilingual-cms/inc/translation-proxy/wpml-pro-translation.class.php on line 420
[03-May-2023 04:45:13 UTC] PHP Warning:  Attempt to read property "post_type" on null in /wp-content/plugins/sitepress-multilingual-cms/inc/translation-proxy/wpml-pro-translation.class.php on line 421
May 3, 2023 at 10:08 am #13577053

Nigel
Supporter

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

OK, well I think I'll need a copy of your site to try and intercept when the notices are generated to see what the trigger was.

Could you please use Duplicator (as described here: https://wpml.org/faq/provide-supporters-copy-site/) to create a copy, or All in One WP Migration which is actually easier to use.

Be sure to exclude the uploads directory as images shouldn't be needed to reproduce the issue and it will make the backup archives smaller.

You can post a link to a dropbox file or similar here, it will be automatically hidden from other users.

(If you use All in One WP Migration you could probably just provide a link to the archive on your server to save having to upload it to a file sharing service.)

May 4, 2023 at 5:25 am #13582663

arnoP-3

Will do so, thanks. I need a bit of time because I can't install an additional plugin on the main site, so I will clone it to staging as soon as I can and then take the copy.

Meanwhile I will also check if the message keeps appearing in the log. Yesterday it stopped mid-afternoon.

May 4, 2023 at 6:38 am #13583037

Nigel
Supporter

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

OK, thanks, I'll await your reply.

(I'm off tomorrow, so it may be Monday before I'm in a position to reply if I don't hear from you today.)

May 4, 2023 at 10:50 am #13585541

arnoP-3

Hi Nigel,

I was able to do this a bit quicker than expected. Here's the WP All-in-One Migration file:
hidden link

It says it's 18 Gb, while I excluded the media library. That's more than twice the size of my regular backups which include the media library. Hopefully, it's all fine. If you need the login, just let me know so I can reply with that info in secure mode.

There's no rush as I suppose this warning doesn't mean something is wrong, but it makes the logs a bit hard to read and you might be able to optimize code on your end.

Thanks,
Arno

May 4, 2023 at 11:59 am #13586221

Nigel
Supporter

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

Ouch. That would be the largest file I ever downloaded by a considerable margin, in the history of downloading large files.

If you created a staging server to be able to generate the backup, would you mind if I accessed that myself so that I can have another go creating the backup, possibly with Duplicator instead, trimming what I can.

Let me mark your next reply as private so that I can get log-in credentials from you—you may want to create a temporary admin user for us to use that you can later delete.

May 4, 2023 at 3:01 pm #13587687

Nigel
Supporter

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

Thanks. I used Duplicator instead, where it was clear that creating a backup was including all of your existing backup files stored on the server, too, hence the huge size.

I'm currently installing that locally, although it is slow going, so it will likely be Monday before I can give you any feedback on the site itself.

May 8, 2023 at 9:20 am #13603381

Nigel
Supporter

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

I have the site installed and I've been browsing pages on the front end and navigating the back end, editing and updating some pages, but nothing has generated the notices so far.

I'll keep trying to see if I can do anything to trigger the notices.

May 8, 2023 at 10:04 am #13604037

arnoP-3

Thanks Nigel. I just checked and can confirm that it's still happening on our end. A series of warnings yesterday afternoon. Then a few this morning. I have no idea what triggers it though.

May 8, 2023 at 10:11 am #13604125

Nigel
Supporter

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

Perhaps you could add an activity log plugin to your site to track all of the activity on the site, and then you could compare the times of the deprecation notices in the PHP logs to see if some activity matches.

May 9, 2023 at 9:10 am #13611655

arnoP-3

Ok, I just installed it as it's good to have something like that anyway. Hopefully, it will reveal something useful.