AddToAny Share Buttons - Version 1.5.9

Version Description

  • Accept custom icons of all file types such as png, svg, gif, jpg, webp, etc.
  • Remove empty width and height attributes on custom icons for W3C validation
  • AddToAny is certified as multilingual-ready by WPML
Download this release

Release Info

Developer micropat
Plugin Icon 128x128 AddToAny Share Buttons
Version 1.5.9
Comparing to
See all releases

Code changes from version 1.5.8 to 1.5.9

Files changed (3) hide show
  1. README.txt +14 -11
  2. add-to-any.php +10 -8
  3. addtoany.admin.php +2 -0
README.txt CHANGED
@@ -1,9 +1,9 @@
1
  === Share Buttons by AddToAny ===
2
  Contributors: micropat, addtoany
3
- Tags: sharing, share, share this, bookmarking, social, share button, share buttons, share links, social share, social sharing, social bookmarking, social bookmarks, socialize, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, e-mail, print, seo, button, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, tweet button, +1, plus 1, google +1, google plus, google plus one, plus one, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, whatsapp, lockerz, addthis, sociable, sharedaddy, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpmu, Add to Any, AddToAny
4
  Requires at least: 2.8
5
  Tested up to: 4.3
6
- Stable tag: 1.5.8
7
 
8
  Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more.
9
 
@@ -63,7 +63,7 @@ AddToAny's customizable platform and social share icons let you optimize your si
63
  = Wide Support =
64
 
65
  * Over 8 years of active development
66
- * Over 3.8 million downloads
67
  * Translated into dozens of languages
68
  * Ongoing support from the community
69
 
@@ -140,14 +140,12 @@ Since 2006, AddToAny is trusted across the web to always route to each service's
140
 
141
  Upload sharing icons in a single directory to a public location, and make sure the icon filenames match the icon filenames packaged in the AddToAny plugin. In your Admin panel, go to `Settings` > `AddToAny` > `Advanced Options` > check the "Use custom icons" checkbox and specify the URL to your custom icons directory (including the trailing `/`). For AddToAny's universal button, go to Universal Button, select `Image URL` and specify the exact location of your AddToAny universal share icon (including the filename).
142
 
143
- = How can I add both the universal button and the individual icons to another area of my theme? =
144
 
145
  In the Theme Editor, place this code block where you want the button and individual icons to appear in your theme:
146
-
147
  `<?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_KIT' ) ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>`
148
 
149
- If you want to customize the shared URL and title for the universal button and standalone services, use the following code as a template:
150
-
151
  `<?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_KIT' ) ) {
152
  ADDTOANY_SHARE_SAVE_KIT( array( 'linkname' => 'Example Page', 'linkurl' => 'http://example.com/page.html' ) );
153
  } ?>`
@@ -236,7 +234,7 @@ In settings, disable the default placement of the Vertical Buttons. In your them
236
 
237
  = Why does the Facebook Like Button, Twitter Tweet Button, Pinterest Pin It Button, Google+ Share Button, or Google +1 Button have so much whitespace to the right of it? =
238
 
239
- The minimum width for the Facebook Like Button is 90 pixels. This is required to display the total number of Likes to the right of the button. See Facebook's <a href="http://developers.facebook.com/docs/reference/plugins/like">Like Button documentation</a> for details
240
 
241
  It's not recommended, but you can change the width of the Facebook Like Button using CSS code, for instance: `.a2a_button_facebook_like { width:50px !important; }`
242
 
@@ -254,7 +252,7 @@ Yes, this plugin outputs 100% W3C valid HTML5 & XHTML and W3C valid CSS 3 by def
254
 
255
  If you use the Facebook Like, Twitter Tweet or Google +1 buttons in an HTML5 theme, note that the button iframes use the `scrolling` attribute, which is valid XHTML but the attribute has been deprecated in HTML5. It's needed to prevent scrollbars from appearing over the Like, Tweet, and +1 buttons inside of the iframes.
256
 
257
- Regardless of circumstances for passing W3C tests, the plugin will always output semantically valid and robot-readable code, so publishers do not have to worry about search engine crawler errors due to invalid code. Both <a href="http://en.wikipedia.org/wiki/Web_standards">web standards</a> and <a href="http://en.wikipedia.org/wiki/Cross-browser">cross-browser</a> compatibility are taken seriously.
258
 
