Plugin Directory

Changeset 846693


Ignore:
Timestamp:
01/28/2014 05:52:55 AM (12 years ago)
Author:
sutherlandboswell
Message:

Version 2.5

Location:
video-thumbnails
Files:
5 edited
24 copied

Legend:

Unmodified
Added
Removed
  • video-thumbnails/tags/2.5/js/bulk.js

    r840515 r846693  
     1var video_thumbnails_bulk_scanner;
     2
    13jQuery(function ($) {
    24
     
    1820    };
    1921
     22    VideoThumbnailsBulkScanner.prototype.disableSubmit = function(text) {
     23        $('#video-thumbnails-bulk-scan-options input[type="submit"]').attr('disabled','disabled');
     24    };
     25
     26    VideoThumbnailsBulkScanner.prototype.enableSubmit = function(text) {
     27        $('#video-thumbnails-bulk-scan-options input[type="submit"]').removeAttr('disabled');
     28    };
     29
     30    VideoThumbnailsBulkScanner.prototype.findPosts = function(text) {
     31        var data = {
     32            action: 'video_thumbnails_bulk_posts_query',
     33            params: $('#video-thumbnails-bulk-scan-options').serialize()
     34        };
     35        var self = this;
     36        this.disableSubmit();
     37        $('#queue-count').text('working...');
     38        $.post(ajaxurl, data, function(response) {
     39            self.posts = $.parseJSON( response );
     40            $('#queue-count').text(self.posts.length+' posts');
     41            self.enableSubmit();
     42        });
     43    };
     44
    2045    VideoThumbnailsBulkScanner.prototype.startScan = function() {
     46        this.disableSubmit();
    2147        this.paused = false;
    2248        if ( this.currentItem == 0 ) {
     
    2450            this.progressBar.show();
    2551            this.resetProgressBar();
    26             $('#video-thumbnails-scan-all-posts').parent().slideUp();
     52            $('#video-thumbnails-bulk-scan-options').slideUp();
    2753        } else {
    2854            this.log( 'Resumed Scanning' );
     
    140166    };
    141167
    142     $('#video-thumbnails-scan-all-posts').on('click',function(e){
     168    video_thumbnails_bulk_scanner = new VideoThumbnailsBulkScanner();
     169    video_thumbnails_bulk_scanner.findPosts();
     170
     171    $('#video-thumbnails-bulk-scan-options').on('change',function(e){
     172        video_thumbnails_bulk_scanner.findPosts();
     173    });
     174
     175    $('#video-thumbnails-bulk-scan-options').on('submit',function(e){
    143176        e.preventDefault();
    144         var data = {
    145             action: 'video_thumbnails_bulk_posts_query'
    146         };
    147         $.post(ajaxurl, data, function(response) {
    148             var posts = $.parseJSON( response );
    149             var r = confirm("This will scan " + posts.length + " posts, continue?");
    150             if ( r == true ) {
    151                 x = new VideoThumbnailsBulkScanner( posts );
    152                 x.startScan();
    153             } else {
    154                 x = "You pressed Cancel!";
    155             }
    156         });
     177        video_thumbnails_bulk_scanner.startScan();
    157178    });
    158179
  • video-thumbnails/tags/2.5/php/class-video-thumbnails-settings.php

    r840515 r846693  
    4949            add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );
    5050        }
     51        // Add "Go Pro" call to action to settings footer
     52        add_action( 'video_thumbnails/settings_footer', array( 'Video_Thumbnails_Settings', 'settings_footer' ) );
    5153    }
    5254
     
    568570            ?>
    569571
    570             <div style="width: 250px; margin: 20px 0; padding: 0 20px; background: #f5f5f5; border: 1px solid #dfdfdf; text-align: center; -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 8px;">
    571                 <p>All donations are appreciated!<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYB1rPWk/Rr89ydxDsoXWyYIlAwIORRiWzcLHSBBVBMY69PHCO6WVTK2lXYmjZbDrvrHmN/jrM5r3Q008oX19NujzZ4d1VV+dWZxPU+vROuLToOFkk3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c.yet-another-testing-domain.com/api/grab?url=https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"></form></p>
     572            <?php do_action( 'video_thumbnails/settings_footer' ); ?>
     573
     574        </div><?php
     575    }
     576
     577    public static function settings_footer() {
     578        ?>
     579        <div style="width: 250px; margin: 20px 0; padding: 0 20px; background: #fff; border: 1px solid #dfdfdf; text-align: center;">
     580            <div>
     581                <p>Support video thumbnails and unlock additional features</p>
     582                <p><a href="https://refactored.co/plugins/video-thumbnails" class="button button-primary button-large">Go Pro</a></p>
    572583            </div>
    573 
    574         </div><?php
     584        </div>
     585        <?php
    575586    }
    576587
  • video-thumbnails/tags/2.5/php/providers/class-vimeo-thumbnails.php

    r837855 r846693  
    9191            } elseif ( $response['response']['code'] == 404 ) {
    9292                $result = new WP_Error( 'vimeo_info_retrieval', __( 'The Vimeo endpoint located at <a href="' . $request . '">' . $request . '</a> returned a 404 error.<br />Details: ' . $response['response']['message'] ) );
     93            } elseif ( $response['response']['code'] == 403 ) {
     94                $result = new WP_Error( 'vimeo_info_retrieval', __( 'The Vimeo endpoint located at <a href="' . $request . '">' . $request . '</a> returned a 403 error.<br />This can occur when a video has embedding disabled or restricted to certain domains. Try entering API credentials in the provider settings.' ) );
    9395            } else {
    9496                $xml = new SimpleXMLElement( $response['body'] );
  • video-thumbnails/tags/2.5/readme.txt

    r841939 r846693  
    33Donate link: http://wie.ly/u/donate
    44Tags: Video, Thumbnails, YouTube, Vimeo, Vine, Twitch, Dailymotion, Youku, Rutube, Featured Image
    5 Requires at least: 3.1
     5Requires at least: 3.2
    66Tested up to: 3.8
    7 Stable tag: 2.4.2
     7Stable tag: 2.5
    88
    99Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
     
    1212
    1313Video Thumbnails makes it easy to automatically display video thumbnails in your template. When you publish a post, this plugin will find the first video embedded and locate the thumbnail for you. Thumbnails can be saved to your media library and set as a featured image automatically. There's even support for custom post types and custom fields!
     14
     15**New!** Get even more power with [Video Thumbnails Pro](https://refactored.co/plugins/video-thumbnails). Enjoy features like maximum image sizes, more powerful bulk scanning options, a customizable upload directory, and more!
    1416
    1517Video Thumbnails currently supports these video services:
     
    4143* [WP YouTube Lyte](http://wordpress.org/extend/plugins/wp-youtube-lyte/)
    4244
     45Video Thumbnails will always be totally free while remaining a full-featured plugin, but if you'd like to support the developer consider purchasing [Video Thumbnails Pro](https://refactored.co/plugins/video-thumbnails). The pro version runs alongside the standard version and adds additional features like maximum image sizes, more powerful bulk scanning options, a customizable upload directory, and more!
     46
    4347Some functions are available to advanced users who want to customize their theme:
    4448
     
    111115
    112116== Changelog ==
     117
     118= 2.5 =
     119* Added support for [Video Thumbnails Pro](https://refactored.co/plugins/video-thumbnails), our new solution for power users and professional bloggers
     120* Various bugfixes and improvements
    113121
    114122= 2.4.2 =
  • video-thumbnails/tags/2.5/video-thumbnails.php

    r841939 r846693  
    22/*
    33Plugin Name: Video Thumbnails
    4 Plugin URI: http://refactored.co/plugins/video-thumbnails
     4Plugin URI: https://refactored.co/plugins/video-thumbnails
    55Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Supports YouTube, Vimeo, Facebook, Vine, Justin.tv, Twitch, Dailymotion, Metacafe, Blip, Google Drive, Funny or Die, CollegeHumor, MPORA, Wistia, Youku, and Rutube.
    66Author: Sutherland Boswell
    77Author URI: http://sutherlandboswell.com
    8 Version: 2.4.2
     8Version: 2.5
    99License: GPL2
    1010*/
     
    2929define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) );
    3030define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' );
    31 define( 'VIDEO_THUMBNAILS_VERSION', '2.4.2' );
     31define( 'VIDEO_THUMBNAILS_VERSION', '2.5' );
    3232
    3333// Providers
     
    301301
    302302    // Saves to media library
    303     public function save_to_media_library( $image_url, $post_id ) {
     303    public static function save_to_media_library( $image_url, $post_id ) {
    304304
    305305        $error = '';
     
    324324
    325325            // Save the image bits using the new filename
     326            do_action( 'video_thumbnails/pre_upload_bits', $image_contents );
    326327            $upload = wp_upload_bits( $new_filename, null, $image_contents );
     328            do_action( 'video_thumbnails/after_upload_bits', $upload );
    327329
    328330            // Stop for any errors while saving the data or else continue adding the image to the media library
     
    331333                return $error;
    332334            } else {
     335
     336                do_action( 'video_thumbnails/image_downloaded', $upload['file'] );
    333337
    334338                $image_url = $upload['url'];
     
    400404
    401405    function bulk_posts_query_callback() {
     406        // Some default args
    402407        $args = array(
    403             'showposts' => -1,
     408            'posts_per_page' => -1,
    404409            'post_type' => $this->settings->options['post_types'],
    405410            'fields'    => 'ids'
    406411        );
     412        // Setup an array for any form data and parse the jQuery serialized data
     413        $form_data = array();
     414        parse_str( $_POST['params'], $form_data );
     415
     416        $args = apply_filters( 'video_thumbnails/bulk_posts_query', $args, $form_data );
     417
    407418        $query = new WP_Query( $args );
    408419        echo json_encode( $query->posts );
     
    451462            <p>Use this tool to scan all of your posts for Video Thumbnails.</p>
    452463
    453             <p><a id="video-thumbnails-scan-all-posts" href="#" class="button button-primary">Scan All Posts</a></p>
     464            <form id="video-thumbnails-bulk-scan-options">
     465                <table class="form-table">
     466                    <tbody>
     467                        <?php do_action( 'video_thumbnails/bulk_options_form'); ?>
     468                        <tr valign="top">
     469                            <th scope="row"><span id="queue-count">...</span></th>
     470                            <td>
     471                                <input type="submit" value="Scan Now" class="button button-primary">
     472                            </td>
     473                        </tr>
     474                    </tbody>
     475                </table>
     476            </form>
    454477
    455478            <div id="vt-bulk-scan-results">
  • video-thumbnails/trunk/js/bulk.js

    r840515 r846693  
     1var video_thumbnails_bulk_scanner;
     2
    13jQuery(function ($) {
    24
     
    1820    };
    1921
     22    VideoThumbnailsBulkScanner.prototype.disableSubmit = function(text) {
     23        $('#video-thumbnails-bulk-scan-options input[type="submit"]').attr('disabled','disabled');
     24    };
     25
     26    VideoThumbnailsBulkScanner.prototype.enableSubmit = function(text) {
     27        $('#video-thumbnails-bulk-scan-options input[type="submit"]').removeAttr('disabled');
     28    };
     29
     30    VideoThumbnailsBulkScanner.prototype.findPosts = function(text) {
     31        var data = {
     32            action: 'video_thumbnails_bulk_posts_query',
     33            params: $('#video-thumbnails-bulk-scan-options').serialize()
     34        };
     35        var self = this;
     36        this.disableSubmit();
     37        $('#queue-count').text('working...');
     38        $.post(ajaxurl, data, function(response) {
     39            self.posts = $.parseJSON( response );
     40            $('#queue-count').text(self.posts.length+' posts');
     41            self.enableSubmit();
     42        });
     43    };
     44
    2045    VideoThumbnailsBulkScanner.prototype.startScan = function() {
     46        this.disableSubmit();
    2147        this.paused = false;
    2248        if ( this.currentItem == 0 ) {
     
    2450            this.progressBar.show();
    2551            this.resetProgressBar();
    26             $('#video-thumbnails-scan-all-posts').parent().slideUp();
     52            $('#video-thumbnails-bulk-scan-options').slideUp();
    2753        } else {
    2854            this.log( 'Resumed Scanning' );
     
    140166    };
    141167
    142     $('#video-thumbnails-scan-all-posts').on('click',function(e){
     168    video_thumbnails_bulk_scanner = new VideoThumbnailsBulkScanner();
     169    video_thumbnails_bulk_scanner.findPosts();
     170
     171    $('#video-thumbnails-bulk-scan-options').on('change',function(e){
     172        video_thumbnails_bulk_scanner.findPosts();
     173    });
     174
     175    $('#video-thumbnails-bulk-scan-options').on('submit',function(e){
    143176        e.preventDefault();
    144         var data = {
    145             action: 'video_thumbnails_bulk_posts_query'
    146         };
    147         $.post(ajaxurl, data, function(response) {
    148             var posts = $.parseJSON( response );
    149             var r = confirm("This will scan " + posts.length + " posts, continue?");
    150             if ( r == true ) {
    151                 x = new VideoThumbnailsBulkScanner( posts );
    152                 x.startScan();
    153             } else {
    154                 x = "You pressed Cancel!";
    155             }
    156         });
     177        video_thumbnails_bulk_scanner.startScan();
    157178    });
    158179
  • video-thumbnails/trunk/php/class-video-thumbnails-settings.php

    r840515 r846693  
    4949            add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );
    5050        }
     51        // Add "Go Pro" call to action to settings footer
     52        add_action( 'video_thumbnails/settings_footer', array( 'Video_Thumbnails_Settings', 'settings_footer' ) );
    5153    }
    5254
     
    568570            ?>
    569571
    570             <div style="width: 250px; margin: 20px 0; padding: 0 20px; background: #f5f5f5; border: 1px solid #dfdfdf; text-align: center; -webkit-border-radius: 8px; -moz-border-radius: 8px; border-radius: 8px;">
    571                 <p>All donations are appreciated!<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----MIIHRwYJKoZIhvcNAQcEoIIHODCCBzQCAQExggEwMIIBLAIBADCBlDCBjjELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAkNBMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtQYXlQYWwgSW5jLjETMBEGA1UECxQKbGl2ZV9jZXJ0czERMA8GA1UEAxQIbGl2ZV9hcGkxHDAaBgkqhkiG9w0BCQEWDXJlQHBheXBhbC5jb20CAQAwDQYJKoZIhvcNAQEBBQAEgYB1rPWk/Rr89ydxDsoXWyYIlAwIORRiWzcLHSBBVBMY69PHCO6WVTK2lXYmjZbDrvrHmN/jrM5r3Q008oX19NujzZ4d1VV+dWZxPU+vRO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="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"></form></p>
     572            <?php do_action( 'video_thumbnails/settings_footer' ); ?>
     573
     574        </div><?php
     575    }
     576
     577    public static function settings_footer() {
     578        ?>
     579        <div style="width: 250px; margin: 20px 0; padding: 0 20px; background: #fff; border: 1px solid #dfdfdf; text-align: center;">
     580            <div>
     581                <p>Support video thumbnails and unlock additional features</p>
     582                <p><a href="https://refactored.co/plugins/video-thumbnails" class="button button-primary button-large">Go Pro</a></p>
    572583            </div>
    573 
    574         </div><?php
     584        </div>
     585        <?php
    575586    }
    576587
  • video-thumbnails/trunk/php/providers/class-vimeo-thumbnails.php

    r837855 r846693  
    9191            } elseif ( $response['response']['code'] == 404 ) {
    9292                $result = new WP_Error( 'vimeo_info_retrieval', __( 'The Vimeo endpoint located at <a href="' . $request . '">' . $request . '</a> returned a 404 error.<br />Details: ' . $response['response']['message'] ) );
     93            } elseif ( $response['response']['code'] == 403 ) {
     94                $result = new WP_Error( 'vimeo_info_retrieval', __( 'The Vimeo endpoint located at <a href="' . $request . '">' . $request . '</a> returned a 403 error.<br />This can occur when a video has embedding disabled or restricted to certain domains. Try entering API credentials in the provider settings.' ) );
    9395            } else {
    9496                $xml = new SimpleXMLElement( $response['body'] );
  • video-thumbnails/trunk/readme.txt

    r841939 r846693  
    33Donate link: http://wie.ly/u/donate
    44Tags: Video, Thumbnails, YouTube, Vimeo, Vine, Twitch, Dailymotion, Youku, Rutube, Featured Image
    5 Requires at least: 3.1
     5Requires at least: 3.2
    66Tested up to: 3.8
    7 Stable tag: 2.4.2
     7Stable tag: 2.5
    88
    99Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
     
    1212
    1313Video Thumbnails makes it easy to automatically display video thumbnails in your template. When you publish a post, this plugin will find the first video embedded and locate the thumbnail for you. Thumbnails can be saved to your media library and set as a featured image automatically. There's even support for custom post types and custom fields!
     14
     15**New!** Get even more power with [Video Thumbnails Pro](https://refactored.co/plugins/video-thumbnails). Enjoy features like maximum image sizes, more powerful bulk scanning options, a customizable upload directory, and more!
    1416
    1517Video Thumbnails currently supports these video services:
     
    4143* [WP YouTube Lyte](http://wordpress.org/extend/plugins/wp-youtube-lyte/)
    4244
     45Video Thumbnails will always be totally free while remaining a full-featured plugin, but if you'd like to support the developer consider purchasing [Video Thumbnails Pro](https://refactored.co/plugins/video-thumbnails). The pro version runs alongside the standard version and adds additional features like maximum image sizes, more powerful bulk scanning options, a customizable upload directory, and more!
     46
    4347Some functions are available to advanced users who want to customize their theme:
    4448
     
    111115
    112116== Changelog ==
     117
     118= 2.5 =
     119* Added support for [Video Thumbnails Pro](https://refactored.co/plugins/video-thumbnails), our new solution for power users and professional bloggers
     120* Various bugfixes and improvements
    113121
    114122= 2.4.2 =
  • video-thumbnails/trunk/video-thumbnails.php

    r841939 r846693  
    22/*
    33Plugin Name: Video Thumbnails
    4 Plugin URI: http://refactored.co/plugins/video-thumbnails
     4Plugin URI: https://refactored.co/plugins/video-thumbnails
    55Description: Automatically retrieve video thumbnails for your posts and display them in your theme. Supports YouTube, Vimeo, Facebook, Vine, Justin.tv, Twitch, Dailymotion, Metacafe, Blip, Google Drive, Funny or Die, CollegeHumor, MPORA, Wistia, Youku, and Rutube.
    66Author: Sutherland Boswell
    77Author URI: http://sutherlandboswell.com
    8 Version: 2.4.2
     8Version: 2.5
    99License: GPL2
    1010*/
     
    2929define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) );
    3030define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' );
    31 define( 'VIDEO_THUMBNAILS_VERSION', '2.4.2' );
     31define( 'VIDEO_THUMBNAILS_VERSION', '2.5' );
    3232
    3333// Providers
     
    301301
    302302    // Saves to media library
    303     public function save_to_media_library( $image_url, $post_id ) {
     303    public static function save_to_media_library( $image_url, $post_id ) {
    304304
    305305        $error = '';
     
    324324
    325325            // Save the image bits using the new filename
     326            do_action( 'video_thumbnails/pre_upload_bits', $image_contents );
    326327            $upload = wp_upload_bits( $new_filename, null, $image_contents );
     328            do_action( 'video_thumbnails/after_upload_bits', $upload );
    327329
    328330            // Stop for any errors while saving the data or else continue adding the image to the media library
     
    331333                return $error;
    332334            } else {
     335
     336                do_action( 'video_thumbnails/image_downloaded', $upload['file'] );
    333337
    334338                $image_url = $upload['url'];
     
    400404
    401405    function bulk_posts_query_callback() {
     406        // Some default args
    402407        $args = array(
    403             'showposts' => -1,
     408            'posts_per_page' => -1,
    404409            'post_type' => $this->settings->options['post_types'],
    405410            'fields'    => 'ids'
    406411        );
     412        // Setup an array for any form data and parse the jQuery serialized data
     413        $form_data = array();
     414        parse_str( $_POST['params'], $form_data );
     415
     416        $args = apply_filters( 'video_thumbnails/bulk_posts_query', $args, $form_data );
     417
    407418        $query = new WP_Query( $args );
    408419        echo json_encode( $query->posts );
     
    451462            <p>Use this tool to scan all of your posts for Video Thumbnails.</p>
    452463
    453             <p><a id="video-thumbnails-scan-all-posts" href="#" class="button button-primary">Scan All Posts</a></p>
     464            <form id="video-thumbnails-bulk-scan-options">
     465                <table class="form-table">
     466                    <tbody>
     467                        <?php do_action( 'video_thumbnails/bulk_options_form'); ?>
     468                        <tr valign="top">
     469                            <th scope="row"><span id="queue-count">...</span></th>
     470                            <td>
     471                                <input type="submit" value="Scan Now" class="button button-primary">
     472                            </td>
     473                        </tr>
     474                    </tbody>
     475                </table>
     476            </form>
    454477
    455478            <div id="vt-bulk-scan-results">
Note: See TracChangeset for help on using the changeset viewer.