Skip to content

Commit

Permalink
Fix local env.
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenDufresne committed Sep 20, 2024
1 parent 19b3897 commit 6b7fb7f
Show file tree
Hide file tree
Showing 8 changed files with 2,556 additions and 574 deletions.
563 changes: 0 additions & 563 deletions .env/import.wxr

This file was deleted.

2 changes: 1 addition & 1 deletion .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"wp-content/mu-plugins": "./mu-plugins",
"wp-content/plugins": "./plugins",
"wp-content/themes": "./themes",
"wp-content/mu-plugins/0-sandbox.php": "./.env/0-sandbox.php",
"wp-content/mu-plugins/0-sandbox.php": "./env/0-sandbox.php",
"wp-content/phpunit.xml.dist": "./phpunit.xml.dist",
"wp-cli.local.yml": "./wp-cli.local.yml"
}
Expand Down
28 changes: 18 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ In order to contribute with code changes, you'll want to set up a local environm
npm run wp-env start
```

1. Configure WordPress.

```bash
npm run setup:wp
```

If you're using a different local environment, or don't want to use wp-env, you can skip that step and just replace `wp-content` with this repo, so that the themes and plugins are in the correct places.


Expand All @@ -51,16 +57,18 @@ If you're using a different local environment, or don't want to use wp-env, you

### Setting up default data

1. Set your permalinks to "Post name" at `Settings > Permalinks`.
1. Run the WP XML Importer at `Tools > Import` and select `wp-content/.env/import.wxr`.
1. Set the Primary Menu at `Appearance > Menu`.
1. Set "About" as the static home page at `Settings > Reading`.
1. Add new Pledges on the "Add New Pledge" page. Note that you'll need to use valid WP usernames on your install.
1. Set the new entry to Published in the `Five For the Future > Pledges admin` area.
1. Find the "Sending email" log entry in the pledge admin and copy/paste the link in a new tab to confirm the email.
1. Go to the `Five For the Future > Contributors` page and publish the post(s) via quick edit.
1. Your new pledge should appear on the `/pledges/` pages now.

1. Save your permalinks: `Settings > Permalinks`.
1. Configure your first pledge.
1. Visit `Five for the future > Pledges`
1. Add `Administrator Email Address` -> Any address
1. Add `Organization Name` -> Any name
1. Add `Website Address` -> Any web address
1. Add `Organization Blurb` -> Any content
1. Add `Contributor Usernames` -> Use any of the users listed in `wp-admin/users.php` excluding admin.
1. Technically you can use any wp.org user but we use dummy data added in `./env/bpmain_bp_xprofile_data.sql` which maps to these user IDs.
1. Click `Update` to publish draft pledge.
1. Visit `Five for the future > Contributors`
1. Click on any `Pending` contributors and `Publish` them.

## Scripts

Expand Down
File renamed without changes.
78 changes: 78 additions & 0 deletions env/bpmain_bp_xprofile_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `wordpress`
--

-- --------------------------------------------------------

--
-- Table structure for table `bpmain_bp_xprofile_data`
--

CREATE TABLE `bpmain_bp_xprofile_data` (
`id` bigint(20) UNSIGNED NOT NULL,
`field_id` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`user_id` bigint(20) UNSIGNED NOT NULL DEFAULT 0,
`value` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`last_updated` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `bpmain_bp_xprofile_data`
--

INSERT INTO `bpmain_bp_xprofile_data` (`id`, `field_id`, `user_id`, `value`, `last_updated`) VALUES
(1, 24, 2, 'Yes', '2024-07-01 01:38:31'),
(2, 29, 2, '40', '2024-07-01 01:38:31'),
(3, 30, 2, 'a:1:{i:0;s:9:\"Meta Team\";}', '2024-07-01 01:38:31'),
(4, 24, 3, 'Yes', '2024-07-01 01:38:31'),
(5, 29, 3, '40', '2024-07-01 01:38:31'),
(6, 30, 3, 'a:1:{i:0;s:9:\"Meta Team\";}', '2024-07-01 01:38:31'),
(7, 24, 4, 'Yes', '2024-07-01 01:38:31'),
(8, 29, 4, '40', '2024-07-01 01:38:31'),
(9, 30, 4, 'a:1:{i:0;s:9:\"Meta Team\";}', '2024-07-01 01:38:31'),
(10, 24, 5, 'Yes', '2024-07-01 01:38:31'),
(11, 29, 5, '40', '2024-07-01 01:38:31'),
(12, 30, 5, 'a:1:{i:0;s:9:\"Meta Team\";}', '2024-07-01 01:38:31'),
(13, 24, 6, 'Yes', '2024-07-01 01:38:31'),
(14, 29, 6, '40', '2024-07-01 01:38:31'),
(15, 30, 6, 'a:1:{i:0;s:9:\"Meta Team\";}', '2024-07-01 01:38:31'),
(16, 24, 7, 'Yes', '2024-07-01 01:38:31'),
(17, 29, 7, '40', '2024-07-01 01:38:31'),
(18, 30, 7, 'a:1:{i:0;s:9:\"Meta Team\";}', '2024-07-01 01:38:31');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `bpmain_bp_xprofile_data`
--
ALTER TABLE `bpmain_bp_xprofile_data`
ADD PRIMARY KEY (`id`),
ADD KEY `field_id` (`field_id`),
ADD KEY `user_id` (`user_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `bpmain_bp_xprofile_data`
--
ALTER TABLE `bpmain_bp_xprofile_data`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Loading

0 comments on commit 6b7fb7f

Please sign in to comment.