PHPackages                             monitorbacklinks/yii2-wordpress - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. monitorbacklinks/yii2-wordpress

ActiveYii2-extension[API Development](/categories/api)

monitorbacklinks/yii2-wordpress
===============================

Yii2 component for integration with Wordpress CMS via XML-RPC API

1.1.1(11y ago)3326.9k11[8 issues](https://github.com/monitorbacklinks/yii2-wordpress/issues)[1 PRs](https://github.com/monitorbacklinks/yii2-wordpress/pulls)MITPHPPHP &gt;=5.4.0

Since Aug 4Pushed 8y ago14 watchersCompare

[ Source](https://github.com/monitorbacklinks/yii2-wordpress)[ Packagist](https://packagist.org/packages/monitorbacklinks/yii2-wordpress)[ Docs](http://monitorbacklinks.github.io/yii2-wordpress/)[ RSS](/packages/monitorbacklinks-yii2-wordpress/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

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.
===========================================================================================================================================================

[](#this-repository-is-no-longer-maintainedissue-reports-and-pull-requests-will-not-be-attended-you-are-welcome-to-fork-the-repository-if-youd-like-though)

Yii2 Wordpress
==============

[](#yii2-wordpress)

[Yii2 Wordpress](http://monitorbacklinks.github.io/yii2-wordpress) is a component for [Yii2 framework](https://github.com/yiisoft/yii2) designed for integration with Wordpress CMS via XML-RPC API.

This component is built on top of [Wordpress XML-RPC PHP Client](https://github.com/letrunghieu/wordpress-xmlrpc-client) by [Hieu Le Trung](https://github.com/letrunghieu).

[![Latest Stable Version](https://camo.githubusercontent.com/3afb2931e7f5dfe62398f2a99395de26759176594176bc9dabf23b478472733d/68747470733a2f2f706f7365722e707567782e6f72672f6d6f6e69746f726261636b6c696e6b732f796969322d776f726470726573732f762f737461626c652e737667)](https://packagist.org/packages/monitorbacklinks/yii2-wordpress)[![Build Status](https://camo.githubusercontent.com/bd6eb5cbf68e5faf47f5d0a4230e4efe528370ee3b46ba896f009097419dd389/68747470733a2f2f7472617669732d63692e6f72672f6d6f6e69746f726261636b6c696e6b732f796969322d776f726470726573732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/monitorbacklinks/yii2-wordpress)[![Code Climate](https://camo.githubusercontent.com/f47bf915ac9597f1c88525d5ad055e328aa463fd8a466dc17a97ba409d3699ee/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6d6f6e69746f726261636b6c696e6b732f796969322d776f726470726573732e706e67)](https://codeclimate.com/github/monitorbacklinks/yii2-wordpress)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/3da8a1c2ed280278816841d01c7bd5fb8982f760ccc7e442cb947950f7f656bc/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d6f6e69746f726261636b6c696e6b732f796969322d776f726470726573732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/monitorbacklinks/yii2-wordpress/?branch=master)[![Version Eye](https://camo.githubusercontent.com/029384ecb243722a5b3f9cc93f97a726017b8398f287b366208ecddd84fd3bd8/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f6d6f6e69746f726261636b6c696e6b733a796969322d776f726470726573732f62616467652e737667)](https://www.versioneye.com/php/monitorbacklinks:yii2-wordpress)[![License](https://camo.githubusercontent.com/85775cfc038cb1a5b10bacc7f432ddcf033f023afcf4c6eee59d661fdfdccb71/68747470733a2f2f706f7365722e707567782e6f72672f6d6f6e69746f726261636b6c696e6b732f796969322d776f726470726573732f6c6963656e73652e737667)](https://packagist.org/packages/monitorbacklinks/yii2-wordpress)

Requirements
------------

[](#requirements)

- Yii 2.0
- PHP 5.4
- PHP extension [XML-RPC](http://php.net//manual/en/book.xmlrpc.php)

Installation
------------

[](#installation)

The preferred way to install this extension is through [Composer](http://getcomposer.org/).

Either run

`php composer.phar require monitorbacklinks/yii2-wordpress "dev-master"`

or add

` "monitorbacklinks/yii2-wordpress": "dev-master"`

to the `require` section of your `composer.json` file.

Usage
-----

[](#usage)

### Component creation

[](#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`):

```
    'components' => [
        ...
        'blog' => [
            'class' => '\monitorbacklinks\yii2wp\Wordpress',
            'endpoint' => 'http://example.com/xmlrpc.php',
            'username' => 'demo',
            'password' => 'demo'
        ]
        ...
    ]
```

### First API request

[](#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:

```
    $blogPosts = Yii::$app->blog->getPosts([
        'post_status' => 'publish',
        'number' => 10
    ], ['guid', 'post_title', 'post_content']);
```

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

```
    $postID = Yii::$app->blog->newPost('New post', 'Hello world!');
```

### Caching request results

[](#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:

```
    // The user profile will be fetched from cache if available.
    // If not, the query will be made against XML-RPC API and cached for use next time.
    $profile = Yii::$app->blog->cache(function (Wordpress $blog) {
        return $blog->getProfile();
    });
```

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

```
    $blogPosts = Yii::$app->blog->cache(function (Wordpress $blog) {

        // ... queries that use query cache ...

        return $blog->noCache(function (Wordpress $blog) {
            // this query will not use query cache
            return $blog->getPosts();
        });
    });
```

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

Configuration parameters
------------------------

[](#configuration-parameters)

#### `$endpoint`

[](#endpoint)

`string` Wordpress XML-RPC API endpoint URL.

#### `$username`

[](#username)

`string` Wordpress authentication username.

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

#### `$password`

[](#password)

`string` Wordpress authentication password.

#### `$proxyConfig`

[](#proxyconfig)

`array` Proxy server configuration.

This configuration array should follow the following format:

- `proxy_ip`: the ip of the proxy server (WITHOUT port)
- `proxy_port`: the port of the proxy server
- `proxy_user`: the username for proxy authorization
- `proxy_pass`: the password for proxy authorization
- `proxy_mode`: value for CURLOPT\_PROXYAUTH option (default to CURLAUTH\_BASIC)

Empty array means that no proxy should be used.

Default value: `[]`.

#### `$authConfig`

[](#authconfig)

`array` Server HTTP authentication configuration.

This configuration array should follow the following format:

- `auth_user`: the username for server authentication
- `auth_pass`: the password for server authentication
- `auth_mode`: value for CURLOPT\_HTTPAUTH option (default to CURLAUTH\_BASIC)

Empty array means that no HTTP authentication should be used.

Default value: `[]`.

#### `$catchExceptions`

[](#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`

[](#enablequerycache)

`boolean` Whether to enable query caching.

Default value: `true`.

#### `$queryCacheDuration`

[](#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`

[](#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
-------------------------

[](#list-of-available-methods)

The full list of available methods can be found in [Wordpress XML-RPC PHP Client Class Reference](http://letrunghieu.github.io/wordpress-xmlrpc-client/api/class-HieuLe.WordpressXmlrpcClient.WordpressClient.html).

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
--------------

[](#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:

```
    'components' => [
        ...
        'log' => [
            'targets' => [
                'file' => [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error'],
                    'categories' => ['monitorbacklinks\yii2wp\Wordpress::*'],
                ],
            ],
        ],
        ...
    ]
```

Report
------

[](#report)

- Report any issues [on the GitHub](https://github.com/monitorbacklinks/yii2-wordpress/issues).

License
-------

[](#license)

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

Resources
---------

[](#resources)

- [Project Page](http://monitorbacklinks.github.io/yii2-wordpress)
- [Packagist Package](https://packagist.org/packages/monitorbacklinks/yii2-wordpress)
- [Source Code](https://github.com/monitorbacklinks/yii2-wordpress)

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 78.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~38 days

Total

3

Last Release

4228d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6701010?v=4)[Monitor Backlinks](/maintainers/MonitorBacklinks)[@monitorbacklinks](https://github.com/monitorbacklinks)

---

Top Contributors

[![kop](https://avatars.githubusercontent.com/u/645148?v=4)](https://github.com/kop "kop (15 commits)")[![RazvanGirmacea](https://avatars.githubusercontent.com/u/962767?v=4)](https://github.com/RazvanGirmacea "RazvanGirmacea (2 commits)")[![alancpark](https://avatars.githubusercontent.com/u/13892076?v=4)](https://github.com/alancpark "alancpark (1 commits)")[![jbfm](https://avatars.githubusercontent.com/u/646638?v=4)](https://github.com/jbfm "jbfm (1 commits)")

---

Tags

wordpressyii2wpyiixml-rpcxmlrpcintegration

###  Code Quality

TestsCodeception

### Embed Badge

![Health badge](/badges/monitorbacklinks-yii2-wordpress/health.svg)

```
[![Health](https://phpackages.com/badges/monitorbacklinks-yii2-wordpress/health.svg)](https://phpackages.com/packages/monitorbacklinks-yii2-wordpress)
```

###  Alternatives

[phpxmlrpc/phpxmlrpc

A php library for building xmlrpc clients and servers

2414.9M45](/packages/phpxmlrpc-phpxmlrpc)[hieu-le/wordpress-xmlrpc-client

A PHP client for Wordpress websites that closely implement the XML-RPC WordPress API with full test suite built in

118158.5k2](/packages/hieu-le-wordpress-xmlrpc-client)[baibaratsky/yii2-ga-measurement-protocol

Google Analytics Measurement Protocol for Yii2

13104.2k](/packages/baibaratsky-yii2-ga-measurement-protocol)[sonko-dmitry/yii2-telegram-bot-api

Telegram bot api component for Yii2

2132.2k](/packages/sonko-dmitry-yii2-telegram-bot-api)[skeeks/yii2-google-api

Component for work with google api based on google/apiclient

1243.1k1](/packages/skeeks-yii2-google-api)[tbondois/odoo-ripcord

Ripoo : a PHP8 XML-RPC client handler for Odoo External API

16124.3k1](/packages/tbondois-odoo-ripcord)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
