Plugin Directory

Changeset 761345


Ignore:
Timestamp:
08/23/2013 04:39:12 PM (13 years ago)
Author:
titopandub
Message:

Fix bug on new scheduling feature

Location:
evergreen-post-tweeter/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • evergreen-post-tweeter/trunk/Include/ept-debug.php

    r748326 r761345  
    33function EPT_DEBUG( $str ) {
    44    global $ept_debug;
    5         $ept_enable_log = get_option('ept_enable_log');
    6         if($ept_enable_log)
    7         {
    8     $ept_debug->enable(true);
    9         }
     5    $ept_enable_log = get_option('ept_enable_log');
     6    if($ept_enable_log)
     7    {
     8        $ept_debug->enable(true);
     9    }
    1010       
    1111    $ept_debug->add_to_log( $str );
  • evergreen-post-tweeter/trunk/countdown/ept-app.js

    r698835 r761345  
    11jQuery(document).ready(function($) {
    2     var untilDay = new Date(nextTweetTime * 1000);
     2    var untilDay = new Date(nextTweetTime.tweetTime * 1000);
    33    $('#defaultCountdown').countdown({until: untilDay , format: 'HMS'});
    44});
  • evergreen-post-tweeter/trunk/ept-admin.php

    r756431 r761345  
    1010    //check permission
    1111    if (current_user_can('manage_options'))
    12         {
     12    {
    1313        $message = null;
    1414        $message_updated = __("Evergreen Post Tweeter options have been updated!", 'Evergreen');
     15        $ept_after_update = get_option( 'ept_after_update' );
     16        if ( $ept_after_update ) {
     17            print('
     18                <div id="message" class="updated fade">
     19                    <p>' . __('Evergreen Post Tweeter Options Updated.', 'Evergreen') . '</p>
     20                </div>');
     21            update_option( 'ept_after_update', false );
     22        }
    1523        $response = null;
    1624        $save = true;
     
    9199        }
    92100
    93        
    94         if ( get_option('next_tweet_time')=='0' ){
    95             $next_tweet_time = ept_determine_next_update();
    96             update_option('next_tweet_time', $next_tweet_time);
    97         }
    98 
    99101        //if submit and if bitly selected its fields are filled then save
    100102        if (isset($_POST['submit']) && $save) {
    101103            $message = $message_updated;
    102 
     104           
    103105            //
    104106            if (isset($_POST['as_number_tweet'])) {
     
    229231                update_option('ept_opt_hashtags', '');
    230232            }
    231            
    232             $next_tweet_time = ept_determine_next_update();
    233             update_option('next_tweet_time', $next_tweet_time);
    234233
    235234            //minimum post age to tweet
     
    327326
    328327            // set schedule time - counter
    329             if (isset($_POST['ept_opt_schedule_times_counter'])) {
     328            if (isset( $_POST['ept_opt_schedule_times_counter'] ) &&
     329                isset( $_POST['ept_opt_schedule_times_hour'] ) &&
     330                isset( $_POST['ept_opt_schedule_times_minute'] )
     331                ) {
     332                $ept_schedule_times_counter = $_POST['ept_opt_schedule_times_counter'];
     333                $ept_schedule_times_hour_array = $_POST['ept_opt_schedule_times_hour'];
     334                $ept_schedule_times_minute_array = $_POST['ept_opt_schedule_times_minute'];
     335                foreach ($ept_schedule_times_counter as $key => $value) {
     336                    $timestamp = strtotime($ept_schedule_times_hour_array[$key] . ':' . $ept_schedule_times_minute_array[$key]);
     337                    $ept_opt_schedule_times[$timestamp]['hour']    = $ept_schedule_times_hour_array[$key];
     338                    $ept_opt_schedule_times[$timestamp]['minute']  = $ept_schedule_times_minute_array[$key];
     339                }
     340                ksort($ept_opt_schedule_times);
    330341                update_option('ept_opt_schedule_times_counter', $_POST['ept_opt_schedule_times_counter']);
     342                update_option('ept_opt_schedule_times', $ept_opt_schedule_times);
    331343            } else {
    332344                update_option('ept_opt_schedule_times_counter', array());
    333             }
    334 
     345                update_option('ept_opt_schedule_times', array());
     346            }
     347
     348            update_option( 'next_tweet_time', ept_determine_next_update() );
    335349            // set schedule time - hour
    336350            if (isset($_POST['ept_opt_schedule_times_hour'])) {
     
    365379            }
    366380
     381            update_option( 'ept_after_update', true );
     382
     383            echo '<script language="javascript">window.open ("' . get_bloginfo('wpurl') . '/wp-admin/options-general.php?page=Evergreen","_self")</script>';
     384            die;
     385
    367386            //successful update message
    368             print('
    369             <div id="message" class="updated fade">
    370                 <p>' . __('Evergreen Post Tweeter Options Updated.', 'Evergreen') . '</p>
    371             </div>');
    372387        }
    373388        //tweet now clicked
     
    395410        }
    396411    //set up data into fields from db
    397             global $wpdb;
     412        global $wpdb;
    398413
    399414        $admin_url = site_url('/wp-admin/options-general.php?page=Evergreen');         
     
    612627        }
    613628
    614         $ept_opt_schedule_times_hour = get_option( 'ept_opt_schedule_times_hour' );
    615         if (!(isset($ept_opt_schedule_times_hour)) || ! is_array($ept_opt_schedule_times_hour)) {
    616             $ept_opt_schedule_times_hour = array();
    617         }
    618 
    619         $ept_opt_schedule_times_minute = get_option( 'ept_opt_schedule_times_minute' );
    620         if (!(isset($ept_opt_schedule_times_minute)) || ! is_array($ept_opt_schedule_times_minute)) {
    621             $ept_opt_schedule_times_minute = array();
     629        // $ept_opt_schedule_times_hour = get_option( 'ept_opt_schedule_times_hour' );
     630        // if (!(isset($ept_opt_schedule_times_hour)) || ! is_array($ept_opt_schedule_times_hour)) {
     631        //     $ept_opt_schedule_times_hour = array();
     632        // }
     633
     634        // $ept_opt_schedule_times_minute = get_option( 'ept_opt_schedule_times_minute' );
     635        // if (!(isset($ept_opt_schedule_times_minute)) || ! is_array($ept_opt_schedule_times_minute)) {
     636        //     $ept_opt_schedule_times_minute = array();
     637        // }
     638
     639        $ept_opt_schedule_times = get_option( 'ept_opt_schedule_times' );
     640        if (!(isset($ept_opt_schedule_times)) || ! is_array($ept_opt_schedule_times)) {
     641            $ept_opt_schedule_times = array();
     642        }
     643
     644        foreach ($ept_opt_schedule_times as $key => $value) {
     645            // echo var_dump($value);
     646            $ept_opt_schedule_times_hour[] = $value['hour'];
     647            $ept_opt_schedule_times_minute[] = $value['minute'];
    622648        }
    623649
     
    799825                            <div style="clear: left;"></div>
    800826                            <label></label>
    801                             <div>Tweet at these times on <span id="scheduled-days"></span><div>
     827                            <div>Tweet at these times on <span id="scheduled-days"></span></div>
    802828                            <div style="clear: left;"></div>
    803829                            <label></label>
  • evergreen-post-tweeter/trunk/ept-core.php

    r756431 r761345  
    131131
    132132function ept_tweet_old_post() {
    133     //check last tweet time against set interval and span
    134     //also check if it isn't in pause time
    135     // if (ept_opt_update_time() && ! ept_in_pause_time()) {
    136     //     update_option('ept_opt_last_update', current_time('timestamp', 0));
    137        //  ept_opt_tweet_old_post();
    138     // }
    139 
    140     // if ( ept_opt_update_time() ) {
    141     //     update_option('ept_opt_last_update', current_time('timestamp', 0));
    142     //     ept_opt_tweet_old_post();
    143     // }
    144    
     133//check last tweet time against set interval and span
     134//also check if it isn't in pause time
     135// if (ept_opt_update_time() && ! ept_in_pause_time()) {
     136//     update_option('ept_opt_last_update', current_time('timestamp', 0));
     137   //  ept_opt_tweet_old_post();
     138// }
     139
     140// if ( ept_opt_update_time() ) {
     141//     update_option('ept_opt_last_update', current_time('timestamp', 0));
     142//     ept_opt_tweet_old_post();
     143// }
     144
    145145    if ( ept_check_day_update() && ept_new_to_update() ) {
    146146        update_option('ept_opt_last_update', current_time('timestamp', 0));
    147147        ept_opt_tweet_old_post();
    148148    }
    149 }
    150 
     149    update_option( 'next_tweet_time', ept_determine_next_update() );
     150}
     151
     152function ept_new_to_update()
     153{
     154    global $wpdb;
     155    $last = $wpdb->get_var("select SQL_NO_CACHE option_value from $wpdb->options where option_name = 'ept_opt_last_update';");
     156
     157    $ept_opt_schedule_times_counter = get_option( 'ept_opt_schedule_times_counter' );
     158    if (!(isset($ept_opt_schedule_times_counter)) || ! is_array($ept_opt_schedule_times_counter)) {
     159        $ept_opt_schedule_times_counter = array();
     160    }
     161
     162    $ept_opt_schedule_times = get_option( 'ept_opt_schedule_times' );
     163    if (!(isset($ept_opt_schedule_times)) || ! is_array($ept_opt_schedule_times)) {
     164        $ept_opt_schedule_times = array();
     165    }
     166    ksort( $ept_opt_schedule_times );
     167
     168    // $ept_opt_schedule_times_hour = get_option( 'ept_opt_schedule_times_hour' );
     169    // if (!(isset($ept_opt_schedule_times_hour)) || ! is_array($ept_opt_schedule_times_hour)) {
     170    //     $ept_opt_schedule_times_hour = array();
     171    // }
     172
     173    // $ept_opt_schedule_times_minute = get_option( 'ept_opt_schedule_times_minute' );
     174    // if (!(isset($ept_opt_schedule_times_minute)) || ! is_array($ept_opt_schedule_times_minute)) {
     175    //     $ept_opt_schedule_times_minute = array();
     176    // }
     177
     178    $ret = false;
     179    if ( ! empty( $ept_opt_schedule_times ) ) {
     180        $last_element = array_pop( array_keys( $ept_opt_schedule_times ) );
     181    }
     182    $previous_time = null;
     183
     184    foreach ( $ept_opt_schedule_times as $key => $time ) {
     185        $ept_time_start = strtotime($time['hour'] . ':' . $time['minute'], current_time('timestamp', 0));
     186
     187        // echo var_dump( $last ) . "\n";
     188        // echo var_dump( $previous_time ) . "\n";
     189        // echo var_dump( $ept_time_start ) . "\n";
     190
     191        if ( $key == $last_element ) {
     192            $midnight_time = strtotime("23:59:59", current_time('timestamp', 0));
     193
     194            if (
     195                $ept_time_start < (Integer)current_time('timestamp', 0) &&
     196                (Integer)current_time('timestamp', 0) < $midnight_time &&
     197                ( ! ( $ept_time_start < (Integer)$last && (Integer)$last < $midnight_time ) )
     198                ) {
     199                $ret = true;
     200                break;
     201            }
     202        }
     203
     204        if (
     205            $previous_time < (Integer)current_time('timestamp', 0) &&
     206            (Integer)current_time('timestamp', 0) < $ept_time_start &&
     207            ( ! ( $previous_time < (Integer)$last && (Integer)$last < $ept_time_start ) )
     208            ) {
     209            $ret = true;
     210            break;
     211        }
     212
     213        $previous_time = $ept_time_start;
     214    }
     215
     216    return $ret;
     217}
     218
     219function ept_determine_next_update()
     220{
     221    $ept_opt_schedule_times_counter = get_option( 'ept_opt_schedule_times_counter' );
     222    if (!(isset($ept_opt_schedule_times_counter)) || ! is_array($ept_opt_schedule_times_counter)) {
     223        $ept_opt_schedule_times_counter = array();
     224    }
     225
     226    // $ept_opt_schedule_times = get_option( 'ept_opt_schedule_times' );
     227    // if (!(isset($ept_opt_schedule_times)) || ! is_array($ept_opt_schedule_times)) {
     228    //     $ept_opt_schedule_times = array();
     229    // }
     230
     231    // $ept_opt_schedule_times_hour = get_option( 'ept_opt_schedule_times_hour' );
     232    // if (!(isset($ept_opt_schedule_times_hour)) || ! is_array($ept_opt_schedule_times_hour)) {
     233    //     $ept_opt_schedule_times_hour = array();
     234    // }
     235
     236    // $ept_opt_schedule_times_minute = get_option( 'ept_opt_schedule_times_minute' );
     237    // if (!(isset($ept_opt_schedule_times_minute)) || ! is_array($ept_opt_schedule_times_minute)) {
     238    //     $ept_opt_schedule_times_minute = array();
     239    // }
     240
     241    $ept_opt_schedule_times = get_option( 'ept_opt_schedule_times' );
     242    if (!(isset($ept_opt_schedule_times)) || ! is_array($ept_opt_schedule_times)) {
     243        $ept_opt_schedule_times = array();
     244    }
     245    ksort( $ept_opt_schedule_times );
     246
     247    $ept_times = array();
     248    $last_element = array_pop( array_keys( $ept_opt_schedule_times ) );
     249    $first_element = array_shift( array_keys( $ept_opt_schedule_times ) );
     250
     251    foreach ($ept_opt_schedule_times as $key => $time) {
     252        $ept_time_start = strtotime($time['hour'] . ':' . $time['minute'], current_time('timestamp', 0));
     253
     254        if ( $key != $last_element ) {
     255            $remaining_time = $ept_time_start - current_time( 'timestamp', 0 );
     256        } else {
     257            if ( current_time('timestamp', 0) > $ept_time_start ) {
     258                $ept_time_tomorrow = strtotime(
     259                    $ept_opt_schedule_times[$first_element]['hour'] . ':' . $ept_opt_schedule_times[$first_element]['minute'],
     260                    current_time( 'timestamp', 0 )
     261                );
     262                $ept_time_tomorrow += (24 * 60 *60);
     263                // echo var_dump();
     264                $remaining_time = $ept_time_tomorrow - current_time( 'timestamp', 0 );
     265            } else {
     266                $remaining_time = $ept_time_start - current_time( 'timestamp', 0 );
     267            }
     268        }
     269        if ( 0 < $remaining_time ) {
     270            $ept_times[] = $remaining_time;
     271        }
     272    }
     273
     274    if ( empty($ept_times) ) {
     275        return 0;
     276    }
     277
     278    return (Integer)(time() + $ept_times[min(array_keys($ept_times, min($ept_times)))]);
     279}
     280
     281function ept_check_day_update()
     282{
     283    $current_day = date( 'N', current_time('timestamp', 0) );
     284    $ept_opt_schedule_day_mon = get_option('ept_opt_schedule_day_mon');
     285    $ept_opt_schedule_day_tue = get_option('ept_opt_schedule_day_tue');
     286    $ept_opt_schedule_day_wed = get_option('ept_opt_schedule_day_wed');
     287    $ept_opt_schedule_day_thu = get_option('ept_opt_schedule_day_thu');
     288    $ept_opt_schedule_day_fri = get_option('ept_opt_schedule_day_fri');
     289    $ept_opt_schedule_day_sat = get_option('ept_opt_schedule_day_sat');
     290    $ept_opt_schedule_day_sun = get_option('ept_opt_schedule_day_sun');
     291    $ret = false;
     292
     293    if ($current_day == $ept_opt_schedule_day_mon) {
     294        $ret = true;
     295    } else if ($current_day == $ept_opt_schedule_day_tue) {
     296        $ret = true;
     297    } else if ($current_day == $ept_opt_schedule_day_wed) {
     298        $ret = true;
     299    } else if ($current_day == $ept_opt_schedule_day_thu) {
     300        $ret = true;
     301    } else if ($current_day == $ept_opt_schedule_day_fri) {
     302        $ret = true;
     303    } else if ($current_day == $ept_opt_schedule_day_sat) {
     304        $ret = true;
     305    } else if ($current_day == $ept_opt_schedule_day_sun) {
     306        $ret = true;
     307    }
     308   
     309    return $ret;
     310}
    151311
    152312function ept_currentPageURL() {
     
    291451        ept_w3tc_cache_flush();
    292452
    293         $next_tweet_time = ept_determine_next_update();
    294         update_option('next_tweet_time', $next_tweet_time);
     453        update_option( 'next_tweet_time', ept_determine_next_update() );
    295454
    296455        return $ret;
     
    540699    $tags = $twitter_hashtags;
    541700    $message_length = strlen($message);
    542     $url_length = strlen($url);
     701    $url_length = preg_match("@^https?://@", $url) ? 23 : 22;
    543702    //$cur_length = strlen($tags);
    544703    if ($hashtag_length == 0)
     
    574733
    575734ept_w3tc_cache_flush();
    576 
    577 function ept_new_to_update()
    578 {
    579     global $wpdb;
    580     $last  = $wpdb->get_var("select SQL_NO_CACHE option_value from $wpdb->options where option_name = 'ept_opt_last_update';");
    581 
    582     $ept_opt_schedule_times_counter = get_option( 'ept_opt_schedule_times_counter' );
    583     if (!(isset($ept_opt_schedule_times_counter)) || ! is_array($ept_opt_schedule_times_counter)) {
    584         $ept_opt_schedule_times_counter = array();
    585     }
    586 
    587     $ept_opt_schedule_times_hour = get_option( 'ept_opt_schedule_times_hour' );
    588     if (!(isset($ept_opt_schedule_times_hour)) || ! is_array($ept_opt_schedule_times_hour)) {
    589         $ept_opt_schedule_times_hour = array();
    590     }
    591 
    592     $ept_opt_schedule_times_minute = get_option( 'ept_opt_schedule_times_minute' );
    593     if (!(isset($ept_opt_schedule_times_minute)) || ! is_array($ept_opt_schedule_times_minute)) {
    594         $ept_opt_schedule_times_minute = array();
    595     }
    596 
    597     $ret = false;
    598 
    599 
    600     foreach ($ept_opt_schedule_times_counter as $key => $time) {
    601         $ept_time_start = strtotime($ept_opt_schedule_times_hour[$key] . ':' . $ept_opt_schedule_times_minute[$key]);
    602         $ept_time_end = $ept_time_start + (60 * 10);
    603         if (
    604             $ept_time_start < current_time('timestamp', 0) &&
    605             current_time('timestamp', 0) < $ept_time_end &&
    606             ( ! ( $ept_time_start < $last && $last < $ept_time_end ) )
    607             ) {
    608             $ret = true;
    609             break;
    610         }
    611     }
    612 
    613     return $ret;
    614 }
    615 
    616 function ept_determine_next_update()
    617 {
    618     $ept_opt_schedule_times_counter = get_option( 'ept_opt_schedule_times_counter' );
    619     if (!(isset($ept_opt_schedule_times_counter)) || ! is_array($ept_opt_schedule_times_counter)) {
    620         $ept_opt_schedule_times_counter = array();
    621     }
    622 
    623     $ept_opt_schedule_times_hour = get_option( 'ept_opt_schedule_times_hour' );
    624     if (!(isset($ept_opt_schedule_times_hour)) || ! is_array($ept_opt_schedule_times_hour)) {
    625         $ept_opt_schedule_times_hour = array();
    626     }
    627 
    628     $ept_opt_schedule_times_minute = get_option( 'ept_opt_schedule_times_minute' );
    629     if (!(isset($ept_opt_schedule_times_minute)) || ! is_array($ept_opt_schedule_times_minute)) {
    630         $ept_opt_schedule_times_minute = array();
    631     }
    632 
    633     $ept_times = array();
    634 
    635     foreach ($ept_opt_schedule_times_counter as $key => $value) {
    636    
    637         $ept_time_start = strtotime($ept_opt_schedule_times_hour[$key] . ':' . $ept_opt_schedule_times_minute[$key], current_time('timestamp', 0));
    638         $remaining_time = $ept_time_start - current_time('timestamp', 0);
    639         if ( 0 < $remaining_time ) {
    640             $ept_times[] = $remaining_time;
    641         }
    642     }
    643 
    644     // return $ept_times;
    645 
    646     if ( empty($ept_times) ) {
    647         return 0;
    648     }
    649 
    650     return (Integer)(time() + $ept_times[min(array_keys($ept_times, min($ept_times)))]);
    651 }
    652 
    653 function ept_check_day_update()
    654 {
    655     $current_day = date( 'N', current_time('timestamp', 0) );
    656     $ept_opt_schedule_day_mon = get_option('ept_opt_schedule_day_mon');
    657     $ept_opt_schedule_day_tue = get_option('ept_opt_schedule_day_tue');
    658     $ept_opt_schedule_day_wed = get_option('ept_opt_schedule_day_wed');
    659     $ept_opt_schedule_day_thu = get_option('ept_opt_schedule_day_thu');
    660     $ept_opt_schedule_day_fri = get_option('ept_opt_schedule_day_fri');
    661     $ept_opt_schedule_day_sat = get_option('ept_opt_schedule_day_sat');
    662     $ept_opt_schedule_day_sun = get_option('ept_opt_schedule_day_sun');
    663     $ret = false;
    664 
    665     if ($current_day == $ept_opt_schedule_day_mon) {
    666         $ret = true;
    667     } else if ($current_day == $ept_opt_schedule_day_tue) {
    668         $ret = true;
    669     } else if ($current_day == $ept_opt_schedule_day_wed) {
    670         $ret = true;
    671     } else if ($current_day == $ept_opt_schedule_day_thu) {
    672         $ret = true;
    673     } else if ($current_day == $ept_opt_schedule_day_fri) {
    674         $ret = true;
    675     } else if ($current_day == $ept_opt_schedule_day_sat) {
    676         $ret = true;
    677     } else if ($current_day == $ept_opt_schedule_day_sun) {
    678         $ret = true;
    679     }
    680    
    681     return $ret;
    682 }
    683735
    684736function ept_to_update() {
  • evergreen-post-tweeter/trunk/evergreen.php

    r757575 r761345  
    55Description: Evergreen Post Tweeter enables you to automatically tweet out links to old posts based upon a tag or tags.
    66Author: Tom Ewer
    7 Version: 1.8.1
     7Version: 1.8.2
    88Author URI: http://www.leavingworkbehind.com/about-me/
    99*/ 
     
    2727function ept_admin_notice() {
    2828    global $current_user ;
    29         $user_id = $current_user->ID;
    30         /* Check that the user hasn't already clicked to ignore the message */
     29    $user_id = $current_user->ID;
     30    /* Check that the user hasn't already clicked to ignore the message */
    3131    if ( ! get_user_meta($user_id, 'ept_ignore_notice') ) {
    3232        echo '<div class="updated"><p>';
    3333        printf( __('Evergreen Post Tweeter has been upgraded with a brand new scheduling feature. You need to set a new schedule via the settings screen before tweets will be published. ') );
    3434        echo "</p><p>";
    35         printf( __('<a href="%s">Go to EPT Setting Page</a> or <a href="%1$s">Hide Notice</a>'), site_url('/wp-admin/options-general.php?page=Evergreen'), '?ept_nag_ignore=0' );
     35        printf( __('<a class="button" href="%1$s">Go to EPT Settings Page</a> or <a class="button" href="%2$s">Hide Notice</a>'), site_url('/wp-admin/options-general.php?page=Evergreen'), '?ept_nag_ignore=0' );
    3636        echo "</p></div>";
    3737    }
     
    4242function ept_nag_ignore() {
    4343    global $current_user;
    44         $user_id = $current_user->ID;
    45         /* If user clicks to ignore the notice, add that to their user meta */
    46         if ( isset($_GET['ept_nag_ignore']) && '0' == $_GET['ept_nag_ignore'] ) {
    47              add_user_meta($user_id, 'ept_ignore_notice', 'true', true);
     44    $user_id = $current_user->ID;
     45    /* If user clicks to ignore the notice, add that to their user meta */
     46    if ( isset($_GET['ept_nag_ignore']) && '0' == $_GET['ept_nag_ignore'] ) {
     47         add_user_meta($user_id, 'ept_ignore_notice', 'true', true);
     48         wp_redirect( site_url('/wp-admin/options-general.php?page=Evergreen'), '302' );
    4849    }
    4950}
     
    6465    /* Link our already registered script to a page */
    6566    wp_enqueue_script( 'ept_plugin_script_countdown' );
    66     wp_enqueue_script( 'ept_plugin_script_app', plugins_url( 'countdown/ept-app.js', __FILE__), array( 'jquery', 'ept_plugin_script_countdown' ) );
     67    wp_enqueue_script( 'ept_plugin_script_app', plugins_url( 'countdown/ept-app.js', __FILE__), array( 'jquery', 'ept_plugin_script_countdown' ), 1, true );
    6768    wp_enqueue_script( 'ept_plugin_application', plugins_url( 'js/application.js', __FILE__ ), array( 'jquery' ) );
    68     $next_tweet_time = get_option('next_tweet_time') ;
    69     wp_localize_script( 'ept_plugin_script_app', 'nextTweetTime', $next_tweet_time );
     69    $next_tweet_time = get_option('next_tweet_time');
     70    wp_localize_script( 'ept_plugin_script_app', 'nextTweetTime', array('tweetTime' => $next_tweet_time) );
    7071}
    7172
     
    108109                            "ept_admin"
    109110                        );
    110     add_action('admin_print_scripts-' . $page_hook_suffix, 'ept_admin_scripts');
    111 } 
     111    // add_action('admin_print_scripts-' . $page_hook_suffix, 'ept_admin_scripts');
     112}
    112113
    113114add_action('admin_menu', 'ept_admin_actions'); 
     
    115116add_action('init','ept_tweet_old_post');
    116117add_action('admin_init','ept_authorize',1);
     118add_action( 'admin_enqueue_scripts', 'ept_enqueue' );
     119
     120function ept_enqueue( $hook )
     121{
     122    if ( 'settings_page_Evergreen' != $hook ) {
     123        return;
     124    }
     125
     126    ept_admin_scripts();
     127}
    117128       
    118129function ept_authorize()
  • evergreen-post-tweeter/trunk/readme.txt

    r757575 r761345  
    66Requires at least: 3.5
    77Tested up to: 3.6
    8 Stable tag: 1.8.1
     8Stable tag: 1.8.2
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1111
    12 Evergreen Post Tweeter enables you to automatically tweet out links to old posts based upon a tag or tags.
     12Evergreen Post Tweeter enables you to schedule and automatically tweet out links to old posts.
    1313
    1414== Description ==
    1515
    16 Evergreen Post Tweeter enables you to automatically and periodically tweet out links to old posts based upon a tag or tags.
    17 
    18 Rather than tweet out any and all of your old posts, Evergreen Post Tweeter enables you to selectively tweet out only those posts that are still relevant and "evergreen." Just create a custom tag for all of your best posts (like "Evergreen"), enable the plugin to tweet out posts with that tag and Evergreen Post Tweeter will do the rest!
     16Evergreen Post Tweeter enables you to schedule and automatically tweet out links to old posts.
    1917
    2018Your Twitter followers will thank you for exposing them to more of your great content and you will get even more traffic to your site! I recently boosted Twitter referrals to my site by approximately 250% with Evergreen Post Tweeter. Enjoy!
    2119
    2220Features:
    23 
     21 - Schedule by day and time, just like Buffer
    2422 - Tweet out posts and/or pages
     23 - Filter posts to be tweeted by category and/or tag
     24 - Filter posts by age
    2525 - Add additional text to the tweet
    2626 - Choose from a selection of URL shorteners
    27  - Set the time between each tweet
    28  - Set minimum/maximum post ages
    29  - Select multiple tags for inclusion
    3027
    3128If you have any comments or questions you can find me on Twitter @tomewer!
     
    5148
    52491. Basic options for the tweets that will be published.
    53 2. Additional variables you can set for your tweets.
    54 3. The tag selection area.
     502. Additional variables you can set for your tweets + category/tag selectors.
     513. The tweet scheduling area.
    5552
    5653== Upgrade Notice ==
     54
     55= 1.8.2 =
     56* Fix bug on new scheduling feature
    5757
    5858= 1.8.1 =
     
    103103== Changelog ==
    104104
     105= 1.8.2 =
     106* Fix bug on new scheduling feature
     107
    105108= 1.8.1 =
    106109* Add admin notice for plugin upgrade
Note: See TracChangeset for help on using the changeset viewer.