Download the PHP package monitorbacklinks/yii2-wordpress without Composer

On this page you can find all versions of the php package monitorbacklinks/yii2-wordpress. 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 yii2-wordpress

This repository is no longer maintained. Issue reports and pull requests will not be attended. You are welcome to fork the repository if you'd like though.

Yii2 Wordpress

Yii2 Wordpress is a component for Yii2 framework designed for integration with Wordpress CMS via XML-RPC API.

This component is built on top of Wordpress XML-RPC PHP Client by Hieu Le Trung.

Latest Stable Version Build Status Code Climate Scrutinizer Code Quality Version Eye License

Requirements

Installation

The preferred way to install this extension is through Composer.

Either run

or add

to the require section of your composer.json file.

Usage

Component creation

In order to use this extension, first thing you need to do is to create a blog (you can change the name if you want) component and configure it. Here is the example of minimal configuration (in your config/main.php):

First API request

When component is configured, you can start making requests to your Wordpress site.

For example, get ten latest published posts. Select guid, post_title and post_content fields only:

Or create a new post with title "New post" and content "Hello world!":

Caching request results

Making API calls to an external application means delays. If you don't want your users to wait for a Wordpress response each time, caching is a right thing to do:

In case, if you need something more complex, you can disable caching for some requests:

Caching will work for data retrieval queries only. Queries that create, update or delete records will not use caching component.

Configuration parameters

$endpoint

string Wordpress XML-RPC API endpoint URL.

$username

string Wordpress authentication username.

Please note, that any actions made by XML-RPC will be made on behalf of this user.

$password

string Wordpress authentication password.

$proxyConfig

array Proxy server configuration.

This configuration array should follow the following format:

Empty array means that no proxy should be used.

Default value: [].

$authConfig

array Server HTTP authentication configuration.

This configuration array should follow the following format:

Empty array means that no HTTP authentication should be used.

Default value: [].

$catchExceptions

boolean Whether to catch exceptions thrown by Wordpress API, pass them to the log and return default value, or transmit them further along the call chain.

Default value: true.

$enableQueryCache

boolean Whether to enable query caching.

Default value: true.

$queryCacheDuration

integer The default number of seconds that query results can remain valid in cache.

Use 0 to indicate that the cached data will never expire.

Default value: 3600.

$queryCache

Cache|string The cache object or the ID of the cache application component that is used for query caching.

Default value: 'cache'.

List of available methods

The full list of available methods can be found in Wordpress XML-RPC PHP Client Class Reference.

Please note, that all those methods are throwing an exceptions in case of any errors. While this extension is configured (by default), in case of errors, to return an empty array for any data retrial methods and false for any create, update or delete methods. Please see $catchExceptions configuration option for details.

Errors logging

There are a lot of things that can go wrong (network problems, wrong Wordpress user permissions, etc.). If $catchExceptions configuration option is set to true (default value), this extension will catch them and pass to monitorbacklinks\yii2wp\Wordpress::* logging category.

In order to see them, you can configure your Yii2 log component to something similar to this:

Report

License

yii2-wordpress is released under the MIT License. See the bundled LICENSE.md for details.

Resources


All versions of yii2-wordpress with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
ext-xmlrpc Version *
yiisoft/yii2 Version *
hieu-le/wordpress-xmlrpc-client Version ~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 monitorbacklinks/yii2-wordpress contains the following files

Loading the files please wait ....