diff --git a/.github/workflows/phpcs_on_pull_request.yml b/.github/workflows/phpcs_on_pull_request.yml new file mode 100644 index 000000000..1cc01b2a0 --- /dev/null +++ b/.github/workflows/phpcs_on_pull_request.yml @@ -0,0 +1,18 @@ +on: pull_request +name: Inspections +jobs: + runPHPCSInspection: + name: Run PHPCS inspection + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + - name: Run PHPCS inspection + uses: rtCamp/action-phpcs-code-review@master + env: + SKIP_FOLDERS: "tests,.github,lib,node_modules,vendor" + GH_BOT_TOKEN: ${{ secrets.RTBOT_TOKEN }} + PHPCS_SNIFFS_EXCLUDE: "WordPress.Files.FileName" + with: + args: WordPress,WordPress-Core,WordPress-Docs \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index 418ba7ce9..1ed487ea6 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -72,6 +72,26 @@ module.exports = function (grunt) { files: { 'app/assets/js/godam-ajax-refresh.min.js': ['app/assets/js/godam-ajax-refresh.js'] } + }, + rtmedia_admin: { + files: { + 'app/assets/admin/js/rtmedia-admin.min.js': ['app/assets/admin/js/rtmedia-admin.js'] + } + }, + importer: { + files: { + 'app/assets/admin/js/importer.min.js': ['app/assets/admin/js/importer.js'] + } + }, + wp67_media_element: { + files: { + 'app/assets/js/wp67-mediaelement-init.min.js': ['app/assets/js/wp67-mediaelement-init.js'] + } + }, + migration: { + files: { + 'app/assets/admin/js/migration.min.js': ['app/assets/admin/js/migration.js'] + } } } }); diff --git a/README.md b/README.md index c609d50f1..51ae3c669 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Add albums, photo, audio/video upload, privacy, sharing, front-end uploads & mor  -* **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/), [krupajnanda](https://profiles.wordpress.org/krupajnanda/), [utsavladani](https://profiles.wordpress.org/utsavladani/),[krishana79](https://profiles.wordpress.org/krishana79/), [rohitmathur7](https://profiles.wordpress.org/rohitmathur7/) +* **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/), [krupajnanda](https://profiles.wordpress.org/krupajnanda/), [utsavladani](https://profiles.wordpress.org/utsavladani/),[krishana79](https://profiles.wordpress.org/krishana79/), [rohitmathur7](https://profiles.wordpress.org/rohitmathur7/), [kuldipchaudhary](https://profiles.wordpress.org/kuldipchaudhary/), [mchirag2002](https://profiles.wordpress.org/mchirag2002/), [vedantgandhi28](https://profiles.wordpress.org/vedantgandhi28/) * **License:** [GPL v2 or later]( http://www.gnu.org/licenses/gpl-2.0.html) @@ -138,7 +138,7 @@ https://www.youtube.com/watch?v=dJrykKQGDcs 3. Media Types Settings 4. Media Size Settings 5. Privacy Settings -6. Other Setiings +6. Other Settings 7. Export/Import Settings 8. Media View 9. Album View @@ -151,6 +151,15 @@ https://www.youtube.com/watch?v=dJrykKQGDcs ## Changelog ## +### 4.7.4 +* FIXED + * Apply security recommendations and fixes. + * Restrict the media upload by its types based on selected tab in rtMedia gallery. + +* ENHANCEMENT + * Enhances media upload support by adding a broader set of commonly used video and audio formats. + * Replace PHP file system functions with WordPress alternative filesystem function to enhance security. + ### 4.7.3 * FIXED @@ -1984,7 +1993,7 @@ rtMedia includes [full translation support](https://rtmedia.io/docs/translations rtMedia uses the following projects/sources for some functionality * [MediaElement.js](http://mediaelementjs.com/) for html5 audio/video player -* [Maginific Popup](http://dimsemenov.com/plugins/magnific-popup/) for responsive lightbox +* [Magnific Popup](http://dimsemenov.com/plugins/magnific-popup/) for responsive lightbox * [getID3](http://getid3.sourceforge.net/) gets us some ID tags for the media * [Foundation](http://foundation.zurb.com/) for the media grid and layout * [Backbone.js](http://backbonejs.org/) for an MVC architecture for the frontend diff --git a/app/admin/RTMediaAdmin.php b/app/admin/RTMediaAdmin.php index 51aea3a04..a532b7206 100644 --- a/app/admin/RTMediaAdmin.php +++ b/app/admin/RTMediaAdmin.php @@ -48,12 +48,12 @@ class RTMediaAdmin { */ public $rtmedia_feed; - /* + /** * Static property to store the admin pages * * @var array */ - public static $rtmedia_pages = [ + public static $rtmedia_pages = array( 'rtmedia-settings', 'rtmedia-addons', 'rtmedia-pro-addons', @@ -64,7 +64,7 @@ class RTMediaAdmin { 'rtmedia-attributes', 'rtmedia-moderate', 'rtmedia-blocked-users', - ]; + ); /** * Constructor - get the plugin hooked in and ready @@ -131,11 +131,9 @@ public function __construct() { if ( isset( $rtmedia_option['general_showAdminMenu'] ) && 1 === intval( $rtmedia_option['general_showAdminMenu'] ) ) { add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 100, 1 ); } - } else { - if ( is_array( $rtmedia->options ) ) { - if ( 1 === intval( $rtmedia->options['general_showAdminMenu'] ) ) { - add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 100, 1 ); - } + } elseif ( is_array( $rtmedia->options ) ) { + if ( 1 === intval( $rtmedia->options['general_showAdminMenu'] ) ) { + add_action( 'admin_bar_menu', array( $this, 'admin_bar_menu' ), 100, 1 ); } } @@ -245,6 +243,7 @@ public function rtm_admin_templates() { */ $display = apply_filters( 'rtmedia_disable_media_in_commented_media', false ); if ( $display ) { + // No a security issue, so keeping the style here. ?> - +