Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
Removed social media sites that have shut down, changed inactive button placeholders to prevent 404 Not Found errors by indexing bots
  • Loading branch information
kmhcreative committed Jun 2, 2018
1 parent d4945c7 commit 6b39226
Show file tree
Hide file tree
Showing 22 changed files with 937 additions and 119 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

functions/error_log
functions/error_log
icon-picker/error_log
options/error_log
12 changes: 8 additions & 4 deletions README.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

Automagically adds responsive, customizable mobile UI to (almost) any WordPress theme.

**Version:** 0.2.2
**Version:** 0.2.3

**Requires WordPress Version:** 3.5 or higher, PHP 5+

**Compatible up to:** 4.8
**Compatible up to:** 4.9.6

**Alpha Version Disclaimer**

Expand Down Expand Up @@ -123,8 +123,6 @@ ZappBar has it’s own Social Media functions to make is easy for people to shar
* Twitter
* Google Plus
* Reddit
* StumbleUpon
* Digg
* LinkedIn
* Pinterest
* RSS Feed
Expand Down Expand Up @@ -225,6 +223,12 @@ simply be an icon with no dynamic elements.

## Changelog

Version 0.2.3
* Removed Digg from Social Media options
* Removed StumbleUpon from Social Media options
* Fixed issue where inactive ZappBar buttons caused 404 Not Found errors for bots indexing site. The button href placeholders were mistaken for links to non-existent pages. They are now masked as in-page anchor links.
* Updated zappbar.js to find and activate buttons via the fake anchor links.

