MainWP Community

PHP Fatal error when Pro Reports hooks Sucuri scan done

I’ve just recently re-enabled the Sucuri extension on my dashboard and have been working to also implement Pro Reports. Once a Sucuri scan has completed, I receive a critical error notice.

My logs are showing the following error:

[Thu Jan 30 14:01:25.638036 2020] [proxy_fcgi:error] [pid 2201:tid 140142283052800] [client 184.18.50.152:0] AH01071: Got error ‘PHP message: PHP Fatal error: Uncaught ArgumentCountError: Too few arguments to function MainWP_Pro_Reports_Extension::sucuri_scan_done(), 3 passed in /home/…/wp-includes/class-wp-hook.php on line 288 and exactly 4 expected in /home/…/wp-content/plugins/mainwp-pro-reports-extension/mainwp-pro-reports-extension.php:193\nStack trace:\n#0 /home/…/wp-includes/class-wp-hook.php(288): MainWP_Pro_Reports_Extension->sucuri_scan_done(‘3’, ‘success’, Array)\n#1 /home/…/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array)\n#2 /home/…/wp-includes/plugin.php(478): WP_Hook->do_action(Array)\n#3 /home/…/wp-content/plugins/mainwp-sucuri-extension/class/mainwp-sucuri.class.php(645): do_action(‘mainwp_sucuri_s…’, ‘3’, ‘success’, Array)\n#4 /home/…/wp-includes/class-wp-hook.php(288): MainWP_Sucuri->ajax_sucuri_scan_site(’…’, referer: https://…/wp-admin/admin.php?page=Extensions-Mainwp-Sucuri-Extension

It looks like we need to receive a 4th argument on the mainwp_sucuri_scan_done action, so that it can be passed to the function in Pro Reports.

I’m running Sucuri Extentsion v4.0.2 and Pro Reports 4.0.

3 Likes

Hi Joshua, thanks for reporting this.
I will have our dev team check this. As soon as I get some update from them, I will update this topic.

2 Likes

Thought I was the only one. :sweat_smile:

I put in a ticket the other day as well.

1 Like

Nope, you’re not the only one :smiley: I submitted this 4 days ago.

The $time_scan variable is missing in mainwp-sucuri-wp-cli-command.class.php on line 193 and adding that as an argument fixes the issue and logs the wp-cli sucuri scans again.

For a quick fix until an official update is released edit /plugins/mainwp-pro-reports-extension/mainwp-pro-reports-extension.php and add the $time_scan variable to line 193 so it becomes:

function sucuri_scan_done( $website_id, $scan_status, $data, $time_scan ) {
1 Like

The dev team updated the extension, you can grab the pre-release version here: https://www.dropbox.com/s/v1m6iy4rrwh1ml7/mainwp-sucuri-extension.zip?dl=0 and see if it solves the problem?

3 Likes

Seems to be working on my end. Thanks!

2 Likes

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.