Skip to content

WordPress Plugin(WPSiteSync for Content) Bug fix

WordPress Plugin (https://wordpress.org/plugins/wpsitesynccontent/) Version 1.3.1 does not work well. Here is some solution to make the code through without license.(Really waste time to fix this plugin)

In file classes/apirequest.php Line 710 better be:

'post_status' => 'inherit',

Following code will upload all related attachments to the new site.

However it’s NOT compatible with Attachments Plugin.

And also has lots of bugs. So the following code is not recommended:

foreach ($post_children as $child_id => $child_post) {
  $attach_id = $child_id;
  if($attach_id != 0)
       $this->send_media($child_post->guid, $post_id, $post_thumbnail_id, $attach_id);
}

And same file Line 716 -> Line 789 has a HUGE logic bug! what if the image is just an external link? and what if image is not added by Add Media then class attribute does not generate? and what if image is just a base64 code?

Actually Line 716 -> Line 789 can be removed if you DO NOT need upload files to new site.
Meanwhile, you should also remove line 330 in file classes/apicontroller.php.
Then links(images) will become external links referred to the old site’s media library.

Published inBugs

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

http://next.sh/wp-content/smilies/icon_confused.gif 
http://next.sh/wp-content/smilies/icon_cool.gif 
http://next.sh/wp-content/smilies/icon_cry.gif 
http://next.sh/wp-content/smilies/icon_eek.gif 
http://next.sh/wp-content/smilies/icon_evil.gif 
http://next.sh/wp-content/smilies/icon_exclaim.gif 
http://next.sh/wp-content/smilies/icon_idea.gif 
http://next.sh/wp-content/smilies/icon_mad.gif 
http://next.sh/wp-content/smilies/icon_mrgreen.gif 
http://next.sh/wp-content/smilies/icon_neutral.gif 
http://next.sh/wp-content/smilies/icon_question.gif 
http://next.sh/wp-content/smilies/icon_razz.gif 
http://next.sh/wp-content/smilies/icon_redface.gif 
http://next.sh/wp-content/smilies/icon_rolleyes.gif 
http://next.sh/wp-content/smilies/icon_sad.gif 
http://next.sh/wp-content/smilies/icon_smile.gif 
http://next.sh/wp-content/smilies/icon_arrow.gif 
http://next.sh/wp-content/smilies/icon_biggrin.gif 
http://next.sh/wp-content/smilies/icon_surprised.gif 
http://next.sh/wp-content/smilies/icon_twisted.gif 
http://next.sh/wp-content/smilies/10.gif 
http://next.sh/wp-content/smilies/102.gif 
http://next.sh/wp-content/smilies/103.gif 
http://next.sh/wp-content/smilies/106.gif 
http://next.sh/wp-content/smilies/108.gif 
http://next.sh/wp-content/smilies/20.gif 
http://next.sh/wp-content/smilies/26.gif 
http://next.sh/wp-content/smilies/37.gif 
http://next.sh/wp-content/smilies/99.gif