Plugin Directory

Changeset 950682


Ignore:
Timestamp:
07/17/2014 10:14:23 PM (12 years ago)
Author:
sutherlandboswell
Message:

Improved debugging page

Location:
video-thumbnails
Files:
2 added
6 deleted
4 edited
35 copied
2 moved

Legend:

Unmodified
Added
Removed
  • video-thumbnails/tags/2.10/js/settings.js

    r922717 r950682  
    1 // Custom field detection
    21jQuery(function ($) {
    32
     3    /**
     4     * Custom field detection
     5     */
    46    $('#vt_detect_custom_field').on('click',function(e) {
    57        e.preventDefault();
     
    2426    });
    2527
     28    /**
     29     * Debugging tests
     30     */
     31    $('a.toggle-video-thumbnails-test-content').on('click',function(e) {
     32        e.preventDefault();
     33        $(this).closest('.video-thumbnails-test').toggleClass('closed');
     34    });
     35
     36    function enable_video_thumbnails_tests() {
     37        $('.video-thumbnails-test-button').attr('disabled',false);
     38    }
     39
     40    function disable_video_thumbnails_tests() {
     41        $('.video-thumbnails-test-button').attr('disabled',true);
     42    }
     43
     44    /* Provider testing */
     45
     46    function test_single_provider(provider_slug) {
     47        disable_video_thumbnails_tests();
     48        $('#'+provider_slug+'-provider-test').addClass('test-working');
     49        $('#'+provider_slug+'-provider-test .retest-video-provider').val(video_thumbnails_settings_language.working);
     50        var data = {
     51            action: 'video_thumbnail_provider_test',
     52            provider_slug: provider_slug
     53        };
     54        $.ajax({
     55            type: "POST",
     56            url: ajaxurl,
     57            data: data,
     58            success: function(response){
     59                $('#'+provider_slug+'-provider-test .test-results').html(response);
     60                $('#'+provider_slug+'-provider-test .retest-video-provider').val(video_thumbnails_settings_language.retest);
     61                $('#'+provider_slug+'-provider-test').removeClass('test-working');
     62                done_testing_single_provider();
     63            },
     64            error: function(XMLHttpRequest, textStatus, errorThrown) {
     65                $('#'+provider_slug+'-provider-test .test-results').html('<p>' + video_thumbnails_settings_language.ajax_error + ' ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText + '</p>');
     66                $('#'+provider_slug+'-provider-test .retest-video-provider').val(video_thumbnails_settings_language.retest);
     67                $('#'+provider_slug+'-provider-test').removeClass('test-working');
     68                done_testing_single_provider();
     69            }
     70        });
     71    }
     72
     73    var provider_index = 0;
     74    var testing_all_providers = false;
     75
     76    function done_testing_single_provider() {
     77        // If we aren't testing providers, don't do anything
     78        if (testing_all_providers==false) {
     79            enable_video_thumbnails_tests();
     80        }
     81        provider_index = provider_index + 1;
     82        if (provider_index>=video_thumbnails_provider_slugs.provider_slugs.length) {
     83            testing_all_providers = false;
     84            enable_video_thumbnails_tests();
     85            return;
     86        } else {
     87            test_single_provider(video_thumbnails_provider_slugs.provider_slugs[provider_index]);
     88        }
     89    }
     90
     91    $('#test-all-video-thumbnail-providers').on('click',function(e) {
     92        e.preventDefault();
     93        $('#provider-test-results').removeClass('hidden');
     94        $(this).parent().remove();
     95        testing_all_providers = true;
     96        test_single_provider(video_thumbnails_provider_slugs.provider_slugs[provider_index]);
     97    });
     98
     99    $('.retest-video-provider').on('click',function(e) {
     100        e.preventDefault();
     101        test_single_provider( $(this).data('provider-slug') );
     102    });
     103
     104    /* Markup detection testing */
     105    $('#test-markup-detection').on('click',function(e) {
     106        disable_video_thumbnails_tests();
     107        e.preventDefault();
     108        var data = {
     109            action: 'video_thumbnail_markup_detection_test',
     110            markup: $('#markup-input').val()
     111        };
     112        document.getElementById( 'markup-test-result' ).innerHTML = '<p>' + video_thumbnails_settings_language.working + '</p>';
     113        $.ajax({
     114            type: "POST",
     115            url: ajaxurl,
     116            data: data,
     117            success: function(response){
     118                document.getElementById( 'markup-test-result' ).innerHTML = response;
     119                enable_video_thumbnails_tests();
     120            },
     121            error: function(XMLHttpRequest, textStatus, errorThrown) {
     122                document.getElementById( 'markup-test-result' ).innerHTML = '<p>' + video_thumbnails_settings_language.ajax_error + ' ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText + '</p>';
     123                enable_video_thumbnails_tests();
     124            }
     125        });
     126    });
     127
     128    /* Media download testing */
    26129    $('#test-video-thumbnail-saving-media').on('click',function(e) {
     130        disable_video_thumbnails_tests();
    27131        $('#media-test-result').html( '<p>' + video_thumbnails_settings_language.working + '</p>' );
    28132        e.preventDefault();
     
    36140            success: function(response){
    37141                $('#media-test-result').html(response);
     142                enable_video_thumbnails_tests();
    38143            },
    39144            error: function(XMLHttpRequest, textStatus, errorThrown) {
    40145                $('#media-test-result').html('<p>' + video_thumbnails_settings_language.ajax_error + ' ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText + '</p>');
     146                enable_video_thumbnails_tests();
    41147            }
    42148        });
     
    44150
    45151    $('#delete-video-thumbnail-test-images').on('click',function(e) {
     152        disable_video_thumbnails_tests();
    46153        $('#media-test-result').html( '<p>' + video_thumbnails_settings_language.working + '</p>' );
    47154        e.preventDefault();
     
    55162            success: function(response){
    56163                $('#media-test-result').html(response);
     164                enable_video_thumbnails_tests();
    57165            },
    58166            error: function(XMLHttpRequest, textStatus, errorThrown) {
    59167                $('#media-test-result').html('<p>' + video_thumbnails_settings_language.ajax_error + ' ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText + '</p>');
     168                enable_video_thumbnails_tests();
    60169            }
    61170        });
     
    64173});
    65174
    66 // Test actions
    67 function test_video_thumbnail( test_type ) {
    68     var data = {
    69         action: 'video_thumbnail_' + test_type + '_test'
    70     };
    71     document.getElementById( test_type + '-test' ).innerHTML = video_thumbnails_settings_language.working;
    72     jQuery.ajax({
    73         type: "POST",
    74         url: ajaxurl,
    75         data: data,
    76         success: function(response){
    77             document.getElementById( test_type + '-test' ).innerHTML = response;
    78         },
    79         error: function(XMLHttpRequest, textStatus, errorThrown) {
    80             document.getElementById( test_type + '-test' ).innerHTML = '<p>' + video_thumbnails_settings_language.ajax_error + ' ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText + '</p>';
    81         }
    82     });
    83 };
    84 
    85 function test_video_thumbnail_markup_detection() {
    86     var data = {
    87         action: 'video_thumbnail_markup_detection_test',
    88         markup: jQuery('#markup-input').val()
    89     };
    90     document.getElementById( 'markup-test-result' ).innerHTML = '<p>' + video_thumbnails_settings_language.working + '</p>';
    91     jQuery.ajax({
    92         type: "POST",
    93         url: ajaxurl,
    94         data: data,
    95         success: function(response){
    96             document.getElementById( 'markup-test-result' ).innerHTML = response;
    97         },
    98         error: function(XMLHttpRequest, textStatus, errorThrown) {
    99             document.getElementById( 'markup-test-result' ).innerHTML = '<p>' + video_thumbnails_settings_language.ajax_error + ' ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText + '</p>';
    100         }
    101     });
    102 }
    103 
    104 // Clear all video thumbnails
     175/**
     176 * Clear all video thumbnails
     177 */
    105178function clear_all_video_thumbnails( nonce ) {
    106179    var confimation_result = confirm(video_thumbnails_settings_language.clear_all_confirmation);
  • video-thumbnails/tags/2.10/php/class-video-thumbnails-settings.php

    r922717 r950682  
    4747        add_action( 'wp_ajax_video_thumbnail_delete_test_images', array( &$this, 'delete_test_images_callback' ) ); // Delete test images
    4848        add_action( 'wp_ajax_video_thumbnail_markup_detection_test', array( &$this, 'markup_detection_test_callback' ) ); // Markup input test
    49         // Settings page actions
    50         if ( isset ( $_GET['page'] ) && ( $_GET['page'] == 'video_thumbnails' ) ) {
    51             // Admin scripts
    52             add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );
    53         }
     49        // Admin scripts
     50        add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );
    5451        // Add "Go Pro" call to action to settings footer
    5552        add_action( 'video_thumbnails/settings_footer', array( 'Video_Thumbnails_Settings', 'settings_footer' ) );
     
    136133    }
    137134
    138     function admin_scripts() {
    139         wp_enqueue_script( 'video_thumbnails_settings', plugins_url( 'js/settings.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ), array( 'jquery' ), VIDEO_THUMBNAILS_VERSION );
    140         wp_localize_script( 'video_thumbnails_settings', 'video_thumbnails_settings_language', array(
    141             'detection_failed'       => __( 'We were unable to find a video in the custom fields of your most recently updated post.', 'video-thumbnails' ),
    142             'working'                => __( 'Working...', 'video-thumbnails' ),
    143             'ajax_error'             => __( 'AJAX Error:', 'video-thumbnails' ),
    144             'clear_all_confirmation' => __( 'Are you sure you want to clear all video thumbnails? This cannot be undone.', 'video-thumbnails' ),
    145         ) );
     135    function admin_scripts( $hook ) {
     136        if ( 'settings_page_video_thumbnails' == $hook ) {
     137            wp_enqueue_style( 'video-thumbnails-settings-css', plugins_url( '/css/settings.css', VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ), false, VIDEO_THUMBNAILS_VERSION );
     138            wp_enqueue_script( 'video_thumbnails_settings', plugins_url( 'js/settings.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ), array( 'jquery' ), VIDEO_THUMBNAILS_VERSION );
     139            wp_localize_script( 'video_thumbnails_settings', 'video_thumbnails_settings_language', array(
     140                'detection_failed'       => __( 'We were unable to find a video in the custom fields of your most recently updated post.', 'video-thumbnails' ),
     141                'working'                => __( 'Working...', 'video-thumbnails' ),
     142                'retest'                 => __( 'Retest', 'video-thumbnails' ),
     143                'ajax_error'             => __( 'AJAX Error:', 'video-thumbnails' ),
     144                'clear_all_confirmation' => __( 'Are you sure you want to clear all video thumbnails? This cannot be undone.', 'video-thumbnails' ),
     145            ) );
     146            global $video_thumbnails;
     147            $provider_slugs = array();
     148            foreach ( $video_thumbnails->providers as $provider ) {
     149                $provider_slugs[] = $provider->service_slug;
     150            }
     151            wp_localize_script( 'video_thumbnails_settings', 'video_thumbnails_provider_slugs', array(
     152                'provider_slugs' => $provider_slugs
     153            ) );
     154        }
    146155    }
    147156
     
    223232                </thead>
    224233                <tbody>
    225             <?php
    226             $passed = 0;
    227             $failed = 0;
    228             foreach ( $video_thumbnails->providers as $provider ) {
     234                <?php
     235                $provider = $video_thumbnails->providers[$_POST['provider_slug']];
    229236                foreach ( $provider->get_test_cases() as $test_case ) {
    230237                    echo '<tr>';
    231                     echo '<td><strong>' . $provider->service_name . '</strong> - ' . $test_case['name'] . '</td>';
     238                    echo '<td><strong>' . $test_case['name'] . '</strong></td>';
    232239                    $markup = apply_filters( 'the_content', $test_case['markup'] );
    233240                    $result = $video_thumbnails->get_first_thumbnail_url( $markup );
     
    252259                        if ( $matched ) {
    253260                            echo '<td style="color:green;">&#10004; ' . __( 'Passed', 'video-thumbnails' ) . '</td>';
    254                             $passed++;
    255261                        } else {
    256262                            echo '<td style="color:red;">&#10007; ' . __( 'Failed', 'video-thumbnails' ) . '</td>';
    257                             $failed++;
    258263                        }
    259264                        echo '<td>';
     
    267272                    }
    268273                    echo '</tr>';
    269                 }
    270             } ?>
     274                } ?>
    271275                <tbody>
    272                 <tfoot>
    273                     <tr>
    274                         <th></th>
    275                         <th><span style="color:green;">&#10004; <?php echo $passed; ?></span> / <span style="color:red;">&#10007; <?php echo $failed; ?></span></th>
    276                         <th></th>
    277                     </tr>
    278                 </tfoot>
    279276            </table>
    280277        <?php die();
     
    497494        }
    498495
     496        global $video_thumbnails;
     497
    499498        ?><div class="wrap">
    500499
     
    569568            <p><?php _e( 'Use these tests to help diagnose any problems. Please include results when requesting support.', 'video-thumbnails' ); ?></p>
    570569
    571             <h3><?php _e( 'Test Video Providers', 'video-thumbnails' ); ?></h3>
    572 
    573             <p><?php _e( 'This test automatically searches a sample for every type of video supported and compares it to the expected value. Sometimes tests may fail due to API rate limits.', 'video-thumbnails' ); ?></p>
    574 
    575             <div id="provider-test">
    576                 <p><input type="submit" class="button-primary" onclick="test_video_thumbnail('provider');" value="<?php esc_attr_e( 'Test Video Providers', 'video-thumbnails' ); ?>" /></p>
     570            <div class="video-thumbnails-test closed">
     571
     572                <a href="#" class="toggle-video-thumbnails-test-content show-hide-test-link"><span class="show"><?php _e( 'Show', 'video-thumbnails' ); ?></span> <span class="hide"><?php _e( 'Hide', 'video-thumbnails' ); ?></span></a>
     573
     574                <a href="#" class="toggle-video-thumbnails-test-content title-test-link"><h3 class="test-title"><?php _e( 'Test Video Providers', 'video-thumbnails' ); ?></h3></a>
     575
     576                <div class="video-thumbnails-test-content">
     577
     578                    <p><?php _e( 'This test automatically searches a sample for every type of video supported and compares it to the expected value. Sometimes tests may fail due to API rate limits.', 'video-thumbnails' ); ?></p>
     579
     580                    <p><input type="submit" class="button-primary video-thumbnails-test-button" id="test-all-video-thumbnail-providers" value="<?php esc_attr_e( 'Test Video Providers', 'video-thumbnails' ); ?>" /></p>
     581
     582                    <div id="provider-test-results" class="hidden">
     583                        <?php
     584                        foreach ( $video_thumbnails->providers as $provider ) {
     585                            echo '<div id="' . $provider->service_slug . '-provider-test" class="single-provider-test-results">';
     586                                echo '<h3>' . $provider->service_name . ' <input type="submit" data-provider-slug="' . $provider->service_slug . '" class="button-primary retest-video-provider video-thumbnails-test-button" value="' . esc_attr__( 'Waiting...', 'video-thumbnails' ) . '" /></h3>';
     587                                echo '<div class="test-results"></div>';
     588                            echo '</div>';
     589                        }
     590                        ?>
     591                    </div>
     592
     593                </div><!-- /.video-thumbnails-test-content -->
     594
    577595            </div>
    578 
    579             <h3><?php _e( 'Test Markup for Video', 'video-thumbnails' ); ?></h3>
    580 
    581             <p><?php _e( 'Copy and paste an embed code below to see if a video is detected.', 'video-thumbnails' ); ?></p>
    582 
    583             <textarea id="markup-input" cols="50" rows="5"></textarea>
    584 
    585             <p><input type="submit" class="button-primary" onclick="test_video_thumbnail_markup_detection();" value="<?php esc_attr_e( 'Scan For Thumbnail', 'video-thumbnails' ); ?>" /></p>
    586 
    587             <div id="markup-test-result"></div>
    588 
    589             <h3><?php _e( 'Test Saving to Media Library', 'video-thumbnails' ); ?></h3>
    590 
    591             <p><?php _e( 'This test checks for issues with the process of saving a remote thumbnail to your local media library.', 'video-thumbnails' ); ?></p>
    592 
    593             <p><?php _e( 'Also be sure to test that you can manually upload an image to your site. If you\'re unable to upload images, you may need to <a href="http://codex.wordpress.org/Changing_File_Permissions">change file permissions</a>.', 'video-thumbnails' ); ?></p>
    594 
    595             <p>
    596                 <input type="submit" id="test-video-thumbnail-saving-media" class="button-primary" value="<?php esc_attr_e( 'Download Test Image', 'video-thumbnails' ); ?>" />
    597                 <input type="submit" id="delete-video-thumbnail-test-images" class="button" value="<?php esc_attr_e( 'Delete Test Images', 'video-thumbnails' ); ?>" />
    598             </p>
    599 
    600             <div id="media-test-result"></div>
    601 
    602             <h3><?php _e( 'Installation Information', 'video-thumbnails' ); ?></h3>
    603             <table class="widefat">
    604                 <thead>
    605                     <tr>
    606                         <th></th>
    607                         <th></th>
    608                         <th></th>
    609                     </tr>
    610                 </thead>
    611                 <tbody>
    612                     <tr>
    613                         <td><strong><?php _e( 'WordPress Version', 'video-thumbnails' ); ?></strong></td>
    614                         <td><?php echo get_bloginfo( 'version' ); ?></td>
    615                         <td></td>
    616                     </tr>
    617                     <tr>
    618                         <td><strong><?php _e( 'Video Thumbnails Version', 'video-thumbnails' ); ?></strong></td>
    619                         <td><?php echo VIDEO_THUMBNAILS_VERSION; ?></td>
    620                         <td></td>
    621                     </tr>
    622                     <tr>
    623                         <td><strong><?php _e( 'Video Thumbnails Settings Version', 'video-thumbnails' ); ?></strong></td>
    624                         <td><?php echo $this->options['version']; ?></td>
    625                         <td></td>
    626                     </tr>
    627                     <tr>
    628                         <td><strong><?php _e( 'PHP Version', 'video-thumbnails' ); ?></strong></td>
    629                         <td><?php echo PHP_VERSION; ?></td>
    630                         <td></td>
    631                     </tr>
    632                     <tr>
    633                         <td><strong><?php _e( 'Post Thumbnails', 'video-thumbnails' ); ?></strong></td>
    634                         <td><?php if ( current_theme_supports( 'post-thumbnails' ) ) : ?><span style="color:green">&#10004;</span> <?php _e( 'Your theme supports post thumbnails.', 'video-thumbnails' ); ?><?php else: ?><span style="color:red">&#10006;</span> <?php _e( 'Your theme does not support post thumbnails, you\'ll need to make modifications or switch to a different theme. <a href="http://codex.wordpress.org/Post_Thumbnails">More info</a>', 'video-thumbnails' ); ?><?php endif; ?></td>
    635                         <td></td>
    636                     </tr>
    637                     <tr>
    638                         <td><strong><?php _e( 'Video Providers', 'video-thumbnails' ); ?></strong></td>
    639                         <td>
    640                             <?php global $video_thumbnails; ?>
    641                                 <?php $provider_names = array(); foreach ( $video_thumbnails->providers as $provider ) { $provider_names[] = $provider->service_name; }; ?>
    642                             <strong><?php echo count( $video_thumbnails->providers ); ?></strong>: <?php echo implode( ', ', $provider_names ); ?>
    643                         </td>
    644                         <td></td>
    645                     </tr>
    646                 </tbody>
    647                 <tfoot>
    648                     <tr>
    649                         <th></th>
    650                         <th></th>
    651                         <th></th>
    652                     </tr>
    653                 </tfoot>
    654             </table>
     596            <div class="video-thumbnails-test closed">
     597
     598                <a href="#" class="toggle-video-thumbnails-test-content show-hide-test-link"><span class="show"><?php _e( 'Show', 'video-thumbnails' ); ?></span> <span class="hide"><?php _e( 'Hide', 'video-thumbnails' ); ?></span></a>
     599
     600                <a href="#" class="toggle-video-thumbnails-test-content title-test-link"><h3 class="test-title"><?php _e( 'Test Markup for Video', 'video-thumbnails' ); ?></h3></a>
     601
     602                <div class="video-thumbnails-test-content">
     603
     604                    <p><?php _e( 'Copy and paste an embed code below to see if a video is detected.', 'video-thumbnails' ); ?></p>
     605
     606                    <textarea id="markup-input" cols="50" rows="5"></textarea>
     607
     608                    <p><input type="submit" id="test-markup-detection" class="button-primary video-thumbnails-test-button" value="<?php esc_attr_e( 'Scan For Thumbnail', 'video-thumbnails' ); ?>" /></p>
     609
     610                    <div id="markup-test-result"></div>
     611
     612                </div><!-- /.video-thumbnails-test-content -->
     613
     614            </div>
     615            <div class="video-thumbnails-test closed">
     616
     617                <a href="#" class="toggle-video-thumbnails-test-content show-hide-test-link"><span class="show"><?php _e( 'Show', 'video-thumbnails' ); ?></span> <span class="hide"><?php _e( 'Hide', 'video-thumbnails' ); ?></span></a>
     618
     619                <a href="#" class="toggle-video-thumbnails-test-content title-test-link"><h3 class="test-title"><?php _e( 'Test Saving to Media Library', 'video-thumbnails' ); ?></h3></a>
     620
     621                <div class="video-thumbnails-test-content">
     622
     623                    <p><?php _e( 'This test checks for issues with the process of saving a remote thumbnail to your local media library.', 'video-thumbnails' ); ?></p>
     624
     625                    <p><?php _e( 'Also be sure to test that you can manually upload an image to your site. If you\'re unable to upload images, you may need to <a href="http://codex.wordpress.org/Changing_File_Permissions">change file permissions</a>.', 'video-thumbnails' ); ?></p>
     626
     627                    <p>
     628                        <input type="submit" id="test-video-thumbnail-saving-media" class="button-primary video-thumbnails-test-button" value="<?php esc_attr_e( 'Download Test Image', 'video-thumbnails' ); ?>" />
     629                        <input type="submit" id="delete-video-thumbnail-test-images" class="button video-thumbnails-test-button" value="<?php esc_attr_e( 'Delete Test Images', 'video-thumbnails' ); ?>" />
     630                    </p>
     631
     632                    <div id="media-test-result"></div>
     633
     634                </div><!-- /.video-thumbnails-test-content -->
     635
     636            </div>
     637            <div class="video-thumbnails-test closed">
     638
     639                <a href="#" class="toggle-video-thumbnails-test-content show-hide-test-link"><span class="show"><?php _e( 'Show', 'video-thumbnails' ); ?></span> <span class="hide"><?php _e( 'Hide', 'video-thumbnails' ); ?></span></a>
     640
     641                <a href="#" class="toggle-video-thumbnails-test-content title-test-link"><h3 class="test-title"><?php _e( 'Installation Information', 'video-thumbnails' ); ?></h3></a>
     642
     643                <div class="video-thumbnails-test-content">
     644
     645                    <table class="widefat">
     646                        <thead>
     647                            <tr>
     648                                <th></th>
     649                                <th></th>
     650                                <th></th>
     651                            </tr>
     652                        </thead>
     653                        <tbody>
     654                            <tr>
     655                                <td><strong><?php _e( 'WordPress Version', 'video-thumbnails' ); ?></strong></td>
     656                                <td><?php echo get_bloginfo( 'version' ); ?></td>
     657                                <td></td>
     658                            </tr>
     659                            <tr>
     660                                <td><strong><?php _e( 'Video Thumbnails Version', 'video-thumbnails' ); ?></strong></td>
     661                                <td><?php echo VIDEO_THUMBNAILS_VERSION; ?></td>
     662                                <td></td>
     663                            </tr>
     664                            <tr>
     665                                <td><strong><?php _e( 'Video Thumbnails Settings Version', 'video-thumbnails' ); ?></strong></td>
     666                                <td><?php echo $this->options['version']; ?></td>
     667                                <td></td>
     668                            </tr>
     669                            <tr>
     670                                <td><strong><?php _e( 'PHP Version', 'video-thumbnails' ); ?></strong></td>
     671                                <td><?php echo PHP_VERSION; ?></td>
     672                                <td></td>
     673                            </tr>
     674                            <tr>
     675                                <td><strong><?php _e( 'Post Thumbnails', 'video-thumbnails' ); ?></strong></td>
     676                                <td><?php if ( current_theme_supports( 'post-thumbnails' ) ) : ?><span style="color:green">&#10004;</span> <?php _e( 'Your theme supports post thumbnails.', 'video-thumbnails' ); ?><?php else: ?><span style="color:red">&#10006;</span> <?php _e( 'Your theme does not support post thumbnails, you\'ll need to make modifications or switch to a different theme. <a href="http://codex.wordpress.org/Post_Thumbnails">More info</a>', 'video-thumbnails' ); ?><?php endif; ?></td>
     677                                <td></td>
     678                            </tr>
     679                            <tr>
     680                                <td><strong><?php _e( 'Video Providers', 'video-thumbnails' ); ?></strong></td>
     681                                <td>
     682                                    <?php global $video_thumbnails; ?>
     683                                        <?php $provider_names = array(); foreach ( $video_thumbnails->providers as $provider ) { $provider_names[] = $provider->service_name; }; ?>
     684                                    <strong><?php echo count( $video_thumbnails->providers ); ?></strong>: <?php echo implode( ', ', $provider_names ); ?>
     685                                </td>
     686                                <td></td>
     687                            </tr>
     688                        </tbody>
     689                        <tfoot>
     690                            <tr>
     691                                <th></th>
     692                                <th></th>
     693                                <th></th>
     694                            </tr>
     695                        </tfoot>
     696                    </table>
     697
     698                </div><!-- /.video-thumbnails-test-content -->
     699
     700            </div>
    655701
    656702            <?php
  • video-thumbnails/tags/2.10/readme.txt

    r931306 r950682  
    55Requires at least: 3.2
    66Tested up to: 3.9
    7 Stable tag: 2.9.1
     7Stable tag: 2.10
    88
    99Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
     
    132132
    133133== Changelog ==
     134
     135= 2.10 =
     136* Improved debugging page
    134137
    135138= 2.9.1 =
  • video-thumbnails/tags/2.10/video-thumbnails.php

    r931306 r950682  
    66Author: Sutherland Boswell
    77Author URI: http://sutherlandboswell.com
    8 Version: 2.9.1
     8Version: 2.10
    99License: GPL2
    1010Text Domain: video-thumbnails
     
    3131define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) );
    3232define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' );
    33 define( 'VIDEO_THUMBNAILS_VERSION', '2.9.1' );
     33define( 'VIDEO_THUMBNAILS_VERSION', '2.10' );
    3434
    3535// Providers
  • video-thumbnails/trunk/js/settings.js

    r922717 r950682  
    1 // Custom field detection
    21jQuery(function ($) {
    32
     3    /**
     4     * Custom field detection
     5     */
    46    $('#vt_detect_custom_field').on('click',function(e) {
    57        e.preventDefault();
     
    2426    });
    2527
     28    /**
     29     * Debugging tests
     30     */
     31    $('a.toggle-video-thumbnails-test-content').on('click',function(e) {
     32        e.preventDefault();
     33        $(this).closest('.video-thumbnails-test').toggleClass('closed');
     34    });
     35
     36    function enable_video_thumbnails_tests() {
     37        $('.video-thumbnails-test-button').attr('disabled',false);
     38    }
     39
     40    function disable_video_thumbnails_tests() {
     41        $('.video-thumbnails-test-button').attr('disabled',true);
     42    }
     43
     44    /* Provider testing */
     45
     46    function test_single_provider(provider_slug) {
     47        disable_video_thumbnails_tests();
     48        $('#'+provider_slug+'-provider-test').addClass('test-working');
     49        $('#'+provider_slug+'-provider-test .retest-video-provider').val(video_thumbnails_settings_language.working);
     50        var data = {
     51            action: 'video_thumbnail_provider_test',
     52            provider_slug: provider_slug
     53        };
     54        $.ajax({
     55            type: "POST",
     56            url: ajaxurl,
     57            data: data,
     58            success: function(response){
     59                $('#'+provider_slug+'-provider-test .test-results').html(response);
     60                $('#'+provider_slug+'-provider-test .retest-video-provider').val(video_thumbnails_settings_language.retest);
     61                $('#'+provider_slug+'-provider-test').removeClass('test-working');
     62                done_testing_single_provider();
     63            },
     64            error: function(XMLHttpRequest, textStatus, errorThrown) {
     65                $('#'+provider_slug+'-provider-test .test-results').html('<p>' + video_thumbnails_settings_language.ajax_error + ' ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText + '</p>');
     66                $('#'+provider_slug+'-provider-test .retest-video-provider').val(video_thumbnails_settings_language.retest);
     67                $('#'+provider_slug+'-provider-test').removeClass('test-working');
     68                done_testing_single_provider();
     69            }
     70        });
     71    }
     72
     73    var provider_index = 0;
     74    var testing_all_providers = false;
     75
     76    function done_testing_single_provider() {
     77        // If we aren't testing providers, don't do anything
     78        if (testing_all_providers==false) {
     79            enable_video_thumbnails_tests();
     80        }
     81        provider_index = provider_index + 1;
     82        if (provider_index>=video_thumbnails_provider_slugs.provider_slugs.length) {
     83            testing_all_providers = false;
     84            enable_video_thumbnails_tests();
     85            return;
     86        } else {
     87            test_single_provider(video_thumbnails_provider_slugs.provider_slugs[provider_index]);
     88        }
     89    }
     90
     91    $('#test-all-video-thumbnail-providers').on('click',function(e) {
     92        e.preventDefault();
     93        $('#provider-test-results').removeClass('hidden');
     94        $(this).parent().remove();
     95        testing_all_providers = true;
     96        test_single_provider(video_thumbnails_provider_slugs.provider_slugs[provider_index]);
     97    });
     98
     99    $('.retest-video-provider').on('click',function(e) {
     100        e.preventDefault();
     101        test_single_provider( $(this).data('provider-slug') );
     102    });
     103
     104    /* Markup detection testing */
     105    $('#test-markup-detection').on('click',function(e) {
     106        disable_video_thumbnails_tests();
     107        e.preventDefault();
     108        var data = {
     109            action: 'video_thumbnail_markup_detection_test',
     110            markup: $('#markup-input').val()
     111        };
     112        document.getElementById( 'markup-test-result' ).innerHTML = '<p>' + video_thumbnails_settings_language.working + '</p>';
     113        $.ajax({
     114            type: "POST",
     115            url: ajaxurl,
     116            data: data,
     117            success: function(response){
     118                document.getElementById( 'markup-test-result' ).innerHTML = response;
     119                enable_video_thumbnails_tests();
     120            },
     121            error: function(XMLHttpRequest, textStatus, errorThrown) {
     122                document.getElementById( 'markup-test-result' ).innerHTML = '<p>' + video_thumbnails_settings_language.ajax_error + ' ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText + '</p>';
     123                enable_video_thumbnails_tests();
     124            }
     125        });
     126    });
     127
     128    /* Media download testing */
    26129    $('#test-video-thumbnail-saving-media').on('click',function(e) {
     130        disable_video_thumbnails_tests();
    27131        $('#media-test-result').html( '<p>' + video_thumbnails_settings_language.working + '</p>' );
    28132        e.preventDefault();
     
    36140            success: function(response){
    37141                $('#media-test-result').html(response);
     142                enable_video_thumbnails_tests();
    38143            },
    39144            error: function(XMLHttpRequest, textStatus, errorThrown) {
    40145                $('#media-test-result').html('<p>' + video_thumbnails_settings_language.ajax_error + ' ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText + '</p>');
     146                enable_video_thumbnails_tests();
    41147            }
    42148        });
     
    44150
    45151    $('#delete-video-thumbnail-test-images').on('click',function(e) {
     152        disable_video_thumbnails_tests();
    46153        $('#media-test-result').html( '<p>' + video_thumbnails_settings_language.working + '</p>' );
    47154        e.preventDefault();
     
    55162            success: function(response){
    56163                $('#media-test-result').html(response);
     164                enable_video_thumbnails_tests();
    57165            },
    58166            error: function(XMLHttpRequest, textStatus, errorThrown) {
    59167                $('#media-test-result').html('<p>' + video_thumbnails_settings_language.ajax_error + ' ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText + '</p>');
     168                enable_video_thumbnails_tests();
    60169            }
    61170        });
     
    64173});
    65174
    66 // Test actions
    67 function test_video_thumbnail( test_type ) {
    68     var data = {
    69         action: 'video_thumbnail_' + test_type + '_test'
    70     };
    71     document.getElementById( test_type + '-test' ).innerHTML = video_thumbnails_settings_language.working;
    72     jQuery.ajax({
    73         type: "POST",
    74         url: ajaxurl,
    75         data: data,
    76         success: function(response){
    77             document.getElementById( test_type + '-test' ).innerHTML = response;
    78         },
    79         error: function(XMLHttpRequest, textStatus, errorThrown) {
    80             document.getElementById( test_type + '-test' ).innerHTML = '<p>' + video_thumbnails_settings_language.ajax_error + ' ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText + '</p>';
    81         }
    82     });
    83 };
    84 
    85 function test_video_thumbnail_markup_detection() {
    86     var data = {
    87         action: 'video_thumbnail_markup_detection_test',
    88         markup: jQuery('#markup-input').val()
    89     };
    90     document.getElementById( 'markup-test-result' ).innerHTML = '<p>' + video_thumbnails_settings_language.working + '</p>';
    91     jQuery.ajax({
    92         type: "POST",
    93         url: ajaxurl,
    94         data: data,
    95         success: function(response){
    96             document.getElementById( 'markup-test-result' ).innerHTML = response;
    97         },
    98         error: function(XMLHttpRequest, textStatus, errorThrown) {
    99             document.getElementById( 'markup-test-result' ).innerHTML = '<p>' + video_thumbnails_settings_language.ajax_error + ' ' + XMLHttpRequest.status + ' ' + XMLHttpRequest.statusText + '</p>';
    100         }
    101     });
    102 }
    103 
    104 // Clear all video thumbnails
     175/**
     176 * Clear all video thumbnails
     177 */
    105178function clear_all_video_thumbnails( nonce ) {
    106179    var confimation_result = confirm(video_thumbnails_settings_language.clear_all_confirmation);
  • video-thumbnails/trunk/php/class-video-thumbnails-settings.php

    r922717 r950682  
    4747        add_action( 'wp_ajax_video_thumbnail_delete_test_images', array( &$this, 'delete_test_images_callback' ) ); // Delete test images
    4848        add_action( 'wp_ajax_video_thumbnail_markup_detection_test', array( &$this, 'markup_detection_test_callback' ) ); // Markup input test
    49         // Settings page actions
    50         if ( isset ( $_GET['page'] ) && ( $_GET['page'] == 'video_thumbnails' ) ) {
    51             // Admin scripts
    52             add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );
    53         }
     49        // Admin scripts
     50        add_action( 'admin_enqueue_scripts', array( &$this, 'admin_scripts' ) );
    5451        // Add "Go Pro" call to action to settings footer
    5552        add_action( 'video_thumbnails/settings_footer', array( 'Video_Thumbnails_Settings', 'settings_footer' ) );
     
    136133    }
    137134
    138     function admin_scripts() {
    139         wp_enqueue_script( 'video_thumbnails_settings', plugins_url( 'js/settings.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ), array( 'jquery' ), VIDEO_THUMBNAILS_VERSION );
    140         wp_localize_script( 'video_thumbnails_settings', 'video_thumbnails_settings_language', array(
    141             'detection_failed'       => __( 'We were unable to find a video in the custom fields of your most recently updated post.', 'video-thumbnails' ),
    142             'working'                => __( 'Working...', 'video-thumbnails' ),
    143             'ajax_error'             => __( 'AJAX Error:', 'video-thumbnails' ),
    144             'clear_all_confirmation' => __( 'Are you sure you want to clear all video thumbnails? This cannot be undone.', 'video-thumbnails' ),
    145         ) );
     135    function admin_scripts( $hook ) {
     136        if ( 'settings_page_video_thumbnails' == $hook ) {
     137            wp_enqueue_style( 'video-thumbnails-settings-css', plugins_url( '/css/settings.css', VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ), false, VIDEO_THUMBNAILS_VERSION );
     138            wp_enqueue_script( 'video_thumbnails_settings', plugins_url( 'js/settings.js' , VIDEO_THUMBNAILS_PATH . '/video-thumbnails.php' ), array( 'jquery' ), VIDEO_THUMBNAILS_VERSION );
     139            wp_localize_script( 'video_thumbnails_settings', 'video_thumbnails_settings_language', array(
     140                'detection_failed'       => __( 'We were unable to find a video in the custom fields of your most recently updated post.', 'video-thumbnails' ),
     141                'working'                => __( 'Working...', 'video-thumbnails' ),
     142                'retest'                 => __( 'Retest', 'video-thumbnails' ),
     143                'ajax_error'             => __( 'AJAX Error:', 'video-thumbnails' ),
     144                'clear_all_confirmation' => __( 'Are you sure you want to clear all video thumbnails? This cannot be undone.', 'video-thumbnails' ),
     145            ) );
     146            global $video_thumbnails;
     147            $provider_slugs = array();
     148            foreach ( $video_thumbnails->providers as $provider ) {
     149                $provider_slugs[] = $provider->service_slug;
     150            }
     151            wp_localize_script( 'video_thumbnails_settings', 'video_thumbnails_provider_slugs', array(
     152                'provider_slugs' => $provider_slugs
     153            ) );
     154        }
    146155    }
    147156
     
    223232                </thead>
    224233                <tbody>
    225             <?php
    226             $passed = 0;
    227             $failed = 0;
    228             foreach ( $video_thumbnails->providers as $provider ) {
     234                <?php
     235                $provider = $video_thumbnails->providers[$_POST['provider_slug']];
    229236                foreach ( $provider->get_test_cases() as $test_case ) {
    230237                    echo '<tr>';
    231                     echo '<td><strong>' . $provider->service_name . '</strong> - ' . $test_case['name'] . '</td>';
     238                    echo '<td><strong>' . $test_case['name'] . '</strong></td>';
    232239                    $markup = apply_filters( 'the_content', $test_case['markup'] );
    233240                    $result = $video_thumbnails->get_first_thumbnail_url( $markup );
     
    252259                        if ( $matched ) {
    253260                            echo '<td style="color:green;">&#10004; ' . __( 'Passed', 'video-thumbnails' ) . '</td>';
    254                             $passed++;
    255261                        } else {
    256262                            echo '<td style="color:red;">&#10007; ' . __( 'Failed', 'video-thumbnails' ) . '</td>';
    257                             $failed++;
    258263                        }
    259264                        echo '<td>';
     
    267272                    }
    268273                    echo '</tr>';
    269                 }
    270             } ?>
     274                } ?>
    271275                <tbody>
    272                 <tfoot>
    273                     <tr>
    274                         <th></th>
    275                         <th><span style="color:green;">&#10004; <?php echo $passed; ?></span> / <span style="color:red;">&#10007; <?php echo $failed; ?></span></th>
    276                         <th></th>
    277                     </tr>
    278                 </tfoot>
    279276            </table>
    280277        <?php die();
     
    497494        }
    498495
     496        global $video_thumbnails;
     497
    499498        ?><div class="wrap">
    500499
     
    569568            <p><?php _e( 'Use these tests to help diagnose any problems. Please include results when requesting support.', 'video-thumbnails' ); ?></p>
    570569
    571             <h3><?php _e( 'Test Video Providers', 'video-thumbnails' ); ?></h3>
    572 
    573             <p><?php _e( 'This test automatically searches a sample for every type of video supported and compares it to the expected value. Sometimes tests may fail due to API rate limits.', 'video-thumbnails' ); ?></p>
    574 
    575             <div id="provider-test">
    576                 <p><input type="submit" class="button-primary" onclick="test_video_thumbnail('provider');" value="<?php esc_attr_e( 'Test Video Providers', 'video-thumbnails' ); ?>" /></p>
     570            <div class="video-thumbnails-test closed">
     571
     572                <a href="#" class="toggle-video-thumbnails-test-content show-hide-test-link"><span class="show"><?php _e( 'Show', 'video-thumbnails' ); ?></span> <span class="hide"><?php _e( 'Hide', 'video-thumbnails' ); ?></span></a>
     573
     574                <a href="#" class="toggle-video-thumbnails-test-content title-test-link"><h3 class="test-title"><?php _e( 'Test Video Providers', 'video-thumbnails' ); ?></h3></a>
     575
     576                <div class="video-thumbnails-test-content">
     577
     578                    <p><?php _e( 'This test automatically searches a sample for every type of video supported and compares it to the expected value. Sometimes tests may fail due to API rate limits.', 'video-thumbnails' ); ?></p>
     579
     580                    <p><input type="submit" class="button-primary video-thumbnails-test-button" id="test-all-video-thumbnail-providers" value="<?php esc_attr_e( 'Test Video Providers', 'video-thumbnails' ); ?>" /></p>
     581
     582                    <div id="provider-test-results" class="hidden">
     583                        <?php
     584                        foreach ( $video_thumbnails->providers as $provider ) {
     585                            echo '<div id="' . $provider->service_slug . '-provider-test" class="single-provider-test-results">';
     586                                echo '<h3>' . $provider->service_name . ' <input type="submit" data-provider-slug="' . $provider->service_slug . '" class="button-primary retest-video-provider video-thumbnails-test-button" value="' . esc_attr__( 'Waiting...', 'video-thumbnails' ) . '" /></h3>';
     587                                echo '<div class="test-results"></div>';
     588                            echo '</div>';
     589                        }
     590                        ?>
     591                    </div>
     592
     593                </div><!-- /.video-thumbnails-test-content -->
     594
    577595            </div>
    578 
    579             <h3><?php _e( 'Test Markup for Video', 'video-thumbnails' ); ?></h3>
    580 
    581             <p><?php _e( 'Copy and paste an embed code below to see if a video is detected.', 'video-thumbnails' ); ?></p>
    582 
    583             <textarea id="markup-input" cols="50" rows="5"></textarea>
    584 
    585             <p><input type="submit" class="button-primary" onclick="test_video_thumbnail_markup_detection();" value="<?php esc_attr_e( 'Scan For Thumbnail', 'video-thumbnails' ); ?>" /></p>
    586 
    587             <div id="markup-test-result"></div>
    588 
    589             <h3><?php _e( 'Test Saving to Media Library', 'video-thumbnails' ); ?></h3>
    590 
    591             <p><?php _e( 'This test checks for issues with the process of saving a remote thumbnail to your local media library.', 'video-thumbnails' ); ?></p>
    592 
    593             <p><?php _e( 'Also be sure to test that you can manually upload an image to your site. If you\'re unable to upload images, you may need to <a href="http://codex.wordpress.org/Changing_File_Permissions">change file permissions</a>.', 'video-thumbnails' ); ?></p>
    594 
    595             <p>
    596                 <input type="submit" id="test-video-thumbnail-saving-media" class="button-primary" value="<?php esc_attr_e( 'Download Test Image', 'video-thumbnails' ); ?>" />
    597                 <input type="submit" id="delete-video-thumbnail-test-images" class="button" value="<?php esc_attr_e( 'Delete Test Images', 'video-thumbnails' ); ?>" />
    598             </p>
    599 
    600             <div id="media-test-result"></div>
    601 
    602             <h3><?php _e( 'Installation Information', 'video-thumbnails' ); ?></h3>
    603             <table class="widefat">
    604                 <thead>
    605                     <tr>
    606                         <th></th>
    607                         <th></th>
    608                         <th></th>
    609                     </tr>
    610                 </thead>
    611                 <tbody>
    612                     <tr>
    613                         <td><strong><?php _e( 'WordPress Version', 'video-thumbnails' ); ?></strong></td>
    614                         <td><?php echo get_bloginfo( 'version' ); ?></td>
    615                         <td></td>
    616                     </tr>
    617                     <tr>
    618                         <td><strong><?php _e( 'Video Thumbnails Version', 'video-thumbnails' ); ?></strong></td>
    619                         <td><?php echo VIDEO_THUMBNAILS_VERSION; ?></td>
    620                         <td></td>
    621                     </tr>
    622                     <tr>
    623                         <td><strong><?php _e( 'Video Thumbnails Settings Version', 'video-thumbnails' ); ?></strong></td>
    624                         <td><?php echo $this->options['version']; ?></td>
    625                         <td></td>
    626                     </tr>
    627                     <tr>
    628                         <td><strong><?php _e( 'PHP Version', 'video-thumbnails' ); ?></strong></td>
    629                         <td><?php echo PHP_VERSION; ?></td>
    630                         <td></td>
    631                     </tr>
    632                     <tr>
    633                         <td><strong><?php _e( 'Post Thumbnails', 'video-thumbnails' ); ?></strong></td>
    634                         <td><?php if ( current_theme_supports( 'post-thumbnails' ) ) : ?><span style="color:green">&#10004;</span> <?php _e( 'Your theme supports post thumbnails.', 'video-thumbnails' ); ?><?php else: ?><span style="color:red">&#10006;</span> <?php _e( 'Your theme does not support post thumbnails, you\'ll need to make modifications or switch to a different theme. <a href="http://codex.wordpress.org/Post_Thumbnails">More info</a>', 'video-thumbnails' ); ?><?php endif; ?></td>
    635                         <td></td>
    636                     </tr>
    637                     <tr>
    638                         <td><strong><?php _e( 'Video Providers', 'video-thumbnails' ); ?></strong></td>
    639                         <td>
    640                             <?php global $video_thumbnails; ?>
    641                                 <?php $provider_names = array(); foreach ( $video_thumbnails->providers as $provider ) { $provider_names[] = $provider->service_name; }; ?>
    642                             <strong><?php echo count( $video_thumbnails->providers ); ?></strong>: <?php echo implode( ', ', $provider_names ); ?>
    643                         </td>
    644                         <td></td>
    645                     </tr>
    646                 </tbody>
    647                 <tfoot>
    648                     <tr>
    649                         <th></th>
    650                         <th></th>
    651                         <th></th>
    652                     </tr>
    653                 </tfoot>
    654             </table>
     596            <div class="video-thumbnails-test closed">
     597
     598                <a href="#" class="toggle-video-thumbnails-test-content show-hide-test-link"><span class="show"><?php _e( 'Show', 'video-thumbnails' ); ?></span> <span class="hide"><?php _e( 'Hide', 'video-thumbnails' ); ?></span></a>
     599
     600                <a href="#" class="toggle-video-thumbnails-test-content title-test-link"><h3 class="test-title"><?php _e( 'Test Markup for Video', 'video-thumbnails' ); ?></h3></a>
     601
     602                <div class="video-thumbnails-test-content">
     603
     604                    <p><?php _e( 'Copy and paste an embed code below to see if a video is detected.', 'video-thumbnails' ); ?></p>
     605
     606                    <textarea id="markup-input" cols="50" rows="5"></textarea>
     607
     608                    <p><input type="submit" id="test-markup-detection" class="button-primary video-thumbnails-test-button" value="<?php esc_attr_e( 'Scan For Thumbnail', 'video-thumbnails' ); ?>" /></p>
     609
     610                    <div id="markup-test-result"></div>
     611
     612                </div><!-- /.video-thumbnails-test-content -->
     613
     614            </div>
     615            <div class="video-thumbnails-test closed">
     616
     617                <a href="#" class="toggle-video-thumbnails-test-content show-hide-test-link"><span class="show"><?php _e( 'Show', 'video-thumbnails' ); ?></span> <span class="hide"><?php _e( 'Hide', 'video-thumbnails' ); ?></span></a>
     618
     619                <a href="#" class="toggle-video-thumbnails-test-content title-test-link"><h3 class="test-title"><?php _e( 'Test Saving to Media Library', 'video-thumbnails' ); ?></h3></a>
     620
     621                <div class="video-thumbnails-test-content">
     622
     623                    <p><?php _e( 'This test checks for issues with the process of saving a remote thumbnail to your local media library.', 'video-thumbnails' ); ?></p>
     624
     625                    <p><?php _e( 'Also be sure to test that you can manually upload an image to your site. If you\'re unable to upload images, you may need to <a href="http://codex.wordpress.org/Changing_File_Permissions">change file permissions</a>.', 'video-thumbnails' ); ?></p>
     626
     627                    <p>
     628                        <input type="submit" id="test-video-thumbnail-saving-media" class="button-primary video-thumbnails-test-button" value="<?php esc_attr_e( 'Download Test Image', 'video-thumbnails' ); ?>" />
     629                        <input type="submit" id="delete-video-thumbnail-test-images" class="button video-thumbnails-test-button" value="<?php esc_attr_e( 'Delete Test Images', 'video-thumbnails' ); ?>" />
     630                    </p>
     631
     632                    <div id="media-test-result"></div>
     633
     634                </div><!-- /.video-thumbnails-test-content -->
     635
     636            </div>
     637            <div class="video-thumbnails-test closed">
     638
     639                <a href="#" class="toggle-video-thumbnails-test-content show-hide-test-link"><span class="show"><?php _e( 'Show', 'video-thumbnails' ); ?></span> <span class="hide"><?php _e( 'Hide', 'video-thumbnails' ); ?></span></a>
     640
     641                <a href="#" class="toggle-video-thumbnails-test-content title-test-link"><h3 class="test-title"><?php _e( 'Installation Information', 'video-thumbnails' ); ?></h3></a>
     642
     643                <div class="video-thumbnails-test-content">
     644
     645                    <table class="widefat">
     646                        <thead>
     647                            <tr>
     648                                <th></th>
     649                                <th></th>
     650                                <th></th>
     651                            </tr>
     652                        </thead>
     653                        <tbody>
     654                            <tr>
     655                                <td><strong><?php _e( 'WordPress Version', 'video-thumbnails' ); ?></strong></td>
     656                                <td><?php echo get_bloginfo( 'version' ); ?></td>
     657                                <td></td>
     658                            </tr>
     659                            <tr>
     660                                <td><strong><?php _e( 'Video Thumbnails Version', 'video-thumbnails' ); ?></strong></td>
     661                                <td><?php echo VIDEO_THUMBNAILS_VERSION; ?></td>
     662                                <td></td>
     663                            </tr>
     664                            <tr>
     665                                <td><strong><?php _e( 'Video Thumbnails Settings Version', 'video-thumbnails' ); ?></strong></td>
     666                                <td><?php echo $this->options['version']; ?></td>
     667                                <td></td>
     668                            </tr>
     669                            <tr>
     670                                <td><strong><?php _e( 'PHP Version', 'video-thumbnails' ); ?></strong></td>
     671                                <td><?php echo PHP_VERSION; ?></td>
     672                                <td></td>
     673                            </tr>
     674                            <tr>
     675                                <td><strong><?php _e( 'Post Thumbnails', 'video-thumbnails' ); ?></strong></td>
     676                                <td><?php if ( current_theme_supports( 'post-thumbnails' ) ) : ?><span style="color:green">&#10004;</span> <?php _e( 'Your theme supports post thumbnails.', 'video-thumbnails' ); ?><?php else: ?><span style="color:red">&#10006;</span> <?php _e( 'Your theme does not support post thumbnails, you\'ll need to make modifications or switch to a different theme. <a href="http://codex.wordpress.org/Post_Thumbnails">More info</a>', 'video-thumbnails' ); ?><?php endif; ?></td>
     677                                <td></td>
     678                            </tr>
     679                            <tr>
     680                                <td><strong><?php _e( 'Video Providers', 'video-thumbnails' ); ?></strong></td>
     681                                <td>
     682                                    <?php global $video_thumbnails; ?>
     683                                        <?php $provider_names = array(); foreach ( $video_thumbnails->providers as $provider ) { $provider_names[] = $provider->service_name; }; ?>
     684                                    <strong><?php echo count( $video_thumbnails->providers ); ?></strong>: <?php echo implode( ', ', $provider_names ); ?>
     685                                </td>
     686                                <td></td>
     687                            </tr>
     688                        </tbody>
     689                        <tfoot>
     690                            <tr>
     691                                <th></th>
     692                                <th></th>
     693                                <th></th>
     694                            </tr>
     695                        </tfoot>
     696                    </table>
     697
     698                </div><!-- /.video-thumbnails-test-content -->
     699
     700            </div>
    655701
    656702            <?php
  • video-thumbnails/trunk/readme.txt

    r931306 r950682  
    55Requires at least: 3.2
    66Tested up to: 3.9
    7 Stable tag: 2.9.1
     7Stable tag: 2.10
    88
    99Video Thumbnails simplifies the process of automatically displaying video thumbnails in your WordPress template.
     
    132132
    133133== Changelog ==
     134
     135= 2.10 =
     136* Improved debugging page
    134137
    135138= 2.9.1 =
  • video-thumbnails/trunk/video-thumbnails.php

    r931306 r950682  
    66Author: Sutherland Boswell
    77Author URI: http://sutherlandboswell.com
    8 Version: 2.9.1
     8Version: 2.10
    99License: GPL2
    1010Text Domain: video-thumbnails
     
    3131define( 'VIDEO_THUMBNAILS_PATH', dirname(__FILE__) );
    3232define( 'VIDEO_THUMBNAILS_FIELD', '_video_thumbnail' );
    33 define( 'VIDEO_THUMBNAILS_VERSION', '2.9.1' );
     33define( 'VIDEO_THUMBNAILS_VERSION', '2.10' );
    3434
    3535// Providers
Note: See TracChangeset for help on using the changeset viewer.