' ) ) { $msg = sprintf( __( 'Your ARVE Pro Addon is outdated, you need version %s or later. If you have setup your license here semi auto updates (Admin panel notice and auto install on confirmation) should work again. If not please report it and manually update as described here. I am sorry for the many manual updates with .zip file you had to do in the past. It came to my attention to late that this was actually not working, partly because customers bravely just did the manual update without saying a word. For beta versions the manual update is still needed but until this is supported by EDD (its in the works)', ARVE_SLUG ), ARVE_PRO_VERSION_REQUIRED, get_admin_url() . 'admin.php?page=nextgenthemes-licenses', 'https://nextgenthemes.com/support/', 'https://nextgenthemes.com/plugins/advanced-responsive-video-embedder-pro/documentation/installing-and-license-management/' ); new ARVE_Admin_Notice_Factory( 'arve-pro-outdated', "
$msg
", false ); } $pro_ad_message = arve_get_pro_ad(); if( $pro_ad_message ) { new ARVE_Admin_Notice_Factory( 'arve_dismiss_pro_notice', $pro_ad_message, true ); } } function arve_get_pro_ad() { $inst = (int) get_option( 'arve_install_date' ); if ( ! current_user_can( 'update_plugins' ) || ! apply_filters( 'arve_pro_ad', true ) || current_time( 'timestamp' ) < strtotime( '+1 week', $inst ) ) { return false; } $pro_message = __( 'This is Nico(las Jonas) the Author of the Advanced Responsive Video Embedder plugin. When you buy the Pro Addon for this plugin you will get this:
', ARVE_SLUG ); $pro_message .= file_get_contents( plugin_dir_path( dirname( __FILE__ ) ) . 'readme/description-features-pro.html' ); $pro_message = str_replace( '' . $args['description'] . '
'; } echo $out; } function arve_textarea( $args ) { unset( $args['input_attr']['type'] ); $out = sprintf( '', arve_attr( $args['input_attr'] ) ); if ( ! empty( $args['description'] ) ) { $out = $out . '' . $args['description'] . '
'; } echo $out; } function arve_select( $args ) { unset( $args['input_attr']['type'] ); foreach ( $args['option_values']['options'] as $key => $value ) { if ( 2 === count( $args['option_values']['options'] ) && array_key_exists( 'yes', $args['option_values']['options'] ) && array_key_exists( 'no', $args['option_values']['options'] ) ) { $current_option = $args['input_attr']['value'] ? 'yes' : 'no'; } else { $current_option = $args['input_attr']['value']; } $options[] = sprintf( '', esc_attr( $key ), selected( $current_option, $key, false ), esc_html( $value ) ); } $select_attr = $args['input_attr']; unset( $select_attr['value'] ); $out = sprintf( '', arve_attr( $select_attr ), implode( '', $options ) ); if ( ! empty( $args['description'] ) ) { $out = $out . '' . $args['description'] . '
'; } echo $out; } /** * * * @since 2.6.0 */ function arve_register_settings() { $options = arve_get_options(); // Main $main_title = __( 'Main Options', ARVE_SLUG ); add_settings_section( 'main_section', sprintf( '%s', esc_attr( $main_title ), esc_html( $main_title ) ), null, ARVE_SLUG ); foreach( arve_get_settings_definitions() as $key => $value ) { if ( ! empty( $value['hide_from_settings'] ) ) { continue; }; if ( empty( $value['meta'] ) ) { $value['meta'] = array(); }; if ( isset( $value['options'][''] ) ) { unset( $value['options'][''] ); } if( in_array( $value['type'], array( 'text', 'number', 'url' ) ) ) { $callback_function = 'arve_input'; } else { $callback_function = 'arve_' . $value['type']; } add_settings_field( "arve_options_main[{$value['attr']}]", // ID $value['label'], // title $callback_function, // callback ARVE_SLUG, // page 'main_section', // section array( // args 'label_for' => ( 'radio' === $value['type'] ) ? null : "arve_options_main[{$value['attr']}]", 'input_attr' => $value['meta'] + array( 'type' => $value['type'], 'value' => $options[ $value['attr'] ], 'id' => "arve_options_main[{$value['attr']}]", 'name' => "arve_options_main[{$value['attr']}]", ), 'description' => ! empty( $value['description'] ) ? $value['description'] : null, 'option_values' => $value, ) ); } add_settings_field( 'arve_options_main[reset]', null, "arve_submit_reset", ARVE_SLUG, 'main_section', array( 'reset_name' => 'arve_options_main[reset]', ) ); // Params $params_title = __( 'URL Parameters', ARVE_SLUG ); add_settings_section( 'params_section', sprintf( '%s', esc_attr( $params_title ), esc_html( $params_title ) ), 'arve_params_section_description', ARVE_SLUG ); // Options foreach ( $options['params'] as $provider => $params ) { add_settings_field( "arve_options_params[$provider]", ucfirst ( $provider ), 'arve_input', ARVE_SLUG, 'params_section', array( 'label_for' => "arve_options_params[$provider]", 'input_attr' => array( 'type' => 'text', 'value' => $params, 'id' => "arve_options_params[$provider]", 'name' => "arve_options_params[$provider]", 'class' => 'large-text' ), ) ); } add_settings_field( 'arve_options_params[reset]', null, 'arve_submit_reset', ARVE_SLUG, 'params_section', array( 'reset_name' => 'arve_options_params[reset]', ) ); // Shortcode Tags $shortcodes_title = __( 'Shortcode Tags', ARVE_SLUG ); add_settings_section( 'shortcodes_section', sprintf( '%s', esc_attr( $shortcodes_title ), esc_html( $shortcodes_title ) ), 'arve_shortcodes_section_description', ARVE_SLUG ); foreach ( $options['shortcodes'] as $provider => $shortcode ) { add_settings_field( "arve_options_shortcodes[$provider]", ucfirst ( $provider ), 'arve_input', ARVE_SLUG, 'shortcodes_section', array( 'label_for' => "arve_options_shortcodes[$provider]", 'input_attr' => array( 'type' => 'text', 'value' => $shortcode, 'id' => "arve_options_shortcodes[$provider]", 'name' => "arve_options_shortcodes[$provider]", 'class' => 'medium-text' ), ) ); } add_settings_field( 'arve_options_shortcodes[reset]', null, 'arve_submit_reset', ARVE_SLUG, 'shortcodes_section', array( 'reset_name' => 'arve_options_shortcodes[reset]', ) ); // register_setting( $option_group, $option_name, $sanitize_callback ) register_setting( 'arve-settings-group', 'arve_options_main', 'arve_validate_options_main' ); register_setting( 'arve-settings-group', 'arve_options_params', 'arve_validate_options_params' ); register_setting( 'arve-settings-group', 'arve_options_shortcodes', 'arve_validate_options_shortcodes' ); } /** * * * @since 6.0.6 */ function arve_register_settings_debug() { // Debug Information $debug_title = __( 'Debug Info', ARVE_SLUG ); add_settings_section( 'debug_section', sprintf( '%s', esc_attr( $debug_title ), esc_html( $debug_title ) ), 'arve_debug_section_description', ARVE_SLUG ); } function arve_submit_reset( $args ) { submit_button( __('Save Changes' ), 'primary','submit', false ); echo ' '; submit_button( __('Reset This Settings Section', 'advanced-responsive-video-embedder' ), 'secondary', $args['reset_name'], false ); } function arve_shortcodes_section_description() { $desc = __( 'This shortcodes exist for backwards compatiblity only. It is not recommended to use them at all, please use the[arve] shortcode. You can change the old shortcode tags here. You may need this to prevent conflicts with other plugins you want to use.', ARVE_SLUG );
echo "$desc
"; } function arve_params_section_description() { $url = 'https://nextgenthemes.com/advanced-responsive-video-embedder-pro/documentation'; $desc = sprintf( __( 'Please read the documentation in how this settings work. Do not removewmode=transparent, this will make some modes fail to work.',
ARVE_SLUG ),
esc_url( $url )
);
echo "$desc
"; ?>&. They will be transformed to two spaces after save. Resources: ", ARVE_SLUG); ?> Youtube Parameters, Dailymotion Parameters, Vimeo Parameters. wmode=transparent should not be changed/removed", ARVE_SLUG); ?>
100 ) { $output['video_maxwidth'] = (int) $input['video_maxwidth']; } else { $output['video_maxwidth'] = ''; } if( (int) $input['align_maxwidth'] > 100 ) { $output['align_maxwidth'] = (int) $input['align_maxwidth']; } $options_defaults = arve_get_options_defaults( 'main' ); //* Store only the options in the database that are different from the defaults. return array_diff_assoc( $output, $options_defaults ); } function arve_validate_options_params( $input ) { //* Storing the Options Section as a empty array will cause the plugin to use defaults if( isset( $input['reset'] ) ) { return array(); } $output = array(); foreach ( $input as $key => $var ) { $output[ $key ] = preg_replace( '!\s+!', '&', trim( $var ) ); $output[ $key ] = preg_replace( '!\s+!', '&', trim( $var ) ); } $options_defaults = arve_get_options_defaults( 'params' ); //* Store only the options in the database that are different from the defaults. return array_diff_assoc( $output, $options_defaults ); } function arve_validate_options_shortcodes( $input ) { $output = array(); //* Storing the Options Section as a empty array will cause the plugin to use defaults if( isset( $input['reset'] ) ) { return array(); } foreach ( $input as $key => $var ) { $var = preg_replace( '/[_]+/', '_', $var ); // remove multiple underscores $var = preg_replace( '/[^A-Za-z0-9_]/', '', $var ); // strip away everything except a-z,0-9 and underscores if ( strlen($var) < 3 ) { continue; } $output[ $key ] = $var; } $options_defaults = arve_get_options_defaults( 'shortcodes' ); //* Store only the options in the database that are different from the defaults. return array_diff_assoc( $output, $options_defaults ); } function arve_admin_enqueue_styles() { wp_enqueue_style( ARVE_SLUG, plugin_dir_url( __FILE__ ) . 'arve-admin.css', array(), ARVE_VERSION, 'all' ); } function arve_mce_css( $mce_css ) { if ( ! empty( $mce_css ) ) { $mce_css .= ','; } $css_file = plugin_dir_url( __DIR__ ) . 'public/arve-public.css'; $mce_css .= $css_file; return $mce_css; } /** * Register the JavaScript for the dashboard. * * @since 1.0.0 */ function arve_admin_enqueue_scripts() { wp_enqueue_script( ARVE_SLUG, plugin_dir_url( __FILE__ ) . 'arve-admin.js', array( 'jquery' ), ARVE_VERSION, true ); if ( is_plugin_active( 'shortcode-ui/shortcode-ui.php' ) ) { wp_enqueue_script( ARVE_SLUG . '-sc-ui', plugin_dir_url( __FILE__ ) . 'arve-shortcode-ui.js', array( 'shortcode-ui' ), ARVE_VERSION, true ); } }