259
  = Why does the menu appear behind embedded objects (like Flash)? =
260
 
@@ -275,6 +273,11 @@ Upload the plugin directory (including all files and directories within) to the
275
 
276
  == Changelog ==
277
 
 
 
 
 
 
278
  = 1.5.8 =
279
  * Toggle share buttons on custom post types in AddToAny settings
280
  * Supports WooCommerce Product post types
@@ -833,10 +836,10 @@ Upload the plugin directory (including all files and directories within) to the
833
  * Major changes to plugin CSS stylesheet to support A2A Kit (official standalone services)
834
  * Standalone services are no longer list items within an unordered list container
835
  * Button is no longer a list item
836
- * Button/standalones now follow the HTML markup layout suggested by the <a href="https://www.addtoany.com/buttons/customize/standalone_services">AddToAny Kit</a>
837
 
838
  = .9.9.6.5 =
839
- * Add class-names to use official <a href="https://www.addtoany.com/buttons/customize/standalone_services">Standalone Services Kit</a>
840
  * Google Analytics stats for individual services
841
  * Dutch translation (by Rene from <a href="http://wpwebshop.com/premium-wordpress-plugins/">WordPress Webshop</a>)
842
 
1
  === Share Buttons by AddToAny ===
2
  Contributors: micropat, addtoany
3
+ Tags: sharing, share, share this, bookmarking, social, share button, share buttons, share links, social share, social sharing, social bookmarking, social bookmarks, socialize, bookmark, bookmarks, save, Post, posts, page, pages, images, image, admin, statistics, stats, links, plugin, shortcode, sidebar, widget, responsive, email, e-mail, print, seo, button, delicious, google, tumblr, linkedin, digg, reddit, facebook, facebook share, facebook like, like, twitter, twitter button, twitter share, tweet, tweet button, +1, google +1, google plus, pinterest, pin, pin it, pinit, wanelo, buffer, stumbleupon, bitly, whatsapp, lockerz, addthis, sociable, sharedaddy, sharethis, shareaholic, icon, icons, vector, SVG, floating, floating buttons, wpml, wpmu, Add to Any, AddToAny
4
  Requires at least: 2.8
5
  Tested up to: 4.3
6
+ Stable tag: 1.5.9
7
 
8
  Share buttons for WordPress including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more.
9
 
63
  = Wide Support =
64
 
65
  * Over 8 years of active development
66
+ * Over 3.9 million downloads
67
  * Translated into dozens of languages
68
  * Ongoing support from the community
69
 
140
 
141
  Upload sharing icons in a single directory to a public location, and make sure the icon filenames match the icon filenames packaged in the AddToAny plugin. In your Admin panel, go to `Settings` > `AddToAny` > `Advanced Options` > check the "Use custom icons" checkbox and specify the URL to your custom icons directory (including the trailing `/`). For AddToAny's universal button, go to Universal Button, select `Image URL` and specify the exact location of your AddToAny universal share icon (including the filename).
142
 
143
+ = How can I place the share buttons in a specific area of my site? =
144
 
145
  In the Theme Editor, place this code block where you want the button and individual icons to appear in your theme:
 
146
  `<?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_KIT' ) ) { ADDTOANY_SHARE_SAVE_KIT(); } ?>`
147
 
148
+ If you want to customize the shared URL and title, use the following code as a template:
 
149
  `<?php if ( function_exists( 'ADDTOANY_SHARE_SAVE_KIT' ) ) {
150
  ADDTOANY_SHARE_SAVE_KIT( array( 'linkname' => 'Example Page', 'linkurl' => 'http://example.com/page.html' ) );
151
  } ?>`
234
 
235
  = Why does the Facebook Like Button, Twitter Tweet Button, Pinterest Pin It Button, Google+ Share Button, or Google +1 Button have so much whitespace to the right of it? =
236
 
237
+ The minimum width for the Facebook Like Button is 90 pixels. This is required to display the total number of Likes to the right of the button. See Facebook's <a href="https://developers.facebook.com/docs/plugins/like-button">Like Button documentation</a> for details
238
 
239
  It's not recommended, but you can change the width of the Facebook Like Button using CSS code, for instance: `.a2a_button_facebook_like { width:50px !important; }`
