rtMedia for WordPress, BuddyPress and bbPress - Version 2.15.1

Version Description

Bug fixes for admin settings

Download this release

Release Info

Developer saurabhshukla
Plugin Icon 128x128 rtMedia for WordPress, BuddyPress and bbPress
Version 2.15.1
Comparing to
See all releases

Code changes from version 2.15 to 2.15.1

app/admin/BPMediaAdmin.php CHANGED
@@ -63,11 +63,9 @@ if (!class_exists('BPMediaAdmin')) {
63
  * @param type $hook
64
  */
65
  public function ui($hook) {
66
-
67
- $admin_pages = array('toplevel_page_bp-media-settings', 'buddypress-media_page_bp-media-addons', 'buddypress-media_page_bp-media-support', 'buddypress-media_page_bp-media-importer');
68
 
69
  if(in_array($hook, $admin_pages)) {
70
-
71
  $admin_ajax = admin_url('admin-ajax.php');
72
 
73
  wp_enqueue_script('bootstrap-switch', BP_MEDIA_URL . 'app/assets/js/bootstrap-switch.js', array('jquery'), BP_MEDIA_VERSION);
@@ -182,16 +180,22 @@ if (!class_exists('BPMediaAdmin')) {
182
  <?php
183
  $settings_url = ( is_multisite() ) ? network_admin_url('edit.php?action=' . $option_group) : 'options.php';
184
  ?>
185
- <?php if ($option_group) { ?>
186
  <form id="bp_media_settings_form" name="bp_media_settings_form" action="<?php echo $settings_url; ?>" method="post" enctype="multipart/form-data">
187
  <div class="bp-media-metabox-holder"><?php
188
  settings_fields($option_group);
189
-
 
 
190
  echo '<div id="bpm-settings-tabs">';
191
  $sub_tabs = $this->settings_sub_tabs();
192
  BPMediaFormHandler::rtForm_settings_tabs_content($page, $sub_tabs);
193
  echo '</div>';
194
- submit_button();
 
 
 
 
195
  ?><div class="rt-link alignright"><?php _e('By', 'buddypress-media'); ?> <a href="http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media" title="<?php _e('Empowering The Web With WordPress', 'buddypress-media'); ?>"><img src="<?php echo BP_MEDIA_URL; ?>app/assets/img/rtcamp-logo.png"></a></div>
196
  </div>
197
  </form><?php } else {
@@ -259,26 +263,26 @@ if (!class_exists('BPMediaAdmin')) {
259
 
260
  // Setup core admin tabs
261
  $tabs = array(
262
- '0' => array(
263
  'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
264
  'name' => __('Settings', 'buddypress-media'),
265
  'slug' => 'bp-media-settings'
266
  ),
267
- '1' => array(
268
  'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-addons'), 'admin.php')),
269
  'name' => __('Addons', 'buddypress-media'),
270
  'slug' => 'bp-media-addons'
271
  ),
272
- '2' => array(
273
  'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-support'), 'admin.php')),
274
  'name' => __('Support', 'buddypress-media'),
275
  'slug' => 'bp-media-support'
276
  ),
277
- '3' => array(
278
  'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-importer'), 'admin.php')),
279
  'name' => __('Importer', 'buddypress-media'),
280
  'slug' => 'bp-media-importer'
281
- ),
282
  );
283
 
284
  $tabs = apply_filters('bp_media_add_tabs', $tabs);
63
  * @param type $hook
64
  */
65
  public function ui($hook) {
66
+ $admin_pages = array('buddypress-media_page_bp-media-kaltura-settings','buddypress-media_page_bp-media-ffmpeg-settings','toplevel_page_bp-media-settings', 'buddypress-media_page_bp-media-addons', 'buddypress-media_page_bp-media-support', 'buddypress-media_page_bp-media-importer');
 
67
 
68
  if(in_array($hook, $admin_pages)) {
 
69
  $admin_ajax = admin_url('admin-ajax.php');
70
 
71
  wp_enqueue_script('bootstrap-switch', BP_MEDIA_URL . 'app/assets/js/bootstrap-switch.js', array('jquery'), BP_MEDIA_VERSION);
180
  <?php
181
  $settings_url = ( is_multisite() ) ? network_admin_url('edit.php?action=' . $option_group) : 'options.php';
182
  ?>
183
+ <?php if ($option_group) { //$option_group if ($page == "bp-media-settings") ?>
184
  <form id="bp_media_settings_form" name="bp_media_settings_form" action="<?php echo $settings_url; ?>" method="post" enctype="multipart/form-data">
185
  <div class="bp-media-metabox-holder"><?php
186
  settings_fields($option_group);
187
+ if ($page == "bp-media-settings") {
188
+
189
+
190
  echo '<div id="bpm-settings-tabs">';
191
  $sub_tabs = $this->settings_sub_tabs();
192
  BPMediaFormHandler::rtForm_settings_tabs_content($page, $sub_tabs);
193
  echo '</div>';
194
+ }else{
195
+ do_settings_sections($page);
196
+ }
197
+ submit_button();
198
+
199
  ?><div class="rt-link alignright"><?php _e('By', 'buddypress-media'); ?> <a href="http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media" title="<?php _e('Empowering The Web With WordPress', 'buddypress-media'); ?>"><img src="<?php echo BP_MEDIA_URL; ?>app/assets/img/rtcamp-logo.png"></a></div>
200
  </div>
201
  </form><?php } else {
263
 
264
  // Setup core admin tabs
265
  $tabs = array(
266
+ array(
267
  'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-settings'), 'admin.php')),
268
  'name' => __('Settings', 'buddypress-media'),
269
  'slug' => 'bp-media-settings'
270
  ),
271
+ array(
272
  'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-addons'), 'admin.php')),
