• Resolved Mikhail Alferov

    (@malferov)


    I see in error.log:

    PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, non-static method C4WP_Settings::c4wp_nocaptcha_plugin_notice_ignore() cannot be called statically

    The method c4wp_nocaptcha_plugin_notice_ignore() must be statically.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author robertabela

    (@robert681)

    Thank you for using our plugin Mikhail.

    I am sorry to read about your issue. Can you please share more details with us so we can better understand the issue?

    1. Is this a one off error or is it repeating itself?
    2. Is the plugin / website still functioning or are there any issues?
    3. What version of the plugin, WordPress and PHP are you using?
    4. Do you know if this error happens when you do something specific / can you reproduce the issue?

    Looking forward to hearing from you.

    Thread Starter Mikhail Alferov

    (@malferov)

    1. Repapeating.
    2. Still functioning.
    3. Plugin version: 7.2.0, PHP 8.1 and WordPress 6.2.
    4. In the admin/settings.php file you call an action by passing $this into a hook: add_action( 'wp_ajax_c4wp_nocaptcha_plugin_notice_ignore', array( $this, 'c4wp_nocaptcha_plugin_notice_ignore' ), 10, 1 ); and in the anr-capthca-class.php file — statically (without passing $this or new instance of class): add_action( 'wp_ajax_c4wp_nocaptcha_plugin_notice_ignore', array( 'C4WP_Settings', 'c4wp_nocaptcha_plugin_notice_ignore' ), 10, 1 );

    In PHP, static methods can be called both statically and from within an object context, but not the other way around.

    P. S. To reproduce an error you can run your own JS-code in the browser console when admin dashboard with c4wp_nocaptcha_plugin_notice_ignore action:

    let ourButton = jQuery(this);
    var nonce = ourButton.attr('data-nonce');
    var type = ourButton.attr('data-notice-type');
    
    jQuery.ajax({
    ? ? type: 'POST',
    ? ? url: ajaxurl,
    ? ? async: true,
    ? ? data: {
    ? ? ? ? action: 'c4wp_nocaptcha_plugin_notice_ignore',
    ? ? ? ? nonce: nonce,
    ? ? ? ? notice_type: type,
    ? ? },
    ? ? success: function (result) {
    ? ? ? ? jQuery(ourButton).closest('.notice').slideUp();
    ? ? }
    });
    Plugin Author robertabela

    (@robert681)

    Hello Mikhail,

    We have escalated your issue to the developers and we’ll let you know if we need more information. We should be releasing an update of the plugin within the next few days with a fix for this issue.

    Plugin Author robertabela

    (@robert681)

    Hello @malferov

    We have an updated version of the plugin ready to be tested. You can download this update from the plugins patches page.

    Can you please test it and let us know if that does the trick for you?

    Thanks.

    Plugin Author robertabela

    (@robert681)

    Hello @malferov

    As per the other forum thread, we have just released update 7.2.1 which addresses this issue. Please update your copy of the plugin to the latest version.

    Should you have any other questions, please do not hesitate to ask us. Also, if you like the plugin and our service we would really appreciate it if you can rate the plugin. These ratings are really helpful.

    Have a great day and thank you very much for using our plugin.

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