Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Commit

Permalink
Merge pull request #211 from wp-shortcake/release-0-2-0
Browse files Browse the repository at this point in the history
Prepare v0.2.0 for release
  • Loading branch information
goldenapples authored May 2, 2017
2 parents 8e50139 + 3fd114e commit db636fb
Show file tree
Hide file tree
Showing 8 changed files with 529 additions and 45 deletions.
103 changes: 90 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
**Contributors:** [fusionengineering](https://profiles.wordpress.org/fusionengineering), [davisshaver](https://profiles.wordpress.org/davisshaver), [danielbachhuber](https://profiles.wordpress.org/danielbachhuber)
**Tags:** shortcodes, Facebook, Infogram, Playbuzz, Rap Genius, Scribd
**Requires at least:** 4.2
**Tested up to:** 4.3
**Stable tag:** 0.1.0
**Tested up to:** 4.7.4
**Stable tag:** 0.2.0
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -13,17 +13,34 @@ A fine selection of Shortcake-powered shortcodes.

Shortcake Bakery adds a fine selection of shortcodes to your WordPress site. Use with [Shortcake](https://wordpress.org/plugins/shortcode-ui/) for the optimal experience.

The follow shortcodes are now available for your use within the content field:

- Image Comparison `[image-comparison left="9" right="10" position="center"]`
- Facebook `[facebook url="https://www.facebook.com/willpd/posts/1001217146572688"]`
- iFrames (requires code-level configuration of accepted domains) `[iframe src="http://www.buzzfeed.com"]`
- Infogram `[infogram url="http://infogr.am/washington_marijuana_sales"]`
- PDF's (requires PDF be served locally or from domain with `Access-Control-Allow-Origin` header) `[pdf url="https://assets.fusion.net/edit/pdfs/the_interview_budget_excerpts.pdf"]`
- Playbuzz `[playbuzz url="https://www.playbuzz.com/Fusion/5-mind-blowing-facts-about-cloning-from-jurassic-park-youll-never-believe-actually-exist-in-real"]`
- Rap Genius `[rap-genius]`
- Scribd `[scribd url="http://www.scribd.com/doc/269993358/Transgender-Care-Memorandum"]`
- Scripts (requires code-level configuration of accepted domains) `[script src="https://ajax.googleapis.com/ajax/libs/threejs/r69/three.min.js"]`
The following shortcodes are now available for your use within the content field:

- ABC_News `[abc-news]`
- Facebook `[facebook]`
- Flickr `[flickr]`
- Giphy `[giphy]`
- GoogleDocs `[googledocs]` (Includes several common formats: Documents, Spreadsheets, Presentations, Forms, Maps, and Fusion Tables.)
- Guardian `[guardian]`
- Image Comparison `[image-comparison]` (Uses the juxtapose.js script from Knight Labs.)
- Infogram `[infogram]`
- Instagram `[instagram]`
- Live Photo `[live-photo]`
- Livestream `[livestream]`
- PDF Viewer `[pdf]` (PDF documents can be uploaded attachments or remotely hosted documents. A code-based proxy pass can be made available for external documents with a filter.)
- Playbuzz `[playbuzz]`
- Rap_Genius `[rap-genius]`
- Scribd `[scribd]`
- Script `[script]` (Requires code-level configuration of accepted domains.)
- Silk `[silk]`
- SoundCloud `[soundcloud]`
- Twitter `[twitter]`
- Videoo `[videoo]`
- Vimeo `[vimeo]`
- Vine `[vine]`
- YouTube `[youtube]`
- iFrame `[iframe]` (Requires code-level configuration of accepted domains.)

Shortcake Bakery also enables an "Add Embed Code" experience for Shortcake shortcodes. Clicking the "Add Embed Code" media button will display a form in the media modal where a user can paste an embed code as received from a provider (by copying the embed code from a YouTube video, for one example). If that embed code matches a shortcode registered with the Shortcake Bakery shortcode API, the matched shortcode will be sent to the editor.

See the [Installation](#Installation) section for code-level configuration details. Get involved with the project and [submit your own shortcodes](https://github.com/fusioneng/shortcake-bakery) on Github.

Expand All @@ -49,6 +66,28 @@ Most of the shortcodes work out of the box, but you'll need to whitelist any dom
});


If you don't want to enable all of the shortcodes which are bundled with this plugin, you can filter them by returning a smaller array from the filter 'shortcake_bakery_shortcode_classes':


add_filter( 'shortcake_bakery_shortcode_classes', function() {
return array(
'Shortcake_Bakery\Shortcodes\Facebook',
'Shortcake_Bakery\Shortcodes\Twitter',
'Shortcake_Bakery\Shortcodes\YouTube',
);
});


Because of cross-domain issues, the `[pdf]` shortcode will only work out of the box with PDFs uploaded as local attachments, or that are served with appropriate Cross-Origin Resource Sharing headers. (If you don't know about the domain you're hosting the PDFs on, most likely it doesn't include these headers and as a result, the PDF will not render properly on the front end.)

If you need to be able to serve pdf documents from other domains, you will need to set up an asset proxy for them. We have a basic PHP-based asset proxy built in to the plugin, which is disabled by default. If you want to enable it, return true from the following filter:


add_filter( 'shortcake_bakery_pdf_enable_cors_proxy', '__return_true' );


This feature should be enabled only with conscious thought, though, as if this is used heavily, it has the potential to cause serious performance issues. If you will be serving many, or very large PDFs, we recommend building your own proxy for these - using an nginx [proxy_pass](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass) directive, for example.

## Screenshots ##

### 1. Shortcodes are accessible through the Insert Element screen, exposed in the media library. ###
Expand Down Expand Up @@ -84,9 +123,47 @@ Most of the shortcodes work out of the box, but you'll need to whitelist any dom
### 11. Playbuzz quizs can be embedded, with a few options supported. ###
![Playbuzz quizs can be embedded, with a few options supported.](https://s.w.org/plugins/shortcake-bakery/screenshot-11.png)

### 12. An "Add Embed" button is added to the editor media buttons. ###
![An "Add Embed" button is added to the editor media buttons.](https://s.w.org/plugins/shortcake-bakery/screenshot-12.png)

### 13. Clicking the "Add Embed" button brings up a from to insert a provided embed code. If an embed code doesn't match a known shortcode, a warning will be displayed. (Note - other plugins such as WordPress VIP's Protected Embeds functionality that reverse arbitrary embed codes to shortcodes in other ways can also hook in to this and make their own replacements.) ###
![Clicking the "Add Embed" button brings up a from to insert a provided embed code. If an embed code doesn't match a known shortcode, a warning will be displayed. (Note - other plugins such as WordPress VIP's Protected Embeds functionality that reverse arbitrary embed codes to shortcodes in other ways can also hook in to this and make their own replacements.)](https://s.w.org/plugins/shortcake-bakery/screenshot-13.png)

### 14. If an embed code can be recognized as matching one of the Shortcake Bakery shortcodes, or any shortcodes which make use of this plugin's API, it can be inserted from this screen... ###
![If an embed code can be recognized as matching one of the Shortcake Bakery shortcodes, or any shortcodes which make use of this plugin's API, it can be inserted from this screen...](https://s.w.org/plugins/shortcake-bakery/screenshot-14.png)

### 15. ... and it will be sent to the editor as the corresponding shortcode, rather than the full embed code. ###
![... and it will be sent to the editor as the corresponding shortcode, rather than the full embed code.](https://s.w.org/plugins/shortcake-bakery/screenshot-15.png)


## Changelog ##

### 0.2.0 (April 17, 2017) ###

This release includes 14 new shortcodes, and some major new features for users.

* Add "Add embed" media button; allow users to enter an arbitrary code from a provider, and convert it to a shortcode if that shortcode is available (as defined by the shortcode's "reversal" method). Developers: note that this only works with shortcodes that extend \Shortcode_Bakery\Shortcode and implement the reversal()" method. You may also disable this button using the `shortcake_bakery_show_add_embed` filter.
* Updated the format of Instagram embeds.
* Added several new URL patterns for Facebook embeds. Groups, Pages, and videos are now supported in addition to Posts.
* New shortcode: `[soundcloud]` Shortcode for Soundcloud embeds.
* New shortcode: `[abc-news]` Shortcode for ABC News embeds.
* New shortcode: `[flickr]` Shortcode for Flickr embeds.
* New shortcode: `[giphy]` Shortcode for Giphy embeds.
* New shortcode: `[google-docs]` Shortcode for Google Docs embeds.
* New shortcode: `[guardian]` Shortcode for embeds from The Guardian.
* New shortcode: `[instagram]` Shortcode for Instagram embeds.
* New shortcode: `[live-photo]` Shortcode for Apple Live Photo embeds.
* New shortcode: `[livestream]` Shortcode for Livestream embeds.
* New shortcode: `[pdf]` Embed local or external PDF documents using pdf.js.
* New shortcode: `[silk]` Shortcode for Silk embeds
* New shortcode: `[videoo]` Shortcode for Videoo embeds.
* New shortcode: `[vimeo]` Shortcode for Vimeo embeds.
* New shortcode: `[vine]` Shortcode for Vine embeds.
* Improved UI for selecting post elements; consistant icons for all embeds.
* Bug fix: Allow Giphy embeds with hyp0hens in URLs.
* Added Japanese translation
* Allow the source of iframe and script embeds to be filtered, for SSL compatability.

### 0.1.0 (July 17, 2015) ###

* Initial release.
Expand Down
Loading

0 comments on commit db636fb

Please sign in to comment.