PHPackages                             dxw/wordpress-setup - 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. dxw/wordpress-setup

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

dxw/wordpress-setup
===================

Helpers for automating your WordPress setup

v0.1.1(1y ago)14.4k↓59.4%MITPHPCI passing

Since Jul 22Pushed 1mo ago8 watchersCompare

[ Source](https://github.com/dxw/wordpress-setup)[ Packagist](https://packagist.org/packages/dxw/wordpress-setup)[ RSS](/packages/dxw-wordpress-setup/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (2)Dependencies (4)Versions (6)Used By (0)

WordPress Setup
===============

[](#wordpress-setup)

A package to help with getting WordPress configured and populated with content, so that it's a known testable or dev-able state.

How to use
----------

[](#how-to-use)

Install with Composer:

```
composer require-dev dxw/wordpress-setup

```

Call the Factory to get a new Setup instance, e.g.:

```
$setup = Dxw\WordPressSetup\Factory::create();

```

Then call specific modules as properties of setup, e.g to create a post:

```
$setup->post->create();

```

Or to create a menu and assign it to a menu location in your theme:

```
$setup->menu->createAndAssignLocation('menu-name', 'menu-location');

```

Modules and their available methods are documented in detail below.

Modules
-------

[](#modules)

### Media

[](#media)

#### `upload`

[](#upload)

Upload a file to the media library, and create the appropriate attachment metadata.

Takes either a path to the file, or a URL:

```
$setup->media->upload(string $pathOrUrlToFile);

```

Returns the ID of the created attachment.

### Menu

[](#menu)

#### `addCustomLink`

[](#addcustomlink)

Add a custom link item to a menu, where the first argument is the ID of the menu to assign it to:

```
$setup->menu->addCustomLink(int $menuId, string $menuItemTitle, string $menuItemUrl);

```

Can also be passed the ID of the menu item this should be a child of as the final argument:

```
$setup->menu->addCustomLink(int $menuId, string $menuItemTitle, string $menuItemUrl, int $parentMenuItemId);

```

Returns the ID of the menu item that has been created.

#### `addTaxonomyLink`

[](#addtaxonomylink)

Add a taxonomy archive link to a menu.

```
$setup->menu->addTaxonomyLink(int $menuId, int $termid, int $taxonomyName)

```

Can also optionally be passed the ID of the menu item this should be a child of:

```
$setup->menu->addTaxonomyLink(int $menuId, int $termid, int $taxonomyName, int $parentMenuItemId)

```

Returns the ID of the menu item that has been created.

#### `createAndAssignLocation`

[](#createandassignlocation)

Create a new menu and assign it to a theme location by name:

```
$setup->menu->createAndAssignLocation(string $menuName, string $menuLocation);

```

Returns the ID of the new menu.

### Plugin

[](#plugin)

#### `activate`

[](#activate)

Activate a plugin by its slug:

```
$setup->plugin->activate(string $pluginSlug)

```

### Post

[](#post)

#### `create`

[](#create)

Create a new post:

```
$setup->post->create();

```

By default, Faker will be used to generate dummy title and content, the post type will be `post` and the post status will be `publish`.

You can override any of these defaults (or add additional parameters) using the same array of args you would pass to `wp_insert_post`.

Returns the ID of the new post.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance65

Regular maintenance activity

Popularity23

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84% 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 ~789 days

Total

2

Last Release

644d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/370665?v=4)[Rob Skilling](/maintainers/RobjS)[@RobjS](https://github.com/RobjS)

![](https://avatars.githubusercontent.com/u/1659723?v=4)[jkeasley](/maintainers/jkeasley)[@jkeasley](https://github.com/jkeasley)

![](https://avatars.githubusercontent.com/u/4721596?v=4)[Matthew Passmore](/maintainers/matpassmore)[@matpassmore](https://github.com/matpassmore)

![](https://avatars.githubusercontent.com/u/71827088?v=4)[Serena Piccioni](/maintainers/serena-piccioni)[@serena-piccioni](https://github.com/serena-piccioni)

---

Top Contributors

[![RobjS](https://avatars.githubusercontent.com/u/370665?v=4)](https://github.com/RobjS "RobjS (21 commits)")[![serena-piccioni](https://avatars.githubusercontent.com/u/71827088?v=4)](https://github.com/serena-piccioni "serena-piccioni (2 commits)")[![snim2](https://avatars.githubusercontent.com/u/97674?v=4)](https://github.com/snim2 "snim2 (2 commits)")

---

Tags

composergovpresspackagistphp

### Embed Badge

![Health badge](/badges/dxw-wordpress-setup/health.svg)

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

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

100387.6k57](/packages/verbb-formie)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

53675.5k15](/packages/solspace-craft-freeform)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49517.1k](/packages/blackfire-player)[directorytree/dummy

438.9k](/packages/directorytree-dummy)[beyondcode/laravel-masked-db-dump

Dump masked information from your database

11345.8k](/packages/beyondcode-laravel-masked-db-dump)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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