• Resolved asteaguinity

    (@asteaguinity)


    Wordpress: 6.0.1
    CAU: 3.8.6

    Seems like the plugin tries to use the WordPress get_plugins() function, without requiring the necessary file wp-admin/includes/plugin.php first (as the already required update.php does not seem to do it by itself).

    [28-Aug-2022 18:05:02 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function get_plugins() in /wp-admin/includes/update.php:378
    Stack trace:
    #0 /wp-content/plugins/companion-auto-update/cau_emails.php(239): get_plugin_updates()
    #1 /wp-content/plugins/companion-auto-update/cau_emails.php(9): cau_list_plugin_updates()
    #2 /wp-includes/class-wp-hook.php(307): cau_check_updates_mail()
    #3 /wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #4 /wp-includes/plugin.php(524): WP_Hook->do_action(Array)
    #5 /wp-cron.php(138): do_action_ref_array('cau_set_schedul...', Array)
    #6 {main}
      thrown in /wp-admin/includes/update.php on line 378
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Papin Schipper

    (@papin)

    Hi there! This should be fixed in version 3.8.7 ??

    Thread Starter asteaguinity

    (@asteaguinity)

    Sadly the new update does not seem to have resolved the issue. I guess you’ll have to extend your function_exists check to include get_plugins(), as get_plugin_updates() seems to be defined already.
    Although it definitely feels strange that it would already be defined but the required get_plugins() function not.

    Here’s the changed stack trace:

    [14-Sep-2022 18:05:02 UTC] PHP Fatal error:  Uncaught Error: Call to undefined function get_plugins() in /wp-admin/includes/update.php:378
    Stack trace:
    #0 /wp-content/plugins/companion-auto-update/cau_emails.php(250): get_plugin_updates()
    #1 /wp-content/plugins/companion-auto-update/cau_emails.php(9): cau_list_plugin_updates()
    #2 /wp-includes/class-wp-hook.php(307): cau_check_updates_mail()
    #3 /wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #4 /wp-includes/plugin.php(524): WP_Hook->do_action(Array)
    #5 /wp-cron.php(138): do_action_ref_array('cau_set_schedul...', Array)
    #6 {main}
      thrown in /wp-admin/includes/update.php on line 378
    
    Plugin Author Papin Schipper

    (@papin)

    That’s odd, I’ve added the get_plugins check in version 3.8.7.1, could you check if this fixes it?

    Thread Starter asteaguinity

    (@asteaguinity)

    This seems to have done the trick, as no error showed up this time after the cron event was handled. I still find it quite strange, that get_plugin_updates() would already be defined, but the required get_plugins() function would not.

    Anyway, thanks for your efforts!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fatal error when trying to send update emails’ is closed to new replies.