• Resolved gregnsn

    (@gregnsn)


    I have a problem when I execute the WP CLI command: wp imagify generate-missing-nextgen wp
    The command returns a Fatal error and asks me for a supplementary argument that seems to be the “Format”.

    Fatal error: Uncaught ArgumentCountError: Too few arguments to function Imagify\Bulk\Bulk::run_generate_nextgen(), 1 passed in /htdocs/wp-content/plugins/imagify/classes/CLI/GenerateMissingNextgenCommand.php on line 19 and exactly 2 expected in /htdocs/wp-content/plugins/imagify/classes/Bulk/Bulk.php:223
    Stack trace: 0 /htdocs/wp-content/plugins/imagify/classes/CLI/GenerateMissingNextgenCommand.php(19): Imagify\Bulk\Bulk->run_generate_nextgen() 1 [internal function]: Imagify\CLI\GenerateMissingNextgenCommand->__invoke() 2 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func() 3 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher{closure}() 4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(488): call_user_func() 5 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php in /htdocs/wp-content/plugins/imagify/classes/Bulk/Bulk.php on line 223

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author WP Media

    (@wp_media)

    Hello,

    I understand you’re encountering an error when trying to generate missing next-gen images with the wp imagify generate-missing-nextgen command.

    The issue is that the command requires an additional argument specifying the format you want to generate (WebP or AVIF).

    Here’s the corrected command format:

    wp imagify generate-missing-nextgen <format>

    Replace <format> with either webp or avif depending on your preference.

    For example, to generate WebP versions:

    wp imagify generate-missing-nextgen webp

    Remember to enable WebP or AVIF generation in your Imagify settings before running the command.

    I hope this helps! Let me know if you have any other questions.

    Best Regards,
    Saransh.

    Thread Starter gregnsn

    (@gregnsn)

    Hello,
    Thank you for your answer.
    But I have the same error when I use: wp imagify generate-missing-nextgen webp
    Webp format is enabled in settings

    wp imagify generate-missing-nextgen webp
    Fatal error: Uncaught ArgumentCountError: Too few arguments to function Imagify\Bulk\Bulk::run_generate_nextgen(), 1 passed in /app/wp-content/plugins/imagify/classes/CLI/GenerateMissingNextgenCommand.php on line 19 and exactly 2 expected in /app/wp-content/plugins/imagify/classes/Bulk/Bulk.php:223
    Stack trace:
    #0 /app/wp-content/plugins/imagify/classes/CLI/GenerateMissingNextgenCommand.php(19): Imagify\Bulk\Bulk->run_generate_nextgen()
    #1 [internal function]: Imagify\CLI\GenerateMissingNextgenCommand->__invoke()
    #2 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(100): call_user_func()
    #3 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}()
    #4 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php(491): call_user_func()
    #5 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(419): WP_CLI\Dispatcher\Subcommand->invoke()
    #6 phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(442): WP_CLI\Runner-> in /app/wp-content/plugins/imagify/classes/Bulk/Bulk.php on line 223

    Plugin Author WP Media

    (@wp_media)

    Hello,

    I’m sorry about that.

    Can you please try below and see if it helps?

    wp imagify generate-missing-nextgen wp webp

    Best Regards,

    Plugin Author WP Media

    (@wp_media)

    Hi,

    I’m following up to see if I left any of your questions about Imagify unanswered?
    If all is well, there’s no need to reply, and I will just close our conversation.

    However, if you have any further questions about Imagify, feel free to let me know, I’ll gladly continue to assist you.

    Thanks!
    Marko

    I’ve tried several commands but I’m still getting the Too few arguments to function error. The version I’ve installed is 2.2.2

    Plugin Author WP Media

    (@wp_media)

    Hey @kipzes,

    Our developers have confirmed that this is a bug, and it has been added to their list of issues to address. Unfortunately, I don’t have an ETA for when this will be resolved at the moment but you can track it here: https://github.com/wp-media/imagify-plugin/issues/885

    Thank you for your understanding.

    Best Regards,
    Saransh.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.