Giter Site home page Giter Site logo

humanmade / wp-hammer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 10up/wp-hammer

3.0 12.0 1.0 82 KB

wp hammer cleans your WordPress site of personally identifiable information and extra content

Home Page: http://hammer.press

License: MIT License

PHP 100.00%

wp-hammer's Introduction

#WP Hammer wp ha is a multi-tool. You can use it to clean your environment of personally identifiable information and extra content (posts and users) that are not necessary.

WARNING

WARNING All changes are final and modify your site DB. Make sure you take a backup of your database BEFORE you play around with the tool wp db export

Before You Begin

Make a copy of your database.

About

This tool will help you work on a client's site without having to worry about any of their user's personal information (emails, post content etc) being hosted on your dev environment.

Installation

Make sure you have wp-cli installed and in your $PATH. Following that, run this command in your terminal:

wp package install ivankruchkoff/wp-hammer

Usage

With wp ha you can:

Clean up user emails.

wp ha -f users.user_email='[email protected]'

Clean up user passwords.

To auto generate passwords: wp ha -f users.user_pass=auto

To set all passwords to password: wp ha -f users.user_pass=password

Replace posts with dummy posts.

wp ha -f posts.post_content=markov,posts.post_title=random

Remove extra users.

wp ha -l users=10

Remove extra Posts.

wp ha -l posts=100

Or you can chain tasks together like in the following example, which we'll break down in parts as the syntax is fairly powerful wp ha -f posts.post_author=auto,users.user_pass=auto,users.user_email='[email protected]',posts.post_title=ipsum,posts.post_content=markov -l users=10,posts=100.post_date

wp ha How you invoke the command

Format

wp ha -f posts.post_author=auto users.user_pass=__user_email__UMINtHeroJEreAGleC users.user_email='[email protected]' posts.post_title=ipsum posts.post_content=markov posts.post_author is set to a random user ID (from those that will remain after we've performed any adjustments to the users) users.user_pass is set to the user email followed by UMINtHeroJEreAGleC users.user_email='[email protected]' - __ID__ is replaced by the user ID posts.post_title=ipsum replaces all post_titles with auto-generated lorem ipsum posts.post_content=markov replaces all post_content with randomly generated content, using markov chains for the specified post_content

Limits

-l users=10 posts=page.100.post_date,post.50.post_content.length users=10 only the first 10 users remain posts=page.100.postdate,post.50.post_content.length We keep the following posts: post type = page, 100 posts sorted by postdate, descending post type = post, 50 posts with the longest post_content `

Another example

wp db import production.sql && wp ha posts.post_author=auto,users.user_pass=XGRwPjb7uFD5de23,users.user_email='[email protected]',posts.post_title=ipsum,posts.post_content=markov -l users=10 && wp db export staging.sql

License

Copyright (c) 2015, Ivan Kruchkoff, 10up Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Credits

Created by Ivan Kruchkoff ( @ivankk), at 10up.com.

Think this is a cool project? Love working with WordPress? 10up is hiring!

wp-hammer's People

Contributors

danielbachhuber avatar ivankruchkoff avatar jpry avatar tlovett1 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

sshyran

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.