{"id":31650575,"url":"https://github.com/roelmagdaleno/herd-wp-setup","last_synced_at":"2026-05-01T12:32:10.040Z","repository":{"id":318234640,"uuid":"1070437629","full_name":"roelmagdaleno/herd-wp-setup","owner":"roelmagdaleno","description":"Automate local WordPress site creation with Laravel Herd, WP-CLI, and DBngin.","archived":false,"fork":false,"pushed_at":"2025-10-05T23:19:30.000Z","size":5,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-06T01:13:10.280Z","etag":null,"topics":["bash-script","laravel-herd","local-development","wordpress","wp-cli"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/roelmagdaleno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-05T23:08:09.000Z","updated_at":"2025-10-05T23:21:09.000Z","dependencies_parsed_at":"2025-10-06T01:13:22.459Z","dependency_job_id":"c294f2f8-d987-483e-ae9d-f5677883a1b2","html_url":"https://github.com/roelmagdaleno/herd-wp-setup","commit_stats":null,"previous_names":["roelmagdaleno/herd-wp-setup"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/roelmagdaleno/herd-wp-setup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roelmagdaleno%2Fherd-wp-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roelmagdaleno%2Fherd-wp-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roelmagdaleno%2Fherd-wp-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roelmagdaleno%2Fherd-wp-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/roelmagdaleno","download_url":"https://codeload.github.com/roelmagdaleno/herd-wp-setup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/roelmagdaleno%2Fherd-wp-setup/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32497810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash-script","laravel-herd","local-development","wordpress","wp-cli"],"created_at":"2025-10-07T08:30:58.808Z","updated_at":"2026-05-01T12:32:10.026Z","avatar_url":"https://github.com/roelmagdaleno.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# herd-wp-setup\n\nA tiny Bash utility to automate the local setup of a new WordPress site using WP-CLI and Laravel Herd.\n\n## Features\n\n- Creates a project folder under a configured base path\n- Downloads WordPress via WP-CLI\n- Secures the local site with `herd secure`\n- Creates a MySQL database\n- Generates `wp-config.php`\n- Runs the WordPress installer with your chosen admin credentials\n- Loads configuration variables from a .env file (or via `--env-file`) with sensible defaults\n\n## Requirements\n\n### Laravel Herd\n\n[Install and configure Laravel Herd](https://herd.laravel.com/docs/macos/getting-started/installation) on your machine. Ensure your base WordPress projects directory is added to Herd.\n\n### WP-CLI\n\nInstall [WP-CLI](https://wp-cli.org/) and ensure it's available in your terminal's PATH.\n\n### MySQL\n\nEnsure you have a local MySQL server running and accessible. The script uses the `mysql` client to create databases.\n\nYou can use databases created via [Herd Pro Services](https://herd.laravel.com/docs/macos/herd-pro-services/services), DBngin, Homebrew MySQL, or another local server.  \n\nThe default connection in the script points to:\n\n- `DB_USER` = `root`\n- `DB_PASSWORD` = (empty)\n- `DB_HOST` = `127.0.0.1`\n- `DB_PORT` = `3307`\n\n### Other Dependencies\n\n- OpenSSL (for generating an admin password when not provided)\n\n## Configuration\n\nThis script uses simple variables at the top of `herd-wp-setup.sh`. Edit these to suit your environment before running.\n\n### Path\n\nThis is the base folder where new WordPress sites will be created. It must be registered in Herd.\n\nDefault is `/Users/roelmagdaleno/Code/WordPress`, but change it to your own path.\n\n### Database\n\nConfigure your local MySQL connection details:\n\n- `DB_USER` (default: `root`)\n- `DB_PASSWORD` (default: empty)\n- `DB_HOST` (default: `127.0.0.1`)\n- `DB_PORT` (default: `3307`)\n\n### Environment variables (.env support)\n\nYou can configure the script using environment variables loaded from a .env-style file.\n\nWays to provide configuration (highest priority first):\n\n1. CLI flags (e.g., `--name`, `--username`, etc.)\n2. Variables loaded from an env file\n   - Pass a file via `--env-file /path/to/.herd-wp-setup.env`\n   - Or place a default file at `~/.herd-wp-setup.env`\n3. Built-in defaults (shown above)\n\nSupported variables for the env file:\n\n- `HERD_WP_BASE_PATH` — Base folder for new sites (must be registered in Herd)\n- `HERD_WP_DB_USER` - MySQL username\n- `HERD_WP_DB_PASSWORD` - MySQL password\n- `HERD_WP_DB_HOST` - MySQL host\n- `HERD_WP_DB_PORT` - MySQL port\n- `HERD_WP_DEFAULT_ADMIN_USER` — Default WordPress admin username\n- `HERD_WP_DEFAULT_ADMIN_EMAIL` — Default WordPress admin email\n- `HERD_WP_DEFAULT_ADMIN_PASSWORD` — Default WordPress admin password\n\nExample `~/.herd-wp-setup.env`:\n\n```\nHERD_WP_BASE_PATH=/Users/you/Code/WordPress\nHERD_WP_DB_USER=root\nHERD_WP_DB_PASSWORD=\nHERD_WP_DB_HOST=127.0.0.1\nHERD_WP_DB_PORT=3307\nHERD_WP_DEFAULT_ADMIN_USER=admin\nHERD_WP_DEFAULT_ADMIN_EMAIL=admin@local.test\nHERD_WP_DEFAULT_ADMIN_PASSWORD=secret\n```\n\n## Mail\n\nThe script includes the `stubs/herd-mailer.php` must-use plugin that connects to Herd's Pro SMTP server for local email logging.\n\nAfter running the script, the PHP file will be copied to the next path `wp-content/mu-plugins/herd-mailer.php` of the new WordPress site.\n\n[Mail](https://herd.laravel.com/docs/macos/herd-pro-services/mail#wordpress) is part of Herd Pro Services.\n\n## Usage\n\nMake the script executable (first time only):\n\n```\nchmod +x herd-wp-setup.sh\n```\n\nRun the script. You can provide CLI arguments or follow the interactive prompts.\n\nSupported options:\n- `--name`       Site name (e.g., \"WPB Plugins\"). Used to derive domain, folder, and DB name\n- `--username`   WordPress admin username (default prompted; falls back to `admin`)\n- `--email`      WordPress admin email (default prompted; falls back to `admin@\u003cdomain\u003e.test`)\n- `--password`   WordPress admin password (if omitted, you’ll be prompted and can auto-generate)\n- `--env-file`   Path to a .env file to load configuration variables (overrides defaults)\n\nExamples:\n\n```bash\n# Fully interactive\n./herd-wp-setup.sh\n\n# Provide only the site name (other values prompted)\n./herd-wp-setup.sh --name \"My WP Site\"\n\n# Use an env file for configuration (overrides defaults)\n./herd-wp-setup.sh --env-file ~/.herd-wp-setup.env --name \"Env Driven Site\"\n\n# Non-interactive install with explicit admin credentials\n./herd-wp-setup.sh \\\n  --name \"Acme Blog\" \\\n  --username acme_admin \\\n  --email admin@acme.test \\\n  --password \"S3cureP@ss!\"\n```\n\nWhat the script will do:\n\n- Convert the site name to a domain (lowercase, spaces → dashes). Example: \"Acme Blog\" → `acme-blog.test`\n- Create a folder at `${BASE_PATH}/acme-blog`\n- `wp core download`\n- `herd secure` to ensure a local TLS cert\n- Create a MySQL database named `acme_blog`\n- `wp config create` with the DB connection\n- `wp core install` with the provided or prompted admin credentials\n- Move the `herd-mailer` plugin to the `mu-plugins` folder for local email logging\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froelmagdaleno%2Fherd-wp-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Froelmagdaleno%2Fherd-wp-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Froelmagdaleno%2Fherd-wp-setup/lists"}