Skip to main content

Setup sync

The plugin supports two ways of updating the data in Wordpress. The first one is a manual sync, and the other a automatic sync based on webhooks.

Manual sync

Before you can show courses, the plugin should fetch the course data first. In your Wordpress admin in the top-bar is shows the name Eduframe, when you hover over this it will state Sync (also Sync (force) in case you use older versions). You can click this button to tell Wordpress to fetch all the course data from Eduframe.

note

The manual sync should only be used at the start just after installing the plugin or when data doesn't match with Eduframe anymore.

New post types

Now that all courses are imported, on the left it will show a sidebar item called 'Courses'. When you open this it will show a list of all courses that are available. There are more tabs in the side bar, for example Planned courses, Teachers, Labels... Each page shows the data imported from Eduframe which you will be able to show on your website.

Automatic sync

The plugin supports a way to automatically update courses when changes are made in Eduframe. We can do this using webhooks. We highly recommend setting this up right after the installation.

For this you go to Eduframe. Under settings it will show a tab called 'Webhooks'. Here you have to add a new Webhook with the url as follows: 'YOUR_WEBSITE_DOMAIN/wp-content/plugins/eduframe/api/sync.php' where you replace YOUR_WEBSITE_DOMAIN with the domain of your website.

In order for the webhook to work you also need to select a couple of events.

V2 or newer events

  • catalog_variant.created, updated, and deleted
  • product.created, updated, and deleted
  • program.created, updated, and deleted
  • course.created, updated, and deleted
  • teacher_role.created, updated, and deleted
  • user.created, updated, and deleted
  • meeting.created, updated, and deleted
  • label.created, updated, and deleted
  • course_location.created, updated, and deleted
  • course_variant.created, updated, and deleted
  • category.created, updated, and deleted

V1 events

  • planned_course.created and planned_course.updated
  • course.created and course.updated
  • teacher_role.created and teacher_role.updated
  • user.created and user.updated
  • meeting.created and meeting.updated
  • label.created and label.updated
  • course_location.created and course_location.updated
  • course_variant.created and course_variant.updated
  • category.created and category.updated

Manual sync performance (>=v2 only)

When many products and variants are present, the plugin might run into trouble syncing these as you might run into rate limiting problems. When this happens you can execute the manual sync in steps.

When this occurs you can apply paging and filters to the sync to limit the amount for each manual sync. You can do this for the types: Catalog::Product and Catalog::Variant. Add the params &batch_size=100&batch_offset=100 and increase the batch_offset by 100 until you covered all. The response will show the amount of models synchronized.

Example: /wp-content/plugins/eduframe/api/sync.php?model_type=Catalog::Product&batch_size=100&batch_offset=0

For the other types limiting the batch size is not possible. You can however individually sync the following models: Location, CourseVariant, Label, Category, Teacher and Meeting

Example: /wp-content/plugins/eduframe/api/sync.php?model_type=Location

note

The automatic sync does not run into rate limiting and time-out issues.