Version Description
= * Critical fix
Download this release
Release Info
Developer | jgrietveld |
Plugin | Call Now Button |
Version | 0.4.3 |
Comparing to | |
See all releases |
Code changes from version 0.4.2 to 0.4.3
- call-now-button.php +20 -40
- readme.txt +4 -1
call-now-button.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: Call Now Button
|
4 |
Plugin URI: https://callnowbutton.com
|
5 |
Description: Mobile visitors will see a <strong>Call Now Button</strong> on your website. Easy to use but flexible to meet more demanding requirements. Change placement and color, hide on specific pages, track how many people click them or conversions of your Google Ads campaigns. It's all optional but possible.
|
6 |
-
Version: 0.4.
|
7 |
Author: Jerry Rietveld
|
8 |
Author URI: http://www.callnowbutton.com
|
9 |
License: GPL2
|
@@ -26,7 +26,7 @@ License: GPL2
|
|
26 |
*/
|
27 |
?>
|
28 |
<?php
|
29 |
-
define('CNB_VERSION','0.4.
|
30 |
define('CNB_BASENAME', plugin_basename( __FILE__ ) );
|
31 |
define('CNB_BASEFOLDER', plugin_basename( dirname( __FILE__ ) ) );
|
32 |
define('CNB_FILENAME', str_replace( CNB_BASEFOLDER.'/', '', CNB_BASENAME ) );
|
@@ -38,6 +38,7 @@ add_action('admin_init', 'cnb_options_init');
|
|
38 |
$cnb_changelog =
|
39 |
array(
|
40 |
array(
|
|
|
41 |
'4.2' => 'Button styling adjustments, security improvements',
|
42 |
'4.0' => 'Text bubbles for standard buttons, set the icon color, Google Ads conversion tracking, tabbed admin interface, 6 additional button locations, small button design changes, added support articles for (nearly) all settings, control visibility on front page, plus a bunch of smaller fixes. Enjoy!',
|
43 |
'3.6' => 'Small validation fixes and zoom now controls icon size in full width buttons.',
|
@@ -410,7 +411,7 @@ if(get_option('cnb') && !is_admin()) {
|
|
410 |
$cnb_has_text = ($cnb_options['text'] == '') ? false : true;
|
411 |
$cnb_is_full_width = $cnb_options['appearance'] == "full" || $cnb_options['appearance'] == "tfull" ? true : false;
|
412 |
$cnb_is_classic = isset($cnb_options['classic']) && $cnb_options['classic'] == 1 && !$cnb_has_text ? true : false;
|
413 |
-
$cnb_button_css = "
|
414 |
|
415 |
|
416 |
$ButtonExtra = "";
|
@@ -465,29 +466,7 @@ if(get_option('cnb') && !is_admin()) {
|
|
465 |
if($cnb_has_text && ($cnb_options['appearance'] == 'middle' || $cnb_options['appearance'] == 'tmiddle')) { // don't show the label in this situation
|
466 |
$circularButtonTextCSS = "#callnowbutton span{display: none;";
|
467 |
} elseif($cnb_has_text && !$cnb_is_full_width){
|
468 |
-
$circularButtonTextCSS = "#callnowbutton span{
|
469 |
-
-moz-osx-font-smoothing: grayscale;
|
470 |
-
-webkit-user-select: none;
|
471 |
-
-ms-user-select: none;
|
472 |
-
user-select: none;
|
473 |
-
display: block;
|
474 |
-
width: auto;
|
475 |
-
background-color: rgba(70,70,70,.9);
|
476 |
-
position: absolute;
|
477 |
-
".$cnb_label_side.": 68px;
|
478 |
-
border-radius: 2px;
|
479 |
-
font-family: Helvetica,Arial,sans-serif;
|
480 |
-
padding: 6px 8px;
|
481 |
-
font-size: 13px;
|
482 |
-
font-weight:700;
|
483 |
-
color: #ececec;
|
484 |
-
top: 15px;
|
485 |
-
box-shadow: 0 1px 2px rgba(0,0,0,.15);
|
486 |
-
word-break: keep-all;
|
487 |
-
line-height: 1em;
|
488 |
-
text-overflow: ellipsis;
|
489 |
-
vertical-align: middle;
|
490 |
-
}";
|
491 |
} elseif(!$cnb_is_full_width) {
|
492 |
$circularButtonTextCSS = "#callnowbutton span{display:none;}";
|
493 |
} else {
|
@@ -505,7 +484,7 @@ if(get_option('cnb') && !is_admin()) {
|
|
505 |
|
506 |
|
507 |
}
|
508 |
-
echo "<style>" . esc_html($cnb_button_css) . "</style>\n";
|
509 |
}
|
510 |
add_action('wp_head', 'cnb_head');
|
511 |
|
@@ -560,18 +539,7 @@ if(get_option('cnb') && !is_admin()) {
|
|
560 |
$cnb_button_content = 10; // text only
|
561 |
}
|
562 |
|
563 |
-
|
564 |
-
if($content == 10){
|
565 |
-
return '<a href="tel:'.esc_attr($number).'" id="callnowbutton" onclick="'.$onclick.'""><span>'.esc_html($text).'</span></a>';
|
566 |
-
} elseif($content == 11) {
|
567 |
-
return '<a href="tel:'.esc_attr($number).'" id="callnowbutton" onclick="'.$onclick.'""><span style="color:'.$icon.'">'.esc_html($text).'</span></a>';
|
568 |
-
} elseif($content == 20) {
|
569 |
-
return '<a href="tel:'.esc_attr($number).'" id="callnowbutton" onclick="'.$onclick.'""><img alt="Call Now Button" src="data:image/svg+xml;base64,'.svg(changeColor($color, 'darker'), $icon).'" width="40"></a>';
|
570 |
-
} elseif($content == 31) {
|
571 |
-
return '<a href="tel:'.esc_attr($number).'" id="callnowbutton" onclick="'.$onclick.'""><img alt="Call Now Button" src="data:image/svg+xml;base64,'.svg(changeColor($color, 'darker'), $icon).'" width="40"><span style="color:'.$icon.'">'.esc_html($text).'</span></a>';
|
572 |
-
}
|
573 |
-
|
574 |
-
}
|
575 |
|
576 |
if(is_front_page()) {
|
577 |
if(!$cnb_hide_frontpage) {
|
@@ -593,7 +561,19 @@ if(get_option('cnb') && !is_admin()) {
|
|
593 |
}
|
594 |
add_action('wp_footer', 'cnb_footer');
|
595 |
}
|
596 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
597 |
|
598 |
function cnb_get_options() { // Grabbing existing settings and creating them if it's a first time installation
|
599 |
if(!get_option('cnb')) { // Doesn't exist -> set defaults
|
3 |
Plugin Name: Call Now Button
|
4 |
Plugin URI: https://callnowbutton.com
|
5 |
Description: Mobile visitors will see a <strong>Call Now Button</strong> on your website. Easy to use but flexible to meet more demanding requirements. Change placement and color, hide on specific pages, track how many people click them or conversions of your Google Ads campaigns. It's all optional but possible.
|
6 |
+
Version: 0.4.3
|
7 |
Author: Jerry Rietveld
|
8 |
Author URI: http://www.callnowbutton.com
|
9 |
License: GPL2
|
26 |
*/
|
27 |
?>
|
28 |
<?php
|
29 |
+
define('CNB_VERSION','0.4.3');
|
30 |
define('CNB_BASENAME', plugin_basename( __FILE__ ) );
|
31 |
define('CNB_BASEFOLDER', plugin_basename( dirname( __FILE__ ) ) );
|
32 |
define('CNB_FILENAME', str_replace( CNB_BASEFOLDER.'/', '', CNB_BASENAME ) );
|
38 |
$cnb_changelog =
|
39 |
array(
|
40 |
array(
|
41 |
+
'4.3' => 'Critical fix',
|
42 |
'4.2' => 'Button styling adjustments, security improvements',
|
43 |
'4.0' => 'Text bubbles for standard buttons, set the icon color, Google Ads conversion tracking, tabbed admin interface, 6 additional button locations, small button design changes, added support articles for (nearly) all settings, control visibility on front page, plus a bunch of smaller fixes. Enjoy!',
|
44 |
'3.6' => 'Small validation fixes and zoom now controls icon size in full width buttons.',
|
411 |
$cnb_has_text = ($cnb_options['text'] == '') ? false : true;
|
412 |
$cnb_is_full_width = $cnb_options['appearance'] == "full" || $cnb_options['appearance'] == "tfull" ? true : false;
|
413 |
$cnb_is_classic = isset($cnb_options['classic']) && $cnb_options['classic'] == 1 && !$cnb_has_text ? true : false;
|
414 |
+
$cnb_button_css = "";
|
415 |
|
416 |
|
417 |
$ButtonExtra = "";
|
466 |
if($cnb_has_text && ($cnb_options['appearance'] == 'middle' || $cnb_options['appearance'] == 'tmiddle')) { // don't show the label in this situation
|
467 |
$circularButtonTextCSS = "#callnowbutton span{display: none;";
|
468 |
} elseif($cnb_has_text && !$cnb_is_full_width){
|
469 |
+
$circularButtonTextCSS = "\n#callnowbutton span {-moz-osx-font-smoothing: grayscale; -webkit-user-select: none; -ms-user-select: none; user-select: none; display: block; width: auto; background-color: rgba(70,70,70,.9); position: absolute; ".$cnb_label_side.": 68px; border-radius: 2px; font-family: Helvetica,Arial,sans-serif; padding: 6px 8px; font-size: 13px; font-weight:700; color: #ececec; top: 15px; box-shadow: 0 1px 2px rgba(0,0,0,.15); word-break: keep-all; line-height: 1em; text-overflow: ellipsis; vertical-align: middle; }";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
470 |
} elseif(!$cnb_is_full_width) {
|
471 |
$circularButtonTextCSS = "#callnowbutton span{display:none;}";
|
472 |
} else {
|
484 |
|
485 |
|
486 |
}
|
487 |
+
echo "\n<!-- Call Now Button ".CNB_VERSION." by Jerry Rietveld (callnowbutton.com) -->\n <style>" . esc_html($cnb_button_css) . "</style>\n";
|
488 |
}
|
489 |
add_action('wp_head', 'cnb_head');
|
490 |
|
539 |
$cnb_button_content = 10; // text only
|
540 |
}
|
541 |
|
542 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
543 |
|
544 |
if(is_front_page()) {
|
545 |
if(!$cnb_hide_frontpage) {
|
561 |
}
|
562 |
add_action('wp_footer', 'cnb_footer');
|
563 |
}
|
564 |
+
}
|
565 |
+
function cnb_button_output($number, $onclick, $text, $content, $color, $icon) {
|
566 |
+
if($content == 10){
|
567 |
+
return '<a href="tel:'.esc_attr($number).'" id="callnowbutton" onclick="'.$onclick.'""><span>'.esc_html($text).'</span></a>';
|
568 |
+
} elseif($content == 11) {
|
569 |
+
return '<a href="tel:'.esc_attr($number).'" id="callnowbutton" onclick="'.$onclick.'""><span style="color:'.$icon.'">'.esc_html($text).'</span></a>';
|
570 |
+
} elseif($content == 20) {
|
571 |
+
return '<a href="tel:'.esc_attr($number).'" id="callnowbutton" onclick="'.$onclick.'""><img alt="Call Now Button" src="data:image/svg+xml;base64,'.svg(changeColor($color, 'darker'), $icon).'" width="40"></a>';
|
572 |
+
} elseif($content == 31) {
|
573 |
+
return '<a href="tel:'.esc_attr($number).'" id="callnowbutton" onclick="'.$onclick.'""><img alt="Call Now Button" src="data:image/svg+xml;base64,'.svg(changeColor($color, 'darker'), $icon).'" width="40"><span style="color:'.$icon.'">'.esc_html($text).'</span></a>';
|
574 |
+
}
|
575 |
+
|
576 |
+
}
|
577 |
|
578 |
function cnb_get_options() { // Grabbing existing settings and creating them if it's a first time installation
|
579 |
if(!get_option('cnb')) { // Doesn't exist -> set defaults
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://callnowbutton.com/donate/
|
|
4 |
Tags: call button, click to call, convert, call now button, contact button
|
5 |
Requires at least: 2.7
|
6 |
Tested up to: 5.7
|
7 |
-
Stable tag: 0.4.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -111,6 +111,9 @@ This is coming very soon. We're currently looking for testers so if you want to
|
|
111 |
|
112 |
== Changelog ==
|
113 |
|
|
|
|
|
|
|
114 |
= 0.4.2 =
|
115 |
* Button styling adjustments
|
116 |
* Security improvements (input sanitisation, output escaping)
|
4 |
Tags: call button, click to call, convert, call now button, contact button
|
5 |
Requires at least: 2.7
|
6 |
Tested up to: 5.7
|
7 |
+
Stable tag: 0.4.3
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
111 |
|
112 |
== Changelog ==
|
113 |
|
114 |
+
= 0.4.3 =
|
115 |
+
* Critical fix
|
116 |
+
|
117 |
= 0.4.2 =
|
118 |
* Button styling adjustments
|
119 |
* Security improvements (input sanitisation, output escaping)
|