WordPress.org

Plugin Directory

Changeset 1822395 for add-to-any


Ignore:
Timestamp:
02/14/2018 11:35:41 PM (4 months ago)
Author:
micropat
Message:

1.7.24

  • Move JS into a single block to prevent issues caused by some site optimization plugins
  • Simplify file paths & URLs
  • Prevent Cloudflare's experimental Rocket Loader from causing script issues
  • Remove Google+ share count options because Google+ no longer provides counters
  • Remove AIM, BuddyMarks, diHITT, Jamespot, Netlog, NewsVine, NUjij, Segnalo, Stumpedia, YouMob
Location:
add-to-any/trunk
Files:
10 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • add-to-any/trunk/README.txt

    r1793931 r1822395  
    44Requires at least: 3.7
    55Tested up to: 4.9
    6 Stable tag: 1.7.23
     6Stable tag: 1.7.24
    77
    88Share buttons for WordPress including the AddToAny sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp, many more, and follow icons too.
     
    6262
    6363* Over 10 years of development
    64 * Over 7 million downloads
     64* Over 8 million downloads
    6565* Translated into dozens of languages
    6666* Ongoing support from the community
     
    351351
    352352== Changelog ==
     353
     354= 1.7.24 =
     355* Move JS into a single block to prevent issues caused by some site optimization plugins
     356* Simplify file paths & URLs
     357* Prevent Cloudflare's experimental Rocket Loader from causing script issues
     358* Remove Google+ share count options because Google+ no longer provides counters
     359* Remove AIM, BuddyMarks, diHITT, Jamespot, Netlog, NewsVine, NUjij, Segnalo, Stumpedia, YouMob
    353360
    354361= 1.7.23 =
  • add-to-any/trunk/add-to-any.php

    r1793931 r1822395  
    44Plugin URI: https://www.addtoany.com/
    55Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more.
    6 Version: 1.7.23
     6Version: 1.7.24
    77Author: AddToAny
    88Author URI: https://www.addtoany.com/
     
    1313// Explicitly globalize to support bootstrapped WordPress
    1414global $A2A_locale, $A2A_FOLLOW_services,
    15     $A2A_SHARE_SAVE_plugin_basename, $A2A_SHARE_SAVE_options, $A2A_SHARE_SAVE_plugin_dir, $A2A_SHARE_SAVE_plugin_url_path,
     15    $A2A_SHARE_SAVE_options, $A2A_SHARE_SAVE_plugin_dir, $A2A_SHARE_SAVE_plugin_url,
    1616    $A2A_SHARE_SAVE_services, $A2A_SHARE_SAVE_amp_icons_css;
    1717
    18 $A2A_SHARE_SAVE_plugin_basename = plugin_basename( dirname( __FILE__ ) );
    1918$A2A_SHARE_SAVE_plugin_dir = untrailingslashit( plugin_dir_path( __FILE__ ) );
    20 $A2A_SHARE_SAVE_plugin_url_path = untrailingslashit( plugin_dir_url( __FILE__ ) );
    21 
    22 // HTTPS?
    23 $A2A_SHARE_SAVE_plugin_url_path = is_ssl() ? str_replace( 'http:', 'https:', $A2A_SHARE_SAVE_plugin_url_path ) : $A2A_SHARE_SAVE_plugin_url_path;
     19$A2A_SHARE_SAVE_plugin_url = untrailingslashit( plugin_dir_url( __FILE__ ) );
     20
    2421// Set AddToAny locale (JavaScript)
    2522$A2A_locale = ! isset ( $A2A_locale ) ? '' : $A2A_locale;
     
    3229function A2A_SHARE_SAVE_init() {
    3330    global $A2A_SHARE_SAVE_plugin_dir,
    34         $A2A_SHARE_SAVE_plugin_basename,
    3531        $A2A_SHARE_SAVE_options;
    3632   
    3733    // Load the textdomain for translations
    38     load_plugin_textdomain( 'add-to-any', false, $A2A_SHARE_SAVE_plugin_basename . '/languages/' );
     34    load_plugin_textdomain( 'add-to-any', false, plugin_basename( dirname( __FILE__ ) ) . '/languages/' );
    3935   
    4036    // Update plugin options   
     
    187183    // $args array: output_later, html_container_open, html_container_close, html_wrap_open, html_wrap_close, linkname, linkurl
    188184   
    189     global $A2A_SHARE_SAVE_plugin_url_path,
    190         $A2A_SHARE_SAVE_services,
     185    global $A2A_SHARE_SAVE_services,
    191186        $A2A_FOLLOW_services,
    192187        $A2A_SHARE_SAVE_amp_icons_css;
     
    237232    } else {
    238233        // Default to local SVGs (not an option currently)
    239         $icons_dir = $A2A_SHARE_SAVE_plugin_url_path . '/icons/';
     234        $icons_dir = plugins_url('/icons/', __FILE__ );
    240235        $icons_type = 'svg';
    241236    }
     
    383378   
    384379    // $args array = output_later, html_container_open, html_container_close, html_wrap_open, html_wrap_close, linkname, linkurl, no_universal_button
    385 
    386     global $A2A_SHARE_SAVE_plugin_url_path;
    387380   
    388381    $options = get_option( 'addtoany_options', array() );
     
    516509   
    517510    elseif ( $special_service_code == 'google_plusone' ) {
    518         $custom_attributes .= ( $options['special_google_plusone_options']['show_count'] == '1' ) ? '' : ' data-annotation="none"';
    519511        $custom_attributes .= ' data-href="' . $linkurl . '"';
    520512        $special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
     
    522514   
    523515    elseif ( $special_service_code == 'google_plus_share' ) {
    524         $custom_attributes .= ( $options['special_google_plus_share_options']['show_count'] == '1' ) ? '' : ' data-annotation="none"';
    525516        $custom_attributes .= ' data-href="' . $linkurl . '"';
    526517        $special_html = sprintf( $special_anchor_template, $special_service_code, $custom_attributes );
     
    766757        . ( $additional_js ? "\n" . stripslashes( $additional_js ) : '' );
    767758   
    768     $javascript_header = "\n" . '<script type="text/javascript">' . "\n"
    769    
     759    $javascript_header = "\n"
     760        . '<script data-cfasync="false">' . "\n"
    770761        . 'window.a2a_config=window.a2a_config||{};'
    771762        . 'a2a_config.callbacks=[];a2a_config.overlays=[];'
     
    773764        . A2A_menu_locale()
    774765        . $script_configs
    775        
    776         . "\n</script>\n"
    777        
    778         . '<script type="text/javascript" src="' . $static_server . '/page.js" async="async"></script>' . "\n";
     766        . "\n"
     767        . '(function(d,s,a,b){'
     768            . 'a=d.createElement(s);'
     769            . 'b=d.getElementsByTagName(s)[0];'
     770            . 'a.async=1;'
     771            . 'a.src="' . $static_server . '/page.js";'
     772            . 'b.parentNode.insertBefore(a,b);'
     773        . '})(document,"script");'     
     774        . "\n</script>\n";
    779775   
    780776     echo $javascript_header;
     
    935931
    936932function A2A_SHARE_SAVE_stylesheet() {
    937     global $A2A_SHARE_SAVE_options, $A2A_SHARE_SAVE_plugin_url_path;
     933    global $A2A_SHARE_SAVE_options;
    938934   
    939935    $options = $A2A_SHARE_SAVE_options;
    940936   
    941937    if ( ! is_admin() ) {
    942         wp_enqueue_style( 'addtoany', $A2A_SHARE_SAVE_plugin_url_path . '/addtoany.min.css', false, '1.14' );
     938        wp_enqueue_style( 'addtoany', plugins_url('/addtoany.min.css', __FILE__ ), false, '1.14' );
    943939       
    944940        // Prepare inline CSS
     
    10061002
    10071003function A2A_SHARE_SAVE_enqueue_script() {
    1008     global $A2A_SHARE_SAVE_plugin_url_path;
    1009    
    10101004    if ( wp_script_is( 'jquery', 'registered' ) ) {
    1011         wp_enqueue_script( 'addtoany', $A2A_SHARE_SAVE_plugin_url_path . '/addtoany.min.js', array( 'jquery' ), '1.0' );
     1005        wp_enqueue_script( 'addtoany', plugins_url('/addtoany.min.js', __FILE__ ), array( 'jquery' ), '1.0' );
    10121006    }
    10131007}
  • add-to-any/trunk/addtoany.admin.php

    r1772754 r1822395  
    194194function A2A_SHARE_SAVE_options_page() {
    195195
    196     global $A2A_SHARE_SAVE_plugin_url_path,
     196    global $A2A_SHARE_SAVE_plugin_url,
    197197        $A2A_SHARE_SAVE_services;
    198198   
     
    355355                'show_count' => '-1' // Twitter doesn't provide counts anymore
    356356            );
    357             $new_options['special_google_plusone_options'] = array(
    358                 'show_count' => ( ( isset( $_POST['addtoany_google_plusone_show_count'] ) && $_POST['addtoany_google_plusone_show_count'] == '1' ) ? '1' : '-1' )
    359             );
    360             $new_options['special_google_plus_share_options'] = array(
    361                 'show_count' => ( ( isset( $_POST['addtoany_google_plus_share_show_count'] ) && $_POST['addtoany_google_plus_share_show_count'] == '1' ) ? '1' : '-1' )
    362             );
    363357            $new_options['special_pinterest_pin_options'] = array(
    364358                'show_count' => ( ( isset( $_POST['addtoany_pinterest_pin_show_count'] ) && $_POST['addtoany_pinterest_pin_show_count'] == '1' ) ? '1' : '-1' )
     
    439433            <td><fieldset>
    440434                <ul id="addtoany_services_sortable" class="addtoany_admin_list addtoany_override">
    441                     <li class="dummy"><img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path; ?>/icons/transparent.gif" width="32" height="32" alt="" /></li>
     435                    <li class="dummy"><img src="<?php echo $A2A_SHARE_SAVE_plugin_url; ?>/icons/transparent.gif" width="32" height="32" alt="" /></li>
    442436                </ul>
    443437                <p id="addtoany_services_info"><?php _e("Choose the services you want below. &nbsp;Click a chosen service again to remove. &nbsp;Reorder services by dragging and dropping as they appear above.", 'add-to-any'); ?></p>
     
    458452                    ?>
    459453                        <li data-addtoany-icon-name="<?php echo $site['icon']; ?>"<?php echo $special_service; ?> id="a2a_wp_<?php echo $service_safe_name; ?>" title="<?php echo $site['name']; ?>">
    460                             <img src="<?php echo (isset($site['icon_url'])) ? $site['icon_url'] : $A2A_SHARE_SAVE_plugin_url_path.'/icons/'.$site['icon'].'.svg'; ?>" width="<?php echo (isset($site['icon_width'])) ? $site['icon_width'] : '24'; ?>" height="<?php echo (isset($site['icon_height'])) ? $site['icon_height'] : '24'; ?>"<?php if ( isset( $site['color'] ) ) : ?> style="background-color:#<?php echo $site['color']; endif; ?>"><?php echo $site['name']; ?>
     454                            <img src="<?php echo (isset($site['icon_url'])) ? $site['icon_url'] : $A2A_SHARE_SAVE_plugin_url.'/icons/'.$site['icon'].'.svg'; ?>" width="<?php echo (isset($site['icon_width'])) ? $site['icon_width'] : '24'; ?>" height="<?php echo (isset($site['icon_height'])) ? $site['icon_height'] : '24'; ?>"<?php if ( isset( $site['color'] ) ) : ?> style="background-color:#<?php echo $site['color']; endif; ?>"><?php echo $site['name']; ?>
    461455                        </li>
    462456                <?php
    463457                    } ?>
    464458                    <li style="clear:left" id="a2a_wp_facebook_like" class="addtoany_special_service addtoany_3p_button" title="Facebook Like button">
    465                         <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/facebook_like_2x.png'; ?>" width="101" height="40" alt="Facebook Like" />
     459                        <img src="<?php echo $A2A_SHARE_SAVE_plugin_url.'/icons/facebook_like_2x.png'; ?>" width="101" height="40" alt="Facebook Like" />
    466460                    </li>
    467461                    <li id="a2a_wp_twitter_tweet" class="addtoany_special_service addtoany_3p_button" title="Twitter Tweet button">
    468                         <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/twitter_tweet_2x.png'; ?>" width="122" height="40" alt="Twitter Tweet" />
     462                        <img src="<?php echo $A2A_SHARE_SAVE_plugin_url.'/icons/twitter_tweet_2x.png'; ?>" width="122" height="40" alt="Twitter Tweet" />
    469463                    </li>
    470464                    <li id="a2a_wp_google_plusone" class="addtoany_special_service addtoany_3p_button" title="Google +1 button">
    471                         <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plusone_2x.png'; ?>" width="64" height="40" alt="Google +1" />
     465                        <img src="<?php echo $A2A_SHARE_SAVE_plugin_url.'/icons/google_plusone_2x.png'; ?>" width="64" height="40" alt="Google +1" />
    472466                    </li>
    473467                    <li id="a2a_wp_google_plus_share" class="addtoany_special_service addtoany_3p_button" title="Google+ Share button">
    474                         <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/google_plus_share_2x.png'; ?>" width="113" height="40" alt="Google+ Share" />
     468                        <img src="<?php echo $A2A_SHARE_SAVE_plugin_url.'/icons/google_plus_share_2x.png'; ?>" width="113" height="40" alt="Google+ Share" />
    475469                    </li>
    476470                    <li id="a2a_wp_pinterest_pin" class="addtoany_special_service addtoany_3p_button" title="Pinterest Pin It button">
    477                         <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/pinterest_pin_2x.png'; ?>" width="80" height="40" alt="Pinterest Pin It" />
     471                        <img src="<?php echo $A2A_SHARE_SAVE_plugin_url.'/icons/pinterest_pin_2x.png'; ?>" width="80" height="40" alt="Pinterest Pin It" />
    478472                    </li>
    479473                </ul>
    480474                <div id="addtoany_services_tip">
    481475                    <p style="line-height:0">
    482                         <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path; ?>/icons/instagram.svg" width="24" height="24" style="margin-right:8px">
    483                         <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path; ?>/icons/youtube.svg" width="24" height="24" style="margin-right:8px">
    484                         <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path; ?>/icons/snapchat.svg" width="24" height="24">
     476                        <img src="<?php echo $A2A_SHARE_SAVE_plugin_url; ?>/icons/instagram.svg" width="24" height="24" style="margin-right:8px">
     477                        <img src="<?php echo $A2A_SHARE_SAVE_plugin_url; ?>/icons/youtube.svg" width="24" height="24" style="margin-right:8px">
     478                        <img src="<?php echo $A2A_SHARE_SAVE_plugin_url; ?>/icons/snapchat.svg" width="24" height="24">
    485479                    </p>
    486480                    <p>You can setup Instagram, YouTube, Snapchat, and other buttons in an AddToAny Follow widget.</p><p>Add the &quot;AddToAny Follow&quot; widget in <a href="customize.php?autofocus[panel]=widgets&amp;return=options-general.php%3Fpage%3Daddtoany">Customize</a> or <a href="widgets.php">Widgets</a>.</p>
     
    495489                    <label class="addtoany_override a2a_kit_size_32">
    496490                        <input name="A2A_SHARE_SAVE_button" value="A2A_SVG_32" type="radio"<?php if ( ! isset( $options['button'] ) || 'A2A_SVG_32' == $options['button'] ) echo ' checked="checked"'; ?> style="margin:9px 0;vertical-align:middle">
    497                         <img src="<?php echo $A2A_SHARE_SAVE_plugin_url_path.'/icons/a2a.svg'; ?>" width="32" height="32" alt="AddToAny" onclick="this.parentNode.firstChild.checked=true" />
     491                        <img src="<?php echo $A2A_SHARE_SAVE_plugin_url.'/icons/a2a.svg'; ?>" width="32" height="32" alt="AddToAny" onclick="this.parentNode.firstChild.checked=true" />
    498492                    </label>
    499493                    <br>
     
    879873                    // Special service options?
    880874                    service_name = services_array[i].substr(7);
    881                     if (service_name == 'facebook_like' || service_name == 'twitter_tweet' || service_name == 'google_plusone' || service_name == 'google_plus_share' || service_name == 'pinterest_pin') {
    882                         if (service_name == 'google_plusone' || service_name == 'google_plus_share' || service_name == 'pinterest_pin') {
     875                    if (service_name == 'facebook_like' || service_name == 'twitter_tweet' || service_name == 'pinterest_pin') {
     876                        if (service_name == 'pinterest_pin') {
    883877                            show_count_value = (jQuery('#' + services_array[i] + '_show_count').is(':checked')) ? '1' : '-1' ;
    884878                            jQuery('#addtoany_admin_form').append('<input class="addtoany_hidden_options" name="addtoany_' + service_name + '_show_count" type="hidden" value="' + show_count_value + '"/>');
     
    928922                        + '<option' + checked + ' value="recommend">Recommend</option>'
    929923                        + '</select>';
    930                 } else if ('twitter_tweet' == this_service_name) {
    931                     // twitter_tweet doesn't provide counts anymore
    932                 } else {
    933                     // google_plusone & google_plus_share & pinterest_pin
     924                } else if ('pinterest_pin' == this_service_name) {
    934925                    if (service_options[this_service_name] && service_options[this_service_name].show_count) {
    935926                        checked = ' checked="checked"';
     
    10341025            && isset( $options['special_facebook_like_options'] ) && $options['special_facebook_like_options']['verb'] == 'recommend' ) {
    10351026            ?>service_options.facebook_like = {verb: 'recommend'};<?php
    1036         }
    1037         if ( isset( $_POST['addtoany_google_plusone_show_count'] ) && $_POST['addtoany_google_plusone_show_count'] == '1'
    1038             || ! isset( $_POST['addtoany_google_plusone_show_count'] )
    1039             && isset( $options['special_google_plusone_options'] ) && $options['special_google_plusone_options']['show_count'] == '1' ) {
    1040             ?>service_options.google_plusone = {show_count: 1};<?php
    1041         }
    1042         if ( isset( $_POST['addtoany_google_plus_share_show_count'] ) && $_POST['addtoany_google_plus_share_show_count'] == '1'
    1043             || ! isset( $_POST['addtoany_google_plus_share_show_count'] )
    1044             && isset( $options['special_google_plus_share_options'] ) && $options['special_google_plus_share_options']['show_count'] == '1' ) {
    1045             ?>service_options.google_plus_share = {show_count: 1};<?php
    10461027        }
    10471028        if ( isset( $_POST['addtoany_pinterest_pin_show_count'] ) && $_POST['addtoany_pinterest_pin_show_count'] == '1'
  • add-to-any/trunk/addtoany.services.php

    r1793931 r1822395  
    4848        "color" => "12AF0A",
    4949    ),
    50     "aim" => array(
    51         "name" => "AIM",
    52         "icon" => "aim",
    53         "color" => "00C2FF",
    54     ),
    5550    "amazon_wish_list" => array(
    5651        "name" => "Amazon Wish List",
     
    10398        "color" => "1A74B0",
    10499    ),
    105     "buddymarks" => array(
    106         "name" => "BuddyMarks",
    107         "icon" => "buddymarks",
    108         "color" => "96C044",
    109     ),
    110100    "buffer" => array(
    111101        "name" => "Buffer",
     
    153143        "color" => "2A2A2A",
    154144    ),
    155     "dihitt" => array(
    156         "name" => "diHITT",
    157         "icon" => "dihitt",
    158         "color" => "FF6300",
    159     ),
    160145    "diigo" => array(
    161146        "name" => "Diigo",
     
    238223        "color" => "2A2A2A",
    239224    ),
    240     "jamespot" => array(
    241         "name" => "Jamespot",
    242         "icon" => "jamespot",
    243         "color" => "FF9E2C",
    244     ),
    245225    "kakao" => array(
    246226        "name" => "Kakao",
     
    298278        "color" => "2A2A2A",
    299279    ),
    300     "netlog" => array(
    301         "name" => "Netlog",
    302         "icon" => "netlog",
    303         "color" => "2A2A2A",
    304     ),
    305280    "netvouz" => array(
    306281        "name" => "Netvouz",
     
    308283        "color" => "6C3",
    309284    ),
    310     "newsvine" => array(
    311         "name" => "NewsVine",
    312         "icon" => "newsvine",
    313         "color" => "055D00",
    314     ),
    315     "nujij" => array(
    316         "name" => "NUjij",
    317         "icon" => "nujij",
    318         "color" => "D40000",
    319     ),
    320285    "odnoklassniki" => array(
    321286        "name" => "Odnoklassniki",
     
    398363        "color" => "005EAC",
    399364    ),
    400     "segnalo" => array(
    401         "name" => "Segnalo",
    402         "icon" => "segnalo",
    403         "color" => "FF6500",
    404     ),
    405365    "sina_weibo" => array(
    406366        "name" => "Sina Weibo",
     
    438398        "color" => "EF4E23",
    439399    ),
    440     "stumpedia" => array(
    441         "name" => "Stumpedia",
    442         "icon" => "stumpedia",
    443         "color" => "FFC808",
    444     ),
    445400    "svejo" => array(
    446401        "name" => "Svejo",
     
    542497        "icon" => "yoolink",
    543498        "color" => "A2C538",
    544     ),
    545     "youmob" => array(
    546         "name" => "YouMob",
    547         "icon" => "youmob",
    548         "color" => "3B599D",
    549499    ),
    550500    "yummly" => array(
  • add-to-any/trunk/addtoany.widgets.php

    r1750180 r1822395  
    4141     */
    4242    public function widget( $args = array(), $instance ) {
    43    
    44         global $A2A_SHARE_SAVE_plugin_url_path;
    45        
    4643        $defaults = array(
    4744            'before_widget' => '',
     
    131128     */
    132129    public function widget( $args = array(), $instance ) {
    133         global $A2A_SHARE_SAVE_plugin_url_path;
    134        
    135130        $defaults = array(
    136131            'before_widget' => '',
Note: See TracChangeset for help on using the changeset viewer.