• Resolved maportugal

    (@maportugal)


    My site was on PHP 7.4. I tried switching to PHP 8.1 and critical error occurred.
    After isolating all installations, I found that the cause of this error is Loco Translate.
    By deactivating the plugin the site works.
    In conclusion, the site only works with Loco Translate active if PHP is on version 7.4.
    How do I upgrade to PHP 8.1 without having to give up the Loco Translate plugin?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Tim W

    (@timwhitlock)

    If you have a critical error, pease post the text of the critical error. Ideally with the file and line number. Even better with the stack trace.

    Disabling the plugin is not sufficient to establish “cause”. There can be indirect side effects of disabling the plugin, such as loading different translations which may be causing errors.

    I test the plugin in PHP 7.4, 8.0 and 8.1. If I’ve missed something I need to know what it is.

    Thread Starter maportugal

    (@maportugal)

    The error I referred to is a full-page WordPress error, with the following text:

    “There was been a critical error on your website. Please check your site admin email inbox for instructions.”

    This generated the following log file:

    https://drive.google.com/file/d/1-hUZL366VgTgEQ-5qCiPoOQz47OKKn39/view?usp=sharing

    Plugin Author Tim W

    (@timwhitlock)

    The only fatal error I can see in your 1,903 line file is the following:

    Uncaught ValueError: Unknown format specifier " " in wp-content/plugins/redux-framework/redux-core/inc/classes/class-redux-args.php:271

    I suspect this is a translation that has been formatted incorrectly by whoever edited it. A fairly common mistake, and not a bug in my plugin.

    You will have to debug your site to find out what string this is.

    Thread Starter maportugal

    (@maportugal)

    I couldn’t find the exact location of the plugin that conflicts with Loco Translate when PHP is higher than 7.4. I decided to keep this version.

    Plugin Author Tim W

    (@timwhitlock)

    It sounds like you don’t understand this error. It’s not a conflict with my plug-in. (Assuming this is the error in question). The error is present whether you use PHP 8 or not. It’s just that 7.4 doesn’t throw a fatal.

    Plugin Author Tim W

    (@timwhitlock)

    As I have already said, the ValueError shown in your log is in the string. Not in my plugin.

    You can see this in the stack trace you have posted. None of those files belong to my plugin. The error is thrown from rendering a wrongly formatted translation. You can see it there in the sprintf call. If you don’t understand this, read the WordPress documentation on placeholders.

    The original poster (who kindly gave me a 3 star review for my efforts to help him) points out that upgrading from PHP 7 -> 8 causes this error. PHP 8 is stricter about formatting errors. This is the reason. The error is there in the string regardless of what version is running.

    If you have some other fatal error which is not showing in your logs then I can’t make wild guesses as to what it is. Feel free to post in a new thread if there is another problem that you think is coming from my plugin.

    Thread Starter maportugal

    (@maportugal)

    @tobias_conrad apparently the plugin author still doesn’t understand the real extent of the problem…
    There is an “incorrectly formatted translation”…in my case 100% of the translations were formatted using Loco Translate (???).
    The fact is that when using PHP 8.0 or 8.1 the site is radically brought down. Just deactivate Loco Translate and the site will operate normally again. If the problem is not in Loco Translate, as its author says, there is no doubt that the source of the problem is in the plugin.
    Finally, I wouldn’t want to have to comment on this, but from his sarcastic tone, it seems to me that the author was not satisfied with my assessment of his plugin. I could even reverse it, if there was a sincere request for it, however, given the author’s subtlety in his indirect comment, for now it’s fine anyway…`

    Plugin Author Tim W

    (@timwhitlock)

    apparently the plugin author still doesn’t understand the real extent of the problem…

    Then explain it.

    in my case 100% of the translations were formatted using Loco Translate (???).

    Incorrect. 100% of the translations are either entered by humans or by external translation APIs. My plugin does not enter, validate or fix any printf formatting whatsoever. This is how I know that the error is in the string and not in the plugin.

    The fact is that when using PHP 8.0 or 8.1 the site is radically brought down.

    Yes. I explained why. Twice.

    Finally, I wouldn’t want to have to comment on this, but from his sarcastic tone, it seems to me that the author was not satisfied with my assessment of his plugin

    You are free to review my plugin however you like. It’s important however that other users reading reviews see the context of your complaint.

    Plugin Author Tim W

    (@timwhitlock)

    I have invited you to share more information about any critical error that you can demonstrate is coming from my plugin. It’s my job to fix bugs, and I will if you can show one. However, you have so far not.

    Thread Starter maportugal

    (@maportugal)

    Dear, don’t worry about it anymore. You’ve already clearly demonstrated your stance on the problem (your phrase “The error is thrown from rendering a wrongly formatted translation”).
    The workaround is to keep PHP at version 7.4.

    Thank you very much.

    Life goes on…

    Good afternoon is also a mistake. There is an option not to switch to 7.4. The error occurred after the translation via the API, I have PHP 8.0

    The problem can be removed if you remove the plugin via ftp. But when installing, the problem returns ??

    It is necessary to carefully double-check the translation, maybe translate part of the code. Solution: find the changes in the log and fix the error in the file

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘critical error PHP 8.0 or 8.1’ is closed to new replies.