All Projects → JayWood → jw-wpcli-random-posts

JayWood / jw-wpcli-random-posts

Licence: other
A robust random post generator for WP CLI which supports multisite, post types, post counts, taxonomies, terms, term counts and featured images. Complete with a cleanup command to undo it all!

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to jw-wpcli-random-posts

wordpress-project
Generic project structure for WordPress website industrialisation.
Stars: ✭ 28 (-51.72%)
Mutual labels:  wp-cli
wp-cli-build
Fetch specific versions of plugins/themes from wordpress.org using a build file
Stars: ✭ 45 (-22.41%)
Mutual labels:  wp-cli
BP-Default-Data
Create lots of users, messages, friends connections, groups, topics, activity items in BuddyPress - useful for testing purpose.
Stars: ✭ 13 (-77.59%)
Mutual labels:  lorem-ipsum
bea-content-sync-fusion
Synchronize contents across your Multisite.
Stars: ✭ 41 (-29.31%)
Mutual labels:  multisite
checksum-command
Verifies file integrity by comparing to published checksums.
Stars: ✭ 29 (-50%)
Mutual labels:  wp-cli
import-command
Imports content from a given WXR file.
Stars: ✭ 19 (-67.24%)
Mutual labels:  wp-cli
wp-cli-seed-command
WP CLI Seed Command is extension for WP-CLI to seed database with sample data
Stars: ✭ 20 (-65.52%)
Mutual labels:  wp-cli
Multisite-Language-Switcher
WordPress Plugin: Multisite Language Switcher
Stars: ✭ 118 (+103.45%)
Mutual labels:  multisite
wp-site-cloner
Create sites with content from other sites
Stars: ✭ 22 (-62.07%)
Mutual labels:  multisite
i18n-command
Provides internationalization tools for WordPress projects.
Stars: ✭ 76 (+31.03%)
Mutual labels:  wp-cli
ENIGMA
The ENIGMA Toolbox is an open-source repository for accessing 100+ ENIGMA statistical maps, visualizing cortical and subcortical surface data, and relating neuroimaging findings to micro- and macroscale brain organization. 🤠
Stars: ✭ 66 (+13.79%)
Mutual labels:  multisite
lorem.space
✨✨✨🪐✨✨✨  LOREM.SPACE ✨✨✨🪐✨✨✨
Stars: ✭ 310 (+434.48%)
Mutual labels:  lorem-ipsum
wp-cli-dev
🛠 WP-CLI development environment that allows for easy development across all packages
Stars: ✭ 29 (-50%)
Mutual labels:  wp-cli
hangul ipsum
한글 버전의 lorem ipsum 생성기
Stars: ✭ 17 (-70.69%)
Mutual labels:  lorem-ipsum
ForeignIpsum
Generate text for your mockups in multiple languages ¯\_(ツ)_/¯
Stars: ✭ 43 (-25.86%)
Mutual labels:  lorem-ipsum
WordPress-Distribution
This repository helps you to get a local new and fresh WordPress for everything you want (e.g. Developing, Testing, etc.).
Stars: ✭ 16 (-72.41%)
Mutual labels:  wp-cli
media-command
Imports files as attachments, regenerates thumbnails, or lists registered image sizes.
Stars: ✭ 40 (-31.03%)
Mutual labels:  wp-cli
bea-plugin-defaults
Library of WordPress mu-plugins to set plugin's default options.
Stars: ✭ 17 (-70.69%)
Mutual labels:  multisite
Multisites
Multisites on a single Zikula instance
Stars: ✭ 11 (-81.03%)
Mutual labels:  multisite
trellis-sync
Trellis Database and Uploads Folder Synchronisation scripts and example WP CLI Aliases
Stars: ✭ 27 (-53.45%)
Mutual labels:  wp-cli

WP CLI Random Posts Generator

This WP CLI posts generator, unlike the core generator in WP CLI, supports the following:

  • Terms
  • Term Counts
  • Taxonomies
  • Post Types
  • Post Counts
  • Post Author
  • Post Status
  • Featured Images ( thanks to lorempixel.com )
  • Featured Image Types ( thanks to lorempixel.com )
  • Image Download sizes
  • Multi-site ( specify site id if necessary )

NEW - using wp jw-random cleanup <options> this script now cleans up after itself.

Thanks to Loripsum.net for providing the API for the content - Also thanks to @fzaninotto for the Faker library.

What this does NOT do

Currently this CLI command does not support meta-data, mainly due to the amount of commands you would need to run for large sites. Still a great script if you need to generate some placeholder posts fast, especially with featured images and terms.

Installation

Installing the random post generator is SUPER easy, for the latest and greatest, do the following:

  • wp package install jaywood/jw-wpcli-random-posts:dev-master

If you'd like a specific version, say 2.0, it's this simple:

  • wp package install jaywood/jw-wpcli-random-posts:2.0

Sample Commands

Generate 50 posts, no feature image

Possibly the simplest way to use the generator.

  • wp jw-random generate 50

Create 10 posts with featured business images for an author

First find the author you want to attach the Post to

  • wp user list

Now you know the author ID just use the --author flag like so:

  • wp jw-random generate 10 --author=13 --featured-image --img-type=business

The author field also supports slug ( login ), and email.

Create 10 posts with categories, tags, and featured images ( the usual stuff )

( --term-count tells the script to also add 15 terms to each taxonomy )

  • wp jw-random generate 10 --featured-image --taxonomies=category,post_tag --term-count=15

Clean up posts, terms, and media that was generated

( --force-delete permanently deletes posts and media instead of just trashing them )

  • wp jw-random cleanup --tax=post_tag,category --force-delete

Options

In the interest of keeping this readme slim, all options have been moved to the Wiki.

Changelog

2.0

  • A bit of house cleaning.
  • Moved generate and cleanup commands to separate files.
  • Renamed a lot of CLI arguments to make more sense.
  • Now using the Faker library instead of relying on API calls.
  • Author now supports email, slug ( login ), or ID.
  • Removed the media flag, no sense in having it if post type is empty it defaults to all.
  • Removed the --site option, use --url instead.
  • Made use of md5_file() to prevent image duplication within the media library.

1.4

  • Removed some CLI default values causing the script to complain when it shouldn't have.
  • Cleaned up get_post_content() a bit.
  • Ignore some PHPCS complaints about @unlink
  • Small message updates.
  • Some PHPCS fixes ( alignment, assignments, etc.. )

1.3

  • Changed ipsum generator to loripsum.net, fixes #11
  • Update API url for random word getter ( setgetgo )
  • Remove dependancy on exif PHP library.

1.2

  • Fixed - #6 - Error message duplication
  • Fixed - #10 - Removed a lot of log messages, added progress bars in their place.
  • Changed - posts command to generate - makes more sense.
  • Remove the flag --n for specfying post count, make post count required positional argument instead.
  • Significant readme updates.

1.1

  • Fixed possible bug with post_type_exists checks on multisite installs.
  • Added cleanup method to allow users to undo/remove posts, terms, and media that was added via this generator. This is not backwards compatible, with earlier versions, sorry guys!
  • Added post_status flag for generating posts, you can now set your own status.
    Note: status does not validate, so you can technically set this to anything, its up to you as a developer to expose custom statuses in the admin.
  • Added taxonomy validation: Script will now validate if a taxonomy is even registered, and allow you to continue if you want.

1.0

Initial Release

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].