• Resolved helmar

    (@helmar)


    [08-Jun-2023 16:25:06 UTC] PHP Fatal error:? Uncaught ArgumentCountError: Too few arguments to function burst_rest_api_options_set(), 1 passed in /usr/www/xxxx/site/wp-includes/rest-api/class-wp-rest-server.php on line 1181 and exactly 2 expected in /usr/www/xxxx/site/wp-content/plugins/burst-statistics/settings/settings.php:560
    
    Stack trace:
    
    #0 /usr/www/users/xxxx/wp-includes/rest-api/class-wp-rest-server.php(1181): burst_rest_api_options_set(Object(WP_REST_Request))
    
    #1 /usr/www/users/xxxx/wp-includes/rest-api/class-wp-rest-server.php(1028): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/burst/v1/optio...', Array, NULL)
    
    #2 /usr/www/users/xxxx/wp-includes/rest-api/class-wp-rest-server.php(442): WP_REST_Server->dispatch(Object(WP_REST_Request))
    
    #3 /usr/www/users/xxxx/wp-includes/rest-api.php(410): WP_REST_Server->serve_request('/burst/v1/optio...')
    
    #4 /usr/www/users/xxxx/wp-includes/class-wp-hook.php(308): rest_api_loaded(Object(WP))
    
    #5 /usr/www/users/xxxx/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters('', Array)
    
    #6 /usr/www/users/xxxx/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
    
    #7 /usr/www/users/xxxx/wp-includes/class-wp.php(399): do_action_ref_array('parse_request', Array)
    
    #8 /usr/www/users/xxxx/wp-includes/class-wp.php(780): WP->parse_request('')
    
    #9 /usr/www/users/xxxx/wp-includes/functions.php(1334): WP->main('')
    
    #10 /usr/www/users/xxxx/wp-blog-header.php(16): wp()
    
    #11 /usr/www/users/xxxx/index.php(18): require('/usr/www/users/...')
    
    #12 {main}
    
    ? thrown in /usr/www/users/xxx/wp-content/plugins/burst-statistics/settings/settings.php on line 560

    What gives?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    @helmar Thanks for reporting the issue.

    Since the last version, a fallback for the settings page has been added, which kicks in if the rest api is not working correctly. This requires a second variable, only to be used in case of the fallback, but default false, like this:

    function burst_rest_api_options_set( $request, $ajax_data = false ){}

    In the current version it is set without a default. As a consequence, you get this error if the fallback is NOT used.

    I have corrected this in Github, it will be included in the next update as well. Until then you can use the Github version.

    https://github.com/really-simple-plugins/burst

    You can also leave it as it is, as it only uses this function for specific actions on the back-end, and won’t trigger by normal statistics tracking.

    Let me know if you have any questions!

    Thread Starter helmar

    (@helmar)

    Thanks for taking care of that, Rogier! I now get other messages in my log:

    [17-Jun-2023 20:53:06 UTC] Burst Statistics: burst_create_statistic->required values are not set
    [17-Jun-2023 21:06:42 UTC] Burst Statistics: burst_create_statistic->required values are not set
    [18-Jun-2023 04:31:18 UTC] Burst Statistics: burst_create_statistic->required values are not set
    [18-Jun-2023 04:31:20 UTC] Burst Statistics: burst_create_statistic->required values are not set
    [18-Jun-2023 05:17:23 UTC] Burst Statistics: burst_create_statistic->required values are not set
    [18-Jun-2023 05:18:20 UTC] Burst Statistics: burst_create_statistic->required values are not set
    [18-Jun-2023 05:59:57 UTC] Burst Statistics: burst_create_statistic->required values are not set

    Plus, I often get a server error message (or three, rather) in the bottom right corner. This seems to have gone away at the moment, but I’ll keep an eye on it.

    Cheers and keep up the great work,
    Helmar

    Plugin Author Rogier Lankhorst

    (@rogierlankhorst)

    @helmar thanks for reporting. An update is coming which should address both issues you mentioned. The first is essentially harmless, we have changed all logging to log only if WP_DEBUG is enabled, to prevent filling up the logs. The second is a minor bug which causes the settings page to use the fallback api, even if not needed. Let me know if it still occurs after the next release.

    Thread Starter helmar

    (@helmar)

    Yeah, that makes sense (1). (2) I noticed in the current release. First it was there, then it disappeared and was happy with the endpoint method.

    Thread Starter helmar

    (@helmar)

    Addendum: In my case I get those server error messages far more often than a working stats page. Just now they popped up again, preventing any stats from being shown. I’ll wait for the next release.

    Plugin Author Hessel de Jong

    (@hesseldejong)

    Hi @helmar,

    We have just released a new version. Let us know if that solves issues you are facing.

    Kind regards,
    Hessel

    Thread Starter helmar

    (@helmar)

    Hi Hessel,

    log stays clean (thus far), but still getting these, in 1.4.2.1
    https://www.mrmasterkey.com/site/wp-content/uploads/2023/06/Screenshot-2023-06-20-at-14.26.06.jpg

    as well as 1.4.3

    https://www.mrmasterkey.com/site/wp-content/uploads/2023/06/Screenshot-2023-06-20-at-17.43.26.jpg

    And then it works again after reloading the page. A bit fickle, so I’ll keep an eye on it.
    Cheers and keep it up!

    Helmar

    • This reply was modified 1 year, 5 months ago by helmar.
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Fatal error: too few arguments’ is closed to new replies.