-
Notifications
You must be signed in to change notification settings - Fork 29
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
base: trunk
Are you sure you want to change the base?
Changes from 6 commits
e779591
e6f86ec
ede527c
c50b5bd
bdbc6ee
ac00490
90ba304
6241d27
ab10bad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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" | ||
}, | ||
"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" | ||
} | ||
} | ||
] | ||
} |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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). |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.