240
 
252
 
253
  If you use the Facebook Like, Twitter Tweet or Google +1 buttons in an HTML5 theme, note that the button iframes use the `scrolling` attribute, which is valid XHTML but the attribute has been deprecated in HTML5. It's needed to prevent scrollbars from appearing over the Like, Tweet, and +1 buttons inside of the iframes.
254
 
255
+ Regardless of circumstances for passing W3C tests, the plugin will always output semantically valid and robot-readable code, so publishers do not have to worry about search engine crawler errors due to invalid code. Both <a href="https://en.wikipedia.org/wiki/Web_standards">web standards</a> and <a href="https://en.wikipedia.org/wiki/Cross-browser">cross-browser</a> compatibility are taken seriously.
256
 
257
  = Why does the menu appear behind embedded objects (like Flash)? =
258
 
273
 
274
  == Changelog ==
275
 
276
+ = 1.5.9 =
277
+ * Accept custom icons of all file types such as png, svg, gif, jpg, webp, etc.
278
+ * Remove empty width and height attributes on custom icons for W3C validation
279
+ * AddToAny is certified as multilingual-ready by <a href="https://wpml.org/">WPML</a>
280
+
281
  = 1.5.8 =
282
  * Toggle share buttons on custom post types in AddToAny settings
283
  * Supports WooCommerce Product post types
836
  * Major changes to plugin CSS stylesheet to support A2A Kit (official standalone services)
837
  * Standalone services are no longer list items within an unordered list container
838
  * Button is no longer a list item
839
+ * Button/standalones now follow the HTML markup layout suggested by the <a href="https://www.addtoany.com/buttons/customize/wordpress/standalone_services">AddToAny Kit</a>
840
 
841
  = .9.9.6.5 =
842
+ * Add class-names to use official <a href="https://www.addtoany.com/buttons/customize/wordpress/standalone_services">Standalone Services Kit</a>
843
  * Google Analytics stats for individual services
844
  * Dutch translation (by Rene from <a href="http://wpwebshop.com/premium-wordpress-plugins/">WordPress Webshop</a>)
845
 
add-to-any.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Share Buttons by AddToAny
4
  Plugin URI: https://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
- Version: 1.5.8
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  */
@@ -219,10 +219,12 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
219
  if ( isset( $options['custom_icons'] ) && $options['custom_icons'] == 'url' && isset( $options['custom_icons_url'] ) ) {
220
  // Custom icons expected at a specified URL, i.e. //example.com/blog/uploads/addtoany/icons/custom/
221
  $icons_dir = $options['custom_icons_url'];
 
222
  $custom_icons = true;
223
  } else {
224
  // Packaged 16px icons
225
  $icons_dir = $A2A_SHARE_SAVE_plugin_url_path . '/icons/';
 
226
  }
227
 
228
  // Use default services if services have not been selected yet
@@ -272,22 +274,22 @@ function ADDTOANY_SHARE_SAVE_ICONS( $args = array() ) {
272
 
273
  $icon_url = ( isset( $service['icon_url'] ) ) ? $service['icon_url'] : false;
274
  $icon = ( isset( $service['icon'] ) ) ? $service['icon'] : 'default'; // Just the icon filename
275
- $width = ( isset( $service['icon_width'] ) ) ? $service['icon_width'] : '16';
276
- $height = ( isset( $service['icon_height'] ) ) ? $service['icon_height'] : '16';
277
 
278
  $url = ( $custom_service ) ? $href : "http://www.addtoany.com/add_to/" . $safe_name . "?linkurl=" . $linkurl_enc . "&amp;linkname=" . $linkname_enc;
279
- $src = ( $icon_url ) ? $icon_url : $icons_dir . $icon . ".png";
280
  $counter = ( $counter_enabled ) ? ' a2a_counter' : '';
281
  $class_attr = ( $custom_service ) ? '' : ' class="a2a_button_' . $safe_name . $counter . '"';
282
 
283
- // Remove all dimension values if using custom icons
284
  if ( isset( $custom_icons ) ) {
285
- $width = '';
286
- $height = '';
287
  }
288
 
289
  $link = $html_wrap_open . "<a$class_attr href=\"$url\" title=\"$name\" rel=\"nofollow\" target=\"_blank\">";
290
- $link .= ( $large_icons && ! isset( $custom_icons ) && ! $custom_service ) ? "" : "<img src=\"$src\" width=\"$width\" height=\"$height\" alt=\"$name\"/>";
291
  $link .= "</a>" . $html_wrap_close;
292
  }
