Download the PHP package automattic/jetpack-sync without Composer

On this page you can find all versions of the php package automattic/jetpack-sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package jetpack-sync

Jetpack Sync

Everything needed to allow syncing to the WordPress.com infrastructure.

Get Started

The easiest way to get started with Sync is via the Jetpack Configuration package.

Configuring Sync with all Sync Modules enabled

Assuming a $config instance of Automattic/Jetpack/Config, the following code will configure Sync with all its Modules enabled:

$config->ensure( 'sync' )

Configuring Sync with limited functionality

It's possible to limit Sync functionality by providing an explicit list of data to be synced.

Using the Config package those data settings can be passed as an array in the ensure call for sync.

Here's an example:

Alteratively, if you prefer to use the Sync package directly, you can set the Sync data settings using the Main::set_sync_data_options method. For example:

Configurable Sync data settings

Here's a list of all the Sync data settings that are configurable:

jetpack_sync_modules

The list of Sync modules to enable. By default all Sync modules are enabled. You can override this behaviour by passing an array of Sync modules as follows:

It's important to note that we consider a list of certain Sync modules required for Sync to properly function, therefore the following modules will be enabled no matter the configuration:

jetpack_sync_options_whitelist / jetpack_sync_options_contentless

Controlled by the Sync Options Module, which is required. You can limit the site options to sync by specifying a list of explicit options as follows:

It's important to note that we consider a list of certain options required for Sync to properly function, therefore the following options will be synced no matter the configuration:

Passing a list of options will result in syncing those options plus the required ones.

Passing an empty array will result in syncing only the required options.

Not configuring this setting will result in syncing all default options, as defined by Sync (see Automattic\Jetpack\Sync\Defaults::$default_options_whitelist)

Same logic applies for the list of "Contentless" options we sync. For those options we DO NOT sync contents, only the option name - Good for sensitive information that Sync does not need.

The exception here is that there are no required ones. Therefore, passing an empty array will result in NOT syncing any contentless options.

Not configuring this setting will result in syncing all default contentless options, as defined by Sync (see Automattic\Jetpack\Sync\Defaults::$default_options_contentless)

jetpack_sync_callable_whitelist / jetpack_sync_multisite_callable_whitelist

Controlled by the Sync Callable Module, which is required. You can limit the callables to sync by specifying a list of explicit callables as follows:

When it comes to configuring callables, you need to pass an associative array where the key is the name of your callable and the value the corresponding callback function. It's important to note that we consider a list of certain callables required for Sync to properly function, therefore the following callables will be synced no matter the configuration:

Passing a list of callables will result in syncing those callables plus the required ones.

Passing an empty array will result in syncing only the required callables.

Not configuring this setting will result in syncing all default callables, as defined by Sync (see Automattic\Jetpack\Sync\Defaults::$default_callable_whitelist)

Same logic applies for the list of multisite callables we sync.

The exception here is that there are no required ones. Therefore, passing an empty array will result in NOT syncing any multisite callables.

Not configuring this setting will result in syncing all default multisite callables, as defined by Sync (see Automattic\Jetpack\Sync\Defaults::$default_multisite_callable_whitelist)

jetpack_sync_constants_whitelist

Controlled by the Sync Constants Module, which is required. You can limit the constants to sync by specifying a list of explicit constants as follows:

It's important to note that we consider a list of certain constants required for Sync to properly function, therefore the following constants will be synced no matter the configuration:

Passing a list of constants will result in syncing those constants plus the required ones.

Passing an empty array will result in syncing only the required constants.

Not configuring this setting will result in syncing all default constants, as defined by Sync (see Automattic\Jetpack\Sync\Defaults::$default_constants_whitelist)

jetpack_sync_post_meta_whitelist

Controlled by the Sync Posts Module, which is NOT required. This means that you also need to add the Posts module in jetpack_sync_modules otherwise this setting will be ignored. You can limit the Post meta to sync by specifying a list of explicit Post meta as follows:

Passing an empty array will result in NOT syncing any Post meta.

Not configuring this setting will result in syncing all default Post meta, as defined by Sync (see Automattic\Jetpack\Sync\Defaults::$post_meta_whitelist)

jetpack_sync_comment_meta_whitelist

Controlled by the Sync Comments Module, which is NOT required. This means that you also need to add the Comments module in jetpack_sync_modules otherwise this setting will be ignored. You can limit the Comment meta to sync by specifying a list of explicit Comment meta as follows:

Passing an empty array will result in NOT syncing any Comment meta.

Not configuring this setting will result in syncing all default Comment meta, as defined by Sync (see Automattic\Jetpack\Sync\Defaults::$comment_meta_whitelist)

jetpack_sync_capabilities_whitelist

Controlled by the Sync Users Module, which is NOT required. This means that you also need to add the Users module in jetpack_sync_modules otherwise this setting will be ignored. You can limit the capabilities to sync by specifying a list of explicit Comment meta as follows:

Passing an empty array will result in NOT syncing any capabilities.

Not configuring this setting will result in syncing all default capabilities, as defined by Sync (see Automattic\Jetpack\Sync\Defaults::$default_capabilities_whitelist)

Initial Full Sync

An initial full sync of the site is started when the site is registered or when a user is authorized.

Actions::do_only_first_initial_sync

The Actions::do_only_first_initial_sync method can be used to start an initial full sync when a site has not already had a full sync started. This is useful for situations in which a plugin needs to start an initial full sync only if no other plugin has already started one.

Examples

Using this package in your WordPress plugin

If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

Security

Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.

License

jetpack-sync is licensed under GNU General Public License v2 (or later)


All versions of jetpack-sync with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
automattic/jetpack-connection Version ^2.7.0
automattic/jetpack-constants Version ^2.0.1
automattic/jetpack-identity-crisis Version ^0.18.0
automattic/jetpack-password-checker Version ^0.3.1
automattic/jetpack-ip Version ^0.2.2
automattic/jetpack-roles Version ^2.0.1
automattic/jetpack-status Version ^2.2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package automattic/jetpack-sync contains the following files

Loading the files please wait ....