itinerisltd/gathercontent-sync-command

Sync WordPress and GatherContent.

0.1.0 2018-10-12 08:50 UTC

This package is auto-updated.

Last update: 2024-11-16 03:47:23 UTC


README

Packagist Version PHP from Packagist Packagist Downloads GitHub License Hire Itineris

Goal

Sync WordPress and GatherContent by WP CLI.

Minimum Requirements

  • PHP v7.2
  • WordPress v4.9.8
  • WP CLI v1.5
  • GatherContent Plugin v3.1.9
  • Already pulled some posts from GatherContent

Installation

# For WP CLI v2.0 or later:
$ wp package install itinerisltd/gathercontent-sync-command:@stable

# For WP CLI v1.5.x:
# Check for latest version!
$ wp package install itinerisltd/gathercontent-sync-command:^0.1.0

Usage

Before using the commands, you must first create mappings with the GatherContent Plugin via WP Dashboard, i.e: pull some content first.

Pulling from GatherContent

# Find all imported posts and schedule pulling the newer versions from GatherContent
$ wp gather-content-sync pull

Requirements:

  • some posts already imported
  • a newer version exist on GatherContent
  • WP Ajax is working

If all the requirements are met, the command schedules pulling events.

Cron Jobs

Use case: Pull content from GatherContent to WordPress every 5 minutes with system cron.

$ crontab -e

# Add a new cron task at the end
*/5 * * * * /usr/local/bin/wp gather-content-sync pull --yes --path=/www/my_site/public >/dev/null 2>&1

Tips:

  • Specific full path to wp cli (e.g: /usr/local/bin/wp)
  • Specific full path to WordPress web root (--path=/www/my_site/public)
  • Skip confirmation by --yes

Learn more on How to Write a Cron Job and Manage Server Crons at Kinsta.

FAQ

Will you add support for older PHP versions?

Never! This plugin will only works on actively supported PHP versions.

Don't use it on end of life or security fixes only PHP versions.

It looks awesome. Where can I find some more goodies like this?

This package isn't on wp.org. Where can I give a ⭐️⭐️⭐️⭐️⭐️ review?

Thanks! Glad you like it. It's important to make my boss know somebody is using this project. Instead of giving reviews on wp.org, consider:

Feedback

Please provide feedback! We want to make this library useful in as many projects as possible. Please submit an issue and point out what you do and don't like, or fork the project and make suggestions. No issue is too small.

Change Log

Please see CHANGELOG for more information on what has changed recently.

Security

If you discover any security related issues, please email hello@itineris.co.uk instead of using the issue tracker.

Credits

gathercontent-sync-command is a Itineris Limited project created by Tang Rufus.

Full list of contributors can be found here.

License

The MIT License (MIT). Please see License File for more information.