Apologies for this broad question but I am not hugely familiar with the Error Log entries at present. Any directives on where to begin the relevant research, would be greatly appreciated.

For the past 12 months, I have had the Google Authenticate Plugin, installed on a WordPress powered eCommerce website I work on. There had been no issues with the Plugin until a recent VPS and WordPress update. Since said updates, the Google Authenticate Plugin does not recognise any of the inputted codes. I am not sure if the error is being triggered by the WordPress update or the VPS itself.

I then checked the error_log and saw the below entry when trying to use the Google Authenticate Plugin:

mod_fcgid: stderr: PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'remove_wpcf7' not found or invalid function name in /var/www/vhosts/example.com/httpdocs/wp-includes/class-wp-hook.php on line 286, referer: https://www.example.com/wp-admin/plugins.php

Troubleshooting

As standard, I deactivated all Plugins (Except for the WooCommerce Plugin) as well as the WordPress Theme I had created. I then simply activated WordPress' Twenty Seventeen Theme. The error still persisted; leaving me wondering just what is causing the issue.

I can see there is a reference to WordPress' core files. Maybe there is some incompatibilities?

Any directives on this, would be greatly appreciated ... Even if to just help me expand on this question.

4

There are 4 best solutions below

0
Craig On BEST ANSWER

Finally found the solution ... It related to the Server Time Settings.

If anyone else is experiencing a similar issue with their Google Authentication feature, you will need to ensure your Server's time settings are in sync with the 'Internet's Clock'.

  1. Login into your VPS;
  2. Head to Tools & Settings > General Settings > System Time;
  3. Here, you should have a screen that looks something like:

    enter image description here

  4. Ensure that the Date & Time > Update system time is deselected;

  5. Ensure that Network time > Synchronize system time is selected;
  6. Then within Network time > Domain name or IP, enter 3.pool.ntp.org and select 'Ok'. It was this step, which I needed to do in order to fix my own issue.
5
Santiago Cerro López On

Find in code any reference to 'remove_wpcf7' and find method is assigned in filter/hook. In this case you can find, for example a method inside a class called incorrectly. For example: add_filter('filter_name', 'method');. You can fix, for example, by add: add_filter('filter_name', array($this, 'method')); or if method is static: add_filter('filter_name', array(CLASSNAME::class, 'method'));

Hope this help you

===

UPDATE

Edit wp-includes/class-wp-hook.php line 73 and add:

    public function add_filter( $tag, $function_to_add, $priority, $accepted_args ) {
        if ($function_to_add === 'remove_wpcf7') {
            throw new \Exception('Exception');
        }
        [...]
    }

Get trace of this uncaught exception (if you can use xdebug extension it be better) and you will see line is creating this filter.

0
Ivnhal On

Try to add this function to your WP.

Here is the code to add in the function.php file of your theme:

function remove_wpcf7(){
}
0
Cameron On

If you're here because of Timber/Twig this is an example of the correct way to use add_filter with timber/context:

add_filter('timber/context', function($context) {
    $context['promo_modal'] = get_field('promo_modal', 'option');
    return $context;
});