On updating few of the posts on Wordpress VIP website it throws an error of "Updating failed. The response is not a valid JSON response.".
By checking the network tab it is showing that issue is related to distributor plugin.
Error shown below:
To fix this issue I have added the code snippet in networkSiteConnection.php on line 749 by commenting line no. 748
`
//$site = get_site( (int) $blog_id );
@dkotter This issue seems to be caused by older version of WordPress(<4.6.0) that does not have get_site() function. Since we only support WP 5.7+, I think this issue can be closed.
Describe the bug
On updating few of the posts on Wordpress VIP website it throws an error of "Updating failed. The response is not a valid JSON response.".![image](https://github.com/10up/distributor/assets/165123266/c970d22f-9f33-49ea-9348-577dc328ce5f)
By checking the network tab it is showing that issue is related to distributor plugin. Error shown below:
To fix this issue I have added the code snippet in networkSiteConnection.php on line 749 by commenting line no. 748 ` //$site = get_site( (int) $blog_id );
if(function_exists('get_site'))
{
$sites=
get_site( (int) $blog_id ); } elseif(function_exists('wp_get_site')) { $sites= wp_get_site((int) $blog_id); } `This code snippet has fixed the call which was failing before.
Steps to Reproduce
Screenshots, screen recording, code snippet
API Header:![image](https://github.com/10up/distributor/assets/165123266/74db8c13-11ae-45c6-bd33-826e524f8e2f)
Error on Wordpress dashboard Distributor --> pull content![image](https://github.com/10up/distributor/assets/165123266/0fd18797-3639-48d7-8c01-b61d78b0d286)
Error response: "Uncaught Error: Call to undefined function Distributor\InternalConnections\get_site()"
Environment information
No response
WordPress information
No response
Code of Conduct
@dkotter This issue seems to be caused by older version of WordPress(<4.6.0) that does not have
get_site()
function. Since we only supportWP 5.7+
, I think this issue can be closed.Hello @kirtangajjar, We were already on the wordpress's 6.3 version. Still we are facing this issue for few of our posts.
@dhanashreekere Would it be possible to share the full stack trace of the error? I'm assuming both the sites are on an internal network?
@qasumitbagthariya I tried to reproduce this error, but I was unable to. Can you try to reproduce it on your end? Do the following:
@kirtangajjar I tried to reproduce but could not replicate the "Updating Failed" error.