pepsiftd
Forum Replies Created
-
Forum: Plugins
In reply to: [WP REST Cache] Cache Regeneration doesn’t seem to be workingI’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!
Forum: Plugins
In reply to: [WP REST Cache] Cache Regeneration doesn’t seem to be workingThank 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?
Forum: Plugins
In reply to: [WP REST Cache] Custom endpoint – Only get one entryUPD:
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 🙂Forum: Plugins
In reply to: [WP REST Cache] Custom endpoint – Only get one entryHi @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 909saying 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.