GithubHelp home page GithubHelp logo

isabella232 / wds-user-email-scrambler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from webdevstudios/wds-user-email-scrambler

0.0 0.0 0.0 30 KB

Adds a WP-CLI command that scramblers user email addresses. Useful for preventing accidentally emailing real customers/users when testing mass or transactional email.

License: GNU General Public License v3.0

PHP 100.00%

wds-user-email-scrambler's Introduction

WDS User Email Scrambler

Adds a WP-CLI command that scrambles user email addresses. Useful for preventing accidentally emailing real customers/users when testing mass or transactional email.

Installation

  • Download and install the file like any other WordPress plugin on your site.
  • Activate as a normal WordPress plugin or drop the wds-user-email-scrambler.php file into /mu-plugins

Arguments

  • --ignored-domains=<domains> - Comma-separated list of domains to exclude from the scrambling process.
  • --table=<table> - Table to target for scrambling. Defaults to users.
  • --field=<field> - Field to target for scramlbing. Defaults to user_email.
  • --where-field=<field>, --where-value=<value> - Field and field value used to target specific records via a where clause: WHERE <field> = <value>.

Usage

  • Use wp db export before-scramble.sql to backup your database before scrambling.
  • Run the wp scramble-user-emails command. It is highly recommended to specify some ignored domains.
  • By default, the command applies to the user_email field in the users table. Use the --table and --field arguments to target a field in another table.
  • Use the --where-field and --where-value to target specific records for scrambling.

Specifying Ignored Domains

  • If you run wp scramble-user-emails --ignored-domains="webdevstudios.com, wdslab.com" for example, then any user email that ends with @webdevstudios.com or @wdslab.com will be ignored.
  • This is useful for preserving, for example, admin email addresses or author email addresses.

Specifying custom tables

  • If you run wp scramble-user-emails --table=postmeta --field=meta_value --where-field=meta_key --where-value="_billing_email", the meta_value for all records in the postmeta table with meta_key = "_billing_email" will be scrambled.

Example

Before: before-screenshot

Command

wp scramble-user-emails --ignored-domains="webdevstudios.com, okeeffemuseum.org, anagr.am"

After: after-screenshot

Example with specified target table and WHERE clause arguments

Before: before-screenshot

Command

wp scramble-user-emails --ignored-domains="webdevstudios.com" --table=postmeta --field=meta_value --where-field=meta_key --where-value="_billing_email"

After: after-screenshot

wds-user-email-scrambler's People

Contributors

ggwicz avatar

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.