Skip to content

Commit

Permalink
Merge pull request #1931 from rtCamp/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
pooja-muchandikar authored Jun 15, 2022
2 parents b3990a7 + 32d7600 commit a4dca06
Show file tree
Hide file tree
Showing 15 changed files with 138 additions and 35 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Add albums, photo, audio/video upload, privacy, sharing, front-end uploads & mor
![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=MU1JamdmRnppK0hhQy9QMU8wdDJ2MUEyb1ZuS0ljVFQvSHZ6anFvNzUxTT0tLXhUNnliTnZGcE5CcW93N0I1eXdnM3c9PQ==--8c124e667dd0c317618efde1bed2b260000916b6)


* **Contributors:** [rtcamp](http://profiles.wordpress.org/rtcamp), [mangeshp](http://profiles.wordpress.org/mangeshp), [sanket.parmar](http://profiles.wordpress.org/sanket.parmar), [pranalipatel](http://profiles.wordpress.org/pranalipatel), [jignesh.nakrani](http://profiles.wordpress.org/jignesh.nakrani), [manishsongirkar36](http://profiles.wordpress.org/manishsongirkar36), [kiranpotphode](http://profiles.wordpress.org/kiranpotphode), [yahil](http://profiles.wordpress.org/yahil), [1naveengiri](http://profiles.wordpress.org/1naveengiri), [bhargavbhandari90](http://profiles.wordpress.org/bhargavbhandari90), [deepak1191](http://profiles.wordpress.org/deepak1191), [rittesh.patel](http://profiles.wordpress.org/rittesh.patel), [sagarjadhav](http://profiles.wordpress.org/sagarjadhav), [pushpak.pop](http://profiles.wordpress.org/pushpak.pop), [faishal](http://profiles.wordpress.org/faishal), [desaiuditd](http://profiles.wordpress.org/desaiuditd), [rahul286](http://profiles.wordpress.org/rahul286), [JoshuaAbenazer](http://profiles.wordpress.org/JoshuaAbenazer), [gagan0123](http://profiles.wordpress.org/gagan0123), [saurabhshukla](http://profiles.wordpress.org/saurabhshukla), [nitun.lanjewar](http://profiles.wordpress.org/nitun.lanjewar), [umesh.nevase](http://profiles.wordpress.org/umesh.nevase), [suhasgirgaonkar](http://profiles.wordpress.org/suhasgirgaonkar), [neerukoul](http://profiles.wordpress.org/neerukoul), [hrishiv90](http://profiles.wordpress.org/hrishiv90), [kanakiyajay](http://profiles.wordpress.org/kanakiyajay), [jarretc](http://profiles.wordpress.org/jarretc), [tobiaskluge](http://profiles.wordpress.org/tobiaskluge), [rafaelfunchal](http://profiles.wordpress.org/rafaelfunchal), [UmeshSingla](http://profiles.wordpress.org/UmeshSingla), [mehulkaklotar](http://profiles.wordpress.org/mehulkaklotar), [tannermirabel](http://profiles.wordpress.org/tannermirabel), [kishores](http://profiles.wordpress.org/kishores), [chandrapatel](http://profiles.wordpress.org/chandrapatel), [rahul3883](http://profiles.wordpress.org/rahul3883/), [nomnom99](http://profiles.wordpress.org/nomnom99), [sayanchakraborty](https://profiles.wordpress.org/sayanchakraborty), [milindmore22](https://profiles.wordpress.org/milindmore22), [thrijith](https://profiles.wordpress.org/thrijith), [abhijitrakas](https://profiles.wordpress.org/abhijitrakas), [sid177](https://profiles.wordpress.org/sid177), [montu3366](https://profiles.wordpress.org/montu3366), [jashwini](https://profiles.wordpress.org/jashwini), [juhise](https://profiles.wordpress.org/juhise), [ravatparmar](https://profiles.wordpress.org/ravatparmar), [dharmin16](https://profiles.wordpress.org/dharmin16), [malavvasita](https://profiles.wordpress.org/malavvasita), [pooja1210](https://profiles.wordpress.org/pooja1210), [krupajnanda](https://profiles.wordpress.org/krupajnanda), [kanumalivad](https://profiles.wordpress.org/kanumalivad), [surajkumarsingh](https://profiles.wordpress.org/surajkumarsingh), [dishitpala](https://profiles.wordpress.org/dishitpala), [shobhit2412](https://profiles.wordpress.org/shobhit2412/), [vkd007](https://profiles.wordpress.org/vkd007/), [vaishu.agola27](https://profiles.wordpress.org/vaishuagola27/), [kapilpaul](https://profiles.wordpress.org/kapilpaul/), [opurockey](https://profiles.wordpress.org/opurockey/), [pavanpatil1](https://profiles.wordpress.org/pavanpatil1/), [pradeep1308](https://profiles.wordpress.org/pradeep1308/), [shardul200](https://profiles.wordpress.org/shardul200/), [ibnulk](https://profiles.wordpress.org/ibnulk/), [sabbir1991](https://profiles.wordpress.org/sabbir1991/), [kamalahmed](https://profiles.wordpress.org/kamalahmed/), [harshbarach](https://profiles.wordpress.org/harshbarach/), [mukulsingh27](https://profiles.wordpress.org/mukulsingh27/), [vishalkakadiya](https://profiles.wordpress.org/vishalkakadiya/)
* **Contributors:** [rtcamp](http://profiles.wordpress.org/rtcamp), [mangeshp](http://profiles.wordpress.org/mangeshp), [sanket.parmar](http://profiles.wordpress.org/sanket.parmar), [pranalipatel](http://profiles.wordpress.org/pranalipatel), [jignesh.nakrani](http://profiles.wordpress.org/jignesh.nakrani), [manishsongirkar36](http://profiles.wordpress.org/manishsongirkar36), [kiranpotphode](http://profiles.wordpress.org/kiranpotphode), [yahil](http://profiles.wordpress.org/yahil), [1naveengiri](http://profiles.wordpress.org/1naveengiri), [bhargavbhandari90](http://profiles.wordpress.org/bhargavbhandari90), [deepak1191](http://profiles.wordpress.org/deepak1191), [rittesh.patel](http://profiles.wordpress.org/rittesh.patel), [sagarjadhav](http://profiles.wordpress.org/sagarjadhav), [pushpak.pop](http://profiles.wordpress.org/pushpak.pop), [faishal](http://profiles.wordpress.org/faishal), [desaiuditd](http://profiles.wordpress.org/desaiuditd), [rahul286](http://profiles.wordpress.org/rahul286), [JoshuaAbenazer](http://profiles.wordpress.org/JoshuaAbenazer), [gagan0123](http://profiles.wordpress.org/gagan0123), [saurabhshukla](http://profiles.wordpress.org/saurabhshukla), [nitun.lanjewar](http://profiles.wordpress.org/nitun.lanjewar), [umesh.nevase](http://profiles.wordpress.org/umesh.nevase), [suhasgirgaonkar](http://profiles.wordpress.org/suhasgirgaonkar), [neerukoul](http://profiles.wordpress.org/neerukoul), [hrishiv90](http://profiles.wordpress.org/hrishiv90), [kanakiyajay](http://profiles.wordpress.org/kanakiyajay), [jarretc](http://profiles.wordpress.org/jarretc), [tobiaskluge](http://profiles.wordpress.org/tobiaskluge), [rafaelfunchal](http://profiles.wordpress.org/rafaelfunchal), [UmeshSingla](http://profiles.wordpress.org/UmeshSingla), [mehulkaklotar](http://profiles.wordpress.org/mehulkaklotar), [tannermirabel](http://profiles.wordpress.org/tannermirabel), [kishores](http://profiles.wordpress.org/kishores), [chandrapatel](http://profiles.wordpress.org/chandrapatel), [rahul3883](http://profiles.wordpress.org/rahul3883/), [nomnom99](http://profiles.wordpress.org/nomnom99), [sayanchakraborty](https://profiles.wordpress.org/sayanchakraborty), [milindmore22](https://profiles.wordpress.org/milindmore22), [thrijith](https://profiles.wordpress.org/thrijith), [abhijitrakas](https://profiles.wordpress.org/abhijitrakas), [sid177](https://profiles.wordpress.org/sid177), [montu3366](https://profiles.wordpress.org/montu3366), [jashwini](https://profiles.wordpress.org/jashwini), [juhise](https://profiles.wordpress.org/juhise), [ravatparmar](https://profiles.wordpress.org/ravatparmar), [dharmin16](https://profiles.wordpress.org/dharmin16), [malavvasita](https://profiles.wordpress.org/malavvasita), [pooja1210](https://profiles.wordpress.org/pooja1210), [krupajnanda](https://profiles.wordpress.org/krupajnanda), [kanumalivad](https://profiles.wordpress.org/kanumalivad), [surajkumarsingh](https://profiles.wordpress.org/surajkumarsingh), [dishitpala](https://profiles.wordpress.org/dishitpala), [shobhit2412](https://profiles.wordpress.org/shobhit2412/), [vkd007](https://profiles.wordpress.org/vkd007/), [vaishu.agola27](https://profiles.wordpress.org/vaishuagola27/), [kapilpaul](https://profiles.wordpress.org/kapilpaul/), [opurockey](https://profiles.wordpress.org/opurockey/), [pavanpatil1](https://profiles.wordpress.org/pavanpatil1/), [pradeep1308](https://profiles.wordpress.org/pradeep1308/), [shardul200](https://profiles.wordpress.org/shardul200/), [ibnulk](https://profiles.wordpress.org/ibnulk/), [sabbir1991](https://profiles.wordpress.org/sabbir1991/), [kamalahmed](https://profiles.wordpress.org/kamalahmed/), [harshbarach](https://profiles.wordpress.org/harshbarach/), [mukulsingh27](https://profiles.wordpress.org/mukulsingh27/), [vishalkakadiya](https://profiles.wordpress.org/vishalkakadiya/), [elifvish](https://profiles.wordpress.org/elifvish/)


* **License:** [GPL v2 or later]( http://www.gnu.org/licenses/gpl-2.0.html)
Expand Down Expand Up @@ -152,6 +152,20 @@ https://www.youtube.com/watch?v=dJrykKQGDcs

## Changelog ##

### 4.6.12 [June 16, 2022] ###

* Enhancement

* Compatible with BP-Rewrites latest version.
* Compatible with with WordPress latest version 6.0.

* Fixed

* UI/UX Issues.
* Fixed album count issue for non-admin user and group albums.
* Fixed Video thumbnail issue.


### 4.6.11 [April 27, 2022] ###

* Enhancement
Expand Down
10 changes: 5 additions & 5 deletions app/admin/RTMediaAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -838,10 +838,10 @@ public function admin_bar_menu( $admin_bar ) {
array(
'id' => 'rt-media-addons',
'parent' => 'rtMedia',
'title' => esc_html__( 'Addons', 'buddypress-media' ),
'title' => esc_html__( 'Premium', 'buddypress-media' ),
'href' => admin_url( 'admin.php?page=rtmedia-addons' ),
'meta' => array(
'title' => esc_html__( 'Addons', 'buddypress-media' ),
'title' => esc_html__( 'Premium', 'buddypress-media' ),
'target' => '_self',
),
)
Expand Down Expand Up @@ -1043,8 +1043,8 @@ public function menu() {

add_submenu_page(
'rtmedia-settings',
esc_html__( 'Addons', 'buddypress-media' ),
esc_html__( 'Addons', 'buddypress-media' ),
esc_html__( 'Premium', 'buddypress-media' ),
esc_html__( 'Premium', 'buddypress-media' ),
'manage_options',
'rtmedia-addons',
array(
Expand Down Expand Up @@ -1399,7 +1399,7 @@ public function rtmedia_tabs() {
),
array(
'href' => get_admin_url( null, esc_url( add_query_arg( array( 'page' => 'rtmedia-addons' ), 'admin.php' ) ) ),
'name' => esc_html__( 'Addons', 'buddypress-media' ),
'name' => esc_html__( 'Premium', 'buddypress-media' ),
'slug' => 'rtmedia-addons',
),
);
Expand Down
2 changes: 1 addition & 1 deletion app/assets/js/rtMedia.backbone.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ jQuery( function( $ ) {


// Update the count on sub navigations (Albums)
jQuery( '#rtmedia-nav-item-albums span' ).text( response.media_count.albums_count );
// jQuery( '#rtmedia-nav-item-albums span' ).text( response.media_count.albums_count );

// Update the count on sub navigations (Photo, Video & Music)
jQuery( '#rtmedia-nav-item-photo span' ).text( response.media_count.photos_count );
Expand Down
2 changes: 1 addition & 1 deletion app/assets/js/rtMedia.js
Original file line number Diff line number Diff line change
Expand Up @@ -923,7 +923,7 @@ jQuery( 'document' ).ready( function( $ ) {
jQuery( '#user-media span, #media-groups-li #media span, #rtmedia-nav-item-all span' ).text( response.data.all_media_count );

// Update the count on sub navigations (Albums)
jQuery( '#rtmedia-nav-item-albums span' ).text( response.data.albums_count );
// jQuery( '#rtmedia-nav-item-albums span' ).text( response.data.albums_count );

// Update the count on sub navigations (Photo, Video & Music)
jQuery( '#rtmedia-nav-item-photo span' ).text( response.data.photos_count );
Expand Down
2 changes: 1 addition & 1 deletion app/assets/js/rtmedia.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions app/helper/RTMediaAddon.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public function get_addons() {

if ( ! is_rtmedia_vip_plugin() ) {
$tabs[] = array(
'title' => esc_html__( 'Plugins', 'buddypress-media' ),
'name' => esc_html__( 'Plugins', 'buddypress-media' ),
'title' => esc_html__( 'Premium Features', 'buddypress-media' ),
'name' => esc_html__( 'Premium Features', 'buddypress-media' ),
'href' => '#rtm-plugins',
'icon' => 'dashicons-admin-plugins',
'callback' => array( $this, 'plugins_content' ),
Expand Down
2 changes: 1 addition & 1 deletion app/main/controllers/activity/RTMediaActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public function media( $media, $type = 'activity' ) {
$poster = '';
}
if ( empty( $youtube_url ) ) {
$html = '<video %s src="%s" width="%d" height="%d" type="video/mp4" class="%s" id="rt_media_video_%s" controls="controls" preload="none"></video>';
$html = '<video %s src="%s" width="%d" height="%d" type="video/mp4" class="%s" id="rt_media_video_%s" controls="controls" preload="metadata"></video>';
$html = sprintf( $html, $poster, esc_url( wp_get_attachment_url( $media->media_id ) ), esc_attr( $rtmedia->options['defaultSizes_video_activityPlayer_width'] ), esc_attr( $rtmedia->options['defaultSizes_video_activityPlayer_height'] ), $video_class, esc_attr( $media->id ) );
}
} elseif ( 'music' === $media->media_type ) {
Expand Down
2 changes: 1 addition & 1 deletion app/main/controllers/privacy/RTMediaPrivacy.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class RTMediaPrivacy {
public function __construct( $flag = true ) {

if ( is_rtmedia_privacy_enable() && $flag ) {
add_action( 'bp_init', array( $this, 'add_nav' ) );
add_action( 'bp_setup_nav', array( $this, 'add_nav' ) );
add_action( 'bp_template_content', array( $this, 'content' ) );
add_filter( 'bp_activity_get_user_join_filter', array( $this, 'activity_privacy' ), 10, 6 );

Expand Down
16 changes: 9 additions & 7 deletions app/main/controllers/template/RTMediaNav.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct( $action = true ) {
add_action( 'admin_bar_menu', array( $this, 'admin_nav' ), $order );

if ( class_exists( 'BuddyPress' ) ) {
add_action( 'bp_init', array( $this, 'custom_media_nav_tab' ), 10, 1 );
add_action( 'bp_parse_query', array( $this, 'custom_media_nav_tab' ), 99, 1 );
add_filter( 'bp_nouveau_nav_has_count', array( $this, 'rtmedia_bp_nouveau_nav_has_count' ), 10, 3 );
add_filter( 'bp_nouveau_get_nav_count', array( $this, 'rtmedia_bp_nouveau_get_nav_count' ), 10, 3 );
}
Expand Down Expand Up @@ -278,12 +278,14 @@ public function sub_nav() {
$global_albums = rtmedia_global_albums();

// Return the album count if the album has media in it.
$global_albums = array_filter(
$global_albums,
function( $album_id ) {
return (int) rtm_get_album_media_count( $album_id ) > 0;
}
);
if ( function_exists( 'bp_is_group' ) && bp_is_group() && $user_group_status ) {
$global_albums = array_filter(
$global_albums,
function( $album_id ) {
return (int) rtm_get_album_media_count( $album_id ) > 0;
}
);
}

$other_count = count( $global_albums );

Expand Down
74 changes: 74 additions & 0 deletions app/main/controllers/template/rtmedia-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,80 @@ function rtmedia_gallery_shortcode_json_query_vars( $wp_query ) {
}
add_action( 'pre_get_posts', 'rtmedia_gallery_shortcode_json_query_vars', 99 );

/**
* Handles the conflicting between - BuddyPress Rewrites and rtMedia plugins.
*
* @param object $query WP query object.
*/
function rtmedia_pre_get_posts( $query ) {

global $wp_query;

if ( ! $query->is_main_query() ) {
return;
}

if ( get_query_var( 'bp_members' ) ) {

$bp_member = get_query_var( 'bp_member' );
$bp_member_component = get_query_var( 'bp_member_component' );

if ( $bp_member && ( 'media' === $bp_member_component || 'upload' === $bp_member_component ) ) {

$wp_query->query['attachment'] = $bp_member;
$wp_query->query_vars['attachment'] = $bp_member;

unset( $wp_query->queried_object );
unset( $wp_query->queried_object_id );

$wp_query->set( 'tax_query', '' );

$wp_query->query[ $bp_member_component ] = '';

$action = get_query_var( 'bp_member_action' );

if ( 'media' === $bp_member_component ) {

$action_variable = get_query_var( 'bp_member_action_variables' );

if ( ! empty( $action_variable ) ) {
$action = $action . '/' . $action_variable;
}
}

$wp_query->query_vars[ $bp_member_component ] = $action;
}
} elseif ( get_query_var( 'bp_groups' ) ) {

$bp_group = get_query_var( 'bp_group' );
$bp_group_action = get_query_var( 'bp_group_action' );

if ( $bp_group && 'media' === $bp_group_action || 'upload' === $bp_group_action ) {

$wp_query->query['attachment'] = $bp_group;
$wp_query->query_vars['attachment'] = $bp_group;

if ( ! empty( $bp_group_action ) ) {
$wp_query->query[ $bp_group_action ] = '';
$wp_query->query_vars[ $bp_group_action ] = get_query_var( 'bp_group_action_variables' );
}

unset( $wp_query->queried_object );
unset( $wp_query->queried_object_id );
}

} elseif ( get_query_var( 'bp_activities' ) ) {

$bp_activity_action = get_query_var( 'bp_activity_action' );

if ( ! empty( $bp_activity_action ) ) {
$wp_query->query[ $bp_activity_action ] = '';
$wp_query->query_vars[ $bp_activity_action ] = '';
}
}
}
add_action( 'pre_get_posts', 'rtmedia_pre_get_posts', 9999 );

/**
* Rule for pagination for rtmedia gallery shortcode
*/
Expand Down
2 changes: 1 addition & 1 deletion app/main/interactions/RTMediaInteraction.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function __construct() {
add_action( 'init', array( $this, 'flush_rules' ) );

// set up interaction and routes.
add_action( 'template_redirect', array( $this, 'init' ), 99 );
add_action( 'template_redirect', array( $this, 'init' ), 9999 );

add_filter( 'wp_title', array( $this, 'set_title' ), 99999, 2 );
add_filter( 'wpseo_opengraph_title', array( $this, 'set_title' ), 9999, 1 );
Expand Down
4 changes: 2 additions & 2 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: rtMedia for WordPress, BuddyPress and bbPress
* Plugin URI: https://rtmedia.io/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
* 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!
* Version: 4.6.11
* Version: 4.6.12
* Author: rtCamp
* Text Domain: buddypress-media
* Author URI: http://rtcamp.com/?utm_source=dashboard&utm_medium=plugin&utm_campaign=buddypress-media
Expand All @@ -19,7 +19,7 @@
/**
* The version of the plugin
*/
define( 'RTMEDIA_VERSION', '4.6.11' );
define( 'RTMEDIA_VERSION', '4.6.12' );
}

if ( ! defined( 'RTMEDIA_PATH' ) ) {
Expand Down
14 changes: 7 additions & 7 deletions languages/buddypress-media.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# This file is distributed under the same license as the rtMedia for WordPress, BuddyPress and bbPress package.
msgid ""
msgstr ""
"Project-Id-Version: rtMedia for WordPress, BuddyPress and bbPress 4.6.11\n"
"Project-Id-Version: rtMedia for WordPress, BuddyPress and bbPress 4.6.12\n"
"Report-Msgid-Bugs-To: https://rtmedia.io/support/\n"
"POT-Creation-Date: 2022-04-22 11:03:37+00:00\n"
"POT-Creation-Date: 2022-06-15 07:59:48+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down Expand Up @@ -154,7 +154,7 @@ msgstr ""
#: app/admin/RTMediaAdmin.php:841 app/admin/RTMediaAdmin.php:844
#: app/admin/RTMediaAdmin.php:1046 app/admin/RTMediaAdmin.php:1047
#: app/admin/RTMediaAdmin.php:1402
msgid "Addons"
msgid "Premium"
msgstr ""

#: app/admin/RTMediaAdmin.php:867 app/admin/RTMediaAdmin.php:870
Expand Down Expand Up @@ -1082,7 +1082,7 @@ msgid "User's Favorites:"
msgstr ""

#: app/helper/RTMediaAddon.php:91 app/helper/RTMediaAddon.php:92
msgid "Plugins"
msgid "Premium Features"
msgstr ""

#: app/helper/RTMediaAddon.php:116
Expand Down Expand Up @@ -2336,7 +2336,7 @@ msgstr ""
msgid "Public - Visible to the world"
msgstr ""

#: app/main/RTMedia.php:869 app/main/controllers/template/RTMediaNav.php:294
#: app/main/RTMedia.php:869 app/main/controllers/template/RTMediaNav.php:296
#: app/main/controllers/template/rtmedia-functions.php:139
msgid "All"
msgstr ""
Expand All @@ -2351,7 +2351,7 @@ msgstr ""
#: app/main/RTMedia.php:885 app/main/RTMedia.php:1412
#: app/main/controllers/media/RTMediaAlbum.php:55
#: app/main/controllers/media/RTMediaAlbum.php:67
#: app/main/controllers/template/RTMediaNav.php:314
#: app/main/controllers/template/RTMediaNav.php:316
msgid "Albums"
msgstr ""

Expand Down Expand Up @@ -3168,7 +3168,7 @@ msgstr ""
msgid "Search Media"
msgstr ""

#: app/main/controllers/template/rtmedia-actions.php:1104
#: app/main/controllers/template/rtmedia-actions.php:1178
msgid "Please swipe for more media."
msgstr ""

Expand Down
Loading

0 comments on commit a4dca06

Please sign in to comment.