293
 
3
  Plugin Name: Share Buttons by AddToAny
4
  Plugin URI: https://www.addtoany.com/
5
  Description: Share buttons for your pages including AddToAny's universal sharing button, Facebook, Twitter, Google+, Pinterest, WhatsApp and many more. [<a href="options-general.php?page=add-to-any.php">Settings</a>]
6
+ Version: 1.5.9
7
  Author: AddToAny
8
  Author URI: https://www.addtoany.com/
9
  */
219
  if ( isset( $options['custom_icons'] ) && $options['custom_icons'] == 'url' && isset( $options['custom_icons_url'] ) ) {
220
  // Custom icons expected at a specified URL, i.e. //example.com/blog/uploads/addtoany/icons/custom/
221
  $icons_dir = $options['custom_icons_url'];
222
+ $icons_type = ( isset( $options['custom_icons_type'] ) ) ? $options['custom_icons_type'] : 'png';
223
  $custom_icons = true;
224
  } else {
225
  // Packaged 16px icons
226
  $icons_dir = $A2A_SHARE_SAVE_plugin_url_path . '/icons/';
227
+ $icons_type = 'png';
228
  }
229
 
230
  // Use default services if services have not been selected yet
274
 
275
  $icon_url = ( isset( $service['icon_url'] ) ) ? $service['icon_url'] : false;
276
  $icon = ( isset( $service['icon'] ) ) ? $service['icon'] : 'default'; // Just the icon filename
277
+ $width_attr = ( isset( $service['icon_width'] ) ) ? ' width="' . $service['icon_width'] . '"' : ' width="16"';
278
+ $height_attr = ( isset( $service['icon_height'] ) ) ? ' height="' . $service['icon_height'] . '"' : ' height="16"';
279
 
280
  $url = ( $custom_service ) ? $href : "http://www.addtoany.com/add_to/" . $safe_name . "?linkurl=" . $linkurl_enc . "&amp;linkname=" . $linkname_enc;
281
+ $src = ( $icon_url ) ? $icon_url : $icons_dir . $icon . '.' . $icons_type;
282
  $counter = ( $counter_enabled ) ? ' a2a_counter' : '';
283
  $class_attr = ( $custom_service ) ? '' : ' class="a2a_button_' . $safe_name . $counter . '"';
284
 
285
+ // Remove dimension attributes if using custom icons
286
  if ( isset( $custom_icons ) ) {
287
+ $width_attr = '';
288
+ $height_attr = '';
289
  }
290
 
291
  $link = $html_wrap_open . "<a$class_attr href=\"$url\" title=\"$name\" rel=\"nofollow\" target=\"_blank\">";
292
+ $link .= ( $large_icons && ! isset( $custom_icons ) && ! $custom_service ) ? "" : "<img src=\"$src\"" . $width_attr . $height_attr . " alt=\"$name\"/>";
293
  $link .= "</a>" . $html_wrap_close;
294
  }
295
 
