Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
d34281a
conversion: refactor use abstract iteration & html build
May 31, 2023
03c93ea
conversion: use generic name function
May 31, 2023
264f2dd
conversion: implement get_count in abstract class
May 31, 2023
2a224aa
conversion: rename posts to items in base class
May 31, 2023
138bff7
conversion: init convert_error
May 31, 2023
f6bdb4c
conversion: ajax limit add TODO
May 31, 2023
44409b5
conversion: implement conversion of meta positions to new table - WIP
May 31, 2023
080c9d9
conversion: table fix, output, error
Jun 1, 2023
ad3706c
conversion: insert update $res to boolean, fix typos
Jun 1, 2023
7490fad
Merge branch '5982615545-position-conversion' of https://github.com/f…
Jun 2, 2023
7c105a8
conversion: custom limit, custom start warning, bugfix
Jun 2, 2023
dc7747a
conversion: video id matcher improve
Jun 2, 2023
5bfa204
positions table: legacy_video_id add index
Jun 2, 2023
0dc14cd
conversion: order items by umeta_id ASC
Jun 2, 2023
50838b7
conversion: pointer box
Jun 2, 2023
af5bc14
conversion: pointer box: Improving text, fixing syntax
fvmartin Jun 2, 2023
71bef64
Merge branch '5982615545-position-conversion' of https://github.com/f…
Jun 2, 2023
eee1ed1
conversion: set pointer box to true on page
Jun 2, 2023
b619dc6
conversion: Fix bad offset calculation
fvmartin Jun 8, 2023
8d95734
conversion: get_items query optimize, meta conversion dont use checkb…
Jun 8, 2023
197e32f
conversion: use cache for user positions select
Jun 8, 2023
59f4dc2
conversion: store conversion finished time when no error
Jun 8, 2023
e6c1ac1
Merge branch '5982615545-position-conversion' of https://github.com/f…
Jun 9, 2023
335529f
Revert "conversion: use cache for user positions select"
Jun 9, 2023
c6b7a39
conversion: always store conversion finished time
Jun 9, 2023
7559e08
conversion: memory usage in response
Jun 9, 2023
39d8d89
position save: use cache
Jun 9, 2023
2609685
position save: sort in sql
Jun 9, 2023
8853ec2
conversion: set limit to 2500
Jun 9, 2023
925bcbd
conversion: meta show only errors, conversion finished message & det…
Jun 12, 2023
ec0201f
positions: cache playlist positions for users
Jun 12, 2023
4aae801
related videos: get videos from related posts & popup - WIP
Jun 13, 2023
131c2a5
related videos: sql prefix & comment
Jun 13, 2023
7232d37
Merge branch '5982615545-position-conversion' of https://github.com/f…
Jun 14, 2023
efbca1c
related videos: img style, yarpp args, skip empty
Jun 14, 2023
e261551
related videos: use limit
Jun 14, 2023
dd1c9e4
Merge branch '5982615545-position-conversion' of https://github.com/f…
Jun 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 69 additions & 44 deletions controller/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ function fv_wp_flowplayer_after_plugin_row( $arg) {
if( apply_filters('fv_player_skip_ads',false) ) {
return;
}

$args = func_get_args();
if( $args[1]['Name'] == 'FV Player' ) {

if( $args[1]['Name'] == 'FV Player' ) {
$options = get_option( 'fvwpflowplayer' );
if( $options['key'] == 'false' || $options['key'] == '' ) :
?>
Expand Down Expand Up @@ -143,13 +143,13 @@ function fv_player_settings_save() {
$_GET['post_mime_type'] = 'image';
}
}

if( isset($_POST['fv-wp-flowplayer-submit']) ) {
check_admin_referer('fv_flowplayer_settings_nonce','fv_flowplayer_settings_nonce');

global $fv_fp;
if( method_exists($fv_fp,'_set_conf') ) {
if(
if(
// pro not installed or
!function_exists('FV_Player_Pro') ||
// pro installed and version is at least 7.5.25.728
Expand Down Expand Up @@ -189,9 +189,9 @@ function fv_player_handle_secrets($new, $old) {
}
}
} else if($v == '1') { // single value, 1 - keep original, 0 - use new
$new[$key] = $old[$key];
$new[$key] = $old[$key];
}
}
}

unset($new[$k]); // remove _is_secret_
}
Expand All @@ -206,12 +206,27 @@ function fv_player_handle_secrets($new, $old) {
/*
* Pointer boxes
*/
add_action('admin_init', 'fv_player_admin_pointer_boxes');
add_action('admin_footer', 'fv_player_admin_pointer_boxes');

function fv_player_admin_pointer_boxes() {
global $fv_fp;
global $fv_wp_flowplayer_ver, $fv_wp_flowplayer_core_ver;

if(
$fv_fp->_get_option('video_position_save_enable') &&
! $fv_fp->_get_option('notice_user_video_positions_conversion')
) {
$fv_fp->pointer_boxes['fv_flowplayer_video_positions_conversion'] = array(
'id' => '#wp-admin-bar-new-content',
'pointerClass' => 'fv_flowplayer_video_positions_conversion',
'heading' => __('FV Player Video Position Conversion', 'fv-wordpress-flowplayer'),
'content' => __("<p>In this new version of FV Player the user video positions are stored in separate table. This avoids slowing down the user database (wp_usermeta).</p><p>Please run the tool to migrate the video positions to the new table.</p>"),
'position' => array( 'edge' => 'top', 'align' => 'left' ),
'button1' => __('Migrate', 'fv-wordpress-flowplayer'),
'function1' => 'location.href = "' . admin_url('admin.php?page=fv_player_conversion_positions_meta2table') . '"',
);
}

if(
isset($fv_fp->conf['disable_videochecker']) && $fv_fp->conf['disable_videochecker'] == 'false' &&
( !isset($fv_fp->conf['video_checker_agreement']) || $fv_fp->conf['video_checker_agreement'] != 'true' )
Expand All @@ -226,7 +241,7 @@ function fv_player_admin_pointer_boxes() {
'button2' => __('Disable the video checker', 'fv-wordpress-flowplayer')
);
}

if( !$fv_fp->_get_option('notice_7_5') ) {
$fv_fp->pointer_boxes['fv_flowplayer_notice_7_5'] = array(
'id' => '#wp-admin-bar-new-content',
Expand All @@ -244,7 +259,7 @@ function fv_player_admin_pointer_boxes() {
'button1' => __('Thanks for letting me know!', 'fv-wordpress-flowplayer')
);
}

if( !$fv_fp->_get_option('notice_new_lightbox') ) {
$fv_fp->pointer_boxes['fv_flowplayer_new_lightbox'] = array(
'id' => '#wp-admin-bar-new-content',
Expand All @@ -255,7 +270,7 @@ function fv_player_admin_pointer_boxes() {
'button1' => __('Thanks for letting me know!', 'fv-wordpress-flowplayer')
);
}

if( !$fv_fp->_get_option('notice_db') ) {
$fv_fp->pointer_boxes['fv_flowplayer_db'] = array(
'id' => '#wp-admin-bar-new-content',
Expand All @@ -266,7 +281,7 @@ function fv_player_admin_pointer_boxes() {
'button1' => __('Thanks for letting me know!', 'fv-wordpress-flowplayer')
);
}

if( $fv_fp->_get_option('video_sitemap') && !$fv_fp->_get_option('disableembedding') && !$fv_fp->_get_option('notice_xml_sitemap_iframes') ) {
$fv_fp->pointer_boxes['fv_flowplayer_notice_xml_sitemap_iframes'] = array(
'id' => '#wp-admin-bar-new-content',
Expand All @@ -278,8 +293,8 @@ function fv_player_admin_pointer_boxes() {
'button2' => __('Go to setting', 'fv-wordpress-flowplayer'),
'function2' => 'location.href = "'.admin_url('options-general.php?page=fvplayer').'#fv_flowplayer_seo"',
);
}
}

if( !$fv_fp->_get_option('notice_db') && !$fv_fp->_get_option('nag_fv_player_7') ) {
$fv_fp->pointer_boxes['fv_flowplayer_fv_player_7'] = array(
'id' => '#wp-admin-bar-new-content',
Expand All @@ -297,11 +312,11 @@ function fv_player_admin_pointer_boxes() {
'button1' => __('Thanks for letting me know!', 'fv-wordpress-flowplayer'),
);
}
if(
(stripos( $_SERVER['REQUEST_URI'], '/plugins.php') !== false ||fv_player_is_admin_screen() )
&& $pnotices = get_option('fv_wordpress_flowplayer_persistent_notices')
) {

if(
(stripos( $_SERVER['REQUEST_URI'], '/plugins.php') !== false ||fv_player_is_admin_screen() )
&& $pnotices = get_option('fv_wordpress_flowplayer_persistent_notices')
) {
$fv_fp->pointer_boxes['fv_flowplayer_license_expired'] = array(
'id' => '#wp-admin-bar-new-content',
'pointerClass' => 'fv_flowplayer_license_expired',
Expand All @@ -311,9 +326,9 @@ function fv_player_admin_pointer_boxes() {
'position' => array( 'edge' => 'top', 'align' => 'center' ),
'button1' => __('Hide this notice', 'fv-wordpress-flowplayer'),
'button2' => __('I\'ll check this later', 'fv-wordpress-flowplayer')
);
);
}

/*if( !$fv_fp->_get_option('disable_video_hash_links') && !$fv_fp->_get_option('notification_video_links') ) {
$fv_fp->pointer_boxes['fv_player_notification_video_links'] = array(
'id' => '#wp-admin-bar-new-content',
Expand All @@ -324,7 +339,7 @@ function fv_player_admin_pointer_boxes() {
'button1' => __('Open Settings', 'fv-wordpress-flowplayer'),
'button2' => __('Dismiss', 'fv-wordpress-flowplayer')
);

add_action( 'admin_print_footer_scripts', 'fv_player_pointer_scripts' );
}*/
}
Expand All @@ -335,7 +350,7 @@ function fv_player_admin_pointer_boxes() {
add_action( 'wp_ajax_fv_foliopress_ajax_pointers', 'fv_wp_flowplayer_pointers_ajax' );

function fv_wp_flowplayer_pointers_ajax() {

if( isset($_POST['key']) && $_POST['key'] == 'fv_flowplayer_video_checker_service' && isset($_POST['value']) ) {
check_ajax_referer('fv_flowplayer_video_checker_service');
$conf = get_option( 'fvwpflowplayer' );
Expand All @@ -350,13 +365,23 @@ function fv_wp_flowplayer_pointers_ajax() {
}
die();
}


if( isset($_POST['key']) && $_POST['key'] == 'fv_flowplayer_video_positions_conversion' && isset($_POST['value']) ) {
check_ajax_referer('fv_flowplayer_video_positions_conversion');
$conf = get_option( 'fvwpflowplayer' );
if( $conf ) {
$conf['notice_user_video_positions_conversion'] = $_POST['value'];
update_option( 'fvwpflowplayer', $conf );
}
die();
}

if( isset($_POST['key']) && $_POST['key'] == 'fv_flowplayer_license_expired' && isset($_POST['value']) && $_POST['value'] === 'true' ) {
check_ajax_referer('fv_flowplayer_license_expired');
delete_option("fv_wordpress_flowplayer_persistent_notices");
die();
}
}

$notices = array(
'fv_flowplayer_notice_7_5' => 'notice_7_5',
'fv_flowplayer_new_lightbox' => 'notice_new_lightbox',
Expand All @@ -365,7 +390,7 @@ function fv_wp_flowplayer_pointers_ajax() {
'fv_flowplayer_fv_player_7' => 'nag_fv_player_7',
'fv_player_notification_video_links' => 'notification_video_links',
);

if( isset($_POST['key']) && isset($_POST['value']) && in_array($_POST['key'], array_keys($notices) ) ) {
check_ajax_referer($_POST['key']);
$conf = get_option( 'fvwpflowplayer' );
Expand All @@ -375,7 +400,7 @@ function fv_wp_flowplayer_pointers_ajax() {
}
die();
}

}


Expand All @@ -390,7 +415,7 @@ function fv_player_pointer_scripts() {
window.location = '<?php echo site_url('wp-admin/options-general.php?page=fvplayer'); ?>#playlist_advance';
});
});
})(jQuery);
})(jQuery);
</script>
<?php
}
Expand All @@ -407,14 +432,14 @@ function fv_flowplayer_admin_scripts() {
global $fv_wp_flowplayer_ver;
if( fv_player_is_admin_screen() ) {
wp_enqueue_media();

wp_enqueue_script('wp-theme-plugin-editor');
wp_enqueue_style('wp-codemirror');

wp_enqueue_script('common');
wp_enqueue_script('wp-lists');
wp_enqueue_script('postbox');

wp_enqueue_script('jquery-minicolors', flowplayer::get_plugin_url().'/js/jquery-minicolors/jquery.minicolors.min.js',array('jquery'), $fv_wp_flowplayer_ver );
wp_enqueue_script('fv-player-admin', flowplayer::get_plugin_url().'/js/admin.js',array('jquery','jquery-minicolors'), filemtime( (__DIR__).'/../js/admin.js' ), true );

Expand All @@ -429,13 +454,13 @@ function fv_flowplayer_admin_scripts() {

add_action('admin_head', 'flowplayer_admin_head');

function flowplayer_admin_head() {
function flowplayer_admin_head() {
if( !fv_player_is_admin_screen() ) return;

global $fv_wp_flowplayer_ver;
wp_enqueue_style('fv-player-admin', flowplayer::get_plugin_url().'/css/license.css',array(), $fv_wp_flowplayer_ver );
wp_enqueue_style('jquery-minicolors', flowplayer::get_plugin_url().'/js/jquery-minicolors/jquery.minicolors.css',array(), $fv_wp_flowplayer_ver );
?>
?>
<script>
jQuery(window).on('unload', function(){
window.fv_flowplayer_wp = window.wp;
Expand All @@ -451,7 +476,7 @@ function flowplayer_admin_head() {

function flowplayer_admin_footer() {
if( !fv_player_is_admin_screen() ) return;

flowplayer_prepare_scripts();
flowplayer_display_scripts();
}
Expand All @@ -462,8 +487,8 @@ function flowplayer_admin_footer() {
add_action('admin_print_footer_scripts', 'flowplayer_admin_footer_wp_js_restore', 999999 );

function flowplayer_admin_footer_wp_js_restore() {
if( !fv_player_is_admin_screen() ) return;
if( !fv_player_is_admin_screen() ) return;

?>
<script>
jQuery(window).on('unload', function(){
Expand All @@ -486,27 +511,27 @@ function fv_player_get_aws_regions($translation_domain = 'fv-wordpress-flowplaye
'ap-southeast-1' => __('Asia Pacific (Singapore)', $translation_domain),
'ap-southeast-2' => __('Asia Pacific (Sydney)', $translation_domain),
'ap-northeast-1' => __('Asia Pacific (Tokyo)', $translation_domain),

'ca-central-1' => __('Canada (Central)', $translation_domain),

'cn-north-1' => __('China (Beijing)', $translation_domain),
'cn-northwest-1' => __('China (Ningxia)', $translation_domain),

'eu-central-1' => __('Europe (Frankfurt)', $translation_domain),
'eu-west-1' => __('Europe (Ireland)', $translation_domain),
'eu-west-2' => __('Europe (London)', $translation_domain),
'eu-south-1' => __('Europe (Milan)', $translation_domain),
'eu-west-3' => __('Europe (Paris)', $translation_domain),
'eu-north-1' => __('Europe (Stockholm)', $translation_domain),

'me-south-1' => __('Middle East (Bahrain)', $translation_domain),

'sa-east-1' => __('South America (S&atilde;o Paulo)', $translation_domain),

'us-west-1' => __('US West (N. California)', $translation_domain),
'us-east-1' => __('US East (N. Virginia)', $translation_domain),
'us-east-2' => __('US East (Ohio)', $translation_domain),
'us-west-2' => __('US West (Oregon)', $translation_domain)

);
}
7 changes: 5 additions & 2 deletions flowplayer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
}

global $fv_wp_flowplayer_ver;
$fv_wp_flowplayer_ver = '7.9.3.24';
$fv_wp_flowplayer_ver = '7.9.3.25';
$fv_wp_flowplayer_core_ver = '7.2.14.11';
include_once( dirname( __FILE__ ) . '/includes/extra-functions.php' );
if( file_exists( dirname( __FILE__ ) . '/includes/module.php' ) ) {
Expand Down Expand Up @@ -96,7 +96,7 @@
if( version_compare(phpversion(),'5.5.0') != -1 ) {
include_once(dirname( __FILE__ ) . '/models/media-browser.php');
}

if( version_compare(phpversion(),'7.3.5') != -1 ) {
include_once(dirname( __FILE__ ) . '/models/media-browser-s3.php');

Expand All @@ -106,6 +106,7 @@

include_once(dirname( __FILE__ ). '/models/conversion/conversion-base.class.php');
include_once(dirname( __FILE__ ). '/models/conversion/shortcode2DB.class.php');
include_once(dirname( __FILE__ ). '/models/conversion/positionsMeta2Table.php');
include_once(dirname( __FILE__ ) . '/models/conversion.php');
include_once( dirname( __FILE__ ) .'/models/splash-download.php');

Expand All @@ -128,6 +129,8 @@

include_once(dirname( __FILE__ ) . '/models/youtube.php');

include_once(dirname( __FILE__ ) . '/models/related-videos.php');

add_action('plugins_loaded', 'fv_player_bunny_stream_include' );

if( !function_exists( 'fv_player_bunny_stream_include' ) && version_compare(PHP_VERSION, '5.2.17') >= 0 ) {
Expand Down
Loading