• Resolved Cécile J.

    (@nvmweb)


    Hi team,
    I have this message in my log file and I think it is not normal.
    PHP Fatal error: Uncaught ArgumentCountError: 5 arguments are required, 4 given in /…./……/…..com/wp-content/plugins/wp-optimize/includes/class-updraft-smush-task.php:287

    Stack trace:
    #0 /..../...../mydomain.com/wp-content/plugins/wp-optimize/includes/class-updraft-smush-task.php(287): sprintf()
    #1 /..../...../mydomain.com/wp-content/plugins/wp-optimize/vendor/team-updraft/common-libs/src/updraft-tasks/class-updraft-task.php(292): Updraft_Smush_Task->complete()
    #2 /..../...../mydomain.com/wp-content/plugins/wp-optimize/vendor/team-updraft/common-libs/src/updraft-tasks/class-updraft-task-manager.php(92): Updraft_Task_1_2->attempt()
    #3 /..../...../mydomain.com/wp-content/plugins/wp-optimize/vendor/team-updraft/common-libs/src/updraft-tasks/class-updraft-task-manager.php(166): Updraft_Task_Manager_1_3->process_task()
    #4 /..../...../mydomain.com/wp-content/plugins/wp-optimize/includes/class-updraft-smush-manager.php(242): Updraft_Task_Manager_1_3->process_queue()
    #5 /..../...../mydomain.com/wp-includes/class-wp-hook.php(308): Updraft_Smush_Manager->autosmush_process_queue()
    #6 /..../...../mydomain.com/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
    #7 /..../...../mydomain.com/wp-includes/plugin.php(565): WP_Hook->do_action()
    #8 /..../...../mydomain.com/wp-cron.php(188): do_action_ref_array()

    I’m run with PHP 8.0 and all the last updates of WP, Woocommerce, Divi…

    Could you check ?

    Thank you

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Contributor Venkat Raj

    (@webulous)

    @nvmweb Which language your site is using?

    Could you please confirm this is translated as expected?
    The file was compressed from %s to %s saving %s percent using WP-Optimize

    Thanks

    Thread Starter Cécile J.

    (@nvmweb)

    Hi
    Thank you for your fast reply. I’m in french language but sorry I’m not a developper and I don’t know where to find this sentence. Could you tell me ?

    Plugin Contributor Venkat Raj

    (@webulous)

    @nvmweb Please open wp-content/plugins/wp-optimize/languages/wp-optimize.pot and search for some thing like this

    #: src/includes/class-updraft-smush-manager.php:134
    msgid "The file was compressed from %s to %s, saving %s percent, using WP-Optimize"
    msgstr ""

    The msgstr should have only three %s symbols

    Thread Starter Cécile J.

    (@nvmweb)

    Hi,

    The only message I found in the .pot is the one below and it seems to be correct.

    The file was compressed from %s to %s, saving %s percent, using WP-Optimize

    Plugin Contributor Venkat Raj

    (@webulous)

    @nvmweb Do you see any other files in that directory?

    Or in wp-content/languages directory?

    This is the line that triggers the error
    https://plugins.trac.wordpress.org/browser/wp-optimize/tags/3.2.10/includes/class-updraft-smush-task.php#L287

    You can see that there is 3 replacements for translation string and are provided. Totally 4 arguments for sprintf which is correctly. The only way I can think of the error can happen is to have incorrect translation

    Thread Starter Cécile J.

    (@nvmweb)

    I’ve found another file in the wp-content/languages.
    The same sentence is correct here too but Poedit display 20 warning of wrong translation. They are little correction like : one space is missing ; This letter should not be in capitale ; one point is missing at the end of the sentence. Etc, etc.
    Do I have to correct all this errors ?
    Do you thing the error logs could came from this ?
    And if yes, do you want me to correct the file and send it to you for the others french natives ?`

    Plugin Contributor Venkat Raj

    (@webulous)

    @nvmweb Is there a french translated string of this? The file was compressed from %s to %s, saving %s percent, using WP-Optimize what it is?

    Thread Starter Cécile J.

    (@nvmweb)

    😀 Sorry ! Apparently I wasn’t concentrating. Indeed the French translation is not fair and there was indeed a % too much. I corrected and I will put the file back and reactivate the plugin. I will come back to confirm if it is ok.
    Thanks

    Thread Starter Cécile J.

    (@nvmweb)

    Hi,

    I come back with exactly the same error logs. It was not the % – I have reactivated the plugin few hours ago but the errors appears now (after around 8/9 hours…) May be the plugin try to lanch a task at this moment.
    I deactivate it.

    • This reply was modified 1 year, 4 months ago by Cécile J..
    Plugin Contributor Venkat Raj

    (@webulous)

    @nvmweb If you have more than 3 % symbols in your translation then this error is going to happen

    Plugin Contributor Venkat Raj

    (@webulous)

    @nvmweb See this thread to refer how correct translation fixes issue.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘PHP Fatal error’ is closed to new replies.