Version Description
- Fixed a bug in the Widget not properly displaying Playlists after updating from 2.3.3. Thanks to Jan Middelkoop and @gnorf for helping out.
- Added shortcode attr to show latest track from a specific, see FAQs for how to do it manually.
- Updated FAQs to give more documentation around the shortcode
- Added a survey for all users: Please help me make this plugin better by answering those few questions.
Download this release
Release Info
Developer | realTM |
Plugin | SoundCloud Is Gold |
Version | 2.4.1 |
Comparing to | |
See all releases |
Code changes from version 2.4 to 2.4.1
- readme.txt +26 -9
- soundcloud-is-gold-css.css +36 -1
- soundcloud-is-gold-functions.php +9 -2
- soundcloud-is-gold.php +49 -26
readme.txt
CHANGED
@@ -1,15 +1,17 @@
|
|
1 |
=== SoundCloud Is Gold ===
|
2 |
Contributors: Thomas Michalak
|
3 |
Donate link: http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin
|
4 |
-
Tags: soundcloud,
|
5 |
Requires at least: 3.2
|
6 |
-
Tested up to: 4.7.
|
7 |
-
Stable tag: 2.4
|
8 |
|
9 |
Browse through your soundcloud tracks, playlists and favorites. Add tracks, playlists and favorites to your posts. Live preview, easy to use.
|
10 |
|
11 |
== Description ==
|
12 |
|
|
|
|
|
13 |
**New Widget to display latest and random track, favorites or sets for one user, multiple users or random users.**
|
14 |
|
15 |
**Soundcloud is Gold** integrates perfectly into wordpress. Browse through your soundcloud tracks, playlists and favorites from the 'Soundcloud is gold' tab in the post's 'upload media' popup window. Select, set and add track, playlists, favorites to your post using the soundcloud player. Live Preview, easy, smart and straightforward.
|
@@ -102,17 +104,26 @@ Here's a simple method to track down incompatibilities with plugins and themes:
|
|
102 |
|
103 |
Remenber that even if a plugin is popular, most of the plugins are badly coded or the developer didn't follow Wordpress guidelines on plugin development. Therefor conflict happens. The method is useful not just for this plugin.
|
104 |
|
105 |
-
=
|
106 |
|
107 |
-
If for some reason you wish to use the shortcode manually,
|
108 |
|
109 |
-
**
|
|
|
110 |
|
111 |
-
|
112 |
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
|
115 |
-
**[soundcloud id='10450254' comments='true' autoplay='false' playertype='Standard' width='100%' color='#005bff']**
|
116 |
|
117 |
|
118 |
= Can I request features? =
|
@@ -137,6 +148,12 @@ Sometimes, I generally keep a eye on my plugin's forums and website's comments.
|
|
137 |
|
138 |
== Changelog ==
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
= 2.4 =
|
141 |
* Removed flash player and all related options as Soundcloud only support their html5 player now
|
142 |
* New Visual player now supported (big full artwork) with the addition with a force square option (height of 450px) to match Soundcloud default settings
|
1 |
=== SoundCloud Is Gold ===
|
2 |
Contributors: Thomas Michalak
|
3 |
Donate link: http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin
|
4 |
+
Tags: soundcloud, simple, shortcode, music, sound
|
5 |
Requires at least: 3.2
|
6 |
+
Tested up to: 4.7.2
|
7 |
+
Stable tag: 2.4.1
|
8 |
|
9 |
Browse through your soundcloud tracks, playlists and favorites. Add tracks, playlists and favorites to your posts. Live preview, easy to use.
|
10 |
|
11 |
== Description ==
|
12 |
|
13 |
+
**The only way to a create a better plugin is to listen to you, the users. I created a super short survey with questions around possible new features and asking what you like or hate about the plugin. It’s very short and only take a few minutes at most. [https://mightymess.typeform.com/to/Bg82kF](https://mightymess.typeform.com/to/Bg82kF), Thank you for your support**
|
14 |
+
|
15 |
**New Widget to display latest and random track, favorites or sets for one user, multiple users or random users.**
|
16 |
|
17 |
**Soundcloud is Gold** integrates perfectly into wordpress. Browse through your soundcloud tracks, playlists and favorites from the 'Soundcloud is gold' tab in the post's 'upload media' popup window. Select, set and add track, playlists, favorites to your post using the soundcloud player. Live Preview, easy, smart and straightforward.
|
104 |
|
105 |
Remenber that even if a plugin is popular, most of the plugins are badly coded or the developer didn't follow Wordpress guidelines on plugin development. Therefor conflict happens. The method is useful not just for this plugin.
|
106 |
|
107 |
+
= Do you have some documentation for the shortcode? =
|
108 |
|
109 |
+
If for some reason you wish to use the shortcode manually, here's what's possible:
|
110 |
|
111 |
+
**id or user is required for the shortcode to work**
|
112 |
+
[soundcloud id='trackID']: The id of the track, favorite or playlist.
|
113 |
|
114 |
+
[soundcloud user='yourUsername'] : This will always display the latest track (will overwrite id if set)
|
115 |
|
116 |
+
**Those attributes are optional**
|
117 |
+
comments: True or False
|
118 |
+
autoplay: True or False
|
119 |
+
playertype: 'Standard'
|
120 |
+
width: px or % (for example 56px or 56%)
|
121 |
+
color: rgb hex color code (for example #005bff)
|
122 |
+
show_artwork: True or False
|
123 |
+
visual: True or False (overwrites show_artwork)
|
124 |
+
show_comments: True or False
|
125 |
+
format: 'tracks' or 'playlists'
|
126 |
|
|
|
127 |
|
128 |
|
129 |
= Can I request features? =
|
148 |
|
149 |
== Changelog ==
|
150 |
|
151 |
+
= 2.4.1 =
|
152 |
+
* Fixed a bug in the Widget not properly displaying Playlists after updating from 2.3.3. Thanks to Jan Middelkoop and @gnorf for helping out.
|
153 |
+
* Added shortcode attr to show latest track from a specific, see FAQs for how to do it manually.
|
154 |
+
* Updated FAQs to give more documentation around the shortcode
|
155 |
+
* Added a survey for all users: Please help me make this plugin better by answering those few questions.
|
156 |
+
|
157 |
= 2.4 =
|
158 |
* Removed flash player and all related options as Soundcloud only support their html5 player now
|
159 |
* New Visual player now supported (big full artwork) with the addition with a force square option (height of 450px) to match Soundcloud default settings
|
soundcloud-is-gold-css.css
CHANGED
@@ -676,7 +676,7 @@ select.soundcloudMMInput option{
|
|
676 |
position: absolute;
|
677 |
width: 95%;
|
678 |
}
|
679 |
-
/** Color
|
680 |
.soundcloudMMColorPicker .soundcloudMMColorPickerClose{
|
681 |
display: block;
|
682 |
padding: 6% 2%;
|
@@ -724,3 +724,38 @@ select.soundcloudMMInput option{
|
|
724 |
color:#333333;
|
725 |
text-align:center;
|
726 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
676 |
position: absolute;
|
677 |
width: 95%;
|
678 |
}
|
679 |
+
/** Color Picker **/
|
680 |
.soundcloudMMColorPicker .soundcloudMMColorPickerClose{
|
681 |
display: block;
|
682 |
padding: 6% 2%;
|
724 |
color:#333333;
|
725 |
text-align:center;
|
726 |
}
|
727 |
+
|
728 |
+
/************************/
|
729 |
+
/* */
|
730 |
+
/* SURVEY */
|
731 |
+
/* */
|
732 |
+
/************************/
|
733 |
+
@keyframes survey_anim {
|
734 |
+
from {
|
735 |
+
background: #008ec2;
|
736 |
+
box-shadow: 0 0 10px rgba(0, 142, 194, 1);
|
737 |
+
}
|
738 |
+
to {
|
739 |
+
background: #0085ba;
|
740 |
+
box-shadow: 0 0 0 rgba(0, 0, 0, 0);
|
741 |
+
}
|
742 |
+
}
|
743 |
+
#soundcloudMMSurvey{
|
744 |
+
z-index: 100000;
|
745 |
+
position: fixed;
|
746 |
+
right: -425px;
|
747 |
+
font-size: 1.2em;
|
748 |
+
top: 45%;
|
749 |
+
padding: 0.5% 1%;
|
750 |
+
height: auto;
|
751 |
+
transition: right ease-in-out 0.5s;
|
752 |
+
animation-name: survey_anim;
|
753 |
+
animation-duration: 2s;
|
754 |
+
animation-timing-function: ease-in-out;
|
755 |
+
animation-direction: alternate;
|
756 |
+
animation-iteration-count: infinite;
|
757 |
+
}
|
758 |
+
#soundcloudMMSurvey:hover{
|
759 |
+
right: -2px;
|
760 |
+
transition: right ease-in-out 0.5s;
|
761 |
+
}
|
soundcloud-is-gold-functions.php
CHANGED
@@ -635,15 +635,19 @@ function soundcloud_is_gold_player($id, $user, $autoPlay, $comments, $width, $he
|
|
635 |
if(!isset($classes)) $classes = $soundcloudIsGoldClasses;
|
636 |
if(!isset($color)) $color = $soundcloudIsGoldColor;
|
637 |
if(!isset($format)) $format = 'tracks';
|
|
|
|
|
638 |
if($format == 'playlists' || $format == 'playlist') $format = 'playlists';
|
|
|
|
|
639 |
|
640 |
$color = str_replace('#', '', $color);
|
641 |
|
642 |
//In case of requesting latest track
|
643 |
-
|
644 |
$returnedId = get_soundcloud_is_gold_latest_track_id($user, $format);
|
645 |
if($returnedId != "") $id = $returnedId;
|
646 |
-
}
|
647 |
|
648 |
//Reset Favorites to tracks as soundcloud treats them as tracks.
|
649 |
if($format == 'favorites') $format = "tracks";
|
@@ -831,6 +835,9 @@ class Soundcloud_Is_Gold_Widget extends WP_Widget {
|
|
831 |
$number = $instance['number'];
|
832 |
$format = $instance['format'];
|
833 |
|
|
|
|
|
|
|
834 |
//Random User
|
835 |
if($user == "randomUser") {
|
836 |
$options = get_option('soundcloud_is_gold_options');
|
635 |
if(!isset($classes)) $classes = $soundcloudIsGoldClasses;
|
636 |
if(!isset($color)) $color = $soundcloudIsGoldColor;
|
637 |
if(!isset($format)) $format = 'tracks';
|
638 |
+
|
639 |
+
//Format logic
|
640 |
if($format == 'playlists' || $format == 'playlist') $format = 'playlists';
|
641 |
+
//Fix for people updating from 2.3.3 when widgets settings were using "sets" for "playlists"
|
642 |
+
if($format == 'sets' || $format == 'set') $format = 'playlists';
|
643 |
|
644 |
$color = str_replace('#', '', $color);
|
645 |
|
646 |
//In case of requesting latest track
|
647 |
+
if(isset($user) && $user != "null"){
|
648 |
$returnedId = get_soundcloud_is_gold_latest_track_id($user, $format);
|
649 |
if($returnedId != "") $id = $returnedId;
|
650 |
+
}
|
651 |
|
652 |
//Reset Favorites to tracks as soundcloud treats them as tracks.
|
653 |
if($format == 'favorites') $format = "tracks";
|
835 |
$number = $instance['number'];
|
836 |
$format = $instance['format'];
|
837 |
|
838 |
+
//Fix for people updating from 2.3.3 when widgets settings were using "sets" for "playlists"
|
839 |
+
if($format == 'sets' || $format == 'set') $format = 'playlists';
|
840 |
+
|
841 |
//Random User
|
842 |
if($user == "randomUser") {
|
843 |
$options = get_option('soundcloud_is_gold_options');
|
soundcloud-is-gold.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Soundcloud is Gold
|
4 |
Plugin URI: http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin
|
5 |
Description: <strong><a href="http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin">Soundcloud is gold</a></strong> integrates perfectly into wordpress. Select, set and add track, playlists or favorites to your post using the soundcloud player. Live Preview, easy, smart and straightforward. You can set default settings in the option page, choose your defaut soundcloud player (Standard, Artwork, Visual), its width, extra Css classes for you CSS lovers and your favorite colors. You'll still be able to set players to different settings before adding to your post if you fancy a one off change!
|
6 |
-
Version: 2.4
|
7 |
Author: Thomas Michalak
|
8 |
Author URI: http://www.mightymess.com/thomas-michalak
|
9 |
License: GPL2 or Later
|
@@ -98,51 +98,39 @@ register_activation_hook(__FILE__, 'soundcloud_is_gold_add_defaults');
|
|
98 |
function soundcloud_is_gold_add_defaults() {
|
99 |
//Get the options to see if plugin was already installed or not
|
100 |
$tmpOptions = get_option('soundcloud_is_gold_options');
|
101 |
-
//First Time install or
|
102 |
-
|
|
|
103 |
$soundcloudIsGoldDefaultUsers = array(
|
104 |
'anna-chocola' => array('anna-chocola', 'https://i1.sndcdn.com/avatars-000009470567-spqine-large.jpg?4387aef'),
|
105 |
't-m' => array('t-m', 'https://i1.sndcdn.com/avatars-000002680779-fkvvpj-large.jpg?4387aef'),
|
106 |
'my-disco-nap' => array('my-disco-nap', 'https://i1.sndcdn.com/avatars-000012680897-foqv41-large.jpg?b9f92e9')
|
107 |
);
|
108 |
$soundcloudIsGoldDefaultUser = $soundcloudIsGoldDefaultUsers[array_rand($soundcloudIsGoldDefaultUsers, 1)][0];
|
109 |
-
|
110 |
-
if(get_option('soundcloud_is_gold_user')){
|
111 |
-
$soundcloudIsGoldDefaultUser = get_option('soundcloud_is_gold_user');
|
112 |
-
$userInfo = get_soundcloud_is_gold_api_response("https://api.soundcloud.com/users/".$soundcloudIsGoldDefaultUser.".json?client_id=".CLIENT_ID);
|
113 |
-
$newUsername = (string)$userInfo['response']->permalink;
|
114 |
-
$newUsernameImg = (string)$userInfo['response']->{'avatar-url'}[0];
|
115 |
-
$soundcloudIsGoldDefaultUsers[$newUsername][0] = $newUsername;
|
116 |
-
$soundcloudIsGoldDefaultUsers[$newUsername][1] = $newUsernameImg;
|
117 |
-
}
|
118 |
$soundcloudIsGoldDefaultSettings = array(
|
119 |
false,
|
120 |
true,
|
121 |
true,
|
122 |
false
|
123 |
);
|
|
|
124 |
$soundcloudIsGoldWitdhDefaultSettings = array(
|
125 |
"type" => "custom",
|
126 |
"wp" => "medium",
|
127 |
"custom" => "100%"
|
128 |
);
|
129 |
-
//
|
130 |
$args = array(
|
131 |
'soundcloud_is_gold_users' => $soundcloudIsGoldDefaultUsers,
|
132 |
'soundcloud_is_gold_active_user' => $soundcloudIsGoldDefaultUser,
|
133 |
-
'soundcloud_is_gold_settings' =>
|
134 |
-
'soundcloud_is_gold_width_settings' =>
|
135 |
-
'soundcloud_is_gold_classes' =>
|
136 |
-
'soundcloud_is_gold_color' =>
|
137 |
);
|
138 |
-
//Update
|
139 |
update_option('soundcloud_is_gold_options', $args);
|
140 |
-
//Delete old entries in db
|
141 |
-
delete_option("soundcloud_is_gold_user");
|
142 |
-
delete_option("soundcloud_is_gold_settings");
|
143 |
-
delete_option("soundcloud_is_gold_width_settings");
|
144 |
-
delete_option("soundcloud_is_gold_classes");
|
145 |
-
delete_option("soundcloud_is_gold_color");
|
146 |
}else{
|
147 |
//Updating plugin
|
148 |
}
|
@@ -159,6 +147,40 @@ register_uninstall_hook(__FILE__, 'soundcloud_is_gold_delete_plugin_options');
|
|
159 |
function soundcloud_is_gold_delete_plugin_options() {
|
160 |
delete_option("soundcloud_is_gold_options");
|
161 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
// display default admin notice
|
164 |
function soundcloud_is_gold_add_settings_errors() {
|
@@ -211,8 +233,9 @@ http://localhost/~thomas/Others/dev/wp-admin/admin-ajax.php?action=get_soundclou
|
|
211 |
<input type="submit" name="submit" />
|
212 |
</form> -->
|
213 |
|
214 |
-
|
215 |
-
|
|
|
216 |
<!-- Header -->
|
217 |
<div id="soundcloudMMTop">
|
218 |
<div class="leftPart">
|
3 |
Plugin Name: Soundcloud is Gold
|
4 |
Plugin URI: http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin
|
5 |
Description: <strong><a href="http://www.mightymess.com/soundcloud-is-gold-wordpress-plugin">Soundcloud is gold</a></strong> integrates perfectly into wordpress. Select, set and add track, playlists or favorites to your post using the soundcloud player. Live Preview, easy, smart and straightforward. You can set default settings in the option page, choose your defaut soundcloud player (Standard, Artwork, Visual), its width, extra Css classes for you CSS lovers and your favorite colors. You'll still be able to set players to different settings before adding to your post if you fancy a one off change!
|
6 |
+
Version: 2.4.1
|
7 |
Author: Thomas Michalak
|
8 |
Author URI: http://www.mightymess.com/thomas-michalak
|
9 |
License: GPL2 or Later
|
98 |
function soundcloud_is_gold_add_defaults() {
|
99 |
//Get the options to see if plugin was already installed or not
|
100 |
$tmpOptions = get_option('soundcloud_is_gold_options');
|
101 |
+
//First Time install or reactivating
|
102 |
+
if(empty($tmpOptions)) {
|
103 |
+
//Set default Users and Pick a random user to be active
|
104 |
$soundcloudIsGoldDefaultUsers = array(
|
105 |
'anna-chocola' => array('anna-chocola', 'https://i1.sndcdn.com/avatars-000009470567-spqine-large.jpg?4387aef'),
|
106 |
't-m' => array('t-m', 'https://i1.sndcdn.com/avatars-000002680779-fkvvpj-large.jpg?4387aef'),
|
107 |
'my-disco-nap' => array('my-disco-nap', 'https://i1.sndcdn.com/avatars-000012680897-foqv41-large.jpg?b9f92e9')
|
108 |
);
|
109 |
$soundcloudIsGoldDefaultUser = $soundcloudIsGoldDefaultUsers[array_rand($soundcloudIsGoldDefaultUsers, 1)][0];
|
110 |
+
//Set Default Settings
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
111 |
$soundcloudIsGoldDefaultSettings = array(
|
112 |
false,
|
113 |
true,
|
114 |
true,
|
115 |
false
|
116 |
);
|
117 |
+
//Set default Width Settings
|
118 |
$soundcloudIsGoldWitdhDefaultSettings = array(
|
119 |
"type" => "custom",
|
120 |
"wp" => "medium",
|
121 |
"custom" => "100%"
|
122 |
);
|
123 |
+
//Register defaults settings
|
124 |
$args = array(
|
125 |
'soundcloud_is_gold_users' => $soundcloudIsGoldDefaultUsers,
|
126 |
'soundcloud_is_gold_active_user' => $soundcloudIsGoldDefaultUser,
|
127 |
+
'soundcloud_is_gold_settings' => $soundcloudIsGoldDefaultSettings,
|
128 |
+
'soundcloud_is_gold_width_settings' => $soundcloudIsGoldWitdhDefaultSettings,
|
129 |
+
'soundcloud_is_gold_classes' => '',
|
130 |
+
'soundcloud_is_gold_color' => 'ff7700'
|
131 |
);
|
132 |
+
//Update Settings
|
133 |
update_option('soundcloud_is_gold_options', $args);
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
}else{
|
135 |
//Updating plugin
|
136 |
}
|
147 |
function soundcloud_is_gold_delete_plugin_options() {
|
148 |
delete_option("soundcloud_is_gold_options");
|
149 |
}
|
150 |
+
//Updating plugin
|
151 |
+
//Update database if needed during Update
|
152 |
+
//Updating plugin
|
153 |
+
/*function soundcloud_is_gold_update_plugin($upgrader_object, $options){
|
154 |
+
$current_plugin_path_name = plugin_basename( __FILE__ );
|
155 |
+
|
156 |
+
if ($options['action'] == 'update' && $options['type'] == 'plugin' ){
|
157 |
+
foreach($options['packages'] as $each_plugin){
|
158 |
+
if ($each_plugin==$current_plugin_path_name){
|
159 |
+
soundcloud_is_gold_update_plugin_options();
|
160 |
+
}
|
161 |
+
}
|
162 |
+
}
|
163 |
+
}
|
164 |
+
add_action( 'upgrader_process_complete', 'soundcloud_is_gold_update_plugin',10, 2);
|
165 |
+
*/
|
166 |
+
|
167 |
+
//Update plugin options
|
168 |
+
function soundcloud_is_gold_update_plugin_options_userid(){
|
169 |
+
$options = get_option('soundcloud_is_gold_options');
|
170 |
+
$soundcloudIsGoldUsers = isset($options['soundcloud_is_gold_users']) ? $options['soundcloud_is_gold_users'] : '';
|
171 |
+
foreach ($soundcloudIsGoldUsers as $key => $user) {
|
172 |
+
if(!is_numeric($user[0])){
|
173 |
+
//Get user id based on username
|
174 |
+
$soundcloudIsGoldApiCall = 'https://api.soundcloud.com/resolve.json?url=https://www.soundcloud.com/'.$user[0].'&client_id='.CLIENT_ID;
|
175 |
+
$soundcloudIsGoldApiResponse = get_soundcloud_is_gold_api_response($soundcloudIsGoldApiCall);
|
176 |
+
//Update options with user id
|
177 |
+
if(isset($soundcloudIsGoldApiResponse['response']['location'])){
|
178 |
+
$soundcloudIsGoldApiResponse = get_soundcloud_is_gold_api_response($soundcloudIsGoldApiResponse['response']['location']);
|
179 |
+
//update options
|
180 |
+
}
|
181 |
+
}
|
182 |
+
}
|
183 |
+
}
|
184 |
|
185 |
// display default admin notice
|
186 |
function soundcloud_is_gold_add_settings_errors() {
|
233 |
<input type="submit" name="submit" />
|
234 |
</form> -->
|
235 |
|
236 |
+
<div class="soundcloudMMWrapper soundcloudMMOptions soundcloudMMMainWrapper">
|
237 |
+
<!-- Survey -->
|
238 |
+
<a href="https://mightymess.typeform.com/to/Bg82kF" id="soundcloudMMSurvey" class="button-primary" target="_blank" >Help me make a better plugin by taking this super short survey ></a>
|
239 |
<!-- Header -->
|
240 |
<div id="soundcloudMMTop">
|
241 |
<div class="leftPart">
|