Version Description
- Always load embeds over https
Download this release
Release Info
Developer | por_ |
Plugin | SoundCloud Shortcode |
Version | 3.0.2 |
Comparing to | |
See all releases |
Code changes from version 3.0.1 to 3.0.2
- README.md +18 -10
- readme.txt +3 -0
- soundcloud-shortcode.php +3 -3
- tests/soundcloud-shortcode-test.php +17 -17
README.md
CHANGED
@@ -9,25 +9,33 @@ WordPress plugin for converting SoundCloud shortcodes into Embedded Players.
|
|
9 |
|
10 |
- OS X:
|
11 |
|
12 |
-
|
13 |
|
14 |
2. Run tests
|
15 |
|
16 |
-
|
17 |
|
18 |
|
19 |
-
##
|
20 |
|
21 |
-
1.
|
22 |
|
23 |
-
|
24 |
|
25 |
-
2.
|
26 |
|
27 |
-
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
32 |
|
33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
- OS X:
|
11 |
|
12 |
+
$ brew install phpunit
|
13 |
|
14 |
2. Run tests
|
15 |
|
16 |
+
$ phpunit
|
17 |
|
18 |
|
19 |
+
## Pusing to [WordPress Plugins](https://wordpress.org/plugins/)
|
20 |
|
21 |
+
1. Set up your local svn config:
|
22 |
|
23 |
+
$ git svn init http://plugins.svn.wordpress.org/soundcloud-shortcode/ -T trunk -b branches -t tags --no-minimize-url
|
24 |
|
25 |
+
2. Bump version numbers in `readme.txt` and `soundcloud-shortcode.php` files and commit them.
|
26 |
|
27 |
+
$ git commit -am "Version bump"
|
28 |
|
29 |
+
3. Push your latest code changes to wordpress.org:
|
30 |
|
31 |
+
$ git svn dcommit --username=YOUR_WORDPRESS_ORG_USERNAME
|
32 |
|
33 |
+
4. Tag your release:
|
34 |
+
|
35 |
+
$ git svn tag 1.0.2
|
36 |
+
|
37 |
+
This will create /tags/1.0.2 in the remote SVN repository and copy all the files from the remote /trunk into that tag. This allows people to use an older version of the plugin.
|
38 |
+
|
39 |
+
5. Tag your release in Git and push latest changes:
|
40 |
+
|
41 |
+
$ git tag 1.0.2 && git push origin master --tags
|
readme.txt
CHANGED
@@ -36,6 +36,9 @@ An example of a track that starts playing automatically and won’t show any com
|
|
36 |
|
37 |
== Changelog ==
|
38 |
|
|
|
|
|
|
|
39 |
= 3.0.1 =
|
40 |
* Minor copy updates in readme.txt
|
41 |
|
36 |
|
37 |
== Changelog ==
|
38 |
|
39 |
+
= 3.0.2 =
|
40 |
+
* Always load embeds over https
|
41 |
+
|
42 |
= 3.0.1 =
|
43 |
* Minor copy updates in readme.txt
|
44 |
|
soundcloud-shortcode.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: SoundCloud Shortcode
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/soundcloud-shortcode/
|
5 |
Description: Converts SoundCloud WordPress shortcodes to a SoundCloud widget. Example: [soundcloud]http://soundcloud.com/forss/flickermood[/soundcloud]
|
6 |
-
Version: 3.0.
|
7 |
Author: SoundCloud Inc.
|
8 |
Author URI: http://soundcloud.com
|
9 |
License: GPLv2
|
@@ -167,7 +167,7 @@ function soundcloud_oembed_params_callback($match) {
|
|
167 |
function soundcloud_iframe_widget($options) {
|
168 |
|
169 |
// Build URL
|
170 |
-
$url = '
|
171 |
// Set default width if not defined
|
172 |
$width = isset($options['width']) && $options['width'] !== 0 ? $options['width'] : '100%';
|
173 |
// Set default height if not defined
|
@@ -187,7 +187,7 @@ function soundcloud_iframe_widget($options) {
|
|
187 |
function soundcloud_flash_widget($options) {
|
188 |
|
189 |
// Build URL
|
190 |
-
$url = '
|
191 |
// Set default width if not defined
|
192 |
$width = isset($options['width']) && $options['width'] !== 0 ? $options['width'] : '100%';
|
193 |
// Set default height if not defined
|
3 |
Plugin Name: SoundCloud Shortcode
|
4 |
Plugin URI: http://wordpress.org/extend/plugins/soundcloud-shortcode/
|
5 |
Description: Converts SoundCloud WordPress shortcodes to a SoundCloud widget. Example: [soundcloud]http://soundcloud.com/forss/flickermood[/soundcloud]
|
6 |
+
Version: 3.0.2
|
7 |
Author: SoundCloud Inc.
|
8 |
Author URI: http://soundcloud.com
|
9 |
License: GPLv2
|
167 |
function soundcloud_iframe_widget($options) {
|
168 |
|
169 |
// Build URL
|
170 |
+
$url = 'https://w.soundcloud.com/player?' . http_build_query($options['params']);
|
171 |
// Set default width if not defined
|
172 |
$width = isset($options['width']) && $options['width'] !== 0 ? $options['width'] : '100%';
|
173 |
// Set default height if not defined
|
187 |
function soundcloud_flash_widget($options) {
|
188 |
|
189 |
// Build URL
|
190 |
+
$url = 'https://player.soundcloud.com/player.swf?' . http_build_query($options['params']);
|
191 |
// Set default width if not defined
|
192 |
$width = isset($options['width']) && $options['width'] !== 0 ? $options['width'] : '100%';
|
193 |
// Set default height if not defined
|
tests/soundcloud-shortcode-test.php
CHANGED
@@ -36,7 +36,7 @@ class SC_Widget_Test extends PHPUnit_Framework_TestCase {
|
|
36 |
*/
|
37 |
public function testShortcode() {
|
38 |
|
39 |
-
$expected = '<iframe width="500" height="200" scrolling="no" frameborder="no" src="
|
40 |
$params = array(
|
41 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
42 |
'iframe' => true,
|
@@ -45,7 +45,7 @@ class SC_Widget_Test extends PHPUnit_Framework_TestCase {
|
|
45 |
);
|
46 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Simple visual widget');
|
47 |
|
48 |
-
$expected = '<object width="500" height="200"><param name="movie" value="
|
49 |
$params = array(
|
50 |
'url' => 'http://soundcloud.com/forss/flickermood',
|
51 |
'iframe' => false,
|
@@ -54,7 +54,7 @@ class SC_Widget_Test extends PHPUnit_Framework_TestCase {
|
|
54 |
);
|
55 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Simple Flash widget');
|
56 |
|
57 |
-
$expected = '<iframe width="500" height="200" scrolling="no" frameborder="no" src="
|
58 |
$params = array(
|
59 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
60 |
'iframe' => true,
|
@@ -64,7 +64,7 @@ class SC_Widget_Test extends PHPUnit_Framework_TestCase {
|
|
64 |
);
|
65 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Visual Widget with extra parameters');
|
66 |
|
67 |
-
$expected = '<iframe width="500" height="116" scrolling="no" frameborder="no" src="
|
68 |
$params = array(
|
69 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
70 |
'iframe' => true,
|
@@ -74,7 +74,7 @@ class SC_Widget_Test extends PHPUnit_Framework_TestCase {
|
|
74 |
);
|
75 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Simple HTML5 Widget');
|
76 |
|
77 |
-
$expected = '<object width="300" height="300"><param name="movie" value="
|
78 |
$params = array(
|
79 |
'url' => 'http://api.soundcloud.com/tracks/45036121',
|
80 |
'iframe' => false,
|
@@ -84,7 +84,7 @@ class SC_Widget_Test extends PHPUnit_Framework_TestCase {
|
|
84 |
);
|
85 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Flash Widget with extra parameters');
|
86 |
|
87 |
-
$expected = '<object width="300" height="300"><param name="movie" value="
|
88 |
$params = array(
|
89 |
'url' => 'http://api.soundcloud.com/tracks/41770793',
|
90 |
'iframe' => false,
|
@@ -100,7 +100,7 @@ class SC_Widget_Test extends PHPUnit_Framework_TestCase {
|
|
100 |
*/
|
101 |
public function testShortcodeDefaults() {
|
102 |
|
103 |
-
$expected = '<iframe width="500" height="200" scrolling="no" frameborder="no" src="
|
104 |
$params = array(
|
105 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
106 |
'width' => 500,
|
@@ -108,40 +108,40 @@ class SC_Widget_Test extends PHPUnit_Framework_TestCase {
|
|
108 |
);
|
109 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Check if Visual widget is the default');
|
110 |
|
111 |
-
$expected = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="
|
112 |
$params = array(
|
113 |
'url' => 'http://api.soundcloud.com/tracks/38987054'
|
114 |
);
|
115 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Default height and width for Visual widget');
|
116 |
|
117 |
-
$expected = '<iframe width="100%" height="166" scrolling="no" frameborder="no" src="
|
118 |
$params = array(
|
119 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
120 |
'params' => 'visual=false'
|
121 |
);
|
122 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Default height and width for HTML5 widget');
|
123 |
|
124 |
-
$expected = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="
|
125 |
$params = array(
|
126 |
'url' => 'https://api.soundcloud.com/playlists/1815863'
|
127 |
);
|
128 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Default height and width for Visual playlist widget');
|
129 |
|
130 |
-
$expected = '<object width="100%" height="81"><param name="movie" value="
|
131 |
$params = array(
|
132 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
133 |
'iframe' => false
|
134 |
);
|
135 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Default height and width for Flash widget');
|
136 |
|
137 |
-
$expected = '<object width="100%" height="255"><param name="movie" value="
|
138 |
$params = array(
|
139 |
'url' => 'https://api.soundcloud.com/playlists/1815863',
|
140 |
'iframe' => false
|
141 |
);
|
142 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Default height and width for Flash playlist widget');
|
143 |
|
144 |
-
$expected = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="
|
145 |
$params = array(
|
146 |
'url' => 'http://soundcloud.com/forss/flickermood',
|
147 |
'iframe' => true
|
@@ -154,7 +154,7 @@ class SC_Widget_Test extends PHPUnit_Framework_TestCase {
|
|
154 |
*/
|
155 |
public function testShortcodeBadValues() {
|
156 |
|
157 |
-
$expected = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="
|
158 |
$params = array(
|
159 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
160 |
'width' => '',
|
@@ -162,20 +162,20 @@ class SC_Widget_Test extends PHPUnit_Framework_TestCase {
|
|
162 |
);
|
163 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Check bad input');
|
164 |
|
165 |
-
$expected = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="
|
166 |
$params = array(
|
167 |
'url' => ' http://api.soundcloud.com/tracks/38987054',
|
168 |
);
|
169 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Trim whitespace');
|
170 |
|
171 |
-
$expected = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="
|
172 |
$params = array(
|
173 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
174 |
'iframe' => 'true'
|
175 |
);
|
176 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Check iframe true as string');
|
177 |
|
178 |
-
$expected = '<object width="100%" height="81"><param name="movie" value="
|
179 |
$params = array(
|
180 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
181 |
'iframe' => 'false'
|
36 |
*/
|
37 |
public function testShortcode() {
|
38 |
|
39 |
+
$expected = '<iframe width="500" height="200" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054&visual=true"></iframe>';
|
40 |
$params = array(
|
41 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
42 |
'iframe' => true,
|
45 |
);
|
46 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Simple visual widget');
|
47 |
|
48 |
+
$expected = '<object width="500" height="200"><param name="movie" value="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fforss%2Fflickermood"></param><param name="allowscriptaccess" value="always"></param><embed width="500" height="200" src="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fsoundcloud.com%2Fforss%2Fflickermood" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>';
|
49 |
$params = array(
|
50 |
'url' => 'http://soundcloud.com/forss/flickermood',
|
51 |
'iframe' => false,
|
54 |
);
|
55 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Simple Flash widget');
|
56 |
|
57 |
+
$expected = '<iframe width="500" height="200" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054&visual=true&color=ff0000"></iframe>';
|
58 |
$params = array(
|
59 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
60 |
'iframe' => true,
|
64 |
);
|
65 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Visual Widget with extra parameters');
|
66 |
|
67 |
+
$expected = '<iframe width="500" height="116" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054"></iframe>';
|
68 |
$params = array(
|
69 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
70 |
'iframe' => true,
|
74 |
);
|
75 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Simple HTML5 Widget');
|
76 |
|
77 |
+
$expected = '<object width="300" height="300"><param name="movie" value="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F45036121&auto_play=false&player_type=artwork&color=00ff3b"></param><param name="allowscriptaccess" value="always"></param><embed width="300" height="300" src="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F45036121&auto_play=false&player_type=artwork&color=00ff3b" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>';
|
78 |
$params = array(
|
79 |
'url' => 'http://api.soundcloud.com/tracks/45036121',
|
80 |
'iframe' => false,
|
84 |
);
|
85 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Flash Widget with extra parameters');
|
86 |
|
87 |
+
$expected = '<object width="300" height="300"><param name="movie" value="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F41770793&auto_play=false&player_type=artwork&color=ff7700"></param><param name="allowscriptaccess" value="always"></param><embed width="300" height="300" src="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F41770793&auto_play=false&player_type=artwork&color=ff7700" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>';
|
88 |
$params = array(
|
89 |
'url' => 'http://api.soundcloud.com/tracks/41770793',
|
90 |
'iframe' => false,
|
100 |
*/
|
101 |
public function testShortcodeDefaults() {
|
102 |
|
103 |
+
$expected = '<iframe width="500" height="200" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054&visual=true"></iframe>';
|
104 |
$params = array(
|
105 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
106 |
'width' => 500,
|
108 |
);
|
109 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Check if Visual widget is the default');
|
110 |
|
111 |
+
$expected = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054&visual=true"></iframe>';
|
112 |
$params = array(
|
113 |
'url' => 'http://api.soundcloud.com/tracks/38987054'
|
114 |
);
|
115 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Default height and width for Visual widget');
|
116 |
|
117 |
+
$expected = '<iframe width="100%" height="166" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054"></iframe>';
|
118 |
$params = array(
|
119 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
120 |
'params' => 'visual=false'
|
121 |
);
|
122 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Default height and width for HTML5 widget');
|
123 |
|
124 |
+
$expected = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=https%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F1815863&visual=true"></iframe>';
|
125 |
$params = array(
|
126 |
'url' => 'https://api.soundcloud.com/playlists/1815863'
|
127 |
);
|
128 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Default height and width for Visual playlist widget');
|
129 |
|
130 |
+
$expected = '<object width="100%" height="81"><param name="movie" value="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054"></param><param name="allowscriptaccess" value="always"></param><embed width="100%" height="81" src="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>';
|
131 |
$params = array(
|
132 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
133 |
'iframe' => false
|
134 |
);
|
135 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Default height and width for Flash widget');
|
136 |
|
137 |
+
$expected = '<object width="100%" height="255"><param name="movie" value="https://player.soundcloud.com/player.swf?url=https%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F1815863"></param><param name="allowscriptaccess" value="always"></param><embed width="100%" height="255" src="https://player.soundcloud.com/player.swf?url=https%3A%2F%2Fapi.soundcloud.com%2Fplaylists%2F1815863" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>';
|
138 |
$params = array(
|
139 |
'url' => 'https://api.soundcloud.com/playlists/1815863',
|
140 |
'iframe' => false
|
141 |
);
|
142 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Default height and width for Flash playlist widget');
|
143 |
|
144 |
+
$expected = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=http%3A%2F%2Fsoundcloud.com%2Fforss%2Fflickermood&visual=true"></iframe>';
|
145 |
$params = array(
|
146 |
'url' => 'http://soundcloud.com/forss/flickermood',
|
147 |
'iframe' => true
|
154 |
*/
|
155 |
public function testShortcodeBadValues() {
|
156 |
|
157 |
+
$expected = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054&visual=true"></iframe>';
|
158 |
$params = array(
|
159 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
160 |
'width' => '',
|
162 |
);
|
163 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Check bad input');
|
164 |
|
165 |
+
$expected = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054&visual=true"></iframe>';
|
166 |
$params = array(
|
167 |
'url' => ' http://api.soundcloud.com/tracks/38987054',
|
168 |
);
|
169 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Trim whitespace');
|
170 |
|
171 |
+
$expected = '<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054&visual=true"></iframe>';
|
172 |
$params = array(
|
173 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
174 |
'iframe' => 'true'
|
175 |
);
|
176 |
$this->assertEquals($expected, soundcloud_shortcode($params), 'Check iframe true as string');
|
177 |
|
178 |
+
$expected = '<object width="100%" height="81"><param name="movie" value="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054"></param><param name="allowscriptaccess" value="always"></param><embed width="100%" height="81" src="https://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F38987054" allowscriptaccess="always" type="application/x-shockwave-flash"></embed></object>';
|
179 |
$params = array(
|
180 |
'url' => 'http://api.soundcloud.com/tracks/38987054',
|
181 |
'iframe' => 'false'
|