-3

I'm writing WordPress plugin which can post to many sites at once. When I publish a post or create a user or category on server, all content will be sync with clients by using form post method. But the code run too slowly.

How can I speed up synchronization of data?

  • Posting data to 1000 sites once should be very slow (even 3 sites will be very slow). You should run that into a cronjob or something. – Mario Sep 02 '18 at 06:23

1 Answers1

0

The best way to go would to create a plugin that hooks into the save_post action. This will be triggered when a post is saved (added or modified). Then store the post ID in a custom queue table. Using a cronjob script you can work the queue every x minutes and post the data through xmlrpc to the other websites.

Frank
  • 530
  • 5
  • 15