Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter pepsiftd

    (@pepsiftd)

    I’m not sure what was the problem but the cron job is there now. All I did was change from Twice Daily to Once Daily and there it was. Now when I change back to Twice Daily it is still there so I can’t reproduce the problem ¯\_(ツ)_/¯

    Well thanks for your help anyway! And thanks again for the awesome plugin!

    Thread Starter pepsiftd

    (@pepsiftd)

    Thank you @rockfire for your reply!

    Yes I think that is the one Action Scheduler I was talking about. I thought it was built in WP. Now I see it might be WooCommerce added.

    Anyway, I’ve installed WP Control and it doesn’t show the desired WP Cron job wp_rest_cache_regenerate_cron . I’ll try disabling other plugins to see if they affect this.

    Could you suggest anything I should do to debug this?

    Thread Starter pepsiftd

    (@pepsiftd)

    UPD:
    actually it didn’t fix the issue, just removed the warnings
    I’m not sure why but without wp_json_encode it returns the proper array in my case
    $data['data'] = json_decode( $data['data'] , true );
    forget it 🙂

    Thread Starter pepsiftd

    (@pepsiftd)

    Hi @rockfire

    Thank you for your reply!

    You’ve verified that it is not the above code that creates the problem for me. So it became clear that it was my fiddling with the code that made the trouble. So I just reinstalled the plugin and it worked!

    Thanks for the support.

    p.s. to somehow atone for the waste of your time I’ll tell about a small issue I had with the same custom route:

    The first time the request went through your plugin, the response contained php warnings which ruined the json string. Warnings pointed to the includes/caching/class-caching.php line 909 saying the $data['data'] was not an array. But 2 lines above it explicitly says it has to be

    // Force data to be an array.
    $data['data'] = json_decode( wp_json_encode( $data['data'] ), true );

    Somehow this line didn’t work for me returning a string.
    This fixed the issue

    // Force data to be an array.
    $data['data'] = (array)json_decode( wp_json_encode( $data['data'] ), true );

    Hope it may help somebody

    • This reply was modified 4 years, 11 months ago by pepsiftd.
Viewing 4 replies - 1 through 4 (of 4 total)