273
  'name' => __('Addons', 'buddypress-media'),
274
  'slug' => 'bp-media-addons'
275
  ),
276
+ array(
277
  'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-support'), 'admin.php')),
278
  'name' => __('Support', 'buddypress-media'),
279
  'slug' => 'bp-media-support'
280
  ),
281
+ array(
282
  'href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-media-importer'), 'admin.php')),
283
  'name' => __('Importer', 'buddypress-media'),
284
  'slug' => 'bp-media-importer'
285
+ )
286
  );
287
 
288
  $tabs = apply_filters('bp_media_add_tabs', $tabs);
app/admin/BPMediaFormHandler.php CHANGED
@@ -421,14 +421,21 @@ class BPMediaFormHandler {
421
  global $wp_settings_sections, $wp_settings_fields;
422
 
423
  if (!isset($wp_settings_fields) ||
424
- !isset($wp_settings_fields[$page]) ||
425
- !isset($wp_settings_fields[$page]['bpm-activity-upload']) ||
426
- !isset($wp_settings_fields[$page]['bpm-media-lightbox']) ||
427
- !isset($wp_settings_fields[$page]['bpm-media-fine']) ||
428
- !isset($wp_settings_fields[$page]['bpm-miscellaneous']) )
429
  return;
430
 
431
- $sections = array("bpm-activity-upload","bpm-media-lightbox","bpm-media-fine","bpm-miscellaneous");
 
 
 
 
 
 
 
 
 
 
 
432
 
433
  echo '<div class="large-12">';
434
  foreach ($sections as $section) {
421
  global $wp_settings_sections, $wp_settings_fields;
422
 
423
  if (!isset($wp_settings_fields) ||
424
+ !isset($wp_settings_fields[$page]) )
 
 
 
 
425
  return;
426
 
427
+ $sections = array();
428
+
429
+ if( isset($wp_settings_fields[$page]['bpm-media-type']) )
430
+ $sections[] = "bpm-media-type";
431
+ if( isset($wp_settings_fields[$page]['bpm-activity-upload']) )
432
+ $sections[] = "bpm-activity-upload";
433
+ if( isset($wp_settings_fields[$page]['bpm-media-lightbox']) )
434
+ $sections[] = "bpm-media-lightbox";
435
+ if( isset($wp_settings_fields[$page]['bpm-media-fine']) )
436
+ $sections[] = "bpm-media-fine";
437
+ if( isset($wp_settings_fields[$page]['bpm-miscellaneous']) )
438
+ $sections[] = "bpm-miscellaneous";
439
 
440
  echo '<div class="large-12">';
441
  foreach ($sections as $section) {
app/assets/js/admin.js CHANGED
@@ -71,7 +71,7 @@ jQuery(document).ready(function($){
71
  });
72
  });
73
 
74
- jQuery('#encoding-try-now-form').on('click','.encoding-try-now',function(e){
75
  e.preventDefault();
76
  if(confirm(bp_media_admin_strings.are_you_sure)){
77
  jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+bp_media_admin_url+'images/wpspin_light.gif" />')
@@ -82,7 +82,7 @@ jQuery(document).ready(function($){
82
  // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
83
  jQuery.getJSON(ajaxurl, data, function(response) {
84
  if(response.error===undefined && response.apikey){
85
- document.location.href = document.URL+'&apikey='+response.apikey;
86
  }else{
87
  jQuery('.encoding-try-now').next().remove();
88
  jQuery('#settings-error-encoding-error').remove();
@@ -92,7 +92,7 @@ jQuery(document).ready(function($){
92
  }
93
  });
94
 
95
- jQuery('.bp-media-encoding').on('click','#api-key-submit',function(e){
96
  e.preventDefault();
97
  jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+bp_media_admin_url+'images/wpspin_light.gif" />')
98
  var data = {
@@ -103,7 +103,13 @@ jQuery(document).ready(function($){
103
  // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
104
  jQuery.getJSON(ajaxurl, data, function(response) {
105
  if(response.error===undefined && response.apikey){
106
- document.location.href = document.URL+'&update=true&apikey='+response.apikey;
 
 
 
 
 
 
107
  }else{
108
  jQuery('#settings-error-api-key-error').remove();
109
  jQuery('h2:first').after('<div class="error" id="settings-error-api-key-error"><p>'+response.error+'</p></div>');
@@ -111,7 +117,7 @@ jQuery(document).ready(function($){
111
  });
112
  });
113
 
114
- jQuery('.bp-media-encoding').on('click','#disable-encoding',function(e){
115
  e.preventDefault();
116
  if ( confirm(bp_media_admin_strings.disable_encoding )) {
117
  jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+bp_media_admin_url+'images/wpspin_light.gif" />')
71
  });
72
  });
73
 
74
+ jQuery(document).on('click',"#bpm-services .encoding-try-now",function(e){
75
  e.preventDefault();
76
  if(confirm(bp_media_admin_strings.are_you_sure)){
77
  jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+bp_media_admin_url+'images/wpspin_light.gif" />')
82
  // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
83
  jQuery.getJSON(ajaxurl, data, function(response) {
84
  if(response.error===undefined && response.apikey){
85
+ document.location.href = document.URL+'&apikey='+response.apikey;
86
  }else{
87
  jQuery('.encoding-try-now').next().remove();
88
  jQuery('#settings-error-encoding-error').remove();
92
  }
93
  });
94
 
95
+ jQuery(document).on('click','#api-key-submit',function(e){
96
  e.preventDefault();
97
  jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+bp_media_admin_url+'images/wpspin_light.gif" />')
98
  var data = {
103
  // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
104
  jQuery.getJSON(ajaxurl, data, function(response) {
105
  if(response.error===undefined && response.apikey){
106
+ var tempUrl = document.URL;
107
+ if(document.URL.toString().indexOf('&apikey='+response.apikey) == -1)
108
+ tempUrl += '&apikey='+response.apikey;
109
+ if(document.URL.toString().indexOf('&update=true') == -1)
110
+ tempUrl += '&update=true';
111
+ document.location.href = tempUrl;
112
+
113
  }else{
114
  jQuery('#settings-error-api-key-error').remove();
115
  jQuery('h2:first').after('<div class="error" id="settings-error-api-key-error"><p>'+response.error+'</p></div>');
117
  });
118
  });
119
 
120
+ jQuery(document).on('click','#disable-encoding',function(e){
121
  e.preventDefault();
122
  if ( confirm(bp_media_admin_strings.disable_encoding )) {
123
  jQuery(this).after('<img style="margin: 0 0 0 10px" src="'+bp_media_admin_url+'images/wpspin_light.gif" />')
app/services/BPMediaEncoding.php CHANGED
@@ -201,14 +201,14 @@ class BPMediaEncoding {
201
  }
202
  add_action('admin_notices', array($this, 'successfully_subscribed_notice'));
203
  }
204
- if (isset($_GET['apikey']) && is_admin() && isset($_GET['page']) && ($_GET['page'] == 'bp-media-encoding') && $this->is_valid_key($_GET['apikey'])) {
205
  if ($this->api_key && !(isset($_GET['update']) && $_GET['update'])) {
206
  $unsubscribe_url = trailingslashit($this->api_url) . 'api/cancel/' . $this->api_key;
207
  wp_remote_post($unsubscribe_url, array('timeout' => 120, 'body' => array('note' => 'Direct URL Input (API Key: ' . $_GET['apikey'] . ')')));
208
  }
209
  bp_update_option('bp-media-encoding-api-key', $_GET['apikey']);
210
  $usage_info = $this->update_usage($_GET['apikey']);
211
- $return_page = add_query_arg(array('page' => 'bp-media-encoding', 'api_key_updated' => $usage_info->plan->name), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php')));
212
  wp_safe_redirect($return_page);
213
  }
214
  }
@@ -221,7 +221,7 @@ class BPMediaEncoding {
221
 
222
  public function encoding_service_notice() {
223
  $link = add_query_arg(
224
- array('page' => 'bp-media-encoding'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
225
  )
226
  ?>
227
  <div class="updated">
@@ -240,7 +240,7 @@ class BPMediaEncoding {
240
  if ($this->api_key)
241
  $this->update_usage($this->api_key);
242
  $action = $this->sandbox_testing ? 'https://sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';
243
- $return_page = add_query_arg(array('page' => 'bp-media-encoding'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php')));
244
 
245
  $usage_details = bp_get_option('bp-media-encoding-usage');
246
  if (isset($usage_details[$this->api_key]->plan->name) && (strtolower($usage_details[$this->api_key]->plan->name) == strtolower($name)) && $usage_details[$this->api_key]->sub_status && !$force) {
201
  }
202
  add_action('admin_notices', array($this, 'successfully_subscribed_notice'));
203
  }
204
+ if (isset($_GET['apikey']) && is_admin() && isset($_GET['page']) && ($_GET['page'] == 'bp-media-addons') && $this->is_valid_key($_GET['apikey'])) {
205
  if ($this->api_key && !(isset($_GET['update']) && $_GET['update'])) {
206
  $unsubscribe_url = trailingslashit($this->api_url) . 'api/cancel/' . $this->api_key;
207
  wp_remote_post($unsubscribe_url, array('timeout' => 120, 'body' => array('note' => 'Direct URL Input (API Key: ' . $_GET['apikey'] . ')')));
208
  }
209
  bp_update_option('bp-media-encoding-api-key', $_GET['apikey']);
210
  $usage_info = $this->update_usage($_GET['apikey']);
211
+ $return_page = add_query_arg(array('page' => 'bp-media-addons', 'api_key_updated' => $usage_info->plan->name), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php')));
212
  wp_safe_redirect($return_page);
213
  }
214
  }
221
 
222
  public function encoding_service_notice() {
223
  $link = add_query_arg(
224
+ array('page' => 'bp-media-addons'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php'))
225
  )
226
  ?>
227
  <div class="updated">
240
  if ($this->api_key)
241
  $this->update_usage($this->api_key);
242
  $action = $this->sandbox_testing ? 'https://sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';
243
+ $return_page = add_query_arg(array('page' => 'bp-media-addons'), (is_multisite() ? network_admin_url('admin.php') : admin_url('admin.php')));
244
 
245
  $usage_details = bp_get_option('bp-media-encoding-usage');
246
  if (isset($usage_details[$this->api_key]->plan->name) && (strtolower($usage_details[$this->api_key]->plan->name) == strtolower($name)) && $usage_details[$this->api_key]->sub_status && !$force) {
index.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: BuddyPress Media
4
  Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
5
  Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
6
- Version: 2.15
7
  Author: rtCamp
8
  Text Domain: buddypress-media
9
  Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
3
  Plugin Name: BuddyPress Media
4
  Plugin URI: http://rtcamp.com/buddypress-media/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
5
  Description: This plugin adds missing media rich features like photos, videos and audio uploading to BuddyPress which are essential if you are building social network, seriously!
6
+ Version: 2.15.1
7
  Author: rtCamp
8
  Text Domain: buddypress-media
9
  Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
readme.txt CHANGED
@@ -6,7 +6,7 @@ License: GPLv2 or later
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: WordPress 3.5 + BuddyPress 1.6
8
  Tested up to: WordPress 3.5 + BuddyPress 1.7
9
- Stable tag: 2.15
10
 
11
  Adds Photos, Music, Videos & Albums to BuddyPress. Supports mobile devices (iPhone/iPad, etc) and automatic audio/video conversion.
12
 
@@ -149,6 +149,9 @@ Please visit [BuddyPress Media's Features page](http://rtcamp.com/buddypress-med
149
  == Changelog ==
150
 
151
  Please visit [BuddyPress Media's Roadmap page](http://rtcamp.com/buddypress-media/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit BuddyPress Media's Features page") to get some details about future releases.
 
 
 
152
 
153
  = 2.15 =
154
  * Fixes bugs in Admin settings
@@ -447,5 +450,5 @@ Please visit [BuddyPress Media's Roadmap page](http://rtcamp.com/buddypress-medi
447
  * HTML5 Video Tag Support (with fallback)
448
 
449
  == Upgrade Notice ==
450
- = 2.15 =
451
- Bug fixes for admin screen
6
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
7
  Requires at least: WordPress 3.5 + BuddyPress 1.6
8
  Tested up to: WordPress 3.5 + BuddyPress 1.7
9
+ Stable tag: 2.15.1
10
 
11
  Adds Photos, Music, Videos & Albums to BuddyPress. Supports mobile devices (iPhone/iPad, etc) and automatic audio/video conversion.
12
 
149
  == Changelog ==
150
 
151
  Please visit [BuddyPress Media's Roadmap page](http://rtcamp.com/buddypress-media/roadmap/?utm_source=readme&utm_medium=plugin&utm_campaign=buddypress-media "Visit BuddyPress Media's Features page") to get some details about future releases.
152
+ = 2.15 =
153
+ * Fixes bugs in Group settings
154
+ * Fixes bugs in Addon settings
155
 
156
  = 2.15 =
157
  * Fixes bugs in Admin settings
450
  * HTML5 Video Tag Support (with fallback)
451
 
452
  == Upgrade Notice ==
453
+ = 2.15.1 =
454
+ Bug fixes for admin settings