Skip to content

Commit

Permalink
Merge pull request #167 from 10up/feature/plugin-preview
Browse files Browse the repository at this point in the history
Add support for the WordPress.org plugin preview
  • Loading branch information
dkotter authored Jan 4, 2024
2 parents 76a947b + 0dc08ea commit 44c6862
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 9 deletions.
29 changes: 20 additions & 9 deletions .github/workflows/wordpress-plugin-asset-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,23 @@ jobs:
name: Push to trunk
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Build
run: |
composer install --no-dev
- name: WordPress.org plugin asset/readme update
uses: 10up/action-wordpress-plugin-asset-update@stable
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
- name: Checkout code
uses: actions/checkout@v4

- name: Setup node version
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm

- name: Build
run: |
npm install
npm run build
composer install --no-dev
- name: WordPress.org plugin asset/readme update
uses: 10up/action-wordpress-plugin-asset-update@stable
env:
SVN_PASSWORD: ${{ secrets.SVN_PASSWORD }}
SVN_USERNAME: ${{ secrets.SVN_USERNAME }}
53 changes: 53 additions & 0 deletions .wordpress-org/blueprints/Info-icon_Wikipedians.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions .wordpress-org/blueprints/blueprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "https://playground.wordpress.net/blueprint-schema.json",
"landingPage": "\/wp-admin\/post.php?post=6&action=edit",
"preferredVersions": {
"php": "7.4",
"wp": "latest"
},
"phpExtensionBundles": ["kitchen-sink"],
"steps": [
{
"step": "login",
"username": "admin",
"password": "password"
},
{
"step": "installPlugin",
"pluginZipFile": {
"resource": "wordpress.org\/plugins",
"slug": "safe-svg"
},
"options": {
"activate": true
}
},
{
"step": "importFile",
"file": {
"resource": "url",
"url": "https:\/\/raw.githubusercontent.com\/10up\/safe-svg\/ec6071406de403e9c9f4b5833abf4e438816df05\/.wordpress-org\/blueprints\/demo-data.xml"
}
}
]
}
91 changes: 91 additions & 0 deletions .wordpress-org/blueprints/demo-data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->

<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
<!-- 4. Activate & Run Importer. -->
<!-- 5. Upload this file using the form provided on that page. -->
<!-- 6. You will first be asked to map the authors in this export file to users -->
<!-- on the site. For each author, you may choose to map to an -->
<!-- existing user on the site or to create a new user. -->
<!-- 7. WordPress will then import each of the posts, pages, comments, categories, etc. -->
<!-- contained in this file into your site. -->

<!-- generator="WordPress/6.4.2" created="2023-12-21 15:52" -->
<rss version="2.0"
xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.2/"
>

<channel>
<title>My WordPress Website</title>
<link>https://playground.wordpress.net/</link>
<description></description>
<pubDate>Thu, 21 Dec 2023 15:52:39 +0000</pubDate>
<language>en-US</language>
<wp:wxr_version>1.2</wp:wxr_version>
<wp:base_site_url>https://playground.wordpress.net/</wp:base_site_url>
<wp:base_blog_url>https://playground.wordpress.net/</wp:base_blog_url>

<wp:author><wp:author_id>1</wp:author_id><wp:author_login><![CDATA[admin]]></wp:author_login><wp:author_email><![CDATA[[email protected]]]></wp:author_email><wp:author_display_name><![CDATA[admin]]></wp:author_display_name><wp:author_first_name><![CDATA[]]></wp:author_first_name><wp:author_last_name><![CDATA[]]></wp:author_last_name></wp:author>


<generator>https://wordpress.org/?v=6.4.2</generator>

<item>
<title><![CDATA[Safe SVG demo]]></title>
<link>https://playground.wordpress.net/?p=6</link>
<pubDate>Thu, 21 Dec 2023 15:52:18 +0000</pubDate>
<dc:creator><![CDATA[admin]]></dc:creator>
<guid isPermaLink="false">https://playground.wordpress.net/?p=6</guid>
<description></description>
<content:encoded><![CDATA[<!-- wp:paragraph -->
<p>This is a demo of the Safe SVG plugin.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>There's an SVG icon displayed below. This SVG "<a href="https://commons.wikimedia.org/w/index.php?curid=19035934" target="_blank" rel="noreferrer noopener">Info-icon Wikipedians</a>" by David Peters is licensed under <a href="https://creativecommons.org/licenses/by-sa/3.0/?ref=openverse" target="_blank" rel="noreferrer noopener">CC BY-SA 3.0</a>.</p>
<!-- /wp:paragraph -->
<!-- wp:image {"sizeSlug":"large"} -->
<figure class="wp-block-image size-large"><img src="https://raw.githubusercontent.com/10up/safe-svg/da123197efc0bf54c33f8fa83120c17981840da6/.wordpress-org/blueprints/Info-icon_Wikipedians.svg" alt=""/></figure>
<!-- /wp:image -->
<!-- wp:paragraph -->
<p>You can try uploading additional SVG files either straight in the Media Library or inline here using the Inline SVG block or core Image block. In addition, you can control which users have the ability to upload SVGs by going to Settings > Media.</p>
<!-- /wp:paragraph -->]]></content:encoded>
<excerpt:encoded><![CDATA[]]></excerpt:encoded>
<wp:post_id>6</wp:post_id>
<wp:post_date><![CDATA[2023-12-21 15:52:18]]></wp:post_date>
<wp:post_date_gmt><![CDATA[2023-12-21 15:52:18]]></wp:post_date_gmt>
<wp:post_modified><![CDATA[2023-12-21 15:52:32]]></wp:post_modified>
<wp:post_modified_gmt><![CDATA[2023-12-21 15:52:32]]></wp:post_modified_gmt>
<wp:comment_status><![CDATA[open]]></wp:comment_status>
<wp:ping_status><![CDATA[open]]></wp:ping_status>
<wp:post_name><![CDATA[safe-svg-demo]]></wp:post_name>
<wp:status><![CDATA[publish]]></wp:status>
<wp:post_parent>0</wp:post_parent>
<wp:menu_order>0</wp:menu_order>
<wp:post_type><![CDATA[post]]></wp:post_type>
<wp:post_password><![CDATA[]]></wp:post_password>
<wp:is_sticky>0</wp:is_sticky>
<category domain="category" nicename="uncategorized"><![CDATA[Uncategorized]]></category>
<wp:postmeta>
<wp:meta_key><![CDATA[_pingme]]></wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
<wp:postmeta>
<wp:meta_key><![CDATA[_encloseme]]></wp:meta_key>
<wp:meta_value><![CDATA[1]]></wp:meta_value>
</wp:postmeta>
</item>
</channel>
</rss>

0 comments on commit 44c6862

Please sign in to comment.