Update Site Cloner
Describe the bug
https://wordpress.slack.com/archives/C08M59V3P/p1715272078520129
Details pending completion.
@renintw did you get anywhere with this? It's come up a few times that block themes don't clone easily - it was suggested that the create block theme community plugin could get us someway there.
when attempting to clone a block theme (tt4) noting some things i'm noticing missing:
- remote CSS location
- template parts and templates
- patterns
- content from source site (unsure if this is needed?)
If content/media isn't cloned is it a true clone of another site?
When I previously helped develop the website, and from feedback I saw over time, it doesn't matter if content and media aren't cloned. But patterns, template parts, and templates are important and really what people want. The remote CSS location doesn't need to be cloned either since a new folder should be created each time.
Some findings:
- The site cloner in the local environment is not functioning.
- The customizer additional CSS and the site editor’s additional CSS in the local environment cannot be opened. Attempts to fix deprecated functions, upgrade the WordPress version, database, and plugins did not resolve the issue. Currently, both the sandbox and production environments are functioning correctly. It is suspected that the issue stems from the setup process of the local environment.
- How the current clone works:
- The target site switches the theme to the theme of the cloned site.
- Editor styles like: a. Variations b. Colors c. Shadows d. Layout e. Block settings f. Additional CSS are not cloned.
- The customizer’s Additional CSS is cloned to the target site’s Customizer’s Additional CSS.
- Remote CSS (such as specified GitHub CSS file) is also cloned to the target site’s Customizer’s Additional CSS.
- The input in Appearance -> Fonts is not cloned.
- The input in Appearance -> Remote CSS is not cloned, but as mentioned above, the CSS content is directly cloned to the customizer’s additional CSS.
- All Post Types, CPT posts, and media are not cloned.
Testing the "Create Block Theme" plugin:
- The exported ZIP file does not include the patterns and templates added to the site.
- The plugin itself does not provide an import feature.
The exported ZIP file does not include the patterns and templates added to the site.
I'm pretty certain it should.
I'm pretty certain it should.
I retested this locally rather than on the testing site again. Patterns didn't get exported. As for custom templates, they will be exported with the prefix 'wp-custom-template'.
Update Found that patterns are exported only after the "Save Changes" in the Create Block Theme tool is pressed. Initially, the default settings appear as shown in the image, but they won't take effect until "Save Changes" again. However, if users create patterns without selecting "synced," those patterns still won't be exported.
Additionally, any images added to the site must have the "Localize Images" option selected in order to be exported.
Noting that there's two main aspects to this:
- When on a Block Theme, you can't clone any sites
- A Block Theme site can't be cloned
- The search/Filtering of the list no longer works.
As a FYI to others, this is not likely to be resolved anytime soon.