Version 0.2.2
* Fixed error where ComicPress sidebars would be displayed on iPad in portrait even when set to be hidden.
* Fixed error where ComicPress comic post was using comic bottom bar when set to use default one.
Expand Down
60 changes: 0 additions & 60 deletions css/social_buttons.css
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,14 @@ a.zb-share {
a.zb-share.linkedin {
background-color:#0e76a8;
}
/*StumbleUpon*/
a.zb-share.stumbleupon {
background-color:#EF4916;
}
/*Reddit*/
a.zb-share.reddit {
background-color:#CEE3F8;
}
/*Digg*/
a.zb-share.digg {
background-color:#1B5790;
}
/*Pinterest*/
a.zb-share.pinterest {
background-color:#C92228;
}
/*Delicious*/
a.zb-share.delicious {
background-color:#0b79e5;
}
/*RSS*/
a.zb-share.rss-feed {
background-color:#F64C0B;
Expand Down Expand Up @@ -83,26 +71,14 @@ a.zb-share {
.zb-sharethis.small a.zb-share.linkedin {
background-image: url('../includes/images/social_icons/icons_small/linkedin.png');
}
/*StumbleUpon*/
.zb-sharethis.small a.zb-share.stumbleupon {
background-image: url('../includes/images/social_icons/icons_small/stumbleupon.png');
}
/*Reddit*/
.zb-sharethis.small a.zb-share.reddit {
background-image: url('../includes/images/social_icons/icons_small/reddit.png');
}
/*Digg*/
.zb-sharethis.small a.zb-share.digg {
background-image: url('../includes/images/social_icons/icons_small/digg.png');
}
/*Pinterest*/
.zb-sharethis.small a.zb-share.pinterest {
background-image: url('../includes/images/social_icons/icons_small/pinterest.png');
}
/*Delicious*/
.zb-sharethis.small a.zb-share.delicious {
background-image: url('../includes/images/social_icons/icons_small/delicious.png');
}
/*RSS*/
.zb-sharethis.small a.zb-share.rss-feed {
background-image: url('../includes/images/social_icons/icons_small/rss.png');
Expand Down Expand Up @@ -136,26 +112,14 @@ a.zb-share {
.zb-sharethis.medium a.zb-share.linkedin {
background-image: url('../includes/images/social_icons/icons_medium/linkedin.png');
}
/*StumbleUpon*/
.zb-sharethis.medium a.zb-share.stumbleupon {
background-image: url('../includes/images/social_icons/icons_medium/stumbleupon.png');
}
/*Reddit*/
.zb-sharethis.medium a.zb-share.reddit {
background-image: url('../includes/images/social_icons/icons_medium/reddit.png');
}
/*Digg*/
.zb-sharethis.medium a.zb-share.digg {
background-image: url('../includes/images/social_icons/icons_medium/digg.png');
}
/*Pinterest*/
.zb-sharethis.medium a.zb-share.pinterest {
background-image: url('../includes/images/social_icons/icons_medium/pinterest.png');
}
/*Delicious*/
.zb-sharethis.medium a.zb-share.delicious {
background-image: url('../includes/images/social_icons/icons_medium/delicious.png');
}
/*RSS*/
.zb-sharethis.medium a.zb-share.rss-feed {
background-image: url('../includes/images/social_icons/icons_medium/rss.png');
Expand Down Expand Up @@ -188,26 +152,14 @@ a.zb-share {
.zb-sharethis.large a.zb-share.linkedin {
background-image: url('../includes/images/social_icons/icons_large/linkedin.png');
}
/*StumbleUpon*/
.zb-sharethis.large a.zb-share.stumbleupon {
background-image: url('../includes/images/social_icons/icons_large/stumbleupon.png');
}
/*Reddit*/
.zb-sharethis.large a.zb-share.reddit {
background-image: url('../includes/images/social_icons/icons_large/reddit.png');
}
/*Digg*/
.zb-sharethis.large a.zb-share.digg {
background-image: url('../includes/images/social_icons/icons_large/digg.png');
}
/*Pinterest*/
.zb-sharethis.large a.zb-share.pinterest {
background-image: url('../includes/images/social_icons/icons_large/pinterest.png');
}
/*Delicious*/
.zb-sharethis.large a.zb-share.delicious {
background-image: url('../includes/images/social_icons/icons_large/delicious.png');
}
/*RSS*/
.zb-sharethis.large a.zb-share.rss-feed {
background-image: url('../includes/images/social_icons/icons_large/rss.png');
Expand Down Expand Up @@ -239,26 +191,14 @@ a.zb-share {
.zb-sharethis.label a.zb-share.linkedin {
background-image: url('../includes/images/social_icons/icons_small/linkedin.png');
}
/*StumbleUpon*/
.zb-sharethis.label a.zb-share.stumbleupon {
background-image: url('../includes/images/social_icons/icons_small/stumbleupon.png');
}
/*Reddit*/
.zb-sharethis.label a.zb-share.reddit {
background-image: url('../includes/images/social_icons/icons_small/reddit.png');
}
/*Digg*/
.zb-sharethis.label a.zb-share.digg {
background-image: url('../includes/images/social_icons/icons_small/digg.png');
}
/*Pinterest*/
.zb-sharethis.label a.zb-share.pinterest {
background-image: url('../includes/images/social_icons/icons_small/pinterest.png');
}
/*Delicious*/
.zb-sharethis.label a.zb-share.delicious {
background-image: url('../includes/images/social_icons/icons_small/delicious.png');
}
/*RSS*/
.zb-sharethis.label a.zb-share.rss-feed {
background-image: url('../includes/images/social_icons/icons_small/rss.png');
Expand Down
2 changes: 0 additions & 2 deletions functions/error_log

This file was deleted.

8 changes: 1 addition & 7 deletions functions/utility_functions.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function zb_share_shortcode( $atts, $content = null ) {
$include = strtolower($include);
$include = explode(",",$include);
} else {
$include = array('facebook','twitter','googleplus','reddit','stumbleupon','digg','linkedin','pinterest','rss','email');
$include = array('facebook','twitter','googleplus','reddit','linkedin','pinterest','rss','email');
}
if ($exclude != null && $exclude != '') {
$exclude = strtolower($exclude);
Expand All @@ -99,12 +99,6 @@ function zb_share_shortcode( $atts, $content = null ) {
if ( in_array('reddit',$include) && !in_array('reddit',$exclude) ) {
$social .= '<a href="http://www.reddit.com/submit?url='.urlencode(get_permalink($post->ID)).'&amp;title='.urlencode(get_the_title($post->ID)).'" title="Share on Reddit" rel="nofollow" target="_blank" onclick="event.preventDefault();window.open(this.href,\'_blank\',\'height=400,width=700\');" class="zb-share reddit"><span>Reddit</span></a>';
}
if ( in_array('stumbleupon',$include) && !in_array('stumbleupon',$exclude) ) {
$social .= '<a href="http://www.stumbleupon.com/submit?url='.urlencode(get_permalink($post->ID)).'&amp;title='.urlencode(get_the_title($post->ID)).'" title="Stumble It" rel="nofollow" target="_blank" onclick="event.preventDefault();window.open(this.href,\'_blank\',\'height=400,width=700\');" class="zb-share stumbleupon"><span>Stumble It</span></a>';
}
if ( in_array('digg',$include) && !in_array('digg',$exclude) ) {
$social .= '<a href="http://digg.com/submit?url='.urlencode(get_permalink($post->ID)).'&amp;title='.urlencode(get_the_title($post->ID)).'" title="Digg this!" rel="nofollow" target="_blank" onclick="event.preventDefault();window.open(this.href,\'_blank\',\'height=400,width=700\');" class="zb-share digg"><span>Digg this!</span></a>';
}
if ( in_array('linkedin',$include) && !in_array('linkedin',$exclude) ) {
$social .= '<a href="http://www.linkedin.com/shareArticle?mini=true&amp;title='.urlencode(get_the_title($post->ID)).'&amp;url='.urlencode(wp_get_shortlink($post->ID)).'" title="Share on LinkedIn" rel="nofollow" target="_blank" onclick="event.preventDefault();window.open(this.href,\'_blank\',\'height=400,width=700\');" class="zb-share linkedin"><span>LinkedIn</span></a>';
}
Expand Down
2 changes: 0 additions & 2 deletions icon-picker/error_log

This file was deleted.

28 changes: 14 additions & 14 deletions includes/html_inject.php
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -310,13 +310,7 @@ function build_zappbars($value,$layout,$position,$paged) {
$xtra = ' zb-social';
} else if ($val[2] == 'share_reddit') {
$val[2] = 'http://www.reddit.com/submit?url='.urlencode(get_permalink($post->ID)).'&amp;title='.urlencode(get_the_title($post->ID)).'';
$xtra = ' zb-social';
} else if ($val[2] == 'share_stumble') {
$val[2] = 'http://www.stumbleupon.com/submit?url='.urlencode(get_permalink($post->ID)).'&amp;title='.urlencode(get_the_title($post->ID)).'';
$xtra = ' zb-social';
} else if ($val[2] == 'share_digg') {
$val[2] = 'http://digg.com/submit?url='.urlencode(get_permalink($post->ID)).'&amp;title='.urlencode(get_the_title($post->ID)).'';
$xtra = ' zb-social';
$xtra = ' zb-social';
} else if ($val[2] == 'share_linkedin') {
$val[2] = 'http://www.linkedin.com/shareArticle?mini=true&amp;title='.urlencode(get_the_title($post->ID)).'&amp;url='.urlencode(wp_get_shortlink($post->ID)).'';
$xtra = ' zb-social';
Expand All @@ -325,7 +319,19 @@ function build_zappbars($value,$layout,$position,$paged) {
$xtra = ' zb-social';
} else {};
$icon = explode('|',$val[0]);
$html .= '<a href="'.$val[2].'" class="button'.$xtra.'" target="_self"><div class="icon '.$icon[0].' '.$icon[1].'"></div><br/><span class="zb-label">'.$val[1].'</span></a>';
// check if it is a JS action button rather than a URL
if (in_array( $val[2], array('appmenu_left','appmenu_right','share_this','search_box',
'search_left','search_right','woo_search','woo_search_left',
'woo_search_right','callme','sidebar_left','sidebar_right',
'first_page','prev_page','next_page','last_page','commentform',
'woo_review','woo_desc','woo_addl'
)
)
) {
// make it look like an anchor link for stupid bots that do not obey nofollow
$val[2] = '#'.$val[2];
}
$html .= '<a href="'.$val[2].'" class="button'.$xtra.'" target="_self" rel="nofollow"><div class="icon '.$icon[0].' '.$icon[1].'"></div><br/><span class="zb-label">'.$val[1].'</span></a>';

$html .= '</div>';
$x++;
Expand Down Expand Up @@ -436,12 +442,6 @@ function build_zappbars($value,$layout,$position,$paged) {
<?php };
if ( $zb_social_panel['reddit'] != '') { ?>
<a href="http://www.reddit.com/submit?url=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;title=<?php echo urlencode(get_the_title($post->ID)); ?>" title="Share on Reddit" rel="nofollow" target="_blank" class="zb-social reddit">Reddit</a>
<?php };
if ( $zb_social_panel['stumble'] != '') { ?>
<a href="http://www.stumbleupon.com/submit?url=<?php echo urlencode(get_permalink($post->ID)); ?>&amp;title=<?php echo urlencode(get_the_title($post->ID)); ?>" title="Stumble It" rel="nofollow" target="_blank" class="zb-social stumbleupon">Stumble It</a>
<?php };
if ( $zb_social_panel['digg'] != '') { ?>
<a href="http://digg.com/submit?url=<?php urlencode(get_permalink($post->ID)); ?>&amp;title=<?php urlencode(get_the_title($post->ID)); ?>" title="Digg this!" rel="nofollow" target="_blank" class="zb-social digg">Digg this!</a>
<?php };
if ( $zb_social_panel['linkedin'] != '') { ?>
<a href="http://www.linkedin.com/shareArticle?mini=true&amp;title=<?php echo urlencode(get_the_title($post->ID)); ?>&amp;url=<?php echo urlencode(wp_get_shortlink($post->ID)); ?>" title="Share on LinkedIn" rel="nofollow" target="_blank" class="zb-social linkedin">LinkedIn</a>
Expand Down
Binary file removed includes/images/social_icons/icons_large/delicious.png
Binary file not shown.
Binary file removed includes/images/social_icons/icons_large/digg.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed includes/images/social_icons/icons_medium/digg.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed includes/images/social_icons/icons_small/digg.png
Binary file not shown.
Binary file not shown.
40 changes: 20 additions & 20 deletions js/zappbar.js
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -667,38 +667,38 @@ if (device.OS == 'Android' || device.OS == 'iOS' || device.OS == 'Windows 10 Mob
});
// Attach button actions
$(".button").each( function() {
if ( $(this).attr("href") == "appmenu_left" ) {
if ( $(this).attr("href") == "#appmenu_left" ) {
$(this).on("click", function(e) {
zappPanel("zappbar_menu_left",0);
});
$(this).attr("href","javascript:void(0);");
};
if ( $(this).attr("href") == "appmenu_right") {
if ( $(this).attr("href") == "#appmenu_right") {
$(this).on("click", function(e) {
zappPanel("zappbar_menu_right",1);
});
$(this).attr("href","javascript:void(0);");
};
if ( $(this).attr("href") == "share_this") {
if ( $(this).attr("href") == "#share_this") {
$(this).on("click", function(e) {
zappPanel("zappbar_share_this",1);
});
$(this).attr("href","javascript:void(0);");
};
if ( $(this).attr("href") == "search_box" ||
$(this).attr("href") == "search_left" ||
$(this).attr("href") == "search_right" ||
$(this).attr("href") == "woo_search" ||
$(this).attr("href") == "woo_search_left" ||
$(this).attr("href") == "woo_search_right"
if ( $(this).attr("href") == "#search_box" ||
$(this).attr("href") == "#search_left" ||
$(this).attr("href") == "#search_right" ||
$(this).attr("href") == "#woo_search" ||
$(this).attr("href") == "#woo_search_left" ||
$(this).attr("href") == "#woo_search_right"
) {
$(this).on("click mouseover", function(e) {
$(this).find(".search").removeClass("out").addClass("in");
$(this).find("input[type=\'search\']").focus();
});
$(this).attr("href","javascript:void(0);");
};
if ( $(this).attr("href") == "callme") {
if ( $(this).attr("href") == "#callme") {
$(this).on("click", function(e) {
telnum_text = unescape(telnum);
// if you need some other calling pattern either change the regex below or change it to telnum_data = telnum_text to pass through //
Expand All @@ -710,28 +710,28 @@ if (device.OS == 'Android' || device.OS == 'iOS' || device.OS == 'Windows 10 Mob
});
$(this).attr("href","javascript:void(0);");
}
if ( $(this).attr("href") == "sidebar_left") {
if ( $(this).attr("href") == "#sidebar_left") {
$(this).on("click", function(e) {
zappPanel("zappbar_sidebar_left",0,"zappbar_sbtab_left");
});
$(this).attr("href","javascript:void(0);");
};
if ( $(this).attr("href") == "sidebar_right" ) {
if ( $(this).attr("href") == "#sidebar_right" ) {
$(this).on("click", function(e) {
zappPanel("zappbar_sidebar_right",1,"zappbar_sbtab_right");
});
$(this).attr("href","javascript:void(0);");
};
// non-paginated archive with archive buttons
if ( $(this).attr("href") == "first_page" ||
$(this).attr("href") == "prev_page" ||
$(this).attr("href") == "next_page" ||
$(this).attr("href") == "last_page") {
if ( $(this).attr("href") == "#first_page" ||
$(this).attr("href") == "#prev_page" ||
$(this).attr("href") == "#next_page" ||
$(this).attr("href") == "#last_page") {
$(this).attr("href","javascript:void(0);");
$(this).addClass("zb-disabled");
$(this).attr("title","There are no other pages");
};
if ( $(this).attr("href") == "commentform") {
if ( $(this).attr("href") == "#commentform") {
comment_button = true;
if (comments_open=="1" && is_home!="1" && is_archive!="1" && $("#"+comment_custom+"").length ) {
if (altertheme_commentform != "") {
Expand All @@ -749,7 +749,7 @@ if (device.OS == 'Android' || device.OS == 'iOS' || device.OS == 'Windows 10 Mob
};
};
if (woocommerce==true) {
if ($(this).attr("href") == "woo_review") {
if ($(this).attr("href") == "#woo_review") {
woo_review_button = true;
if (comments_open=="1" && is_product=="1" && $("#tab-reviews").length ) {
if (alter_woo_theme_woo_reviews != "") {
Expand All @@ -766,7 +766,7 @@ if (device.OS == 'Android' || device.OS == 'iOS' || device.OS == 'Windows 10 Mob
$(this).attr("href","javascript:void(0);");
};
};
if ($(this).attr("href") == "woo_desc") {
if ($(this).attr("href") == "#woo_desc") {
woo_desc_button = true;
if ( is_product=="1" && $("#tab-description").length ) {
if ( alter_woo_theme_woo_desc != "") {
Expand All @@ -783,7 +783,7 @@ if (device.OS == 'Android' || device.OS == 'iOS' || device.OS == 'Windows 10 Mob
$(this).attr("href","javascript:void(0);");
};
};
if ($(this).attr("href") == "woo_addl") {
if ($(this).attr("href") == "#woo_addl") {
woo_addl_button = true;
if ( is_product=="1" && $("#tab-additional_information").length ) {
if ( alter_woo_theme_woo_addl != "" ) {
Expand Down
Loading

0 comments on commit 6b39226

Please sign in to comment.