WordPress.org

Plugin Directory

Changeset 1106397


Ignore:
Timestamp:
03/05/15 21:58:19 (2 years ago)
Author:
cmstactics
Message:

Modified the way ffmpeg exists detection is handled. Added ffmpeg exists check on init() if option is not set in the db

Location:
wp-video-posts/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • wp-video-posts/trunk/classes/wpvp-core-class.php

    r1017663 r1106397  
    3434        $helper = new WPVP_Helper(); 
    3535        $options = $helper->wpvp_get_full_options(); 
    36         if($helper->wpvp_command_exists_check($this->options['ffmpeg_path']."ffmpeg")>0){ 
    37             $ffmpeg_exists = true; 
    38         } else { 
    39             $ffmpeg_exists = false; 
    40         } 
     36        $ffmpeg_exists = $options['ffmpeg_exists']; 
     37     
    4138        $width = $options['video_width']; 
    4239        $height = $options['video_height']; 
     
    328325        $width = $this->options['video_width']; 
    329326        $height = $this->options['video_height']; 
    330         if($helper->wpvp_command_exists_check($this->options['ffmpeg_path']."ffmpeg")>0){ 
    331             $ffmpeg_exists = true; 
    332         } else { 
    333             $ffmpeg_exists = false; 
    334         } 
     327        $options = $helper->wpvp_get_full_options(); 
     328        $ffmpeg_exists = $options['ffmpeg_exists']; 
    335329        $attachmentID = $id; 
    336330        $content = $html; 
  • wp-video-posts/trunk/classes/wpvp-helper-class.php

    r1017663 r1106397  
    9797        $wpvp_ffmpeg_vpre = isset($wpvp_ffmpeg_options['vpre']) ? $wpvp_ffmpeg_options['vpre'] : 0; 
    9898        $wpvp_ffmpeg_other_flags = isset($wpvp_ffmpeg_options['other_flags']) ? $wpvp_ffmpeg_options['other_flags'] : 0; 
     99        $wpvp_ffmpeg_exists = get_option('wpvp_ffmpeg_exists',0); 
    99100         
    100101        $wpvp_options['wpvp_ffmpeg_ar']=$wpvp_ffmpeg_ar; 
     
    115116        $wpvp_options['debug_mode']=$debug_mode; 
    116117        $wpvp_options['encode_formats']=$encode_formats; 
     118        $wpvp_options['ffmpeg_exists'] = $wpvp_ffmpeg_exists; 
    117119        return $wpvp_options; 
    118120    } 
  • wp-video-posts/trunk/options/wpvp-options.php

    r1017663 r1106397  
    11<?php  
    22$helper = new WPVP_Helper(); 
    3 $ffmpeg_c = $helper->wpvp_check_extension('ffmpeg'); 
    4 $ffmpeg_ext = (is_array($ffmpeg_c)&&!empty($ffmpeg_c)) ? true : false; 
     3$options = $helper->wpvp_get_full_options(); 
     4$ffmpeg_ext = $options['ffmpeg_exists']; 
    55$mp4box_c = $helper->wpvp_check_extension('MP4Box'); 
    66$mp4box_ext = (is_array($mp4box_c)&&!empty($mp4box_c)) ? true : false; 
     
    130130    </div> 
    131131    <?php    
    132     if(!$helper->wpvp_command_exists_check("ffmpeg")>0){ 
    133         if($ffmpeg_ext){ 
    134             echo '<h3 style="color: red;font-size: 12px;font-weight: normal;width: 300px;">FFMPEG test encoding failed. Possible reasons: restricted permissions on /test/ directory within the plugin, incorrectly configured ffmpeg, etc.</h3>'; 
    135         } else { 
    136             echo '<h3 style="color: red;font-size: 12px;font-weight: normal;width: 300px;">FFMPEG is not found on the server. The only extensions available for uploading: mp4.<br />Please verify with your administrator or hosting provider to have this installed and configured. If ffmpeg is installed but you still see this message, specify the path to ffmpeg installation below:</h3><br />'; 
    137         } 
    138     } ?>     
     132    if(!$ffmpeg_ext){ 
     133        echo '<h3 style="color: red;font-size: 12px;font-weight: normal;width: 300px;">FFMPEG test encoding failed. Possible reasons: restricted permissions on /test/ directory within the plugin, incorrectly configured ffmpeg, etc. FFMPEG is not found on the server. The only extensions available for uploading: mp4.<br />Please verify with your administrator or hosting provider to have this installed and configured. If ffmpeg is installed but you still see this message, specify the path to ffmpeg installation below:</h3><br />'; 
     134    }?>  
    139135    <form name="wpvp_form" class="wpvp_form" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>"> 
    140136        <input type="hidden" name="wpvp_hidden" value="Y"> 
  • wp-video-posts/trunk/options/wpvp-uploader-options.php

    r1017034 r1106397  
    11<?php  
    22$helper = new WPVP_Helper(); 
    3 $ffmpeg_c = $helper->wpvp_check_extension('ffmpeg'); 
    4 $ffmpeg_ext = (is_array($ffmpeg_c)&&!empty($ffmpeg_c)) ? true : false; 
     3$options = $helper->wpvp_get_full_options(); 
     4$ffmpeg_ext = $options['ffmpeg_exists']; 
    55if($_POST['wpvp_uploader_hidden'] == 'Y') { 
    66    //Form data sent 
  • wp-video-posts/trunk/readme.txt

    r1106380 r1106397  
    55Requires at least: 3.2.2 
    66Tested up to: 4.0 
    7 Stable tag: 3.3 
     7Stable tag: 3.4 
    88 
    99Upload videos to create custom video posts. With FFMPEG installed, it encodes 
     
    134134 
    135135== Changelog == 
     136= 3.4 =  
     137- Updated the way FFMPEG detection is handled: encoding test is performed only instead of a combined detection. 
     138- Added FFMPEG check on init() hook if option is not set. 
     139 
    136140= 3.3.1 =  
    137141- Added a fix for an E level notice.  
  • wp-video-posts/trunk/wpvp.php

    r1106377 r1106397  
    44Plugin URI: http://cmstactics.com 
    55Description: WP Video Posts creates a custom post for uploaded videos. You can upload videos of different formats (FLV, F4V, MP4, AVI, MOV, 3GP and WMV) and the plugin will convert it to MP4 and play it using Flowplayer.   
    6 Version: 3.3.1 
     6Version: 3.4 
    77Author: Alex Rayan, cmstactics 
    88Author URI: http://cmstactics.com 
     
    2424    * @var string WPVPMediaEncoder version 
    2525    */ 
    26     public $version = '3.3.1'; 
     26    public $version = '3.4'; 
    2727    public static function init(){ 
    2828        $class = __CLASS__; 
     
    4545            add_action('admin_menu',array(&$this,'wpvp_options_page')); 
    4646        } 
    47         add_action('init',array(&$this,'wpvp_register_videos_post_type')); 
     47        add_action('init',array(&$this,'wpvp_init_functions')); 
    4848        add_action('wp_enqueue_scripts',array(&$this,'wpvp_enqueue_scripts')); 
    4949        add_action('wp_footer', array(&$this,'wpvp_footer'), 100); 
     
    8888            add_action('wp_ajax_nopriv_wpvp_process_form',array(&$this,'wpvp_process_form')); 
    8989        } 
     90    } 
     91    /** 
     92    *Run init functions 
     93    *@access public 
     94    **/ 
     95    public function wpvp_init_functions(){ 
     96        //check for ffmpeg 
     97        if(get_option('wpvp_ffmpeg_exists')===FALSE){ 
     98            $helper = new WPVP_Helper(); 
     99            $helper->wpvp_command_exists_check('ffmpeg',true); 
     100        } 
     101        //register post types; 
     102        self::wpvp_register_videos_post_type(); 
    90103    } 
    91104    /** 
Note: See TracChangeset for help on using the changeset viewer.