Skip to content

Instantly share code, notes, and snippets.

@lgedeon
Created October 4, 2018 20:54
Show Gist options
  • Save lgedeon/d5baaa7dd83361e842600f3c754bde3f to your computer and use it in GitHub Desktop.
Save lgedeon/d5baaa7dd83361e842600f3c754bde3f to your computer and use it in GitHub Desktop.
Outline for a WordPress plugin that is able to replicate any content from any site, any time.
Components:
# Change watcher - Hooks into post, meta, menu, option, taxonomy, etc. save events and records the type of content, the id and a timestamp of the most recent change. If the same content is changed again, just update the timestamp.
# Change feed generator - Expose feed of content updates. Include content ID numbers.
# Content feed generator - Expose paginated feeds of all content starting with the oldest content and an end-point listing all content feeds with the number of items in each, so that a site can choose to only consume the last x number of items or can pick up where it left off.
# Site watcher - Consume feed.Record timestamp of last update check. Record origin site's url, content type, content id and the id of where the content was assigned on the local site. Also track highest page number processed so it can start back where it left off.
# Content consumer - Add new content as needed.
# Change consumer - Update individual content items.
# UI - allow selection of content to import. Default is to get everything.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment