Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added blueprint for showcasing custom plugin #57

Open
wants to merge 9 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions blueprints/showcase-plugin-with-media/blueprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"preferredVersions": {
"php": "8.3",
"wp": "6.5"
},
"features": {
"networking": true
},
"phpExtensionBundles": [
"kitchen-sink"
],
"landingPage": "/",
"steps": [
{
"step": "login",
"username": "admin",
"password": "password"
},
{
"step": "installPlugin",
"pluginZipFile": {
"resource": "wordpress.org/plugins",
"slug": "makeiteasy-back-to-top"
},
"options": {
"activate": true
}
},
{
"step": "installPlugin",
"pluginZipFile": {
"resource": "url",
"url": "https://makeiteasypopup.makeiteasy.hr/makeiteasy-popup.zip"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to use paths from this GitHub repo or at least WordPress.org?

In case something changes with the domain, we would still like for the blueprint to work.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll rewrite blueprint as soon as I can.

},
"options": {
"activate": true
}
},
{
"step": "installTheme",
"themeZipFile": {
"resource": "url",
"url": "https://makeiteasypopup.makeiteasy.hr/twentytwentyfour.1.1.zip"
}
},
{
"step": "installTheme",
"themeZipFile": {
"resource": "url",
"url": "https://makeiteasypopup.makeiteasy.hr/twentytwentyfour-child.zip"
},
"options": {
"activate": true
}
},
{
"step": "setSiteOptions",
"options": {
"blogname": "MakeITeasy popup demo",
"blogdescription": "Popup demo",
"page_on_front": "4",
"users_can_register": "0",
"admin_email": "[email protected]",
"start_of_week": "1",
"use_balanceTags": "0",
"use_smilies": "1",
"require_name_email": "1",
"comments_notify": "1",
"posts_per_rss": "10"
}
},
{
"step": "setSiteOptions",
"options": {
"rss_use_excerpt": "0",
"default_category": "1",
"default_comment_status": "open",
"default_ping_status": "open",
"default_pingback_flag": "1",
"posts_per_page": "10",
"date_format": "F j, Y",
"time_format": "g:i a",
"links_updated_date_format": "F j, Y g:i a",
"comment_moderation": "0"
}
},
{
"step": "setSiteOptions",
"options": {
"moderation_notify": "1",
"hack_file": "0",
"blog_charset": "UTF-8",
"ping_sites": "http://rpc.pingomatic.com/",
"comment_max_links": "2",
"gmt_offset": "0",
"default_email_category": "1",
"template": "twentytwentyfour",
"stylesheet": "twentytwentyfour-child",
"comment_registration": "0"
}
},
{
"step": "setSiteOptions",
"options": {
"html_type": "text/html",
"use_trackback": "0",
"default_role": "subscriber",
"db_version": "57155",
"uploads_use_yearmonth_folders": "1",
"blog_public": "1",
"default_link_category": "2",
"show_on_front": "page",
"show_avatars": "1",
"avatar_rating": "G"
}
},
{
"step": "setSiteOptions",
"options": {
"thumbnail_size_w": "150",
"thumbnail_size_h": "150",
"thumbnail_crop": "1",
"medium_size_w": "300",
"medium_size_h": "300",
"avatar_default": "mystery",
"large_size_w": "1024",
"large_size_h": "1024",
"image_default_link_type": "none",
"close_comments_for_old_posts": "0"
}
},
{
"step": "unzip",
"zipFile": {
"resource": "url",
"url": "https://makeiteasypopup.makeiteasy.hr/2024.zip"
},
"extractToPath": "/wordpress/wp-content/uploads"
},
{
"step": "importWxr",
"file": {
"resource": "url",
"url": "https://makeiteasypopup.makeiteasy.hr/makeiteasypopupblock.WordPress.2024-06-20.xml"
}
}
]
}
22 changes: 22 additions & 0 deletions blueprints/showcase-plugin-with-media/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Showcase custom plugin from own server with media files and custom theme
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blueprints in the Gallery usually don't have readmes, we store the description in the Blueprint.

Copy link
Contributor

@bgrgicak bgrgicak Dec 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering what added value a readme could provide and how users could discover it.


➡ Custom theme is customized child theme of twentytwentyfour

### Transfering content

> For transferring content, WXR file is used. The same could be probably achieved with sql dump and runsql step.

After exporting WXR from standard WordPress installation, URL-s in file have to be adjusted. For example, do search-replace to replace
`https://myserver.com/` into `/`, which is the url root in playground.

If sql export-import is used, I propose similarly to use wp-cli search-replace command with export option to do same url string replacement.

### Importing media files into file system

Here, the unzip step is used: zip all the folders in upload folder and in unzip step unpack them to respective path `/site-slug/wp-content/uploads`, where slug
is the custom slug if given, e.g. for `site-slug=mysite` in URL query, path would be `/site-mysite/wp-content/uploads`. If custom slug is not given, replace site-slug
with `wordpress`

### Setting defaults

`setSiteOptions` step is used to set home page and other default WP options, and `landingPage` json property is used to start on front page instead of admin. In your example, you would replace `page_on_front` option with page ID which is front page (if you have front page and not blog).
Loading