FV Flowplayer Video Player - Version 6.5.2

Version Description

  • 2018/04/11 =

  • New feature - video intelligence ads

  • Bugfix - Video position saving - not working when playing HLS in Firefox

Download this release

Release Info

Developer FolioVision
Plugin Icon 128x128 FV Flowplayer Video Player
Version 6.5.2
Comparing to
See all releases

Code changes from version 6.5.1 to 6.5.2

controller/backend.php CHANGED
@@ -363,7 +363,7 @@ function fv_player_admin_update() {
363
  if( !isset($aOptions['version']) || version_compare( $fv_wp_flowplayer_ver, $aOptions['version'] ) ) {
364
  //update_option( 'fv_wordpress_flowplayer_deferred_notices', 'FV Flowplayer upgraded - please click "Check template" and "Check videos" for automated check of your site at <a href="'.site_url().'/wp-admin/options-general.php?page=fvplayer">the settings page</a> for automated checks!' );
365
 
366
- if( $aOptions['version'] == '6.0.5.20' && $aOptions['playlist_advance'] == 'true' ) { // version 6.0.5 used reverse logic for this option!
367
  $aOptions['playlist_advance'] = false;
368
  $fv_fp->_get_conf();
369
  }
@@ -637,146 +637,28 @@ function fv_wp_flowplayer_admin_notice() {
637
  * Check the extension info from plugin license transient and activate the plugin
638
  */
639
  function fv_wp_flowplayer_install_extension( $plugin_package = 'fv_player_pro' ) {
640
- global $hook_suffix;
641
-
642
- $aInstalled = ( get_option('fv_flowplayer_extension_install' ) ) ? get_option('fv_flowplayer_extension_install' ) : array();
643
  $aInstalled = array_merge( $aInstalled, array( $plugin_package => false ) );
644
  update_option('fv_flowplayer_extension_install', $aInstalled );
645
 
646
  $aPluginInfo = get_transient( 'fv_flowplayer_license' );
647
  $plugin_basename = $aPluginInfo->{$plugin_package}->slug;
648
- $download_url = $aPluginInfo->{$plugin_package}->url;
649
-
650
- $sPluginBasenameReal = fv_flowplayer_get_extension_path( str_replace( '_', '-', $plugin_package ) );
651
- if( $sPluginBasenameReal ) {
652
- return; // already installed
653
- }
654
-
655
- $plugin_basename = $sPluginBasenameReal ? $sPluginBasenameReal : $plugin_basename;
656
-
657
- $url = wp_nonce_url( site_url().'/wp-admin/options-general.php?page=fvplayer', 'fv_player_pro_install', 'nonce_fv_player_pro_install' );
658
-
659
- set_current_screen();
660
-
661
- ob_start();
662
- if ( false === ( $creds = request_filesystem_credentials( $url, '', false, false, false ) ) ) {
663
- $form = ob_get_clean();
664
- include( ABSPATH . 'wp-admin/admin-header.php' );
665
- echo fv_wp_flowplayer_install_extension_talk($form);
666
- include( ABSPATH . 'wp-admin/admin-footer.php' );
667
- die;
668
- }
669
-
670
- if ( ! WP_Filesystem( $creds ) ) {
671
- ob_start();
672
- request_filesystem_credentials( $url, $method, true, false, false );
673
- $form = ob_get_clean();
674
- include( ABSPATH . 'wp-admin/admin-header.php' );
675
- echo fv_wp_flowplayer_install_extension_talk($form);
676
- include( ABSPATH . 'wp-admin/admin-footer.php' );
677
- die;
678
- }
679
-
680
- require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
681
-
682
- $sTaskDone = __('FV Flowplayer Pro extension installed - check the new ', 'fv-wordpress-flowplayer') . '<a href="'.site_url().'/wp-admin/options-general.php?page=fvplayer#fv_player_pro">' . __('Pro features', 'fv-wordpress-flowplayer') . '</a>!';
683
- if( !$sPluginBasenameReal || is_wp_error(validate_plugin($plugin_basename)) ) {
684
- echo '<div style="display: none;">';
685
- $objInstaller = new Plugin_Upgrader();
686
- $objInstaller->install( $download_url );
687
- echo '</div>';
688
- wp_cache_flush();
689
 
690
- if ( is_wp_error( $objInstaller->skin->result ) ) {
691
-
692
- update_option( 'fv_wordpress_flowplayer_deferred_notices', __('FV Flowplayer Pro extension install failed - ', 'fv-wordpress-flowplayer') . $objInstaller->skin->result->get_error_message() );
693
- $bResult = false;
694
- } else {
695
- if ( $objInstaller->plugin_info() ) {
696
- $plugin_basename = $objInstaller->plugin_info();
697
-
698
- }
699
-
700
- $activate = activate_plugin( $plugin_basename );
701
- if ( is_wp_error( $activate ) ) {
702
- update_option( 'fv_wordpress_flowplayer_deferred_notices', __('FV Flowplayer Pro extension install failed - ', 'fv-wordpress-flowplayer') . $activate->get_error_message());
703
- $bResult = false;
704
- }
705
- }
706
-
707
- } else if( $sPluginBasenameReal ) {
708
- $sTaskDone = __('FV Flowplayer Pro extension upgraded successfully!', 'fv-wordpress-flowplayer');
709
-
710
- echo '<div style="display: none;">';
711
- $objInstaller = new Plugin_Upgrader();
712
- $objInstaller->upgrade( $sPluginBasenameReal );
713
- echo '</div></div>'; // explanation: extra closing tag just to be safe (in case of "The plugin is at the latest version.")
714
- wp_cache_flush();
715
-
716
- if ( is_wp_error( $objInstaller->skin->result ) ) {
717
- update_option( 'fv_wordpress_flowplayer_deferred_notices', 'FV Flowplayer Pro extension upgrade failed - '.$objInstaller->skin->result->get_error_message() );
718
- $bResult = false;
719
- } else {
720
- if ( $objInstaller->plugin_info() ) {
721
- $plugin_basename = $objInstaller->plugin_info();
722
-
723
- }
724
-
725
- $activate = activate_plugin( $plugin_basename );
726
- if ( is_wp_error( $activate ) ) {
727
- update_option( 'fv_wordpress_flowplayer_deferred_notices', 'FV Flowplayer Pro extension upgrade failed - '.$activate->get_error_message() );
728
- $bResult = false;
729
- }
730
- }
731
-
732
- }
733
-
734
- if( !isset($bResult) ) {
735
- if( !isset($_GET['page']) || strcmp($_GET['page'],'fvplayer') != 0 ) {
736
- update_option( 'fv_wordpress_flowplayer_deferred_notices', $sTaskDone );
737
- }
738
- $bResult = true;
739
- }
740
-
741
  $aInstalled = ( get_option('fv_flowplayer_extension_install' ) ) ? get_option('fv_flowplayer_extension_install' ) : array();
742
- $aInstalled = array_merge( $aInstalled, array( $plugin_package => $bResult ) );
743
- update_option('fv_flowplayer_extension_install', $aInstalled );
744
-
745
- return $bResult;
746
- }
747
-
748
-
749
- function fv_wp_flowplayer_install_extension_talk( $content ) {
750
- $content = preg_replace( '~<h3.*?</h3>~', '<h3>FV Player Pro auto-installation</h3><p>As a FV Flowplayer license holder, we would like to automatically install our Pro extension for you.</p>', $content );
751
- $content = preg_replace( '~(<input[^>]*?type="submit"[^>]*?>)~', '$1 <a href="'.site_url().'/wp-admin/options-general.php?page=fvplayer'.'">Skip the Pro addon install</a>', $content );
752
- return $content;
753
- }
754
-
755
-
756
-
757
-
758
- //search for plugin path with {slug}.php
759
- function fv_flowplayer_get_extension_path( $slug ){
760
- $aPluginSlugs = get_transient('plugin_slugs');
761
- $aPluginSlugs = is_array($aPluginSlugs) ? $aPluginSlugs : array( 'fv-player-pro/fv-player-pro.php');
762
- $aActivePlugins = get_option('active_plugins');
763
- $aInactivePlugins = array_diff($aPluginSlugs,$aActivePlugins);
764
-
765
- if( !$aPluginSlugs )
766
- return false;
767
-
768
- foreach( $aActivePlugins as $item ){
769
- if( stripos($item,$slug.'.php') !== false )
770
- return $item;
771
- }
772
-
773
- $sPluginFolder = plugin_dir_path( dirname( dirname(__FILE__) ) );
774
- foreach( $aInactivePlugins as $item ){
775
- if( stripos($item,$slug.'.php') !== false && file_exists($sPluginFolder.$item) )
776
- return $item;
777
- }
778
-
779
- return false;
780
  }
781
 
782
 
363
  if( !isset($aOptions['version']) || version_compare( $fv_wp_flowplayer_ver, $aOptions['version'] ) ) {
364
  //update_option( 'fv_wordpress_flowplayer_deferred_notices', 'FV Flowplayer upgraded - please click "Check template" and "Check videos" for automated check of your site at <a href="'.site_url().'/wp-admin/options-general.php?page=fvplayer">the settings page</a> for automated checks!' );
365
 
366
+ if( !empty($aOptions['version']) && $aOptions['version'] == '6.0.5.20' && $aOptions['playlist_advance'] == 'true' ) { // version 6.0.5 used reverse logic for this option!
367
  $aOptions['playlist_advance'] = false;
368
  $fv_fp->_get_conf();
369
  }
637
  * Check the extension info from plugin license transient and activate the plugin
638
  */
639
  function fv_wp_flowplayer_install_extension( $plugin_package = 'fv_player_pro' ) {
640
+
641
+ $aInstalled = get_option( 'fv_flowplayer_extension_install', array() );
 
642
  $aInstalled = array_merge( $aInstalled, array( $plugin_package => false ) );
643
  update_option('fv_flowplayer_extension_install', $aInstalled );
644
 
645
  $aPluginInfo = get_transient( 'fv_flowplayer_license' );
646
  $plugin_basename = $aPluginInfo->{$plugin_package}->slug;
647
+ $download_url = $aPluginInfo->{$plugin_package}->url;
648
+
649
+ $result = FV_Wordpress_Flowplayer_Plugin::install_plugin(
650
+ "FV Player Pro",
651
+ $plugin_package,
652
+ $plugin_basename,
653
+ $download_url,
654
+ admin_url('options-general.php?page=fvplayer&reload='.rand()),
655
+ 'fv_wordpress_flowplayer_deferred_notices',
656
+ 'fv_player_pro_install'
657
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
658
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
659
  $aInstalled = ( get_option('fv_flowplayer_extension_install' ) ) ? get_option('fv_flowplayer_extension_install' ) : array();
660
+ $aInstalled = array_merge( $aInstalled, array( $plugin_package => $result ) );
661
+ update_option('fv_flowplayer_extension_install', $aInstalled );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
662
  }
663
 
664
 
css/admin.css CHANGED
@@ -131,4 +131,7 @@ table.fv-player-popup-formats td:first-child { width: 72px }
131
 
132
  #dashboard-widgets .flowplayer-wrapper h3, #dashboard-widgets .flowplayer-wrapper h4 {color:inherit;margin:0 auto;padding:0;font-weight:700;font-size:inherit}
133
 
134
- .fv-player-editor-wrapper { float: left }
 
 
 
131
 
132
  #dashboard-widgets .flowplayer-wrapper h3, #dashboard-widgets .flowplayer-wrapper h4 {color:inherit;margin:0 auto;padding:0;font-weight:700;font-size:inherit}
133
 
134
+ .fv-player-editor-wrapper { float: left }
135
+
136
+ /* otherwise "Drag boxes here" appears when you hide a meta box initially and then you show it with JS */
137
+ .metabox-holder #postbox-container-tab_video_intelligence .empty-container::after { content: none }
css/license.css CHANGED
@@ -81,9 +81,36 @@ a.red-button {
81
  #wpfp_options #fv_flowplayer_integrations table tr > td:first-child { padding-top: 4px; vertical-align: top; }
82
  #wpfp_options table.flowplayer-settings { width: 29%; }
83
 
84
- div.clear { clear: both }
85
- div.column { float: left; width: 49% }
86
- div.green { background-color: #e0ffe0; border-color: #88AA88; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  .amazon-s3-first .fv_fp_amazon_remove { display: none; }
88
  .form-table2 td p { line-height: 20px; }
89
  .meta-box-sortables input[type=text] { width: 100%; }
@@ -145,7 +172,8 @@ td.aligntop > label { margin-top:4px; }
145
  #wpfp_options #flowplayer-wrapper .button-primary,
146
  #wpfp_options #fv_flowplayer_skin_playlist .button-primary,
147
  #wpfp_options #fv_flowplayer_skin_subtitles .button-primary,
148
- #wpfp_options #fv_flowplayer_skin_sticky .button-primary {
 
149
  float: none;
150
  }
151
 
@@ -155,7 +183,7 @@ td.aligntop > label { margin-top:4px; }
155
  }
156
 
157
  #wpfp_options .inside input + label {
158
- display: inline-block;
159
  }
160
 
161
  #fv-player-popups-settings th {
@@ -174,3 +202,11 @@ td.aligntop > label { margin-top:4px; }
174
  .description .more {
175
  display: none;
176
  }
 
 
 
 
 
 
 
 
81
  #wpfp_options #fv_flowplayer_integrations table tr > td:first-child { padding-top: 4px; vertical-align: top; }
82
  #wpfp_options table.flowplayer-settings { width: 29%; }
83
 
84
+ .wp-core-ui .vi-register {
85
+ box-shadow: none;
86
+ border: 2px solid #FFF200;
87
+ border-radius: 20px;
88
+ background-color: #FFF200;
89
+ color: #000;
90
+ text-align: center;
91
+ -webkit-appearance: none;
92
+ margin: 8px 0;
93
+ padding: 10px 30px;
94
+ line-height: 1;
95
+ height: auto;
96
+ font-size: 16px;
97
+ font-weight: 700;
98
+ box-sizing: border-box;
99
+ position: relative;
100
+ transition: all 0.2s ease-in-out;
101
+ }
102
+ .wp-core-ui .vi-register:hover {
103
+ background-color: #000;
104
+ color: #FFF200;
105
+ border: 2px solid #FFF200;
106
+ }
107
+ #fv_flowplayer_video_intelligence_hide .inside {
108
+ padding-left: 270px;
109
+ }
110
+
111
+ div.clear { clear: both }
112
+ div.column { float: left; width: 49% }
113
+ div.green { background-color: #e0ffe0; border-color: #88AA88; }
114
  .amazon-s3-first .fv_fp_amazon_remove { display: none; }
115
  .form-table2 td p { line-height: 20px; }
116
  .meta-box-sortables input[type=text] { width: 100%; }
172
  #wpfp_options #flowplayer-wrapper .button-primary,
173
  #wpfp_options #fv_flowplayer_skin_playlist .button-primary,
174
  #wpfp_options #fv_flowplayer_skin_subtitles .button-primary,
175
+ #wpfp_options #fv_flowplayer_skin_sticky .button-primary,
176
+ #wpfp_options #fv_flowplayer_video_intelligence_account .button-primary {
177
  float: none;
178
  }
179
 
183
  }
184
 
185
  #wpfp_options .inside input + label {
186
+ display: inline-block;
187
  }
188
 
189
  #fv-player-popups-settings th {
202
  .description .more {
203
  display: none;
204
  }
205
+
206
+ #fv_flowplayer_video_intelligence ul {
207
+ list-style: initial;
208
+ padding-left: 1.5em;
209
+ }
210
+ #fv_flowplayer_video_intelligence img {
211
+ width: 95%;
212
+ }
flowplayer-beta/fv-flowplayer.min.js CHANGED
@@ -2411,6 +2411,8 @@ flowplayer( function(api,root) {
2411
  originalVideoApiPath = getOriginalSource(api.video),
2412
  position = originalVideoApiPath.position;
2413
 
 
 
2414
  if (position) {
2415
  var do_seek = setInterval( function() {
2416
  if( api.loading ) return;
@@ -2531,11 +2533,10 @@ flowplayer( function(api,root) {
2531
  }
2532
  };
2533
 
2534
- // pause/stop/progress events
2535
- api.bind('progress', storeVideoPosition);
2536
  api.bind('finish', removeVideoPosition);
2537
 
2538
- // ready event, so we can seek into the last saved position
2539
  api.bind('ready', seekIntoPosition);
2540
 
2541
  // TODO: find out what event can be used to force saving of playlist video positions on video change
2411
  originalVideoApiPath = getOriginalSource(api.video),
2412
  position = originalVideoApiPath.position;
2413
 
2414
+ api.bind('progress', storeVideoPosition);
2415
+
2416
  if (position) {
2417
  var do_seek = setInterval( function() {
2418
  if( api.loading ) return;
2533
  }
2534
  };
2535
 
2536
+ // stop events
 
2537
  api.bind('finish', removeVideoPosition);
2538
 
2539
+ // ready event, so we can seek into the last saved position, it also hooks the progress event
2540
  api.bind('ready', seekIntoPosition);
2541
 
2542
  // TODO: find out what event can be used to force saving of playlist video positions on video change
flowplayer.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: FV Player
4
  Plugin URI: http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer
5
  Description: Formerly FV WordPress Flowplayer. Embed videos (MP4, WEBM, OGV, FLV) into posts or pages. Uses Flowplayer 6.
6
- Version: 6.5.1
7
  Author URI: http://foliovision.com/
8
  License: GPL-3.0
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
@@ -26,7 +26,7 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.txt
26
  along with this program. If not, see <http://www.gnu.org/licenses/>.
27
  */
28
 
29
- $fv_wp_flowplayer_ver = '6.5.1';
30
  $fv_wp_flowplayer_core_ver = '6.0.5';
31
  $fv_wp_flowplayer_core_ver_beta = '7.2.4';
32
 
@@ -56,9 +56,9 @@ include_once(dirname( __FILE__ ) . '/models/widget.php');
56
 
57
  include_once(dirname( __FILE__ ) . '/models/conversion.php');
58
  include_once(dirname( __FILE__ ) . '/models/email-subscription.php');
 
59
  include_once(dirname( __FILE__ ) . '/models/player-position-save.php');
60
 
61
-
62
  $fv_fp = new flowplayer_frontend();
63
 
64
  if( is_admin() ) {
3
  Plugin Name: FV Player
4
  Plugin URI: http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer
5
  Description: Formerly FV WordPress Flowplayer. Embed videos (MP4, WEBM, OGV, FLV) into posts or pages. Uses Flowplayer 6.
6
+ Version: 6.5.2
7
  Author URI: http://foliovision.com/
8
  License: GPL-3.0
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.txt
26
  along with this program. If not, see <http://www.gnu.org/licenses/>.
27
  */
28
 
29
+ $fv_wp_flowplayer_ver = '6.5.2';
30
  $fv_wp_flowplayer_core_ver = '6.0.5';
31
  $fv_wp_flowplayer_core_ver_beta = '7.2.4';
32
 
56
 
57
  include_once(dirname( __FILE__ ) . '/models/conversion.php');
58
  include_once(dirname( __FILE__ ) . '/models/email-subscription.php');
59
+ include_once(dirname( __FILE__ ) . '/models/video-intelligence.php');
60
  include_once(dirname( __FILE__ ) . '/models/player-position-save.php');
61
 
 
62
  $fv_fp = new flowplayer_frontend();
63
 
64
  if( is_admin() ) {
flowplayer/fv-flowplayer.min.js CHANGED
@@ -2223,6 +2223,8 @@ flowplayer( function(api,root) {
2223
  var
2224
  originalVideoApiPath = getOriginalSource(api.video),
2225
  position = originalVideoApiPath.position;
 
 
2226
 
2227
  if (position) {
2228
  var do_seek = setInterval( function() {
@@ -2344,11 +2346,10 @@ flowplayer( function(api,root) {
2344
  }
2345
  };
2346
 
2347
- // pause/stop/progress events
2348
- api.bind('progress', storeVideoPosition);
2349
  api.bind('finish', removeVideoPosition);
2350
 
2351
- // ready event, so we can seek into the last saved position
2352
  api.bind('ready', seekIntoPosition);
2353
 
2354
  // TODO: find out what event can be used to force saving of playlist video positions on video change
2223
  var
2224
  originalVideoApiPath = getOriginalSource(api.video),
2225
  position = originalVideoApiPath.position;
2226
+
2227
+ api.bind('progress', storeVideoPosition);
2228
 
2229
  if (position) {
2230
  var do_seek = setInterval( function() {
2346
  }
2347
  };
2348
 
2349
+ // stop events
 
2350
  api.bind('finish', removeVideoPosition);
2351
 
2352
+ // ready event, so we can seek into the last saved position, it also hooks the progress event
2353
  api.bind('ready', seekIntoPosition);
2354
 
2355
  // TODO: find out what event can be used to force saving of playlist video positions on video change
images/vi-logo.svg ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="125px" height="47px" viewBox="0 0 125 47" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <defs></defs>
4
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="09.4.8.1_direct_sell" transform="translate(-149.000000, -4370.000000)">
6
+ <g id="footer" transform="translate(0.000000, 4284.000000)">
7
+ <g id="logo_footer" transform="translate(150.000000, 87.000000)">
8
+ <path d="M22.2142857,44.5714286 C34.5,44.5714286 44.4285714,34.6428571 44.4285714,22.2857143 C44.4285714,10 34.5,0 22.2142857,0 C9.92857143,0.0714285714 0,10 0,22.2857143 C0,34.5714286 9.92857143,44.5714286 22.2142857,44.5714286" id="Fill-1" fill="#FFF200"></path>
9
+ <path d="M22.1428571,45 C34.3571429,45 44.2857143,34.9285714 44.2857143,22.5 C44.2857143,10.0714286 34.3571429,0 22.1428571,0 C9.92857143,0 0,10.0714286 0,22.5 C0,34.9285714 9.92857143,45 22.1428571,45 L22.1428571,45 L22.1428571,45 L22.1428571,45 L22.1428571,45 Z" id="Stroke-2" stroke="#000000" stroke-width="2"></path>
10
+ <path d="M16,31.8571429 L20.2857143,31.8571429 L26.2142857,17.2142857 L21.7857143,17.2142857 L19.9285714,21.8571429 C19.3571429,23.3571429 18.7142857,25.0714286 18.1428571,26.5 L18.1428571,26.5 C17.6428571,25 17.0714286,23.4285714 16.5,21.8571429 L14.7857143,17.1428571 L10,17.1428571 L16,31.8571429 L16,31.8571429 L16,31.8571429 L16,31.8571429 L16,31.8571429 Z M27.7142857,31.8571429 L32.2142857,31.8571429 L32.2142857,17.2142857 L27.7142857,17.2142857 L27.7142857,31.8571429 L27.7142857,31.8571429 L27.7142857,31.8571429 L27.7142857,31.8571429 Z" id="Fill-4" fill="#000000"></path>
11
+ <polygon id="Fill-5" fill="#000000" points="27.7100067 15.2142857 32.2100067 15.2142857 32.2100067 10.7142857 27.7100067 10.7142857"></polygon>
12
+ <path d="M52.1428571,32.1428571 L54.1428571,32.1428571 L54.1428571,25.7142857 L52.1428571,25.7142857 L52.1428571,32.1428571 L52.1428571,32.1428571 L52.1428571,32.1428571 L52.1428571,32.1428571 Z M55.7857143,32.1428571 L57.7857143,32.1428571 L57.7857143,27.7857143 C58.1428571,27.5 58.6428571,27.2142857 59.1428571,27.2142857 C59.4285714,27.2142857 59.6428571,27.2857143 59.8571429,27.5 C60,27.7142857 60.0714286,27.9285714 60.0714286,28.4285714 L60.0714286,32.1428571 L62.0714286,32.1428571 L62.0714286,28.1428571 C62.0714286,27.2142857 61.9285714,26.6428571 61.5,26.2142857 C61.0714286,25.7857143 60.5,25.5714286 59.7857143,25.5714286 C59,25.5714286 58.2857143,25.9285714 57.7857143,26.2857143 L57.7857143,26.2857143 L57.7857143,25.7142857 L55.7857143,25.7142857 L55.7857143,32.1428571 L55.7857143,32.1428571 L55.7857143,32.1428571 L55.7857143,32.1428571 L55.7857143,32.1428571 Z M64.7142857,31.6428571 C65.1428571,32.0714286 65.7142857,32.2857143 66.3571429,32.2857143 C66.9285714,32.2857143 67.5,32.1428571 67.7857143,31.9285714 L67.7857143,30.3571429 C67.5,30.5 67.1428571,30.6428571 66.8571429,30.6428571 C66.2857143,30.6428571 66.1428571,30.1428571 66.1428571,29.5714286 L66.1428571,27.4285714 L67.8571429,27.4285714 L67.8571429,25.7142857 L66.1428571,25.7142857 L66.1428571,23.7142857 L64.1428571,24.0714286 L64.1428571,25.7142857 L63.0714286,25.7142857 L63.0714286,27.3571429 L64.1428571,27.3571429 L64.1428571,29.7142857 C64.1428571,30.7857143 64.3571429,31.2857143 64.7142857,31.6428571 L64.7142857,31.6428571 L64.7142857,31.6428571 L64.7142857,31.6428571 L64.7142857,31.6428571 Z M75,29.4285714 C75,29.2857143 75.0714286,29 75.0714286,28.7142857 C75.0714286,26.5714286 73.5714286,25.5 72,25.5 C70.2142857,25.5 68.6428571,26.8571429 68.6428571,28.9285714 C68.6428571,30.9285714 70.1428571,32.2857143 72.2857143,32.2857143 C73.1428571,32.2857143 74.1428571,32.0714286 74.7142857,31.7142857 L74.7142857,30.0714286 C74,30.5 73.2142857,30.7857143 72.5,30.7857143 C71.5714286,30.7857143 70.8571429,30.3571429 70.6428571,29.5 L75,29.5 L75,29.4285714 L75,29.4285714 L75,29.4285714 L75,29.4285714 Z M71.9285714,27.0714286 C72.5714286,27.0714286 73.0714286,27.5 73.2142857,28.2142857 L70.6428571,28.2142857 C70.7142857,27.5 71.2857143,27.0714286 71.9285714,27.0714286 L71.9285714,27.0714286 L71.9285714,27.0714286 L71.9285714,27.0714286 L71.9285714,27.0714286 Z M76.2857143,32.1428571 L78.2857143,32.1428571 L78.2857143,22.1428571 L76.2857143,22.1428571 L76.2857143,32.1428571 L76.2857143,32.1428571 L76.2857143,32.1428571 L76.2857143,32.1428571 Z M79.9285714,32.1428571 L81.9285714,32.1428571 L81.9285714,22.1428571 L79.9285714,22.1428571 L79.9285714,32.1428571 L79.9285714,32.1428571 L79.9285714,32.1428571 L79.9285714,32.1428571 Z M83.5714286,32.1428571 L85.5714286,32.1428571 L85.5714286,25.7142857 L83.5714286,25.7142857 L83.5714286,32.1428571 L83.5714286,32.1428571 L83.5714286,32.1428571 L83.5714286,32.1428571 Z M87.7857143,34.7142857 C88.3571429,35 89.1428571,35.2142857 90,35.2142857 C92.0714286,35.2142857 93.4285714,34.0714286 93.4285714,32.0714286 L93.4285714,25.7142857 L91.8571429,26 C91.4285714,25.7857143 90.8571429,25.6428571 90.2142857,25.6428571 C88.2142857,25.6428571 86.8571429,27.1428571 86.8571429,29 C86.8571429,30.9285714 88.2857143,32.1428571 89.8571429,32.1428571 C90.4285714,32.1428571 91,32 91.3571429,31.7142857 L91.3571429,31.7142857 L91.3571429,32.0714286 C91.3571429,33 90.7857143,33.5 89.7857143,33.5 C89.0714286,33.5 88.3571429,33.2857143 87.7142857,32.8571429 L87.7142857,34.7142857 L87.7857143,34.7142857 L87.7857143,34.7142857 L87.7857143,34.7142857 L87.7857143,34.7142857 Z M88.9285714,28.8571429 C88.9285714,28 89.4285714,27.2857143 90.4285714,27.2857143 C90.7857143,27.2857143 91.1428571,27.3571429 91.4285714,27.5 L91.4285714,30.2142857 C91.1428571,30.3571429 90.7857143,30.5 90.4285714,30.5 C89.5,30.5 88.9285714,29.7857143 88.9285714,28.8571429 L88.9285714,28.8571429 L88.9285714,28.8571429 L88.9285714,28.8571429 L88.9285714,28.8571429 Z M101.071429,29.4285714 C101.071429,29.2857143 101.142857,29 101.142857,28.7142857 C101.142857,26.5714286 99.6428571,25.5 98.0714286,25.5 C96.2857143,25.5 94.7142857,26.8571429 94.7142857,28.9285714 C94.7142857,30.9285714 96.2142857,32.2857143 98.3571429,32.2857143 C99.2142857,32.2857143 100.142857,32.0714286 100.785714,31.7142857 L100.785714,30.0714286 C100.071429,30.5 99.2857143,30.7857143 98.5714286,30.7857143 C97.6428571,30.7857143 96.9285714,30.3571429 96.7142857,29.5 L101.071429,29.5 L101.071429,29.4285714 L101.071429,29.4285714 L101.071429,29.4285714 L101.071429,29.4285714 Z M98,27.0714286 C98.6428571,27.0714286 99.1428571,27.5 99.2857143,28.2142857 L96.7142857,28.2142857 C96.8571429,27.5 97.4285714,27.0714286 98,27.0714286 L98,27.0714286 L98,27.0714286 L98,27.0714286 L98,27.0714286 Z M102.428571,32.1428571 L104.428571,32.1428571 L104.428571,27.7857143 C104.785714,27.5 105.285714,27.2142857 105.785714,27.2142857 C106.071429,27.2142857 106.285714,27.2857143 106.5,27.5 C106.642857,27.7142857 106.714286,27.9285714 106.714286,28.4285714 L106.714286,32.1428571 L108.714286,32.1428571 L108.714286,28.1428571 C108.714286,27.2142857 108.571429,26.6428571 108.142857,26.2142857 C107.714286,25.7857143 107.142857,25.5714286 106.428571,25.5714286 C105.642857,25.5714286 104.928571,25.9285714 104.428571,26.2857143 L104.428571,26.2857143 L104.428571,25.7142857 L102.428571,25.7142857 L102.428571,32.1428571 L102.428571,32.1428571 L102.428571,32.1428571 L102.428571,32.1428571 L102.428571,32.1428571 Z M109.928571,28.9285714 C109.928571,30.8571429 111.428571,32.2857143 113.5,32.2857143 C114.214286,32.2857143 115,32.1428571 115.642857,31.7857143 L115.642857,30 C115.071429,30.4285714 114.357143,30.6428571 113.785714,30.6428571 C112.714286,30.6428571 112,29.9285714 112,29 C112,28 112.714286,27.2857143 113.785714,27.2857143 C114.428571,27.2857143 115,27.5 115.571429,27.8571429 L115.571429,26 C115.071429,25.7142857 114.357143,25.5714286 113.642857,25.5714286 C111.571429,25.5714286 109.928571,26.9285714 109.928571,28.9285714 L109.928571,28.9285714 L109.928571,28.9285714 L109.928571,28.9285714 L109.928571,28.9285714 Z M123,29.4285714 C123,29.2857143 123.071429,29 123.071429,28.7142857 C123.071429,26.5714286 121.571429,25.5 120,25.5 C118.214286,25.5 116.642857,26.8571429 116.642857,28.9285714 C116.642857,30.9285714 118.142857,32.2857143 120.285714,32.2857143 C121.142857,32.2857143 122.142857,32.0714286 122.714286,31.7142857 L122.714286,30.0714286 C122,30.5 121.214286,30.7857143 120.5,30.7857143 C119.571429,30.7857143 118.857143,30.3571429 118.642857,29.5 L123,29.5 L123,29.4285714 L123,29.4285714 L123,29.4285714 L123,29.4285714 Z M119.928571,27.0714286 C120.571429,27.0714286 121.071429,27.5 121.214286,28.2142857 L118.571429,28.2142857 C118.785714,27.5 119.285714,27.0714286 119.928571,27.0714286 L119.928571,27.0714286 L119.928571,27.0714286 L119.928571,27.0714286 L119.928571,27.0714286 Z" id="Fill-6" fill="#000000"></path>
13
+ <path d="M52.1428571,24.8571429 L54.1428571,24.8571429 L54.1428571,22.8571429 L52.1428571,22.8571429 L52.1428571,24.8571429 L52.1428571,24.8571429 L52.1428571,24.8571429 L52.1428571,24.8571429 Z M83.5714286,24.8571429 L85.5714286,24.8571429 L85.5714286,22.8571429 L83.5714286,22.8571429 L83.5714286,24.8571429 L83.5714286,24.8571429 L83.5714286,24.8571429 L83.5714286,24.8571429 Z" id="Fill-7" fill="#000000"></path>
14
+ <path d="M54.7857143,20.7142857 L56.7142857,20.7142857 L59.3571429,14.2857143 L57.3571429,14.2857143 L56.5714286,16.3571429 C56.2857143,17 56,17.7857143 55.7857143,18.4285714 L55.7857143,18.4285714 C55.5714286,17.7857143 55.2857143,17.0714286 55.0714286,16.3571429 L54.2142857,14.2857143 L52.1428571,14.2857143 L54.7857143,20.7142857 L54.7857143,20.7142857 L54.7857143,20.7142857 L54.7857143,20.7142857 L54.7857143,20.7142857 Z M60.2142857,20.7142857 L62.2142857,20.7142857 L62.2142857,14.2857143 L60.2142857,14.2857143 L60.2142857,20.7142857 L60.2142857,20.7142857 L60.2142857,20.7142857 L60.2142857,20.7142857 Z M63.5,17.6428571 C63.5,19.6428571 64.9285714,20.8571429 66.5,20.8571429 C67.1428571,20.8571429 67.7142857,20.6428571 68.1428571,20.3571429 L68.1428571,20.3571429 L68.1428571,20.7142857 L70.0714286,20.7142857 L70.0714286,10.7142857 L68.0714286,10.7142857 L68.0714286,14.3571429 L68.0714286,14.3571429 C67.7142857,14.2142857 67.3571429,14.1428571 66.8571429,14.1428571 C64.9285714,14.1428571 63.5,15.5714286 63.5,17.6428571 L63.5,17.6428571 L63.5,17.6428571 L63.5,17.6428571 L63.5,17.6428571 Z M65.5,17.5714286 C65.5,16.5714286 66.0714286,15.7857143 67.1428571,15.7857143 C67.5714286,15.7857143 67.8571429,15.8571429 68.1428571,16 L68.1428571,18.8571429 C67.8571429,19.0714286 67.4285714,19.2142857 67,19.2142857 C66,19.2142857 65.5,18.5 65.5,17.5714286 L65.5,17.5714286 L65.5,17.5714286 L65.5,17.5714286 L65.5,17.5714286 Z M77.7857143,18 C77.7857143,17.8571429 77.8571429,17.5714286 77.8571429,17.2857143 C77.8571429,15.1428571 76.3571429,14.0714286 74.7857143,14.0714286 C73,14.0714286 71.4285714,15.4285714 71.4285714,17.5 C71.4285714,19.5 72.9285714,20.8571429 75.0714286,20.8571429 C75.9285714,20.8571429 76.9285714,20.6428571 77.5,20.2857143 L77.5,18.6428571 C76.7857143,19.0714286 76,19.3571429 75.2857143,19.3571429 C74.3571429,19.3571429 73.6428571,18.9285714 73.4285714,18.0714286 L77.7857143,18.0714286 L77.7857143,18 L77.7857143,18 L77.7857143,18 L77.7857143,18 Z M74.7142857,15.6428571 C75.3571429,15.6428571 75.8571429,16.0714286 76,16.7857143 L73.4285714,16.7857143 C73.5714286,16.0714286 74.0714286,15.6428571 74.7142857,15.6428571 L74.7142857,15.6428571 L74.7142857,15.6428571 L74.7142857,15.6428571 L74.7142857,15.6428571 Z M80.7142857,17.5 C80.7142857,16.5714286 81.4285714,15.8571429 82.2857143,15.8571429 C83.1428571,15.8571429 83.8571429,16.5714286 83.8571429,17.5 C83.8571429,18.4285714 83.1428571,19.1428571 82.2857143,19.1428571 C81.4285714,19.1428571 80.7142857,18.4285714 80.7142857,17.5 L80.7142857,17.5 L80.7142857,17.5 L80.7142857,17.5 L80.7142857,17.5 Z M78.7142857,17.5 C78.7142857,19.4285714 80.2142857,20.8571429 82.2857143,20.8571429 C84.3571429,20.8571429 85.8571429,19.3571429 85.8571429,17.5 C85.8571429,15.6428571 84.3571429,14.1428571 82.2857143,14.1428571 C80.2142857,14.1428571 78.7142857,15.5714286 78.7142857,17.5 L78.7142857,17.5 L78.7142857,17.5 L78.7142857,17.5 L78.7142857,17.5 Z" id="Fill-8" fill="#000000"></path>
15
+ <polygon id="Fill-9" fill="#000000" points="60.2100067 13.4285714 62.2100067 13.4285714 62.2100067 11.4285714 60.2100067 11.4285714"></polygon>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </svg>
includes/fp-api.php CHANGED
@@ -377,6 +377,148 @@ class FV_Wordpress_Flowplayer_Plugin
377
  return version_compare( $GLOBALS['wp_version'], $version. 'alpha', '>=' );
378
  }
379
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
380
 
381
 
382
  }
377
  return version_compare( $GLOBALS['wp_version'], $version. 'alpha', '>=' );
378
  }
379
 
380
+
381
+
382
+
383
+ //search for plugin path with {slug}.php
384
+ public static function get_plugin_path( $slug ){
385
+ $aPluginSlugs = get_transient('plugin_slugs');
386
+ $aPluginSlugs = is_array($aPluginSlugs) ? $aPluginSlugs : array( $slug.'/'.$slug.'.php');
387
+ $aActivePlugins = get_option('active_plugins');
388
+ $aInactivePlugins = array_diff($aPluginSlugs,$aActivePlugins);
389
+
390
+ if( !$aPluginSlugs )
391
+ return false;
392
+
393
+ foreach( $aActivePlugins as $item ){
394
+ if( stripos($item,$slug.'.php') !== false && !is_wp_error(validate_plugin($item)) )
395
+ return $item;
396
+ }
397
+
398
+ $sPluginFolder = plugin_dir_path( dirname( dirname(__FILE__) ) );
399
+ foreach( $aInactivePlugins as $item ){
400
+ if( stripos($item,$slug.'.php') !== false && file_exists($sPluginFolder.$item) )
401
+ return $item;
402
+ }
403
+
404
+ return false;
405
+ }
406
+
407
+
408
+
409
+
410
+ public static function install_form_text( $html, $name ) {
411
+ $tag = stripos($html,'</h3>') !== false ? 'h3' : 'h2';
412
+ $html = preg_replace( '~<'.$tag.'.*?</'.$tag.'>~', '<'.$tag.'>'.$name.' auto-installation</'.$tag.'>', $html );
413
+ $html = preg_replace( '~(<input[^>]*?type="submit"[^>]*?>)~', '$1 <a href="'.admin_url('options-general.php?page=fvplayer').'">Skip the '.$name.' install</a>', $html );
414
+ return $html;
415
+ }
416
+
417
+
418
+
419
+
420
+ public static function install_plugin( $name, $plugin_package, $plugin_basename, $download_url, $settings_url, $option, $nonce ) { // 'FV Player Pro', 'fv-player-pro', '/wp-admin/options-general.php?page=fvplayer', download URL (perhaps from the license), settings URL (use admin_url(...), should also contain some GET which will make it install the extension if present) and option where result message should be stored and a nonce which should be passed
421
+ global $hook_suffix;
422
+
423
+ $plugin_path = self::get_plugin_path( str_replace( '_', '-', $plugin_package ) );
424
+ if( !defined('PHPUnitTestMode') && $plugin_path ) {
425
+ $result = activate_plugin( $plugin_path, $settings_url );
426
+ if ( is_wp_error( $result ) ) {
427
+ update_option( $option, $name.' extension activation error: '.$result->get_error_message() );
428
+ return false;
429
+ } else {
430
+ update_option( $option, $name.' extension activated' );
431
+ return true; // already installed
432
+ }
433
+ }
434
+
435
+ $plugin_basename = $plugin_path ? $plugin_path : $plugin_basename;
436
+
437
+ $url = wp_nonce_url( $settings_url, $nonce, 'nonce_'.$nonce );
438
+
439
+ set_current_screen();
440
+
441
+ ob_start();
442
+ if ( false === ( $creds = request_filesystem_credentials( $url, '', false, false, false ) ) ) {
443
+ $form = ob_get_clean();
444
+ include( ABSPATH . 'wp-admin/admin-header.php' );
445
+ echo self::install_form_text($form, $name);
446
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
447
+ die;
448
+ }
449
+
450
+ if ( ! WP_Filesystem( $creds ) ) {
451
+ ob_start();
452
+ request_filesystem_credentials( $url, $method, true, false, false );
453
+ $form = ob_get_clean();
454
+ include( ABSPATH . 'wp-admin/admin-header.php' );
455
+ echo self::install_form_text($form, $name);
456
+ include( ABSPATH . 'wp-admin/admin-footer.php' );
457
+ die;
458
+ }
459
+
460
+ require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
461
+
462
+ $result = true;
463
+
464
+ if( !$plugin_path || is_wp_error(validate_plugin($plugin_basename)) ) {
465
+ $sTaskDone = $name.__(' extension installed successfully!', 'fv-wordpress-flowplayer');
466
+
467
+ echo '<div style="display: none;">';
468
+ $objInstaller = new Plugin_Upgrader();
469
+ $objInstaller->install( $download_url );
470
+ echo '</div>';
471
+ wp_cache_flush();
472
+
473
+ if ( is_wp_error( $objInstaller->skin->result ) ) {
474
+ update_option( $option, $name.__(' extension install failed - ', 'fv-wordpress-flowplayer') . $objInstaller->skin->result->get_error_message() );
475
+ $result = false;
476
+ } else {
477
+ if ( $objInstaller->plugin_info() ) {
478
+ $plugin_basename = $objInstaller->plugin_info();
479
+ }
480
+
481
+ $activate = activate_plugin( $plugin_basename );
482
+ if ( is_wp_error( $activate ) ) {
483
+ update_option( $option, $name.__(' extension install failed - ', 'fv-wordpress-flowplayer') . $activate->get_error_message());
484
+ $result = false;
485
+ }
486
+ }
487
+
488
+ } else if( $plugin_path ) {
489
+ $sTaskDone = $name.__(' extension upgraded successfully!', 'fv-wordpress-flowplayer');
490
+
491
+ echo '<div style="display: none;">';
492
+ $objInstaller = new Plugin_Upgrader();
493
+ $objInstaller->upgrade( $plugin_path );
494
+ echo '</div></div>'; // explanation: extra closing tag just to be safe (in case of "The plugin is at the latest version.")
495
+ wp_cache_flush();
496
+
497
+ if ( is_wp_error( $objInstaller->skin->result ) ) {
498
+ update_option( $option, $name.' extension upgrade failed - '.$objInstaller->skin->result->get_error_message() );
499
+ $result = false;
500
+ } else {
501
+ if ( $objInstaller->plugin_info() ) {
502
+ $plugin_basename = $objInstaller->plugin_info();
503
+ }
504
+
505
+ $activate = activate_plugin( $plugin_basename );
506
+ if ( is_wp_error( $activate ) ) {
507
+ update_option( $option, $name.' Pro extension upgrade failed - '.$activate->get_error_message() );
508
+ $result = false;
509
+ }
510
+ }
511
+
512
+ }
513
+
514
+ if( $result ) {
515
+ update_option( $option, $sTaskDone );
516
+ echo "<script>location.href='".$settings_url."';</script>";
517
+ }
518
+
519
+ return $result;
520
+ }
521
+
522
 
523
 
524
  }
models/flowplayer.php CHANGED
@@ -162,7 +162,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
162
  $key = (!empty($options['key']) ? $options['key'] : '');
163
  $name = (!empty($options['name']) ? $options['name'] : '');
164
  $help = (!empty($options['help']) ? $options['help'] : '');
165
- $more = (!empty($options['more']) ? $options['more'] : '');
166
 
167
  if (!$key || !$name) {
168
  throw new Exception('Both, "name" and "key" options need to be set for _get_checkbox()!');
@@ -173,7 +173,7 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
173
  $name = func_get_arg(0);
174
  $key = func_get_arg(1);
175
  $help = ($args_num >= 3 ? func_get_arg(2) : false);
176
- $more = ($args_num >= 4 ? func_get_arg(3) : false);
177
  } else {
178
  throw new Exception('Invalid number of arguments passed to the _get_checkbox() method!');
179
  }
@@ -615,15 +615,16 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
615
  }
616
 
617
 
618
- public function _get_option($key) {
 
619
 
620
  $value = false;
621
  if( is_array($key) && count($key) === 2) {
622
- if( isset($this->conf[$key[0]]) && isset($this->conf[$key[0]][$key[1]]) ) {
623
- $value = $this->conf[$key[0]][$key[1]];
624
  }
625
- } elseif( isset($this->conf[$key]) ) {
626
- $value = $this->conf[$key];
627
  }
628
 
629
  if( is_string($value) ) $value = trim($value);
@@ -641,8 +642,8 @@ class flowplayer extends FV_Wordpress_Flowplayer_Plugin {
641
  }
642
 
643
 
644
- public function _set_conf() {
645
- $aNewOptions = $_POST;
646
  $sKey = $aNewOptions['key'];
647
 
648
  // make sure the preset Skin properties are not over-written
162
  $key = (!empty($options['key']) ? $options['key'] : '');
163
  $name = (!empty($options['name']) ? $options['name'] : '');
164
  $help = (!empty($options['help']) ? $options['help'] : '');
165
+ $more = (!empty($options['more']) ? $options['more'] : '');
166
 
167
  if (!$key || !$name) {
168
  throw new Exception('Both, "name" and "key" options need to be set for _get_checkbox()!');
173
  $name = func_get_arg(0);
174
  $key = func_get_arg(1);
175
  $help = ($args_num >= 3 ? func_get_arg(2) : false);
176
+ $more = ($args_num >= 4 ? func_get_arg(3) : false);
177
  } else {
178
  throw new Exception('Invalid number of arguments passed to the _get_checkbox() method!');
179
  }
615
  }
616
 
617
 
618
+ public function _get_option($key) {
619
+ $conf = $this->conf;
620
 
621
  $value = false;
622
  if( is_array($key) && count($key) === 2) {
623
+ if( isset($conf[$key[0]]) && isset($conf[$key[0]][$key[1]]) ) {
624
+ $value = $conf[$key[0]][$key[1]];
625
  }
626
+ } elseif( isset($conf[$key]) ) {
627
+ $value = $conf[$key];
628
  }
629
 
630
  if( is_string($value) ) $value = trim($value);
642
  }
643
 
644
 
645
+ public function _set_conf( $aNewOptions = false ) {
646
+ if( !$aNewOptions ) $aNewOptions = $_POST;
647
  $sKey = $aNewOptions['key'];
648
 
649
  // make sure the preset Skin properties are not over-written
models/video-intelligence.php ADDED
@@ -0,0 +1,287 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class FV_Player_video_intelligence_Installer {
4
+
5
+ var $notice = false;
6
+ var $notice_status = false;
7
+
8
+ function __construct() {
9
+ add_action( 'admin_menu', array( $this, 'start' ), 8 ) ;
10
+ add_action( 'admin_init', array( $this, 'settings_register' ) ) ;
11
+ add_action( 'admin_notices', array( $this, 'show_notice' ) );
12
+ add_action( 'fv_player_admin_settings_tabs', array( $this, 'settings_tab' ) );
13
+ add_action( 'wp_ajax_fv-player-vi-add', array( $this, 'settings_remove' ) );
14
+ add_action( 'wp_ajax_fv-player-vi-remove', array( $this, 'settings_remove' ) );
15
+ }
16
+
17
+ function screen_account() {
18
+ global $fv_fp;
19
+
20
+ $jwt = $fv_fp->_get_option(array('addon-video-intelligence', 'jwt'));
21
+ wp_nonce_field('fv_player_vi_install','nonce_fv_player_vi_install');
22
+ ?>
23
+
24
+ <table class="form-table2" style="margin: 5px; ">
25
+ <tbody>
26
+ <?php
27
+ $data = explode( '.', $jwt );
28
+ $data = !empty($data[1]) ? json_decode( base64_decode($data[1]) ) : false;
29
+
30
+ if( $jwt && $data && !empty($data->exp) && $data->exp > time() ) : ?>
31
+ <tr>
32
+ <td class="first"></td>
33
+ <td>
34
+ <p>We found an existing video intelligence token. Click below to install FV Player video intelligence plugin.</p>
35
+ <input type="submit" name="fv_player_vi_install" value="<?php _e('Install', 'fv-wordpress-flowplayer'); ?>" class="button-primary">
36
+ <input type="submit" name="fv_player_vi_reset" value="<?php _e('Reset', 'fv-wordpress-flowplayer'); ?>" class="button">
37
+ </td>
38
+ </tr>
39
+ <?php endif; ?>
40
+ <?php if( !$jwt || empty($data->exp) || $data->exp < time() ) : ?>
41
+ <tr>
42
+ <td class="first"><label for="vi_login"><?php _e('Login', 'fv-wordpress-flowplayer'); ?>:</label></td>
43
+ <td>
44
+ <p class="description">
45
+ <input type="text" name="vi_login" id="vi_login" class="medium" />
46
+ </p>
47
+ </td>
48
+ </tr>
49
+ <tr>
50
+ <td><label for="vi_pass"><?php _e('Password', 'fv-wordpress-flowplayer'); ?>:</label></td>
51
+ <td>
52
+ <p class="description">
53
+ <input type="password" name="vi_pass" id="vi_pass" class="medium" />
54
+ </p>
55
+ </td>
56
+ </tr>
57
+ <tr>
58
+ <td>
59
+ </td>
60
+ <td>
61
+ <input type="submit" name="fv_player_vi_install" value="<?php _e('Sign in', 'fv-wordpress-flowplayer'); ?>" class="button-primary">
62
+ </td>
63
+ </tr>
64
+ <tr>
65
+ <td></td>
66
+ <td>
67
+ <p><a href="mailto:support@vi.ai?Subject=Issues%20with%20account%20activation%20for%20<?php echo urlencode(home_url()); ?>">I'm having issues with the account activation</a></p>
68
+ </td>
69
+ </tr>
70
+ <?php endif; ?>
71
+ </tbody>
72
+ </table>
73
+
74
+
75
+
76
+ <?php
77
+ }
78
+
79
+ function screen_ad() {
80
+ global $fv_fp;
81
+ $current_user = wp_get_current_user();
82
+
83
+ if( $fv_fp->_get_option('hide-tab-video-intelligence') && !class_exists('FV_Player_Video_Intelligence') ) : ?>
84
+ <style>
85
+ a[href$=postbox-container-tab_video_intelligence] { display: none }
86
+ #fv_flowplayer_video_intelligence { display: none }
87
+ #fv_flowplayer_video_intelligence_account { display: none }
88
+ #fv_flowplayer_video_intelligence_revival { display: block }
89
+ </style>
90
+ <?php else : ?>
91
+ <style>
92
+ #fv_flowplayer_video_intelligence_revival { display: none }
93
+ </style>
94
+ <?php endif;
95
+
96
+ $jwt = $fv_fp->_get_option(array('addon-video-intelligence', 'jwt'));
97
+ wp_nonce_field('fv_player_vi_install','nonce_fv_player_vi_install');
98
+ ?>
99
+ <table class="form-table2" style="margin: 5px; ">
100
+ <tbody>
101
+ <tr>
102
+ <td class="first">
103
+ <img src="<?php echo flowplayer::get_plugin_url(); ?>/images/vi-logo.svg" alt="video intelligence logo" />
104
+ <a href="https://vi.ai/publisher-video-monetization/?aid=foliovision&email=<?php echo $current_user->user_email; ?>&url=<?php echo home_url(); ?>&invtype=3#publisher_signup" target="_blank" class="button vi-register">Learn More</a>
105
+ </td>
106
+ <td>
107
+ <p>Video content and video advertising – powered by <strong>video intelligence</strong></p>
108
+ <p>Advertisers pay more for video advertising when it's matched with video content. This new video player will insert both on your page. It increases time on site, and commands a higher CPM than display advertising.</p>
109
+ <p>You'll see video content that is matched to your sites keywords straight away. A few days after activation you'll begin to receive revenue from advertising served before this video content.</p>
110
+ <ul>
111
+ <li>The set up takes only a few minutes</li>
112
+ <li>Up to 10x higher CPM than traditional display advertising</li>
113
+ <li>Users spend longer on your site thanks to professional video content</li>
114
+ </ul>
115
+ </td>
116
+ </tr>
117
+ <tr>
118
+ <td></td>
119
+ <td>
120
+ <p>By clicking sign up you agree to send your current domain, email and affiliate ID to video intelligence.</p>
121
+ <a href="https://vi.ai/publisher-video-monetization/?aid=foliovision&email=<?php echo $current_user->user_email; ?>&url=<?php echo home_url(); ?>&invtype=3#publisher_signup" target="_blank" class="button vi-register">Learn More or Create an Account</a>
122
+ </td>
123
+ </tr>
124
+ </tbody>
125
+ </table>
126
+
127
+ <?php
128
+ }
129
+
130
+ function settings_hide() {
131
+ ?>
132
+ <input id="fv-player-vi-remove" type="checkbox"> <label for="fv-player-vi-remove"><?php _e('Hide the vi Ads tab', 'fv-wordpress-flowplayer'); ?></label>
133
+ <script>
134
+ jQuery( function($) {
135
+ $('#fv-player-vi-remove').click( function() {
136
+ $.post(ajaxurl, {action:'fv-player-vi-remove'}, function() {
137
+ $('#fv-player-vi-give-back').prop('checked',false);
138
+ $('[href=#postbox-container-tab_video_intelligence]').hide();
139
+ $('#fv_flowplayer_video_intelligence').hide();
140
+ $('[href=#postbox-container-tab_video_ads]').click();
141
+ $('#fv_flowplayer_video_intelligence_revival').show();
142
+ });
143
+
144
+ });
145
+ });
146
+ </script>
147
+ <?php
148
+ }
149
+
150
+ function settings_register() {
151
+ if( !class_exists('FV_Player_Video_Intelligence') ) {
152
+ add_meta_box( 'fv_flowplayer_video_intelligence', __('video intelligence', 'fv-wordpress-flowplayer'), array( $this, 'screen_ad' ), 'fv_flowplayer_settings_video_intelligence', 'normal' );
153
+ add_meta_box( 'fv_flowplayer_video_intelligence_account', __('Account', 'fv-wordpress-flowplayer'), array( $this, 'screen_account' ), 'fv_flowplayer_settings_video_intelligence', 'normal' );
154
+ add_meta_box( 'fv_flowplayer_video_intelligence_hide', __('Hide vi Ads', 'fv-wordpress-flowplayer'), array( $this, 'settings_hide' ), 'fv_flowplayer_settings_video_intelligence', 'normal' );
155
+ add_meta_box( 'fv_flowplayer_video_intelligence_revival', __('Free video intelligence ads', 'fv-wordpress-flowplayer'), array( $this, 'settings_revival' ), 'fv_flowplayer_settings_video_ads', 'normal', 'low' );
156
+ }
157
+ }
158
+
159
+ function settings_remove() {
160
+ if( current_user_can('manage_options') ) {
161
+ global $fv_fp;
162
+ $aNew = $fv_fp->conf;
163
+ $aNew['hide-tab-video-intelligence'] = $_POST['action'] == 'fv-player-vi-remove';
164
+ $fv_fp->_set_conf( $aNew );
165
+ die();
166
+ }
167
+ }
168
+
169
+ function settings_revival() {
170
+ ?>
171
+ <input id="fv-player-vi-give-back" type="checkbox"> <label for="fv-player-vi-give-back"><?php _e('Show the vi Ads tab again', 'fv-wordpress-flowplayer'); ?></label></a>
172
+ <script>
173
+ jQuery( function($) {
174
+ $('#fv-player-vi-give-back').click( function() {
175
+ $.post(ajaxurl, {action:'fv-player-vi-add'}, function() {
176
+ $('#fv-player-vi-remove').prop('checked',false);
177
+ $('[href=#postbox-container-tab_video_intelligence]').show();
178
+ $('#fv_flowplayer_video_intelligence').show();
179
+ $('#fv_flowplayer_video_intelligence_account').show();
180
+ $('[href=#postbox-container-tab_video_intelligence]').click();
181
+ $('#fv_flowplayer_video_intelligence_revival').hide();
182
+ });
183
+ });
184
+ });
185
+ </script>
186
+ <?php
187
+ }
188
+
189
+ function settings_tab( $tabs ) {
190
+ $tabs[] = array('id' => 'fv_flowplayer_settings_video_intelligence', 'hash' => 'tab_video_intelligence', 'name' => __('vi Ads', 'fv-player-vi') );
191
+ return $tabs;
192
+ }
193
+
194
+ function show_notice() {
195
+ if( $this->notice_status ) {
196
+ echo "<div class='".$this->notice_status."'><p>".$this->notice."</p></div>\n";
197
+ }
198
+ }
199
+
200
+ function start() {
201
+ $should_install = false;
202
+
203
+ if( current_user_can('install_plugins') && !empty($_POST['vi_login']) && !empty($_POST['vi_pass']) && !empty($_POST['fv_player_vi_install']) ) {
204
+ check_admin_referer( 'fv_player_vi_install', 'nonce_fv_player_vi_install' );
205
+
206
+ remove_action('admin_init', 'fv_player_settings_save', 9);
207
+
208
+ $request = wp_remote_get( 'https://dashboard-api.vidint.net/v1/api/widget/settings' );
209
+ if( is_wp_error($request) ) {
210
+ $this->notice_status = 'error';
211
+ $this->notice = "Can't connect to dashboard-api.vidint.net (1)!";
212
+ return;
213
+ }
214
+
215
+ $body = wp_remote_retrieve_body( $request );
216
+
217
+ $data = json_decode( $body );
218
+
219
+ if( !$data || empty($data->data) || empty($data->data->loginAPI) ) {
220
+ $this->notice_status = 'error';
221
+ $this->notice = "Can't parse settings URLs!";
222
+ return;
223
+ }
224
+
225
+
226
+ $request = wp_remote_post( $data->data->loginAPI, array(
227
+ 'headers' => array('Content-Type' => 'application/json;charset=UTF-8'),
228
+ 'body' => json_encode(array( 'email' => $_POST['vi_login'], 'password' => $_POST['vi_pass'] )),
229
+ 'method' => 'POST'
230
+ ));
231
+
232
+ if( is_wp_error($request) ) {
233
+ $this->notice_status = 'error';
234
+ $this->notice = "Can't connect to dashboard-api.vidint.net (2)!";
235
+ return;
236
+ }
237
+
238
+ $body = wp_remote_retrieve_body( $request );
239
+
240
+ $data = json_decode( $body );
241
+
242
+ if( !$data || empty($data->status) || $data->status != 'ok' ) {
243
+ $this->notice_status = 'error';
244
+ $this->notice = 'Error logging in to video intelligence account. Please double check that you have filled in the video intelligence signup form and confirmed the account by clicking the link in confirmation email.';
245
+ return;
246
+ }
247
+
248
+ global $fv_fp;
249
+ $aNew = $fv_fp->conf;
250
+ $aNew['addon-video-intelligence'] = array( 'jwt' => $data->data, 'time' => time() );
251
+ $fv_fp->_set_conf( $aNew );
252
+
253
+ $this->notice_status = 'updated';
254
+ $this->notice = 'video intelligence login successful!';
255
+
256
+ // attempt plugin auto install!
257
+ $should_install = true;
258
+ }
259
+
260
+ else if( current_user_can('install_plugins') && !empty($_REQUEST['fv_player_vi_install']) && wp_verify_nonce( $_REQUEST['nonce_fv_player_vi_install'], 'fv_player_vi_install') ) {
261
+ $should_install = true;
262
+ }
263
+
264
+ else if( current_user_can('install_plugins') && !empty($_POST['fv_player_vi_reset']) ) {
265
+ check_admin_referer( 'fv_player_vi_install', 'nonce_fv_player_vi_install' );
266
+ global $fv_fp;
267
+ $fv_fp->conf['addon-video-intelligence'] = array();
268
+ $fv_fp->_set_conf( $fv_fp->conf );
269
+ $this->notice_status = 'updated';
270
+ $this->notice = 'video intelligence login reset!';
271
+ }
272
+
273
+ if( $should_install ) {
274
+ $result = FV_Wordpress_Flowplayer_Plugin::install_plugin(
275
+ "FV Player video intelligence",
276
+ "fv-player-video-intelligence",
277
+ "fv-player-video-intelligence.php",
278
+ "https://foliovision.com/plugins/public/fv-player-video-intelligence.zip",
279
+ admin_url('options-general.php?page=fvplayer&fv_player_vi_install=1#postbox-container-tab_video_intelligence'),
280
+ 'fv_wordpress_flowplayer_deferred_notices',
281
+ 'fv_player_vi_install'
282
+ );
283
+ }
284
+ }
285
+ }
286
+
287
+ new FV_Player_video_intelligence_Installer;
readme.txt CHANGED
@@ -18,8 +18,8 @@ FV Player is a free, easy-to-use, and complete solution for embedding FLV or MP4
18
 
19
  * Remembering video position both both guest users and members
20
  * API for custom video fields
21
- * **NEW** easy AB looped playback for your visitors (great for teaching sites)
22
- * **NEW** improved and more powerful playlists (more playlist features coming soon).
23
  * Automated checking of video encoding for logged in admins
24
  * FV Player is a completely responsive WordPress video player.
25
  * Custom start and end screens are built right in. You can use your own custom design before and after the video.
@@ -30,6 +30,7 @@ FV Player is a free, easy-to-use, and complete solution for embedding FLV or MP4
30
  * 98% Browser coverage. Built-in Flash fallback will get the job done on older browsers.
31
  * Full support for Amazon S3, Cloudfront and other CDN's.
32
  * Totally Brandable. Stop selling YouTube and start selling yourself. Even design your own player.
 
33
 
34
  To remove our branding and add your own branding and get access to additional pro support, [you can buy your own license here](https://foliovision.com/player/download).
35
 
@@ -356,6 +357,11 @@ Thank you for being part of the HMTL 5 mobile video revolution!
356
 
357
  == Changelog ==
358
 
 
 
 
 
 
359
  = 6.5.1 - 2018/04/04 =
360
 
361
  * Amazon S3 - Adding URL signature for subtitles
18
 
19
  * Remembering video position both both guest users and members
20
  * API for custom video fields
21
+ * easy AB looped playback for your visitors (great for teaching sites)
22
+ * improved and more powerful playlists (more playlist features coming soon).
23
  * Automated checking of video encoding for logged in admins
24
  * FV Player is a completely responsive WordPress video player.
25
  * Custom start and end screens are built right in. You can use your own custom design before and after the video.
30
  * 98% Browser coverage. Built-in Flash fallback will get the job done on older browsers.
31
  * Full support for Amazon S3, Cloudfront and other CDN's.
32
  * Totally Brandable. Stop selling YouTube and start selling yourself. Even design your own player.
33
+ * Supports video intelligence video ads
34
 
35
  To remove our branding and add your own branding and get access to additional pro support, [you can buy your own license here](https://foliovision.com/player/download).
36
 
357
 
358
  == Changelog ==
359
 
360
+ = 6.5.2 - 2018/04/11 =
361
+
362
+ * New feature - video intelligence ads
363
+ * Bugfix - Video position saving - not working when playing HLS in Firefox
364
+
365
  = 6.5.1 - 2018/04/04 =
366
 
367
  * Amazon S3 - Adding URL signature for subtitles
test/integration/backend/testSettingsScreen.html CHANGED
@@ -1,4 +1,3 @@
1
-
2
  <div class="wrap">
3
  <div style="position: absolute; margin-top: 10px; right: 10px;">
4
  <a href="https://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer" target="_blank" title="Documentation"><img alt="visit foliovision" src="//foliovision.com/shared/fv-logo.png" /></a>
@@ -48,6 +47,7 @@
48
  <a href="#postbox-container-tab_skin" class="nav-tab" style="outline: 0px;">Skin</a>
49
  <a href="#postbox-container-tab_hosting" class="nav-tab" style="outline: 0px;">Hosting</a>
50
  <a href="#postbox-container-tab_actions" class="nav-tab" style="outline: 0px;">Actions</a>
 
51
  <a href="#postbox-container-tab_help" class="nav-tab" style="outline: 0px;">Help</a>
52
  <div id="fv_player_js_warning" style=" margin: 8px 40px; display: inline-block; color: darkgrey;" >There Is a Problem with JavaScript.</div>
53
  </h2>
@@ -890,7 +890,7 @@ jQuery(document).ready(function($) {
890
  <table class="form-table2" style="margin: 5px; ">
891
  <tr>
892
  <td>
893
- <input type="button" class="button" value="Convert JW Player shortcodes" style="margin-top: 2ex;" onclick="if( confirm('This converts the [jwplayer] shortcodes into [fvplayer] shortcodes.\n\n Please make sure you backup your database before continuing. You can use revisions to get back to previos versions of your posts as well.') ) location.href='http://example.org/wp-admin/options-general.php?page=fvplayer&amp;convert_jwplayer=30f043bc86'; "/>
894
  </td>
895
  </tr>
896
  </table>
@@ -980,7 +980,7 @@ jQuery(document).ready(function($) {
980
  </table>
981
  </div>
982
  </div>
983
- </div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="6513e6efc8" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="8e68cff2f2" />
984
  </div>
985
  <div id='postbox-container-tab_skin' class='postbox-container' style="">
986
  <div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_description" class="postbox " >
@@ -1001,7 +1001,7 @@ jQuery(document).ready(function($) {
1001
  <div class="inside">
1002
  <style id="fv-style-preview"></style>
1003
  <div class="flowplayer-wrapper">
1004
- <div id="wpfp_b5bf849ccc1f648970d2fa7a432be230" class="flowplayer no-brand is-splash fvp-play-button" style="background-image: url(https://i.vimeocdn.com/video/609485450_1280.jpg);" data-ratio="0.5625">
1005
  <div class="fp-ratio" style="padding-top: 56.25%"></div>
1006
  <div class='fvp-share-bar'><ul class="fvp-sharing">
1007
  <li><a class="sharing-facebook" href="https://www.facebook.com/sharer/sharer.php?u=" target="_blank">Facebook</a></li>
@@ -1101,7 +1101,7 @@ jQuery(document).ready(function($) {
1101
  <button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Playlist</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class='hndle'><span>Playlist</span></h2>
1102
  <div class="inside">
1103
  <div class="flowplayer-wrapper">
1104
- <div class="fp-playlist-external fv-playlist-design-2017 fp-playlist-horizontal fp-playlist-has-captions" rel="wpfp_b5bf849ccc1f648970d2fa7a432be230">
1105
  <a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/player.vimeo.com\/external\/196881410.hd.mp4?s=24645ecff21ff60079fc5b7715a97c00f90c6a18&profile_id=174&oauth2_token_id=3501005","type":"video\/mp4"}],"subtitles":[{"srclang":"en","label":"English","src":"http:\/\/example.org\/wp-content\/plugins\/fv-wordpress-flowplayer\/images\/test-subtitles.vtt"}]}'><div style='background-image: url("https://i.vimeocdn.com/video/608654918_295x166.jpg")'></div><h4><span>Foliovision Video</span></h4></a>
1106
  <a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/player.vimeo.com\/external\/224781088.sd.mp4?s=face4dbb990b462826c8e1e43a9c66c6a9bb5585&profile_id=165&oauth2_token_id=3501005","type":"video\/mp4"}]}'><div style='background-image: url("https://i.vimeocdn.com/video/643908843_295x166.jpg")'></div><h4><span>Lapinthrope Extras - Roy Thompson Hall Dance</span></h4></a>
1107
  <a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/player.vimeo.com\/external\/45864857.hd.mp4?s=94fddee594da3258c9e10355f5bad8173c4aee7b&profile_id=113&oauth2_token_id=3501005","type":"video\/mp4"}]}'><div style='background-image: url("https://i.vimeocdn.com/video/319116053_295x166.jpg")'></div><h4><span>Romeo and Juliet Ballet Schloss Kittsee</span></h4></a>
@@ -1234,7 +1234,7 @@ Hint: you can click the thumbnails to switch videos in the above player. This pr
1234
  <div style="clear: both"></div>
1235
  </div>
1236
  </div>
1237
- </div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="6513e6efc8" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="8e68cff2f2" />
1238
  </div>
1239
  <div id='postbox-container-tab_hosting' class='postbox-container' style="">
1240
  <div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_description" class="postbox " >
@@ -1332,7 +1332,7 @@ Hint: you can click the thumbnails to switch videos in the above player. This pr
1332
  </table>
1333
  </div>
1334
  </div>
1335
- </div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="6513e6efc8" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="8e68cff2f2" />
1336
  </div>
1337
  <div id='postbox-container-tab_actions' class='postbox-container' style="">
1338
  <div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_description" class="postbox " >
@@ -1591,7 +1591,7 @@ Hint: you can click the thumbnails to switch videos in the above player. This pr
1591
  jQuery.ajax( {
1592
  type: "POST",
1593
  url: ajaxurl,
1594
- data: aInputs.serialize()+'&key='+key+'&action=fv_player_email_subscription_save&_wpnonce=0076f76ad6',
1595
  success: function(response) {
1596
  button.css('visibility','hidden');
1597
  button.prop('disabled', false);
@@ -1691,7 +1691,109 @@ Hint: you can click the thumbnails to switch videos in the above player. This pr
1691
  </table>
1692
  </div>
1693
  </div>
1694
- </div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="6513e6efc8" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="8e68cff2f2" />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1695
  </div>
1696
  <div id='postbox-container-tab_help' class='postbox-container' style="">
1697
  <div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_usage" class="postbox " >
@@ -1771,11 +1873,11 @@ Hint: you can click the thumbnails to switch videos in the above player. This pr
1771
  </table>
1772
  </div>
1773
  </div>
1774
- </div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="6513e6efc8" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="8e68cff2f2" />
1775
  </div>
1776
  <div style="clear: both"></div>
1777
  </div>
1778
- <input type="hidden" id="fv_flowplayer_settings_nonce" name="fv_flowplayer_settings_nonce" value="b5b463282b" /><input type="hidden" name="_wp_http_referer" value="" /> </form>
1779
 
1780
  </div>
1781
  <script type="text/javascript" >
@@ -1851,7 +1953,7 @@ Hint: you can click the thumbnails to switch videos in the above player. This pr
1851
  var button = jQuery(this);
1852
  button.siblings('img').eq(0).show();
1853
 
1854
- jQuery.post( ajaxurl, { action: 'fv_wp_flowplayer_activate_extension', nonce: '83ea8ddd04', plugin: jQuery(this).attr("data-plugin") }, function( response ) {
1855
  button.siblings('img').eq(0).hide();
1856
 
1857
  var obj;
@@ -1967,4 +2069,4 @@ jQuery('a.fv-settings-anchor').on('click',function(e){
1967
 
1968
 
1969
 
1970
- </script>
 
1
  <div class="wrap">
2
  <div style="position: absolute; margin-top: 10px; right: 10px;">
3
  <a href="https://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer" target="_blank" title="Documentation"><img alt="visit foliovision" src="//foliovision.com/shared/fv-logo.png" /></a>
47
  <a href="#postbox-container-tab_skin" class="nav-tab" style="outline: 0px;">Skin</a>
48
  <a href="#postbox-container-tab_hosting" class="nav-tab" style="outline: 0px;">Hosting</a>
49
  <a href="#postbox-container-tab_actions" class="nav-tab" style="outline: 0px;">Actions</a>
50
+ <a href="#postbox-container-tab_video_intelligence" class="nav-tab" style="outline: 0px;">vi Ads</a>
51
  <a href="#postbox-container-tab_help" class="nav-tab" style="outline: 0px;">Help</a>
52
  <div id="fv_player_js_warning" style=" margin: 8px 40px; display: inline-block; color: darkgrey;" >There Is a Problem with JavaScript.</div>
53
  </h2>
890
  <table class="form-table2" style="margin: 5px; ">
891
  <tr>
892
  <td>
893
+ <input type="button" class="button" value="Convert JW Player shortcodes" style="margin-top: 2ex;" onclick="if( confirm('This converts the [jwplayer] shortcodes into [fvplayer] shortcodes.\n\n Please make sure you backup your database before continuing. You can use revisions to get back to previos versions of your posts as well.') ) location.href='http://example.org/wp-admin/options-general.php?page=fvplayer&amp;convert_jwplayer=f13b4f40a5'; "/>
894
  </td>
895
  </tr>
896
  </table>
980
  </table>
981
  </div>
982
  </div>
983
+ </div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="d28516cc79" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="3edef551d9" />
984
  </div>
985
  <div id='postbox-container-tab_skin' class='postbox-container' style="">
986
  <div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_description" class="postbox " >
1001
  <div class="inside">
1002
  <style id="fv-style-preview"></style>
1003
  <div class="flowplayer-wrapper">
1004
+ <div id="wpfp_1b7da827d9fee9aa6d5bb9c5dca973bf" class="flowplayer no-brand is-splash fvp-play-button" style="background-image: url(https://i.vimeocdn.com/video/609485450_1280.jpg);" data-ratio="0.5625">
1005
  <div class="fp-ratio" style="padding-top: 56.25%"></div>
1006
  <div class='fvp-share-bar'><ul class="fvp-sharing">
1007
  <li><a class="sharing-facebook" href="https://www.facebook.com/sharer/sharer.php?u=" target="_blank">Facebook</a></li>
1101
  <button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Playlist</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class='hndle'><span>Playlist</span></h2>
1102
  <div class="inside">
1103
  <div class="flowplayer-wrapper">
1104
+ <div class="fp-playlist-external fv-playlist-design-2017 fp-playlist-horizontal fp-playlist-has-captions" rel="wpfp_1b7da827d9fee9aa6d5bb9c5dca973bf">
1105
  <a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/player.vimeo.com\/external\/196881410.hd.mp4?s=24645ecff21ff60079fc5b7715a97c00f90c6a18&profile_id=174&oauth2_token_id=3501005","type":"video\/mp4"}],"subtitles":[{"srclang":"en","label":"English","src":"http:\/\/example.org\/wp-content\/plugins\/fv-wordpress-flowplayer\/images\/test-subtitles.vtt"}]}'><div style='background-image: url("https://i.vimeocdn.com/video/608654918_295x166.jpg")'></div><h4><span>Foliovision Video</span></h4></a>
1106
  <a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/player.vimeo.com\/external\/224781088.sd.mp4?s=face4dbb990b462826c8e1e43a9c66c6a9bb5585&profile_id=165&oauth2_token_id=3501005","type":"video\/mp4"}]}'><div style='background-image: url("https://i.vimeocdn.com/video/643908843_295x166.jpg")'></div><h4><span>Lapinthrope Extras - Roy Thompson Hall Dance</span></h4></a>
1107
  <a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/player.vimeo.com\/external\/45864857.hd.mp4?s=94fddee594da3258c9e10355f5bad8173c4aee7b&profile_id=113&oauth2_token_id=3501005","type":"video\/mp4"}]}'><div style='background-image: url("https://i.vimeocdn.com/video/319116053_295x166.jpg")'></div><h4><span>Romeo and Juliet Ballet Schloss Kittsee</span></h4></a>
1234
  <div style="clear: both"></div>
1235
  </div>
1236
  </div>
1237
+ </div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="d28516cc79" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="3edef551d9" />
1238
  </div>
1239
  <div id='postbox-container-tab_hosting' class='postbox-container' style="">
1240
  <div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_description" class="postbox " >
1332
  </table>
1333
  </div>
1334
  </div>
1335
+ </div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="d28516cc79" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="3edef551d9" />
1336
  </div>
1337
  <div id='postbox-container-tab_actions' class='postbox-container' style="">
1338
  <div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_description" class="postbox " >
1591
  jQuery.ajax( {
1592
  type: "POST",
1593
  url: ajaxurl,
1594
+ data: aInputs.serialize()+'&key='+key+'&action=fv_player_email_subscription_save&_wpnonce=71bf337548',
1595
  success: function(response) {
1596
  button.css('visibility','hidden');
1597
  button.prop('disabled', false);
1691
  </table>
1692
  </div>
1693
  </div>
1694
+ </div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="d28516cc79" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="3edef551d9" />
1695
+ </div>
1696
+ <div id='postbox-container-tab_video_intelligence' class='postbox-container' style="">
1697
+ <div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_video_intelligence" class="postbox " >
1698
+ <button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: video intelligence</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class='hndle'><span>video intelligence</span></h2>
1699
+ <div class="inside">
1700
+ <style>
1701
+ #fv_flowplayer_video_intelligence_revival { display: none }
1702
+ </style>
1703
+ <input type="hidden" id="nonce_fv_player_vi_install" name="nonce_fv_player_vi_install" value="d9672c9ed6" /><input type="hidden" name="_wp_http_referer" value="" />
1704
+ <table class="form-table2" style="margin: 5px; ">
1705
+ <tbody>
1706
+ <tr>
1707
+ <td class="first">
1708
+ <img src="http://example.org/wp-content/plugins/fv-wordpress-flowplayer/images/vi-logo.svg" alt="video intelligence logo" />
1709
+ <a href="http://vi.ai/publisher-video-monetization/?aid=foliovision&email=&url=http://example.org&invtype=3#publisher_signup" target="_blank" class="button vi-register">Learn More</a>
1710
+ </td>
1711
+ <td>
1712
+ <p>Video content and video advertising – powered by <strong>video intelligence</strong></p>
1713
+ <p>Advertisers pay more for video advertising when it's matched with video content. This new video player will insert both on your page. It increases time on site, and commands a higher CPM than display advertising.</p>
1714
+ <p>You'll see video content that is matched to your sites keywords straight away. A few days after activation you'll begin to receive revenue from advertising served before this video content.</p>
1715
+ <ul>
1716
+ <li>The set up takes only a few minutes</li>
1717
+ <li>Up to 10x higher CPM than traditional display advertising</li>
1718
+ <li>Users spend longer on your site thanks to professional video content</li>
1719
+ </ul>
1720
+ </td>
1721
+ </tr>
1722
+ <tr>
1723
+ <td></td>
1724
+ <td>
1725
+ <p>By clicking sign up you agree to send your current domain, email and affiliate ID to video intelligence.</p>
1726
+ <a href="http://vi.ai/publisher-video-monetization/?aid=foliovision&email=&url=http://example.org&invtype=3#publisher_signup" target="_blank" class="button vi-register">Learn More or Create an Account</a>
1727
+ </td>
1728
+ </tr>
1729
+ </tbody>
1730
+ </table>
1731
+
1732
+ </div>
1733
+ </div>
1734
+ <div id="fv_flowplayer_video_intelligence_account" class="postbox " >
1735
+ <button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Account</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class='hndle'><span>Account</span></h2>
1736
+ <div class="inside">
1737
+ <input type="hidden" id="nonce_fv_player_vi_install" name="nonce_fv_player_vi_install" value="d9672c9ed6" /><input type="hidden" name="_wp_http_referer" value="" />
1738
+ <table class="form-table2" style="margin: 5px; ">
1739
+ <tbody>
1740
+ <tr>
1741
+ <td class="first"><label for="vi_login">Login:</label></td>
1742
+ <td>
1743
+ <p class="description">
1744
+ <input type="text" name="vi_login" id="vi_login" class="medium" />
1745
+ </p>
1746
+ </td>
1747
+ </tr>
1748
+ <tr>
1749
+ <td><label for="vi_pass">Password:</label></td>
1750
+ <td>
1751
+ <p class="description">
1752
+ <input type="password" name="vi_pass" id="vi_pass" class="medium" />
1753
+ </p>
1754
+ </td>
1755
+ </tr>
1756
+ <tr>
1757
+ <td>
1758
+ </td>
1759
+ <td>
1760
+ <input type="submit" name="fv_player_vi_install" value="Sign in" class="button-primary">
1761
+ </td>
1762
+ </tr>
1763
+ <tr>
1764
+ <td></td>
1765
+ <td>
1766
+ <p><a href="mailto:support@vi.ai?Subject=Issues%20with%20account%20activation%20for%20http%3A%2F%2Fexample.org">I'm having issues with the account activation</a></p>
1767
+ </td>
1768
+ </tr>
1769
+ </tbody>
1770
+ </table>
1771
+
1772
+
1773
+
1774
+ </div>
1775
+ </div>
1776
+ <div id="fv_flowplayer_video_intelligence_hide" class="postbox " >
1777
+ <button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Hide vi Ads</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class='hndle'><span>Hide vi Ads</span></h2>
1778
+ <div class="inside">
1779
+ <input id="fv-player-vi-remove" type="checkbox"> <label for="fv-player-vi-remove">Hide the vi Ads tab</label>
1780
+ <script>
1781
+ jQuery( function($) {
1782
+ $('#fv-player-vi-remove').click( function() {
1783
+ $.post(ajaxurl, {action:'fv-player-vi-remove'}, function() {
1784
+ $('#fv-player-vi-give-back').prop('checked',false);
1785
+ $('[href=#postbox-container-tab_video_intelligence]').hide();
1786
+ $('#fv_flowplayer_video_intelligence').hide();
1787
+ $('[href=#postbox-container-tab_video_ads]').click();
1788
+ $('#fv_flowplayer_video_intelligence_revival').show();
1789
+ });
1790
+
1791
+ });
1792
+ });
1793
+ </script>
1794
+ </div>
1795
+ </div>
1796
+ </div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="d28516cc79" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="3edef551d9" />
1797
  </div>
1798
  <div id='postbox-container-tab_help' class='postbox-container' style="">
1799
  <div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_usage" class="postbox " >
1873
  </table>
1874
  </div>
1875
  </div>
1876
+ </div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="d28516cc79" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="3edef551d9" />
1877
  </div>
1878
  <div style="clear: both"></div>
1879
  </div>
1880
+ <input type="hidden" id="fv_flowplayer_settings_nonce" name="fv_flowplayer_settings_nonce" value="6efb8df58f" /><input type="hidden" name="_wp_http_referer" value="" /> </form>
1881
 
1882
  </div>
1883
  <script type="text/javascript" >
1953
  var button = jQuery(this);
1954
  button.siblings('img').eq(0).show();
1955
 
1956
+ jQuery.post( ajaxurl, { action: 'fv_wp_flowplayer_activate_extension', nonce: 'a3b037f3a9', plugin: jQuery(this).attr("data-plugin") }, function( response ) {
1957
  button.siblings('img').eq(0).hide();
1958
 
1959
  var obj;
2069
 
2070
 
2071
 
2072
+ </script>
test/integration/backend/videointelligenceInstallTest.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require_once( dirname(__FILE__).'/../fv-player-unittest-case.php');
4
+
5
+ /**
6
+ * Tests WordPress integration of playlists without any advertisements present
7
+ * in the HTML markup.
8
+ */
9
+ final class FV_Player_videointelligenceInstallTestCase extends FV_Player_UnitTestCase {
10
+
11
+ var $directory = WP_CONTENT_DIR.'/plugins/fv-player-video-intelligence';
12
+
13
+ // we need to convince it is showing the FV Player settings screen!
14
+ public static function wpSetUpBeforeClass() {
15
+ set_current_screen( 'settings_page_fvplayer' );
16
+
17
+ parent::wpSetUpBeforeClass();
18
+
19
+ remove_action( 'admin_init', 'wp_admin_headers' );
20
+ do_action( 'admin_init' );
21
+ }
22
+
23
+ public function setUp() {
24
+ parent::setUp();
25
+
26
+ // add new user and create last saved position metadata for this new user
27
+ $this->userID = $this->factory->user->create(array(
28
+ 'role' => 'admin'
29
+ ));
30
+
31
+ }
32
+
33
+ public function testInstall() {
34
+
35
+ $this->assertTrue( defined('FV_PLAYER_VI_USER') && defined('FV_PLAYER_VI_PASS') );
36
+
37
+ // we need to submit a valid vi Ads login with an admin user capable of installing plugins
38
+ global $current_user;
39
+ wp_set_current_user($this->userID);
40
+ $current_user->add_cap( 'install_plugins' );
41
+
42
+ $_POST['vi_login'] = FV_PLAYER_VI_USER;
43
+ $_POST['vi_pass'] = FV_PLAYER_VI_PASS;
44
+ $_POST['fv_player_vi_install'] = true;
45
+ $_REQUEST['nonce_fv_player_vi_install'] = wp_create_nonce('fv_player_vi_install'); // notice the nonce goes into $_REQUEST
46
+
47
+ $this->assertFalse( file_exists($this->directory) );
48
+
49
+ do_action( 'admin_menu' );
50
+
51
+ $this->assertEquals( "FV Player video intelligence extension installed successfully!", get_option('fv_wordpress_flowplayer_deferred_notices') );
52
+
53
+ $this->assertFileExists( $this->directory );
54
+
55
+ do_action( 'admin_menu' );
56
+
57
+ $this->assertEquals( "FV Player video intelligence extension upgraded successfully!", get_option('fv_wordpress_flowplayer_deferred_notices') );
58
+ }
59
+
60
+ public function tearDown() {
61
+ unset($_POST['vi_login']);
62
+ unset($_POST['vi_pass']);
63
+ unset($_POST['fv_player_vi_install']);
64
+ unset($_REQUEST['nonce_fv_player_vi_install']);
65
+
66
+ if( strlen($this->directory) > 10 ) {
67
+ $this->removeDirectory($this->directory);
68
+ }
69
+ }
70
+
71
+ private function removeDirectory($path) {
72
+ $files = glob($path . '/*');
73
+ foreach ($files as $file) {
74
+ is_dir($file) ? $this->removeDirectory($file) : unlink($file);
75
+ }
76
+ rmdir($path);
77
+ return;
78
+ }
79
+
80
+ }
test/integration/fv-player-unittest-case.php CHANGED
@@ -14,6 +14,7 @@ abstract class FV_Player_UnitTestCase extends WP_UnitTestCase {
14
  public function fix_newlines( $html ) {
15
  $html = preg_replace( '/(id|rel)="wpfp_[^"]+"/', '$1="some-test-hash"', $html);
16
  $html = preg_replace( '~<input type="hidden" id="([^"]*?)nonce" name="([^"]*?)nonce" value="([^"]*?)" />~', '<input type="hidden" id="$1nonce" name="$2nonce" value="XYZ" />', $html);
 
17
  $html = preg_replace( "~nonce: '([^']*?)'~", "nonce: 'XYZ'", $html);
18
 
19
  // testProfileScreen
14
  public function fix_newlines( $html ) {
15
  $html = preg_replace( '/(id|rel)="wpfp_[^"]+"/', '$1="some-test-hash"', $html);
16
  $html = preg_replace( '~<input type="hidden" id="([^"]*?)nonce" name="([^"]*?)nonce" value="([^"]*?)" />~', '<input type="hidden" id="$1nonce" name="$2nonce" value="XYZ" />', $html);
17
+ $html = preg_replace( '~<input type="hidden" id="nonce_([^"]*?)" name="nonce_([^"]*?)" value="([^"]*?)" />~', '<input type="hidden" id="nonce_$1" name="nonce_$2" value="XYZ" />', $html);
18
  $html = preg_replace( "~nonce: '([^']*?)'~", "nonce: 'XYZ'", $html);
19
 
20
  // testProfileScreen
view/admin-beta.php CHANGED
@@ -1637,7 +1637,7 @@ add_meta_box( 'fv_flowplayer_usage', __('Usage', 'fv-wordpress-flowplayer'), 'fv
1637
  <p id="fv_flowplayer_admin_buttons">
1638
  <?php if( $aCheck && isset($aCheck->valid) && $aCheck->valid ) : ?>
1639
  <?php
1640
- $fv_player_pro_path = fv_flowplayer_get_extension_path('fv-player-pro');
1641
  if( is_plugin_inactive($fv_player_pro_path) && !is_wp_error(validate_plugin($fv_player_pro_path)) ) : ?>
1642
  <input type="button" class='button fv-license-yellow fv_wp_flowplayer_activate_extension' data-plugin="<?php echo $fv_player_pro_path; ?>" value="<?php _e('Enable the Pro extension', 'fv-wordpress-flowplayer'); ?>" /> <img style="display: none; " src="<?php echo site_url(); ?>/wp-includes/images/wpspin.gif" width="16" height="16" />
1643
  <?php elseif( is_plugin_active($fv_player_pro_path) && !is_wp_error(validate_plugin($fv_player_pro_path)) ) : ?>
1637
  <p id="fv_flowplayer_admin_buttons">
1638
  <?php if( $aCheck && isset($aCheck->valid) && $aCheck->valid ) : ?>
1639
  <?php
1640
+ $fv_player_pro_path = FV_Wordpress_Flowplayer_Plugin::get_plugin_path('fv-player-pro');
1641
  if( is_plugin_inactive($fv_player_pro_path) && !is_wp_error(validate_plugin($fv_player_pro_path)) ) : ?>
1642
  <input type="button" class='button fv-license-yellow fv_wp_flowplayer_activate_extension' data-plugin="<?php echo $fv_player_pro_path; ?>" value="<?php _e('Enable the Pro extension', 'fv-wordpress-flowplayer'); ?>" /> <img style="display: none; " src="<?php echo site_url(); ?>/wp-includes/images/wpspin.gif" width="16" height="16" />
1643
  <?php elseif( is_plugin_active($fv_player_pro_path) && !is_wp_error(validate_plugin($fv_player_pro_path)) ) : ?>
view/admin.php CHANGED
@@ -1352,7 +1352,6 @@ $fv_player_aSettingsTabs = array(
1352
  array('id' => 'fv_flowplayer_settings_hosting', 'hash' => 'tab_hosting', 'name' => __('Hosting', 'fv-wordpress-flowplayer') ),
1353
  array('id' => 'fv_flowplayer_settings_actions', 'hash' => 'tab_actions', 'name' => __('Actions', 'fv-wordpress-flowplayer') ),
1354
  array('id' => 'fv_flowplayer_settings_video_ads', 'hash' => 'tab_video_ads', 'name' => __('Video Ads', 'fv-wordpress-flowplayer') ),
1355
- array('id' => 'fv_flowplayer_settings_help', 'hash' => 'tab_help', 'name' => __('Help', 'fv-wordpress-flowplayer') ),
1356
  );
1357
 
1358
  //unset video ads tab for Legacy PRO player
@@ -1364,6 +1363,8 @@ if(version_compare( str_replace( '.beta','',get_option( 'fv_player_pro_ver' ) ),
1364
 
1365
  $fv_player_aSettingsTabs = apply_filters('fv_player_admin_settings_tabs',$fv_player_aSettingsTabs);
1366
 
 
 
1367
  /* Setup tab */
1368
  add_meta_box( 'fv_flowplayer_description', ' ', 'fv_flowplayer_admin_description', 'fv_flowplayer_settings', 'normal', 'high' );
1369
  add_meta_box( 'fv_flowplayer_interface_options', __('Post Interface Options', 'fv-wordpress-flowplayer'), 'fv_flowplayer_admin_interface_options', 'fv_flowplayer_settings', 'normal' );
@@ -1431,7 +1432,7 @@ add_meta_box( 'fv_flowplayer_usage', __('Usage', 'fv-wordpress-flowplayer'), 'fv
1431
  <p id="fv_flowplayer_admin_buttons">
1432
  <?php if( $aCheck && isset($aCheck->valid) && $aCheck->valid ) : ?>
1433
  <?php
1434
- $fv_player_pro_path = fv_flowplayer_get_extension_path('fv-player-pro');
1435
  if( is_plugin_inactive($fv_player_pro_path) && !is_wp_error(validate_plugin($fv_player_pro_path)) ) : ?>
1436
  <input type="button" class='button fv-license-yellow fv_wp_flowplayer_activate_extension' data-plugin="<?php echo $fv_player_pro_path; ?>" value="<?php _e('Enable the Pro extension', 'fv-wordpress-flowplayer'); ?>" /> <img style="display: none; " src="<?php echo site_url(); ?>/wp-includes/images/wpspin.gif" width="16" height="16" />
1437
  <?php elseif( is_plugin_active($fv_player_pro_path) && !is_wp_error(validate_plugin($fv_player_pro_path)) ) : ?>
1352
  array('id' => 'fv_flowplayer_settings_hosting', 'hash' => 'tab_hosting', 'name' => __('Hosting', 'fv-wordpress-flowplayer') ),
1353
  array('id' => 'fv_flowplayer_settings_actions', 'hash' => 'tab_actions', 'name' => __('Actions', 'fv-wordpress-flowplayer') ),
1354
  array('id' => 'fv_flowplayer_settings_video_ads', 'hash' => 'tab_video_ads', 'name' => __('Video Ads', 'fv-wordpress-flowplayer') ),
 
1355
  );
1356
 
1357
  //unset video ads tab for Legacy PRO player
1363
 
1364
  $fv_player_aSettingsTabs = apply_filters('fv_player_admin_settings_tabs',$fv_player_aSettingsTabs);
1365
 
1366
+ $fv_player_aSettingsTabs[] = array('id' => 'fv_flowplayer_settings_help', 'hash' => 'tab_help', 'name' => __('Help', 'fv-wordpress-flowplayer') );
1367
+
1368
  /* Setup tab */
1369
  add_meta_box( 'fv_flowplayer_description', ' ', 'fv_flowplayer_admin_description', 'fv_flowplayer_settings', 'normal', 'high' );
1370
  add_meta_box( 'fv_flowplayer_interface_options', __('Post Interface Options', 'fv-wordpress-flowplayer'), 'fv_flowplayer_admin_interface_options', 'fv_flowplayer_settings', 'normal' );
1432
  <p id="fv_flowplayer_admin_buttons">
1433
  <?php if( $aCheck && isset($aCheck->valid) && $aCheck->valid ) : ?>
1434
  <?php
1435
+ $fv_player_pro_path = FV_Wordpress_Flowplayer_Plugin::get_plugin_path('fv-player-pro');
1436
  if( is_plugin_inactive($fv_player_pro_path) && !is_wp_error(validate_plugin($fv_player_pro_path)) ) : ?>
1437
  <input type="button" class='button fv-license-yellow fv_wp_flowplayer_activate_extension' data-plugin="<?php echo $fv_player_pro_path; ?>" value="<?php _e('Enable the Pro extension', 'fv-wordpress-flowplayer'); ?>" /> <img style="display: none; " src="<?php echo site_url(); ?>/wp-includes/images/wpspin.gif" width="16" height="16" />
1438
  <?php elseif( is_plugin_active($fv_player_pro_path) && !is_wp_error(validate_plugin($fv_player_pro_path)) ) : ?>