Skip to content

Commit

Permalink
Version 1.5.2
Browse files Browse the repository at this point in the history
Version 1.5.2
  • Loading branch information
rmnl committed Apr 26, 2016
2 parents 16ce2eb + 63c9079 commit 5814c8f
Show file tree
Hide file tree
Showing 21 changed files with 551 additions and 441 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
_ignore*
.svnignore
.svn*
.svn*

build/*
8 changes: 3 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
## Warning!

**This plugin is currently in beta. This means there can and probably will be bugs. If you run into anything, please open an issue.**

This is the GitHub mirror of the official JW Player Plugin for Wordpress.
This is the GitHub mirror of the official JW Player Plugin for WordPress.

## Plugin User Information.

If you are only interested in using this plugin please visit [this plugin's page on Wordpress plugins site](https://wordpress.org/plugins/jw-player/) for information on how to install and use this plugin. If you're interested in developing or filing bugs, please read on.
If you are only interested in using this plugin please visit [this plugin's page on WordPress plugins site](https://wordpress.org/plugins/jw-player/) for information on how to install and use this plugin. If you're interested in developing or filing bugs, please read on.

## Plugin Developer Information.

The official releases of our plugin are hosted on [the official Wordpress Subversion Repository](http://plugins.svn.wordpress.org/jw-player/). We've decided to release this mirror on GitHub for easier development and for better feedback from the plugin's users.
The official releases of our plugin are hosted on [the official WordPress Subversion Repository](http://plugins.svn.wordpress.org/jw-player/). We've decided to release this mirror on GitHub for easier development and for better feedback from the plugin's users.

We strongly encourage people to make suggestions for enhancing the plugin by making pull-requests. We also encourage users to [report issues](https://github.com/jwplayer/wordpress-plugin/issues/new) with the plugin here on GitHub.

Expand Down
Binary file modified assets/banner-772x250.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 6 additions & 15 deletions jw-player/include/admin.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
<?php

// Add the JW Player settings to the media page in the admin panel
function jwplayer_admin_init() {
add_action( 'admin_menu', 'jwplayer_settings_init' );
if ( get_option ( 'jwplayer_api_key' ) ) {
add_action( 'admin_head-post.php', 'jwplayer_admin_head' );
add_action( 'admin_head-post-new.php', 'jwplayer_admin_head' );
add_action( 'admin_head-media-upload-popup', 'jwplayer_admin_head' );
add_action( 'admin_enqueue_scripts', 'jwplayer_admin_enqueue_scripts' );
} else {
add_action( 'admin_notices', 'jwplayer_admin_show_login_notice' );
}
}

// Show the login notice in the admin area if necessary
function jwplayer_admin_show_login_notice() {
if ( isset( $_GET['page'] ) && 'jwplayer_login_page' === sanitize_text_field( $_GET['page'] ) ) {// input var okay
if ( isset( $_GET['page'] ) && 'jwplayer_login_page' === sanitize_text_field( wp_unslash( $_GET['page'] ) ) ) { // Input var okay
return;
} else {
$login_url = get_admin_url( null, 'admin.php?page=jwplayer_login_page' );
Expand All @@ -28,13 +15,17 @@ function jwplayer_admin_head() {

$plugin_url = plugins_url( '', __FILE__ );
$content_mask = jwplayer_get_content_mask();
if ( $content_mask === JWPLAYER_CONTENT_MASK && is_ssl() ) {
$content_mask = 'https://' . $content_mask;
}
$nr_videos = intval( get_option( 'jwplayer_nr_videos' ) );
?>

<script type="text/javascript">
jwplayer.plugin_url = '<?php echo esc_url( $plugin_url ); ?>';
jwplayer.content_mask = '<?php echo esc_url( $content_mask ); ?>';
jwplayer.nr_videos = <?php echo esc_js( $nr_videos ); ?>;
jwplayer.debug = <?php echo wp_json_encode( WP_DEBUG ); ?>;
</script>
<?php
}
Expand All @@ -48,7 +39,7 @@ function jwplayer_admin_enqueue_scripts( $hook_suffix ) {
'post.php',
'post-new.php',
);
if ( ! in_array( $hook_suffix, $load_on_pages ) ) {
if ( ! in_array( $hook_suffix, $load_on_pages, true ) ) {
return;
}

Expand Down
17 changes: 8 additions & 9 deletions jw-player/include/ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

// ajax calls for the jwplayer plugin
// utlizes proxy.php
add_action( 'wp_ajax_jwplayer', function(){
if ( isset( $_GET['method'] ) ){//input var okay
if ( 'upload_ready' === sanitize_text_field( $_GET['method'] ) ){//input var okay
echo '{"status" : "ok"}';
}
else {
jwplayer_proxy();
}
add_action( 'wp_ajax_jwp_api_proxy', function() {
if ( isset( $_GET['method'] ) ) {//input var okay
if ( 'upload_ready' === sanitize_text_field( wp_unslash( $_GET['method'] ) ) ) { // Input var okay
echo '{"status" : "ok"}';
} else {
jwplayer_ajax_jwp_api_proxy();
}
die();
}
wp_die();
} );
11 changes: 5 additions & 6 deletions jw-player/include/api.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

function jwplayer_api_call( $method, $params = array() ){
function jwplayer_api_call( $method, $params = array() ) {
$api = jwplayer_api_get_instance();
foreach ($params as $key => $value) {
foreach ( $params as $key => $value ) {
if ( null === $value ) {
unset( $params[ $key ] );
}
Expand Down Expand Up @@ -37,9 +37,8 @@ function jwplayer_api_get_instance() {

if ( 8 === strlen( $api_key ) && 24 === strlen( $api_secret ) ) {
return new JWPlayer_api( $api_key, $api_secret );
}
else {
jwplayer_log( 'API: Could not instantiate.');
} else {
jwplayer_log( 'API: Could not instantiate.' );
return null;
}
}
}
Loading

0 comments on commit 5814c8f

Please sign in to comment.