addtoany.admin.php CHANGED
@@ -266,6 +266,7 @@ function A2A_SHARE_SAVE_options_page() {
266
  $new_options['additional_js_variables'] = ( isset( $_POST['A2A_SHARE_SAVE_additional_js_variables'] ) ) ? trim( $_POST['A2A_SHARE_SAVE_additional_js_variables'] ) : '';
267
  $new_options['custom_icons'] = ( isset( $_POST['A2A_SHARE_SAVE_custom_icons'] ) && $_POST['A2A_SHARE_SAVE_custom_icons'] == 'url' ) ? 'url' : '-1';
268
  $new_options['custom_icons_url'] = ( isset( $_POST['A2A_SHARE_SAVE_custom_icons_url'] ) ) ? trailingslashit( $_POST['A2A_SHARE_SAVE_custom_icons_url'] ) : '';
 
269
  $new_options['inline_css'] = ( isset( $_POST['A2A_SHARE_SAVE_inline_css'] ) && $_POST['A2A_SHARE_SAVE_inline_css'] == '1') ? '1' : '-1';
270
  $new_options['cache'] = ( isset( $_POST['A2A_SHARE_SAVE_cache'] ) && $_POST['A2A_SHARE_SAVE_cache'] == '1' ) ? '1' : '-1';
271
 
@@ -651,6 +652,7 @@ function A2A_SHARE_SAVE_options_page() {
651
  <?php _e('Use custom icons. URL:', 'add-to-any'); ?>
652
  </label>
653
  <input name="A2A_SHARE_SAVE_custom_icons_url" type="text" class="code" size="50" style="vertical-align:middle" placeholder="//example.com/blog/uploads/addtoany/icons/custom/" value="<?php if ( isset( $options['custom_icons_url'] ) ) echo $options['custom_icons_url']; ?>" />
 
654
  <p class="description">
655
  <?php _e("Specify the URL of the directory containing your custom icons. For example, a URL of <code>//example.com/blog/uploads/addtoany/icons/custom/</code> containing <code>facebook.png</code> and <code>twitter.png</code>. Be sure that custom icon filenames match the icon filenames in <code>plugins/add-to-any/icons</code>. For AddToAny's Universal Button, select Image URL and specify the URL of your AddToAny universal share icon (<a href=\"#\" onclick=\"document.getElementsByName('A2A_SHARE_SAVE_button_custom')[0].focus();return false\">above</a>).", "add-to-any"); ?>
656
  </p>
266
  $new_options['additional_js_variables'] = ( isset( $_POST['A2A_SHARE_SAVE_additional_js_variables'] ) ) ? trim( $_POST['A2A_SHARE_SAVE_additional_js_variables'] ) : '';
267
  $new_options['custom_icons'] = ( isset( $_POST['A2A_SHARE_SAVE_custom_icons'] ) && $_POST['A2A_SHARE_SAVE_custom_icons'] == 'url' ) ? 'url' : '-1';
268
  $new_options['custom_icons_url'] = ( isset( $_POST['A2A_SHARE_SAVE_custom_icons_url'] ) ) ? trailingslashit( $_POST['A2A_SHARE_SAVE_custom_icons_url'] ) : '';
269
+ $new_options['custom_icons_type'] = ( isset( $_POST['A2A_SHARE_SAVE_custom_icons_type'] ) ) ? $_POST['A2A_SHARE_SAVE_custom_icons_type'] : 'png';
270
  $new_options['inline_css'] = ( isset( $_POST['A2A_SHARE_SAVE_inline_css'] ) && $_POST['A2A_SHARE_SAVE_inline_css'] == '1') ? '1' : '-1';
271
  $new_options['cache'] = ( isset( $_POST['A2A_SHARE_SAVE_cache'] ) && $_POST['A2A_SHARE_SAVE_cache'] == '1' ) ? '1' : '-1';
272
 
652
  <?php _e('Use custom icons. URL:', 'add-to-any'); ?>
653
  </label>
654
  <input name="A2A_SHARE_SAVE_custom_icons_url" type="text" class="code" size="50" style="vertical-align:middle" placeholder="//example.com/blog/uploads/addtoany/icons/custom/" value="<?php if ( isset( $options['custom_icons_url'] ) ) echo $options['custom_icons_url']; ?>" />
655
+ <input name="A2A_SHARE_SAVE_custom_icons_type" type="text" class="code" size="5" style="vertical-align:middle" maxlength="4" placeholder="png" value="<?php if ( isset( $options['custom_icons_type'] ) ) echo $options['custom_icons_type']; else echo 'png'; ?>" title="<?php esc_attr_e("Filename extension", "add-to-any"); ?>" />
656
  <p class="description">
657
  <?php _e("Specify the URL of the directory containing your custom icons. For example, a URL of <code>//example.com/blog/uploads/addtoany/icons/custom/</code> containing <code>facebook.png</code> and <code>twitter.png</code>. Be sure that custom icon filenames match the icon filenames in <code>plugins/add-to-any/icons</code>. For AddToAny's Universal Button, select Image URL and specify the URL of your AddToAny universal share icon (<a href=\"#\" onclick=\"document.getElementsByName('A2A_SHARE_SAVE_button_custom')[0].focus();return false\">above</a>).", "add-to-any"); ?>
658
  </p>