WP Cloud Station is a client plugin to manage WP Cloud sites.
WP Cloud Station plugin and theme can be installed on any WordPress site.
Our plugin provides a custom site type for managing your WP Cloud sites as well as many hooks for integrating with your own site.
Our theme is block-based and easy to configure and edit.
- Upload
wpcloud-station
to the/wp-content/plugins/
directory. - Activate the plugin through the 'Plugins' menu in WordPress.
- Navigate to
/wp-admin/admin.php?page=wpcloud_admin_settings
. - Save your WP Cloud Client Name and API Key, as well as a default primary Domain.
- Make note of your IP Address at the bottom and contact your WP Cloud representative to add the IP's.
If you would like to use our block-based theme:
- Upload
wpcloud-station
to the/wp-content/themes/
directory. - Activate the theme through the 'Themes' menu in WordPress.
- Navigate to Site Editor to alter.
Issues and feature requests can be submitted in GitHub Issues.
We welcome contributions from the community. If you would like to contribute, please see Contributing.
- Copy the
docker-compose.yml-example
file todocker-compose.yaml
- Update the environment variable
WP_CLOUD_API_KEY
to your WP Cloud API key. - Run
docker compose up
- run
wp-env start
- Note: you will need to add your api key to the WP Cloud settings page
The themes include CSS files that are processed and added inline to the theme.json
under the css
key for each respective block.
To build the CSS for themes, use the following npm commands:
npm run build:theme-css:theme
- Build CSS for the main themenpm run build:theme-css:theme-pico
- Build CSS for the theme-pico themenpm run build:theme-css
- Build CSS for all themes
For development, you can use the watch commands to automatically rebuild CSS when files change:
npm run watch:theme-css:theme
- Watch and build CSS for the main themenpm run watch:theme-css:theme-pico
- Watch and build CSS for the theme-pico themenpm run watch:theme-css
- Watch and build CSS for all themes
The build script accepts the following options:
-V, --verbose
- Show verbose output including processed CSS-h, --help
- Show help information
You can also filter which blocks to process by specifying block names:
npm run build:theme-css:theme core/query wpcloud/button
CSS source files are located in each theme's assets/blocks/src
directory. The build script will only process styles for blocks that are defined in the theme's theme.json
blocks
field.
The css
field in theme.json
is limited in how it can parse CSS:
- It can expand
&
to the core block class but that's about it - It cannot handle nested CSS nor multiple selectors per rule (e.g.,
div, span { color: red }
) - Since JSON is not multiline, the style needs to be rendered to a single line string
The build script uses postcss
to handle:
- CSS nesting (sass style)
- Expanding selectors so that each rule has only one selector
- Setting up new lines and tabs so the styles render cleanly in the site editor CSS panel
Core will expand &
to the top level block class. The build script will expand nested &
to target the parent block.
Given the block wpcloud/button
in assets/blocks/src/wpcloud-button.css
:
& {
color: blue;
&.is-primary {
color: red;
.inner-text {
text-transform: lowercase;
}
}
.inner-text, p {
text-transform: uppercase;
}
}
Will expand to:
& {
color: blue;
}
&.is-primary {
color: red;
}
&.is-primary .inner-text {
text-transform: lowercase;
}
& .inner-text {
text-transform: uppercase;
}
& p {
text-transform: uppercase;
}
And end up in theme.json
:
{ ...
"blocks": {
....
"wpcloud/button": {
...
"css" : "& {\n\tcolor:blue\n}...."
}
}
}
Finally, in the browser, the &
will be expanded to the core block class:
.wp-block-wpcloud-button {
color: blue
}
.wp-block-wpcloud-button.is-primary {
text-transform: uppercase;
}
...
-
Can I use WP Cloud Station plugin on any site?
Yes, WP Cloud Station plugin can be installed on any existing WordPress site.
-
How much does it cost?
WP Cloud Station plugin and theme are free. You will need a client set up and an agreement with Automattic to create new sites.
Please contact us for more information.
-
Can I integrate WP Cloud with my own site?
Yes! We provide a custom post type
wpcloud_site
to manage your sites, but we also integrate with native WordPress architecture include REST API, as well as providing numerous hooks to integrate with actions and callbacks.