Plugin Directory

Changeset 3123942


Ignore:
Timestamp:
07/23/2024 01:36:20 PM (21 months ago)
Author:
mpntod
Message:

Updated to address issues identified via Plugin Check

Location:
rotatingtweets/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • rotatingtweets/trunk/readme.txt

    r3109619 r3123942  
    55Requires at least: 3.2
    66Tested up to: 6.4.3
    7 Stable tag: 1.9.10
     7Stable tag: 1.9.11
    88Requires PHP: 5.2.4
    99License: GPLv2 or later
  • rotatingtweets/trunk/rotatingtweets.php

    r3109619 r3123942  
    415415    endif;
    416416}
    417   /* translators: %d is replaced with the number of hours since the tweet was posted */
    418   if($n < (60*60*16)) { $hours = round($n/(60*60)); return sprintf(_n('about an hour ago','about %d hours ago',$hours,'rotatingtweets'),$hours); }
     417 
     418  if($n < (60*60*16)) { $hours = round($n/(60*60));
     419    if($hours == 1):
     420        return __('about an hour ago');
     421    else:
     422        /* translators: %d is replaced with the number of hours since the tweet was posted */
     423        return sprintf(_n('about %d hour ago','about %d hours ago',$hours,'rotatingtweets'),$hours);
     424    endif;
     425}
    419426  if($n < (time() - strtotime('yesterday'))) return __('yesterday','rotatingtweets');
    420   /* translators: %d is replaced with the number of hours since the tweet was posted */
    421   if($n < (60*60*24)) { $hours = round($n/(60*60)); return sprintf(_n('about an hour ago','about %d hours ago',$hours,'rotatingtweets'),$hours); }
    422   /* translators: %d is replaced with the number of days since the tweet was posted */
    423   if($n < (60*60*24*6.5)) { $days = round($n/(60*60*24)); return sprintf(_n('about a day ago','about %d days ago',$days,'rotatingtweets'),$days); }
     427 
     428  if($n < (60*60*24)) { $hours = round($n/(60*60));
     429    if($hours == 1):
     430        return __('about an hour ago');
     431    else:
     432        /* translators: %d is replaced with the number of hours since the tweet was posted */
     433        return sprintf(_n('about %d hour ago','about %d hours ago',$hours,'rotatingtweets'),$hours);
     434    endif;
     435  }
     436  if($n < (60*60*24*6.5)) { $days = round($n/(60*60*24));
     437    if($days ==1):
     438        return __('about a day ago');
     439    else:
     440        /* translators: %d is replaced with the number of days since the tweet was posted */
     441        return sprintf(_n('about %d day ago','about %d days ago',$days,'rotatingtweets'),$days);
     442    endif;
     443  }
    424444  if($n < (time() - strtotime('last week'))) return __('last week','rotatingtweets');
    425   /* translators: %d is replaced with the number of weeks since the tweet was posted */
    426   if($n < (60*60*24*7*3.5)) { $weeks = round($n/(60*60*24*7)); return sprintf(_n('about a week ago','about %d weeks ago',$weeks,'rotatingtweets'),$weeks); }
     445  if($n < (60*60*24*7*3.5)) { $weeks = round($n/(60*60*24*7));
     446    if($weeks==1):
     447        return __('about a week ago');
     448    else:
     449        /* translators: %d is replaced with the number of weeks since the tweet was posted */
     450        return sprintf(_n('about %d week ago','about %d weeks ago',$weeks,'rotatingtweets'),$weeks);
     451    endif;
     452  }
    427453  if($n < (time() - strtotime('last month'))) return __('last month','rotatingtweets');
    428   /* translators: %d is replaced with the number of months since the tweet was posted */
    429   if($n < (60*60*24*7*4*11.5)) { $months = round($n/(60*60*24*7*4)) ; return sprintf(_n('about a month ago','about %d months ago',$months,'rotatingtweets'),$months);}
     454 
     455  if($n < (60*60*24*7*4*11.5)) { $months = round($n/(60*60*24*7*4)) ;
     456    if($months==1):
     457        return __('about a month ago');
     458    else:
     459        /* translators: %d is replaced with the number of months since the tweet was posted */
     460        return sprintf(_n('about %d month ago','about %d months ago',$months,'rotatingtweets'),$months);
     461    endif;
     462  }
    430463  if($n < (time() - strtotime('last year'))) return __('last year','rotatingtweets');
    431   /* translators: %d is replaced with the number of years since the tweet was posted */
    432   if($n >= (60*60*24*7*4*12)){$years=round($n/(60*60*24*7*52)) ;return sprintf(_n('about a year ago','about %d years ago',$years,'rotatingtweets'),$years);}
     464  if($n >= (60*60*24*7*4*12)){$years=round($n/(60*60*24*7*52)) ;
     465    if($years==1):
     466        return __('about a year ago');
     467    else:
     468        /* translators: %d is replaced with the number of years since the tweet was posted */
     469        return sprintf(_n('about %d year ago','about %d years ago',$years,'rotatingtweets'),$years);
     470    endif;
     471  }
    433472  return false;
    434473}
     
    25192558    //      case 'zeeStyle':
    25202559                wp_dequeue_script( 'zee_jquery-cycle');
    2521                 wp_enqueue_script( 'zee_jquery-cycle', plugins_url($cyclejsfile, __FILE__),$dependence,FALSE,$api['js_in_footer']);
     2560                wp_enqueue_script( 'zee_jquery-cycle', plugins_url($cyclejsfile, __FILE__),$dependence,$rt_data['Version'],$api['js_in_footer']);
    25222561                $dependence[]='zee_jquery-cycle';
    25232562                break;
    25242563            case 'oxygen':
    25252564                wp_dequeue_script( 'oxygen_cycle');
    2526                 wp_enqueue_script( 'oxygen_cycle', plugins_url($cyclejsfile, __FILE__),$dependence,FALSE,$api['js_in_footer']);
     2565                wp_enqueue_script( 'oxygen_cycle', plugins_url($cyclejsfile, __FILE__),$dependence,$rt_data['Version'],$api['js_in_footer']);
    25272566                $dependence[]='oxygen_cycle';
    25282567                break;     
     
    25332572            case 'a52cars':
    25342573                wp_dequeue_script( 'jquery.cycle');
    2535                 wp_enqueue_script( 'jquery.cycle', plugins_url($cyclejsfile, __FILE__),$dependence,FALSE,$api['js_in_footer'] );
     2574                wp_enqueue_script( 'jquery.cycle', plugins_url($cyclejsfile, __FILE__),$dependence,$rt_data['Version'],$api['js_in_footer'] );
    25362575                $dependence[]='jquery.cycle';
    25372576                break;
    25382577            default:
    2539                 wp_enqueue_script( 'jquery-cycle', plugins_url($cyclejsfile, __FILE__),$dependence,FALSE,$api['js_in_footer'] );
     2578                wp_enqueue_script( 'jquery-cycle', plugins_url($cyclejsfile, __FILE__),$dependence,$rt_data['Version'],$api['js_in_footer'] );
    25402579                $dependence[]='jquery-cycle';
    25412580                break;
     
    25522591    if(is_admin()) return;
    25532592    $api = get_option('rotatingtweets-api-settings');
     2593    $rt_data = get_plugin_data( __FILE__ );
    25542594    if(isset($api['hide_css']) && $api['hide_css']==1) return;
    2555     wp_enqueue_style( 'rotatingtweets', plugins_url('css/style.css', __FILE__),array(), 1.9 );  // Update version number if Rotating Tweets CSS changes
     2595    wp_enqueue_style( 'rotatingtweets', plugins_url('css/style.css', __FILE__),array(), $rt_data['Version'] ); 
    25562596    $uploads = wp_upload_dir();
    25572597    $personalstyle = array(
     
    25632603    foreach($personalstyle as $dir => $url):
    25642604        if(file_exists( $dir )):
    2565             wp_enqueue_style( $scriptname, $url);
     2605            wp_enqueue_style( $scriptname, $url,array(),$rt_data['Version']);
    25662606            $scriptname = 'rotatingtweet-yourstyle-'.$scriptcounter;
    25672607            $scriptcounter ++;
     
    25742614}
    25752615function rotatingtweets_enqueue_admin_scripts($hook) {
     2616    $rt_data = get_plugin_data( __FILE__ );
    25762617    wp_enqueue_script( 'jquery' );
    2577     wp_enqueue_script( 'rotating_tweet_admin', plugins_url('js/rotating_tweet_admin.js', __FILE__),array('jquery'),FALSE,FALSE );       
     2618    wp_enqueue_script( 'rotating_tweet_admin', plugins_url('js/rotating_tweet_admin.js', __FILE__),array('jquery'),$rt_data['Version'],FALSE );     
    25782619}
    25792620add_action( 'admin_enqueue_scripts', 'rotatingtweets_enqueue_admin_scripts_widget_page' );
Note: See TracChangeset for help on using the changeset viewer.