PHPackages                             mrkoopie/wp\_wrapper - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mrkoopie/wp\_wrapper

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

mrkoopie/wp\_wrapper
====================

Wraps WordPress functions into mockable objects. Used for WP\_ajaxfilter.

v1.2.4(10y ago)0228[1 PRs](https://github.com/MrKoopie/WP_wrapper/pulls)1MITPHP

Since Mar 19Pushed 9y ago1 watchersCompare

[ Source](https://github.com/MrKoopie/WP_wrapper)[ Packagist](https://packagist.org/packages/mrkoopie/wp_wrapper)[ RSS](/packages/mrkoopie-wp-wrapper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (11)Used By (1)

WP\_wrapper
===========

[](#wp_wrapper)

[![Total Downloads](https://camo.githubusercontent.com/be5b25e9b7b18f14f2aa6ed892631e2fe4d524638e1e336e299b03f1780bdf02/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d726b6f6f7069652f77705f777261707065722e737667)](https://packagist.org/packages/mrkoopie/wp_wrapper)[![Latest Stable Version](https://camo.githubusercontent.com/a971b9933b9ba29cbbc1dd18e8a1589b2b5375da63f63614bf18399b8746e0bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d726b6f6f7069652f77705f777261707065722e737667)](https://packagist.org/packages/mrkoopie/wp_wrapper)[![Build status https://travis-ci.org/MrKoopie/WP_wrapper.svg?branch=master](https://camo.githubusercontent.com/9ab8dcbe8f2aef27392a82d151415c6f5255216f808dda67cea2b35b9ba6933d/68747470733a2f2f7472617669732d63692e6f72672f4d724b6f6f7069652f57505f777261707065722e7376673f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/9ab8dcbe8f2aef27392a82d151415c6f5255216f808dda67cea2b35b9ba6933d/68747470733a2f2f7472617669732d63692e6f72672f4d724b6f6f7069652f57505f777261707065722e7376673f6272616e63683d6d6173746572)

By default WordPress has many non-mockable functions such as register\_taxonomy(). By implementing this wrapper you can create tests that use mocks instead of a real WordPress installation.

How to install
--------------

[](#how-to-install)

1. Go to the root directory of your theme/plugin.
2. Run the following command:

```
composer require mrkoopie/wp_wrapper
```

3. Include the composer autoloader in your script (for a theme the functions.php).

```
require_once('vendor/autoload.php');
```

How to use the wrapper
----------------------

[](#how-to-use-the-wrapper)

Simply include this in the top of your file:

```
use MrKoopie/WP_wrapper/WP_wrapper;
```

Now you can run any command (including any PHP command) via the wrapper:

```
echo WP_wrapper::print_r('Y',1);
```

Do I always have to use the use feature?
----------------------------------------

[](#do-i-always-have-to-use-the-use-feature)

Simply use this code to make the class available without the namespace. Do note that this may cause conflicts when an other class exists with the name WP\_wrapper.

```
require_once('vendor/autoload.php');

class WP_wrapper extends MrKoopie/WP_wrapper/WP_Wrapper {};
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~3 days

Total

8

Last Release

3683d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/48f6009cc6459e5ccb495b790724a2645b7b5eb5f33bb2e6917f054c052da062?d=identicon)[dkoop](/maintainers/dkoop)

---

Top Contributors

[![MrKoopie](https://avatars.githubusercontent.com/u/3456873?v=4)](https://github.com/MrKoopie "MrKoopie (16 commits)")

### Embed Badge

![Health badge](/badges/mrkoopie-wp-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/mrkoopie-wp-wrapper/health.svg)](https://phpackages.com/packages/mrkoopie-wp-wrapper)
```

###  Alternatives

[jaeger/querylist-phantomjs

QueryList Plugin: Use PhantomJS to crawl Javascript dynamically rendered pages.(headless WebKit ) 使用PhantomJS采集JavaScript动态渲染的页面

6124.3k1](/packages/jaeger-querylist-phantomjs)

PHPackages © 2026

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