Fix code quality issues: add iframe titles, fix Markdown formatting, update documentation, and clean up test files
This commit is contained in:
@@ -90,14 +90,14 @@ wp import
|
|||||||
In a WordPress multisite environment, there are two ways to activate plugins:
|
In a WordPress multisite environment, there are two ways to activate plugins:
|
||||||
|
|
||||||
1. **Network Activation**: Activates a plugin for all sites in the network
|
1. **Network Activation**: Activates a plugin for all sites in the network
|
||||||
- In the WordPress admin, go to Network Admin > Plugins
|
* In the WordPress admin, go to Network Admin > Plugins
|
||||||
- Click "Network Activate" under the plugin
|
* Click "Network Activate" under the plugin
|
||||||
- Or use WP-CLI: `wp plugin install plugin-name --activate-network`
|
* Or use WP-CLI: `wp plugin install plugin-name --activate-network`
|
||||||
|
|
||||||
2. **Per-Site Activation**: Activates a plugin for a specific site
|
2. **Per-Site Activation**: Activates a plugin for a specific site
|
||||||
- In the WordPress admin, go to the specific site's admin area
|
* In the WordPress admin, go to the specific site's admin area
|
||||||
- Go to Plugins and activate the plugin for that site only
|
* Go to Plugins and activate the plugin for that site only
|
||||||
- Or use WP-CLI: `wp plugin activate plugin-name --url=site-url`
|
* Or use WP-CLI: `wp plugin activate plugin-name --url=site-url`
|
||||||
|
|
||||||
Our multisite blueprint uses network activation for the Plugin Toggle plugin as an example.
|
Our multisite blueprint uses network activation for the Plugin Toggle plugin as an example.
|
||||||
|
|
||||||
@@ -111,8 +111,8 @@ We have two blueprints for testing:
|
|||||||
To run tests with WordPress Playground:
|
To run tests with WordPress Playground:
|
||||||
|
|
||||||
1. Open the appropriate WordPress Playground link:
|
1. Open the appropriate WordPress Playground link:
|
||||||
- [Single site](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json&_t=11)
|
* [Single site](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json&_t=11)
|
||||||
- [Multisite](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json&_t=23)
|
* [Multisite](https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json&_t=23)
|
||||||
|
|
||||||
2. Test the plugin manually in the browser
|
2. Test the plugin manually in the browser
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ npm run setup:single
|
|||||||
```
|
```
|
||||||
|
|
||||||
This will:
|
This will:
|
||||||
|
|
||||||
1. Start a WordPress single site environment using wp-env
|
1. Start a WordPress single site environment using wp-env
|
||||||
2. Install and activate our plugin
|
2. Install and activate our plugin
|
||||||
3. Configure WordPress for testing
|
3. Configure WordPress for testing
|
||||||
@@ -50,6 +51,7 @@ npm run setup:multisite
|
|||||||
```
|
```
|
||||||
|
|
||||||
This will:
|
This will:
|
||||||
|
|
||||||
1. Start a WordPress multisite environment using wp-env
|
1. Start a WordPress multisite environment using wp-env
|
||||||
2. Install and activate our plugin network-wide
|
2. Install and activate our plugin network-wide
|
||||||
3. Create a test subsite
|
3. Create a test subsite
|
||||||
@@ -158,7 +160,8 @@ describe('WordPress Single Site Tests', () => {
|
|||||||
|
|
||||||
We have GitHub Actions workflows for running tests in CI/CD:
|
We have GitHub Actions workflows for running tests in CI/CD:
|
||||||
|
|
||||||
* `.github/workflows/cypress.yml`: Runs Cypress tests
|
* `.github/workflows/wordpress-tests.yml`: Runs wp-env e2e tests
|
||||||
|
* `.github/workflows/playground-tests.yml`: Runs Playground e2e tests
|
||||||
* `.github/workflows/phpunit.yml`: Runs PHPUnit tests (coming soon)
|
* `.github/workflows/phpunit.yml`: Runs PHPUnit tests (coming soon)
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
iframe {
|
iframe {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -20,6 +21,6 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<iframe src="https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json&_t=11"></iframe>
|
<iframe src="https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/blueprint.json&_t=11" title="WordPress Playground Single Site Environment"></iframe>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
iframe {
|
iframe {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -20,6 +21,6 @@
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<iframe src="https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json&_t=24"></iframe>
|
<iframe src="https://playground.wordpress.net/?blueprint-url=https://raw.githubusercontent.com/wpallstars/wp-plugin-starter-template-for-ai-coding/feature/testing-framework/playground/multisite-blueprint.json&_t=24" title="WordPress Playground Multisite Environment"></iframe>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
iframe {
|
iframe {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
@@ -41,7 +42,7 @@
|
|||||||
<button onclick="loadSingleSite()">Single Site</button>
|
<button onclick="loadSingleSite()">Single Site</button>
|
||||||
<button onclick="loadMultisite()">Multisite</button>
|
<button onclick="loadMultisite()">Multisite</button>
|
||||||
</div>
|
</div>
|
||||||
<iframe id="playground" src="about:blank"></iframe>
|
<iframe id="playground" src="about:blank" title="WordPress Playground Test Environment"></iframe>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function loadSingleSite() {
|
function loadSingleSite() {
|
||||||
@@ -57,6 +58,9 @@
|
|||||||
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
|
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
|
||||||
"landingPage": "/wp-admin/",
|
"landingPage": "/wp-admin/",
|
||||||
"login": true,
|
"login": true,
|
||||||
|
"features": {
|
||||||
|
"networking": true
|
||||||
|
},
|
||||||
"steps": [
|
"steps": [
|
||||||
{
|
{
|
||||||
"step": "defineWpConfigConsts",
|
"step": "defineWpConfigConsts",
|
||||||
@@ -65,18 +69,8 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"step": "installPlugin",
|
"step": "wp-cli",
|
||||||
"pluginData": {
|
"command": "wp plugin install plugin-toggle kadence-blocks --activate"
|
||||||
"resource": "wordpress.org/plugins",
|
|
||||||
"slug": "plugin-toggle"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"step": "installPlugin",
|
|
||||||
"pluginData": {
|
|
||||||
"resource": "wordpress.org/plugins",
|
|
||||||
"slug": "hello-dolly"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
@@ -105,11 +99,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"step": "wp-cli",
|
"step": "wp-cli",
|
||||||
"command": "wp plugin install plugin-toggle --activate-network"
|
"command": "wp plugin install plugin-toggle kadence-blocks --activate-network"
|
||||||
},
|
|
||||||
{
|
|
||||||
"step": "wp-cli",
|
|
||||||
"command": "wp plugin install hello-dolly"
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user