• Resolved slhodson

    (@slhodson)


    I am trying to create a custom plugin and keep getting the following error when activating it:

    Plugin could not be activated because it triggered a?fatal error.

    The plugin does seem to activate however, but obviously this error raises an eyebrow. I tested with a very basic custom plugin and I am even able to reproduce it by activating the Hello Dolly plugin.

    I enabled debug mode and got the following log:

    [Thu Aug 29 13:09:08.622051 2024] [php:error] [pid 67:tid 67] [client 192.168.65.1:16990] PHP Fatal error:  Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "after_otter_activation" not found or invalid function name in /var/www/html/wp-includes/class-wp-hook.php:326\nStack trace:\n#0 /var/www/html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)\n#1 /var/www/html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)\n#2 /var/www/html/wp-admin/includes/plugin.php(730): do_action('activated_plugi...', 'hello.php', false)\n#3 /var/www/html/wp-admin/plugins.php(60): activate_plugin('hello.php', 'https://localhos...', false)\n#4 {main}\n  thrown in /var/www/html/wp-includes/class-wp-hook.php on line 326, referer: https://localhost:8000/wp-admin/plugins.php?plugin_status=all&paged=1&s

    It seems to have some issue with the after_otter_activation function which is part of the theme.

    Is this a bug and something that should be “ignored” for now?

    Note: I am running WordPress locally via Docker.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    Thanks for reaching out!

    This does not seam to be any bug. It’s most likely related to the custom plugin you are trying to build.

    I suggest you have an extra look on it, and try to find any possible issue there.

    Kind regards,

    Rodica

    Thread Starter slhodson

    (@slhodson)

    Hi @rodicaelena,

    I removed all custom plugins and still got the same result.

    With some further digging, I found the cause to be line 69 in the Admin.php file from the theme.

    Currently it is:

    add_action( 'activated_plugin', 'after_otter_activation' );

    So I changed it to:

    add_action( 'activated_plugin', array( $this, 'after_otter_activation' ) );

    And now the error is gone.

    I’m no WordPress or PHP expert so maybe this isn’t the correct solution, but this line was the cause of my issue.

    Hi @slhodson,

    Thank you for getting back to me!

    Indeed this seams to be an issue in the theme, which I’ve reported here https://github.com/Codeinwp/neve-fse/issues/147

    Thank you for your help!

    Hey @slhodson,

    Thank you for pointing out the issue. We’ve made a patch release that fixes this issue. Let us know if it works as expected for you after the update which should be out in few minutes.

    Thread Starter slhodson

    (@slhodson)

    I can confirm that this is fixed in the latest (v1.1.1) release.

    Thanks for the speedy work.

    Thank you for the cooperation!

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