Call Now Button - Version 1.0.7

Version Description

= * Bugfix for Localization

Download this release

Release Info

Developer jasperroel
Plugin Icon 128x128 Call Now Button
Version 1.0.7
Comparing to
See all releases

Code changes from version 1.0.6 to 1.0.7

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: 1.0.6
7
  Author: Jerry Rietveld
8
  Author URI: https://www.callnowbutton.com
9
  GitHub Plugin URI: https://github.com/callnowbutton/wp-plugin
@@ -26,7 +26,7 @@ License: GPL2
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
  */
28
 
29
- define('CNB_VERSION', '1.0.6');
30
  define('CNB_NAME', 'Call Now Button');
31
  define('CNB_BASENAME', plugin_basename(__FILE__));
32
  define('CNB_BASEFOLDER', plugin_basename(dirname(__FILE__)));
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: 1.0.7
7
  Author: Jerry Rietveld
8
  Author URI: https://www.callnowbutton.com
9
  GitHub Plugin URI: https://github.com/callnowbutton/wp-plugin
26
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
27
  */
28
 
29
+ define('CNB_VERSION', '1.0.7');
30
  define('CNB_NAME', 'Call Now Button');
31
  define('CNB_BASENAME', plugin_basename(__FILE__));
32
  define('CNB_BASEFOLDER', plugin_basename(dirname(__FILE__)));
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: call button, click to call, convert, call now button, contact button
5
  Requires at least: 3.9
6
  Requires PHP: 5.4
7
  Tested up to: 5.9
8
- Stable tag: 1.0.6
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -111,6 +111,9 @@ Yes, you can upgrade to Premium to enable tons of extra features. Checkout [call
111
 
112
 
113
  == Changelog ==
 
 
 
114
  = 1.0.6 =
115
  * Adding SMS support to Premium
116
  * More intuitive scheduler in Premium
5
  Requires at least: 3.9
6
  Requires PHP: 5.4
7
  Tested up to: 5.9
8
+ Stable tag: 1.0.7
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
111
 
112
 
113
  == Changelog ==
114
+ = 1.0.7 =
115
+ * Bugfix for Localization
116
+
117
  = 1.0.6 =
118
  * Adding SMS support to Premium
119
  * More intuitive scheduler in Premium
resources/images/flags.png ADDED
Binary file
resources/images/flags@2x.png ADDED
Binary file
resources/style/call-now-button.css CHANGED
@@ -986,3 +986,14 @@ span.cnb_check_email_message {
986
  padding-bottom: 16px;
987
  color: #646970;
988
  }
 
 
 
 
 
 
 
 
 
 
 
986
  padding-bottom: 16px;
987
  color: #646970;
988
  }
989
+
990
+
991
+ .iti__flag {
992
+ background-image: url("../images/flags.png") !important;
993
+ }
994
+
995
+ @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
996
+ .iti__flag {
997
+ background-image: url("../images/flags@2x.png") !important;
998
+ }
999
+ }
src/admin/action-edit.php CHANGED
@@ -326,10 +326,10 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
326
  cnb_domain_timezone_check( $domain );
327
  $timezone_set_correctly = cnb_warn_about_timezone($domain);
328
  ?>
329
- <input type="hidden" name="actions[<?php esc_attr_e($action->id) ?>][id]" value="<?php if ($action->id !== null && $action->id !== 'new') { esc_attr_e($action->id); } ?>" />
330
- <input type="hidden" name="actions[<?php esc_attr_e($action->id) ?>][delete]" id="cnb_action_<?php esc_attr_e($action->id) ?>_delete" value="" />
331
- <input type="hidden" name="actions[<?php esc_attr_e($action->id) ?>][iconText]" value="<?php if (isset($action->iconText)) { esc_attr_e($action->iconText); } ?>" id="cnb_action_icon_text" />
332
- <input type="hidden" name="actions[<?php esc_attr_e($action->id) ?>][iconType]" value="<?php if (isset($action->iconType)) { esc_attr_e($action->iconType); } ?>" />
333
  <?php if ($show_table) { ?>
334
  <table data-tab-name="actions" class="form-table nav-tab-active">
335
  <?php } ?>
@@ -343,10 +343,10 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
343
  <tr class="cnb_hide_on_modal">
344
  <th scope="row"><label for="cnb_action_type">Button type</label></th>
345
  <td>
346
- <select id="cnb_action_type" name="actions[<?php esc_attr_e($action->id) ?>][actionType]">
347
  <?php foreach (cnb_get_action_types() as $action_type_key => $action_type_value) { ?>
348
- <option value="<?php esc_attr_e($action_type_key) ?>"<?php selected($action_type_key, $action->actionType) ?>>
349
- <?php esc_html_e($action_type_value) ?>
350
  </option>
351
  <?php } ?>
352
  </select>
@@ -359,7 +359,7 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
359
 
360
  </th>
361
  <td>
362
- <input type="text" id="cnb_action_value_input" name="actions[<?php esc_attr_e($action->id) ?>][actionValue]" value="<?php esc_attr_e($action->actionValue) ?>"/>
363
  <p class="description cnb-action-properties-map">Preview via <a href="#" onclick="cnb_action_update_map_link(this)" target="_blank">Google Maps</a></p>
364
 
365
  </td>
@@ -367,7 +367,7 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
367
  <tr class="cnb-action-properties-whatsapp">
368
  <th scope="row"><label for="cnb_action_value_input_whatsapp">Whatsapp Number</label></th>
369
  <td>
370
- <input type="tel" id="cnb_action_value_input_whatsapp" name="actions[<?php esc_attr_e($action->id) ?>][actionValueWhatsapp]" value="<?php esc_attr_e($action->actionValue) ?>"/>
371
  <p class="description" id="cnb-valid-msg">✓ Valid</p>
372
  <p class="description" id="cnb-error-msg"></p>
373
  </td>
@@ -375,8 +375,8 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
375
  <tr class="button-text cnb_hide_on_modal">
376
  <th scope="row"><label for="buttonTextField">Button label</label></th>
377
  <td>
378
- <input id="buttonTextField" type="text" name="actions[<?php esc_attr_e($action->id) ?>][labelText]"
379
- value="<?php esc_attr_e($action->labelText) ?>" maxlength="30" placeholder="optional" />
380
  <p class="description">Leave this field empty to only show an icon.</p>
381
  </td>
382
  </tr>
@@ -389,20 +389,20 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
389
  </tr>
390
  <tr class="cnb-action-properties-email-extra">
391
  <th scope="row"><label for="action-properties-subject">Subject</label></th>
392
- <td><input id="action-properties-subject" name="actions[<?php esc_attr_e($action->id) ?>][properties][subject]" type="text" value="<?php if (isset($action->properties) && isset($action->properties->subject)) { esc_attr_e($action->properties->subject); } ?>" /></td>
393
  </tr>
394
  <tr class="cnb-action-properties-email-extra">
395
  <th scope="row"><label for="action-properties-body">Body</label></th>
396
- <td><textarea id="action-properties-body" name="actions[<?php esc_attr_e($action->id) ?>][properties][body]" class="large-text code" rows="3"><?php if (isset($action->properties) && isset($action->properties->body)) { echo esc_textarea($action->properties->body); } ?></textarea></td>
397
 
398
  </tr>
399
  <tr class="cnb-action-properties-email-extra">
400
  <th scope="row"><label for="action-properties-cc">CC</label></th>
401
- <td><input id="action-properties-cc" name="actions[<?php esc_attr_e($action->id) ?>][properties][cc]" type="text" value="<?php if (isset($action->properties) && isset($action->properties->cc)) { esc_attr_e($action->properties->cc); } ?>" /></td>
402
  </tr>
403
  <tr class="cnb-action-properties-email-extra">
404
  <th scope="row"><label for="action-properties-bcc">BCC</label></th>
405
- <td><input id="action-properties-bcc" name="actions[<?php esc_attr_e($action->id) ?>][properties][bcc]" type="text" value="<?php if (isset($action->properties) && isset($action->properties->bcc)) { esc_attr_e($action->properties->bcc); } ?>" /></td>
406
  </tr>
407
  <tr class="cnb-action-properties-email-extra">
408
  <th colspan="2"><hr /></th>
@@ -423,7 +423,7 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
423
  <tr class="cnb-action-properties-whatsapp-extra cnb-action-properties-sms-extra">
424
  <th scope="row"><label for="action-properties-message">Default message</label></th>
425
  <td>
426
- <textarea id="action-properties-message" name="actions[<?php esc_attr_e($action->id) ?>][properties][message]" class="large-text code" rows="3"><?php if (isset($action->properties) && isset($action->properties->message)) { echo esc_textarea($action->properties->message); } ?></textarea>
427
  </td>
428
  </tr>
429
  <tr class="cnb-action-properties-whatsapp-extra cnb-action-properties-sms-extra">
@@ -434,10 +434,10 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
434
  <tr class="cnb_hide_on_modal cnb_advanced_view">
435
  <th colspan="2">
436
  <h2>Colors for a Single button are defined on the Button, not the action.</h2>
437
- <input name="actions[<?php esc_attr_e($action->id) ?>][backgroundColor]" type="hidden" value="<?php esc_attr_e($action->backgroundColor) ?>" />
438
- <input name="actions[<?php esc_attr_e($action->id) ?>][iconColor]" type="hidden" value="<?php esc_attr_e($action->iconColor) ?>" />
439
- <!-- We always enable the icon when the type if SINGLE, original value is "<?php esc_attr_e($action->iconEnabled) ?>" -->
440
- <input name="actions[<?php esc_attr_e($action->id) ?>][iconEnabled]" type="hidden" value="1" />
441
  </th>
442
  </tr>
443
  <?php } else { ?>
@@ -446,27 +446,27 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
446
  <td></td>
447
  </tr>
448
  <tr>
449
- <th scope="row"><label for="actions[<?php esc_attr_e($action->id) ?>][backgroundColor]">Background color</label></th>
450
  <td>
451
- <input name="actions[<?php esc_attr_e($action->id) ?>][backgroundColor]" id="actions[<?php esc_attr_e($action->id) ?>][backgroundColor]" type="text" value="<?php esc_attr_e($action->backgroundColor) ?>"
452
  class="cnb-color-field" data-default-color="#009900"/>
453
  </td>
454
  </tr>
455
  <tr>
456
- <th scope="row"><label for="actions[<?php esc_attr_e($action->id) ?>][iconColor]">Icon color</label></th>
457
  <td>
458
- <input name="actions[<?php esc_attr_e($action->id) ?>][iconColor]" id="actions[<?php esc_attr_e($action->id) ?>][iconColor]" type="text" value="<?php esc_attr_e($action->iconColor) ?>"
459
  class="cnb-iconcolor-field" data-default-color="#FFFFFF"/>
460
  </td>
461
  </tr>
462
  <?php if ($button && $button->type === 'MULTI') { ?>
463
- <input name="actions[<?php esc_attr_e($action->id) ?>][iconEnabled]" type="hidden" value="1" />
464
  <?php } else { ?>
465
  <tr>
466
  <th scope="row"></th>
467
  <td>
468
- <input type="hidden" name="actions[<?php esc_attr_e($action->id) ?>][iconEnabled]" id="actions[<?php esc_attr_e($action->id) ?>][iconEnabled]" value="0" />
469
- <input id="cnb-action-icon-enabled" class="cnb_toggle_checkbox" type="checkbox" name="actions[<?php esc_attr_e($action->id) ?>][iconEnabled]" id="actions[<?php esc_attr_e($action->id) ?>][iconEnabled]" value="true" <?php checked(true, $action->iconEnabled); ?>>
470
  <label for="cnb-action-icon-enabled" class="cnb_toggle_label">Toggle</label>
471
  <span data-cnb_toggle_state_label="cnb-action-icon-enabled" class="cnb_toggle_state cnb_toggle_false">Hide icon</span>
472
  <span data-cnb_toggle_state_label="cnb-action-icon-enabled" class="cnb_toggle_state cnb_toggle_true">Show icon</span>
@@ -479,8 +479,8 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
479
  <th scope="row">Show at all times</th>
480
  <td>
481
  <?php $showAlwaysValue = $action->id === 'new' || $action->schedule->showAlways; ?>
482
- <input name="actions[<?php esc_attr_e($action->id) ?>][schedule][showAlways]" type="hidden" value="false" />
483
- <input id="actions_schedule_show_always" class="cnb_toggle_checkbox" onchange="return cnb_hide_on_show_always();" name="actions[<?php esc_attr_e($action->id) ?>][schedule][showAlways]" type="checkbox"
484
  value="true" <?php checked(true, $showAlwaysValue); ?>
485
  <?php if (!$timezone_set_correctly) { ?>disabled="disabled" <?php } ?>/>
486
  <label for="actions_schedule_show_always" class="cnb_toggle_label">Toggle</label>
@@ -510,7 +510,7 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
510
  }
511
  echo '
512
  <input class="cnb_day_selector" id="cnb_weekday_'.esc_attr($api_server_index).'" type="checkbox" name="actions[' . esc_attr($action->id) . '][schedule][daysOfWeek][' . esc_attr($api_server_index) . ']" value="true" '.$selected.'>
513
- <label title="'.$wp_locale->get_weekday($cnb_day_of_week).'" class="cnb_day_selector" for="cnb_weekday_'.esc_attr($api_server_index).'">'.strtoupper(substr($wp_locale->get_weekday($cnb_day_of_week),0,2)).'</label>
514
  ';
515
  }
516
 
@@ -520,7 +520,7 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
520
  <tr class="cnb_hide_on_show_always">
521
  <th><label for="actions_schedule_outside_hours">After hours</label></th>
522
  <td>
523
- <input id="actions_schedule_outside_hours" class="cnb_toggle_checkbox" name="actions[<?php esc_attr_e($action->id) ?>][schedule][outsideHours]" type="checkbox"
524
  value="true" <?php checked(true, isset($action->schedule) && $action->schedule->outsideHours); ?> />
525
  <label for="actions_schedule_outside_hours" class="cnb_toggle_label">Toggle</label>
526
  </td>
@@ -534,16 +534,16 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
534
  </tr>
535
  <tr class="cnb_hide_on_show_always cnb_advanced_view">
536
  <th><label for="actions-schedule-start">Start time</label></th>
537
- <td><input type="time" name="actions[<?php esc_attr_e($action->id) ?>][schedule][start]" id="actions-schedule-start" value="<?php if (isset($action->schedule)) { esc_attr_e($action->schedule->start); } ?>"></td>
538
  </tr>
539
  <tr class="cnb_hide_on_show_always cnb_advanced_view">
540
  <th><label for="actions-schedule-stop">End time</label></th>
541
- <td><input type="time" name="actions[<?php esc_attr_e($action->id) ?>][schedule][stop]" id="actions-schedule-stop" value="<?php if (isset($action->schedule)) { esc_attr_e($action->schedule->stop); } ?>"></td>
542
  </tr>
543
  <tr class="cnb_hide_on_show_always<?php if (!$action_tz_different_from_domain) { ?> cnb_advanced_view<?php } ?>">
544
- <th><label for="actions[<?php esc_attr_e($action->id) ?>][schedule][timezone]">Timezone</label></th>
545
  <td>
546
- <select name="actions[<?php esc_attr_e($action->id) ?>][schedule][timezone]" id="actions[<?php esc_attr_e($action->id) ?>][schedule][timezone]" class="cnb_timezone_picker">
547
  <?php
548
  echo wp_timezone_choice($timezone);
549
  ?>
@@ -552,12 +552,12 @@ function cnb_render_form_action($action, $button=null, $domain=null, $show_table
552
  <?php if (empty($timezone)) { ?>
553
  Please select your timezone.
554
  <?php } else { ?>
555
- Currently set to <code><?php esc_html_e($timezone)?></code>.
556
  <?php } ?>
557
  </p>
558
  <?php if ($action_tz_different_from_domain) { ?>
559
  <div class="notice notice-warning inline">
560
- <p>Be aware that the timezone for this action (<code><?php esc_html_e($timezone)?></code>) is different from the timezone for your domain (<code><?php esc_html_e($domain->timezone)?></code>).</p>
561
  </div>
562
  <?php } ?>
563
  </td>
326
  cnb_domain_timezone_check( $domain );
327
  $timezone_set_correctly = cnb_warn_about_timezone($domain);
328
  ?>
329
+ <input type="hidden" name="actions[<?php echo esc_attr($action->id) ?>][id]" value="<?php if ($action->id !== null && $action->id !== 'new') { echo esc_attr($action->id); } ?>" />
330
+ <input type="hidden" name="actions[<?php echo esc_attr($action->id) ?>][delete]" id="cnb_action_<?php echo esc_attr($action->id) ?>_delete" value="" />
331
+ <input type="hidden" name="actions[<?php echo esc_attr($action->id) ?>][iconText]" value="<?php if (isset($action->iconText)) { echo esc_attr($action->iconText); } ?>" id="cnb_action_icon_text" />
332
+ <input type="hidden" name="actions[<?php echo esc_attr($action->id) ?>][iconType]" value="<?php if (isset($action->iconType)) { echo esc_attr($action->iconType); } ?>" />
333
  <?php if ($show_table) { ?>
334
  <table data-tab-name="actions" class="form-table nav-tab-active">
335
  <?php } ?>
343
  <tr class="cnb_hide_on_modal">
344
  <th scope="row"><label for="cnb_action_type">Button type</label></th>
345
  <td>
346
+ <select id="cnb_action_type" name="actions[<?php echo esc_attr($action->id) ?>][actionType]">
347
  <?php foreach (cnb_get_action_types() as $action_type_key => $action_type_value) { ?>
348
+ <option value="<?php echo esc_attr($action_type_key) ?>"<?php selected($action_type_key, $action->actionType) ?>>
349
+ <?php echo esc_html($action_type_value) ?>
350
  </option>
351
  <?php } ?>
352
  </select>
359
 
360
  </th>
361
  <td>
362
+ <input type="text" id="cnb_action_value_input" name="actions[<?php echo esc_attr($action->id) ?>][actionValue]" value="<?php echo esc_attr($action->actionValue) ?>"/>
363
  <p class="description cnb-action-properties-map">Preview via <a href="#" onclick="cnb_action_update_map_link(this)" target="_blank">Google Maps</a></p>
364
 
365
  </td>
367
  <tr class="cnb-action-properties-whatsapp">
368
  <th scope="row"><label for="cnb_action_value_input_whatsapp">Whatsapp Number</label></th>
369
  <td>
370
+ <input type="tel" id="cnb_action_value_input_whatsapp" name="actions[<?php echo esc_attr($action->id) ?>][actionValueWhatsapp]" value="<?php echo esc_attr($action->actionValue) ?>"/>
371
  <p class="description" id="cnb-valid-msg">✓ Valid</p>
372
  <p class="description" id="cnb-error-msg"></p>
373
  </td>
375
  <tr class="button-text cnb_hide_on_modal">
376
  <th scope="row"><label for="buttonTextField">Button label</label></th>
377
  <td>
378
+ <input id="buttonTextField" type="text" name="actions[<?php echo esc_attr($action->id) ?>][labelText]"
379
+ value="<?php echo esc_attr($action->labelText) ?>" maxlength="30" placeholder="optional" />
380
  <p class="description">Leave this field empty to only show an icon.</p>
381
  </td>
382
  </tr>
389
  </tr>
390
  <tr class="cnb-action-properties-email-extra">
391
  <th scope="row"><label for="action-properties-subject">Subject</label></th>
392
+ <td><input id="action-properties-subject" name="actions[<?php echo esc_attr($action->id) ?>][properties][subject]" type="text" value="<?php if (isset($action->properties) && isset($action->properties->subject)) { echo esc_attr($action->properties->subject); } ?>" /></td>
393
  </tr>
394
  <tr class="cnb-action-properties-email-extra">
395
  <th scope="row"><label for="action-properties-body">Body</label></th>
396
+ <td><textarea id="action-properties-body" name="actions[<?php echo esc_attr($action->id) ?>][properties][body]" class="large-text code" rows="3"><?php if (isset($action->properties) && isset($action->properties->body)) { echo esc_textarea($action->properties->body); } ?></textarea></td>
397
 
398
  </tr>
399
  <tr class="cnb-action-properties-email-extra">
400
  <th scope="row"><label for="action-properties-cc">CC</label></th>
401
+ <td><input id="action-properties-cc" name="actions[<?php echo esc_attr($action->id) ?>][properties][cc]" type="text" value="<?php if (isset($action->properties) && isset($action->properties->cc)) { echo esc_attr($action->properties->cc); } ?>" /></td>
402
  </tr>
403
  <tr class="cnb-action-properties-email-extra">
404
  <th scope="row"><label for="action-properties-bcc">BCC</label></th>
405
+ <td><input id="action-properties-bcc" name="actions[<?php echo esc_attr($action->id) ?>][properties][bcc]" type="text" value="<?php if (isset($action->properties) && isset($action->properties->bcc)) { echo esc_attr($action->properties->bcc); } ?>" /></td>
406
  </tr>
407
  <tr class="cnb-action-properties-email-extra">
408
  <th colspan="2"><hr /></th>
423
  <tr class="cnb-action-properties-whatsapp-extra cnb-action-properties-sms-extra">
424
  <th scope="row"><label for="action-properties-message">Default message</label></th>
425
  <td>
426
+ <textarea id="action-properties-message" name="actions[<?php echo esc_attr($action->id) ?>][properties][message]" class="large-text code" rows="3"><?php if (isset($action->properties) && isset($action->properties->message)) { echo esc_textarea($action->properties->message); } ?></textarea>
427
  </td>
428
  </tr>
429
  <tr class="cnb-action-properties-whatsapp-extra cnb-action-properties-sms-extra">
434
  <tr class="cnb_hide_on_modal cnb_advanced_view">
435
  <th colspan="2">
436
  <h2>Colors for a Single button are defined on the Button, not the action.</h2>
437
+ <input name="actions[<?php echo esc_attr($action->id) ?>][backgroundColor]" type="hidden" value="<?php echo esc_attr($action->backgroundColor) ?>" />
438
+ <input name="actions[<?php echo esc_attr($action->id) ?>][iconColor]" type="hidden" value="<?php echo esc_attr($action->iconColor) ?>" />
439
+ <!-- We always enable the icon when the type if SINGLE, original value is "<?php echo esc_attr($action->iconEnabled) ?>" -->
440
+ <input name="actions[<?php echo esc_attr($action->id) ?>][iconEnabled]" type="hidden" value="1" />
441
  </th>
442
  </tr>
443
  <?php } else { ?>
446
  <td></td>
447
  </tr>
448
  <tr>
449
+ <th scope="row"><label for="actions[<?php echo esc_attr($action->id) ?>][backgroundColor]">Background color</label></th>
450
  <td>
451
+ <input name="actions[<?php echo esc_attr($action->id) ?>][backgroundColor]" id="actions[<?php echo esc_attr($action->id) ?>][backgroundColor]" type="text" value="<?php echo esc_attr($action->backgroundColor) ?>"
452
  class="cnb-color-field" data-default-color="#009900"/>
453
  </td>
454
  </tr>
455
  <tr>
456
+ <th scope="row"><label for="actions[<?php echo esc_attr($action->id) ?>][iconColor]">Icon color</label></th>
457
  <td>
458
+ <input name="actions[<?php echo esc_attr($action->id) ?>][iconColor]" id="actions[<?php echo esc_attr($action->id) ?>][iconColor]" type="text" value="<?php echo esc_attr($action->iconColor) ?>"
459
  class="cnb-iconcolor-field" data-default-color="#FFFFFF"/>
460
  </td>
461
  </tr>
462
  <?php if ($button && $button->type === 'MULTI') { ?>
463
+ <input name="actions[<?php echo esc_attr($action->id) ?>][iconEnabled]" type="hidden" value="1" />
464
  <?php } else { ?>
465
  <tr>
466
  <th scope="row"></th>
467
  <td>
468
+ <input type="hidden" name="actions[<?php echo esc_attr($action->id) ?>][iconEnabled]" id="actions[<?php echo esc_attr($action->id) ?>][iconEnabled]" value="0" />
469
+ <input id="cnb-action-icon-enabled" class="cnb_toggle_checkbox" type="checkbox" name="actions[<?php echo esc_attr($action->id) ?>][iconEnabled]" id="actions[<?php echo esc_attr($action->id) ?>][iconEnabled]" value="true" <?php checked(true, $action->iconEnabled); ?>>
470
  <label for="cnb-action-icon-enabled" class="cnb_toggle_label">Toggle</label>
471
  <span data-cnb_toggle_state_label="cnb-action-icon-enabled" class="cnb_toggle_state cnb_toggle_false">Hide icon</span>
472
  <span data-cnb_toggle_state_label="cnb-action-icon-enabled" class="cnb_toggle_state cnb_toggle_true">Show icon</span>
479
  <th scope="row">Show at all times</th>
480
  <td>
481
  <?php $showAlwaysValue = $action->id === 'new' || $action->schedule->showAlways; ?>
482
+ <input name="actions[<?php echo esc_attr($action->id) ?>][schedule][showAlways]" type="hidden" value="false" />
483
+ <input id="actions_schedule_show_always" class="cnb_toggle_checkbox" onchange="return cnb_hide_on_show_always();" name="actions[<?php echo esc_attr($action->id) ?>][schedule][showAlways]" type="checkbox"
484
  value="true" <?php checked(true, $showAlwaysValue); ?>
485
  <?php if (!$timezone_set_correctly) { ?>disabled="disabled" <?php } ?>/>
486
  <label for="actions_schedule_show_always" class="cnb_toggle_label">Toggle</label>
510
  }
511
  echo '
512
  <input class="cnb_day_selector" id="cnb_weekday_'.esc_attr($api_server_index).'" type="checkbox" name="actions[' . esc_attr($action->id) . '][schedule][daysOfWeek][' . esc_attr($api_server_index) . ']" value="true" '.$selected.'>
513
+ <label title="'.$wp_locale->get_weekday($cnb_day_of_week).'" class="cnb_day_selector" for="cnb_weekday_'.esc_attr($api_server_index).'">'.$wp_locale->get_weekday_abbrev($wp_locale->get_weekday($cnb_day_of_week)).'</label>
514
  ';
515
  }
516
 
520
  <tr class="cnb_hide_on_show_always">
521
  <th><label for="actions_schedule_outside_hours">After hours</label></th>
522
  <td>
523
+ <input id="actions_schedule_outside_hours" class="cnb_toggle_checkbox" name="actions[<?php echo esc_attr($action->id) ?>][schedule][outsideHours]" type="checkbox"
524
  value="true" <?php checked(true, isset($action->schedule) && $action->schedule->outsideHours); ?> />
525
  <label for="actions_schedule_outside_hours" class="cnb_toggle_label">Toggle</label>
526
  </td>
534
  </tr>
535
  <tr class="cnb_hide_on_show_always cnb_advanced_view">
536
  <th><label for="actions-schedule-start">Start time</label></th>
537
+ <td><input type="time" name="actions[<?php echo esc_attr($action->id) ?>][schedule][start]" id="actions-schedule-start" value="<?php if (isset($action->schedule)) { echo esc_attr($action->schedule->start); } ?>"></td>
538
  </tr>
539
  <tr class="cnb_hide_on_show_always cnb_advanced_view">
540
  <th><label for="actions-schedule-stop">End time</label></th>
541
+ <td><input type="time" name="actions[<?php echo esc_attr($action->id) ?>][schedule][stop]" id="actions-schedule-stop" value="<?php if (isset($action->schedule)) { echo esc_attr($action->schedule->stop); } ?>"></td>
542
  </tr>
543
  <tr class="cnb_hide_on_show_always<?php if (!$action_tz_different_from_domain) { ?> cnb_advanced_view<?php } ?>">
544
+ <th><label for="actions[<?php echo esc_attr($action->id) ?>][schedule][timezone]">Timezone</label></th>
545
  <td>
546
+ <select name="actions[<?php echo esc_attr($action->id) ?>][schedule][timezone]" id="actions[<?php echo esc_attr($action->id) ?>][schedule][timezone]" class="cnb_timezone_picker">
547
  <?php
548
  echo wp_timezone_choice($timezone);
549
  ?>
552
  <?php if (empty($timezone)) { ?>
553
  Please select your timezone.
554
  <?php } else { ?>
555
+ Currently set to <code><?php echo esc_html($timezone)?></code>.
556
  <?php } ?>
557
  </p>
558
  <?php if ($action_tz_different_from_domain) { ?>
559
  <div class="notice notice-warning inline">
560
+ <p>Be aware that the timezone for this action (<code><?php echo esc_html($timezone)?></code>) is different from the timezone for your domain (<code><?php echo esc_html($domain->timezone)?></code>).</p>
561
  </div>
562
  <?php } ?>
563
  </td>
src/admin/button-edit.php CHANGED
@@ -230,16 +230,16 @@ function cnb_button_edit_form($button_id, $button, $default_domain, $options=arr
230
  <input type="hidden" name="page" value="call-now-button" />
231
  <input type="hidden" name="action" value="<?php echo $button_id === 'new' ? 'cnb_create_'.strtolower($button->type).'_button' :'cnb_update_'.esc_attr(strtolower($button->type)).'_button' ?>" />
232
  <input type="hidden" name="_wpnonce_button" value="<?php echo wp_create_nonce('cnb-button-edit')?>" />
233
- <input type="hidden" name="tab" value="<?php esc_attr_e(cnb_get_active_tab_name()) ?>" />
234
 
235
- <input type="hidden" name="cnb[id]" value="<?php esc_attr_e($button->id) ?>" />
236
- <input type="hidden" name="cnb[type]" value="<?php esc_attr_e($button->type) ?>" id="cnb_type" />
237
- <input type="hidden" name="cnb[active]" value="<?php esc_attr_e($button->active) ?>" />
238
- <input type="hidden" name="cnb[domain]" value="<?php esc_attr_e($default_domain->id) ?>" />
239
  <?php
240
  // Show all the current actions (needed to submit the form)
241
  foreach($button->actions as $action) { ?>
242
- <input type="hidden" name="actions[<?php esc_attr_e($action->id) ?>][id]" value="<?php esc_attr_e($action->id) ?>" />
243
  <?php } ?>
244
 
245
  <table class="form-table <?php if(!$hide_on_modal) { echo cnb_is_active_tab('basic_options'); } else { echo 'nav-tab-only'; } ?>" data-tab-name="basic_options">
@@ -251,7 +251,7 @@ function cnb_button_edit_form($button_id, $button, $default_domain, $options=arr
251
  <th scope="row"><label for="cnb[name]">Button name</label></th>
252
 
253
  <td class="activated">
254
- <label for="cnb[name]"><input type="text" name="cnb[name]" id="cnb[name]" required="required" value="<?php esc_attr_e($button->name); ?>" /></label>
255
  </td>
256
  </tr>
257
  <tr class="cnb_hide_on_modal">
@@ -271,8 +271,8 @@ function cnb_button_edit_form($button_id, $button, $default_domain, $options=arr
271
  <select name="cnb[domain]" id="cnb[domain]">
272
  <?php
273
  foreach ($domains as $domain) { ?>
274
- <option value="<?php esc_attr_e($domain->id) ?>"<?php selected($domain->id, $button->domain->id) ?>>
275
- <?php esc_html_e($domain->name) ?>
276
  <?php if ($domain->id == $default_domain->id) { echo ' (current Wordpress domain)'; } ?>
277
  </option>
278
  <?php } ?>
@@ -343,8 +343,8 @@ function cnb_button_edit_form($button_id, $button, $default_domain, $options=arr
343
  <tr>
344
  <th colspan="2">
345
  <h2>Colors for the Buttonbar are defined via the Actions.</h2>
346
- <input name="cnb[options][iconBackgroundColor]" type="hidden" value="<?php esc_attr_e($button->options->iconBackgroundColor); ?>" />
347
- <input name="cnb[options][iconColor]" type="hidden" value="<?php esc_attr_e($button->options->iconColor); ?>" />
348
  </th>
349
  </tr>
350
  <?php } else { ?>
@@ -355,7 +355,7 @@ function cnb_button_edit_form($button_id, $button, $default_domain, $options=arr
355
  <tr>
356
  <th scope="row"><label for="cnb[options][iconBackgroundColor]">Background color</label></th>
357
  <td>
358
- <input name="cnb[options][iconBackgroundColor]" id="cnb[options][iconBackgroundColor]" type="text" value="<?php esc_attr_e($button->options->iconBackgroundColor); ?>"
359
  class="cnb-iconcolor-field" data-default-color="#009900"/>
360
  <?php if ($button->type === 'MULTI') { ?>
361
  <p class="description"><span class="dashicons dashicons-info"></span>This color applies to the collapsable button only.</p>
@@ -365,7 +365,7 @@ function cnb_button_edit_form($button_id, $button, $default_domain, $options=arr
365
  <tr>
366
  <th scope="row"><label for="cnb[options][iconColor]">Icon color</label></th>
367
  <td>
368
- <input name="cnb[options][iconColor]" id="cnb[options][iconColor]" type="text" value="<?php esc_attr_e($button->options->iconColor); ?>"
369
  class="cnb-iconcolor-field" data-default-color="#FFFFFF"/>
370
  <?php if ($button->type === 'MULTI') { ?>
371
  <p class="description"><span class="dashicons dashicons-info"></span>This color applies to the collapsable button only.</p>
@@ -483,33 +483,33 @@ function cnb_button_edit_form($button_id, $button, $default_domain, $options=arr
483
  </tr>
484
  <?php } else { ?>
485
  <?php foreach ($button->conditions as $condition) { ?>
486
- <tr class="appearance cnb-condition" id="cnb_condition_<?php esc_attr_e($condition->id) ?>">
487
  <td colspan="2" style="padding: 0;">
488
  <table class="cnb_condition_rule">
489
  <tbody>
490
  <tr>
491
  <td>
492
- <input type="hidden" name="condition[<?php esc_attr_e($condition->id) ?>][id]" value="<?php esc_attr_e($condition->id) ?>" />
493
- <input type="hidden" name="condition[<?php esc_attr_e($condition->id) ?>][conditionType]" value="<?php esc_attr_e($condition->conditionType) ?>" />
494
- <input type="hidden" name="condition[<?php esc_attr_e($condition->id) ?>][delete]" id="cnb_condition_<?php esc_attr_e($condition->id) ?>_delete" value="" />
495
- <label for="condition[<?php esc_attr_e($condition->id) ?>][filterType]">
496
- <select name="condition[<?php esc_attr_e($condition->id) ?>][filterType]" id="condition[<?php esc_attr_e($condition->id) ?>][filterType]">
497
  <option value="INCLUDE"<?php selected('INCLUDE', $condition->filterType) ?>>Include</option>
498
  <option value="EXCLUDE"<?php selected('EXCLUDE', $condition->filterType) ?>>Exclude</option>
499
  </select>
500
  </label>
501
  </td>
502
  <td>
503
- <select name="condition[<?php esc_attr_e($condition->id) ?>][matchType]">
504
  <?php foreach (cnb_get_condition_match_types() as $condition_match_type_key => $condition_match_type_value) { ?>
505
- <option value="<?php esc_attr_e($condition_match_type_key) ?>"<?php selected($condition_match_type_key, $condition->matchType) ?>>
506
- <?php esc_html_e($condition_match_type_value) ?>
507
  </option>
508
  <?php } ?>
509
  </select>
510
  </td>
511
  <td class="max_width_column">
512
- <input type="text" name="condition[<?php esc_attr_e($condition->id) ?>][matchValue]" value="<?php esc_attr_e($condition->matchValue); ?>"/>
513
  <a onclick="return cnb_remove_condition('<?php echo esc_js($condition->id) ?>');" title="Remove Condition" class="button-link button-link-delete"><span class="dashicons dashicons-no"></span></a>
514
  </td>
515
  </tr>
@@ -520,7 +520,7 @@ function cnb_button_edit_form($button_id, $button, $default_domain, $options=arr
520
  </tr>
521
  <?php } ?>
522
  <tr class="cnb_advanced_view">
523
- <td colspan="3" style="padding: 5px 10px"><div class="cnb_font_normal cnb_font_90">ID: <code class="cnb_font_90"><?php esc_html_e($condition->id) ?></code></div></td>
524
  </tr>
525
  </tbody>
526
  </table>
230
  <input type="hidden" name="page" value="call-now-button" />
231
  <input type="hidden" name="action" value="<?php echo $button_id === 'new' ? 'cnb_create_'.strtolower($button->type).'_button' :'cnb_update_'.esc_attr(strtolower($button->type)).'_button' ?>" />
232
  <input type="hidden" name="_wpnonce_button" value="<?php echo wp_create_nonce('cnb-button-edit')?>" />
233
+ <input type="hidden" name="tab" value="<?php echo esc_attr(cnb_get_active_tab_name()) ?>" />
234
 
235
+ <input type="hidden" name="cnb[id]" value="<?php echo esc_attr($button->id) ?>" />
236
+ <input type="hidden" name="cnb[type]" value="<?php echo esc_attr($button->type) ?>" id="cnb_type" />
237
+ <input type="hidden" name="cnb[active]" value="<?php echo esc_attr($button->active) ?>" />
238
+ <input type="hidden" name="cnb[domain]" value="<?php echo esc_attr($default_domain->id) ?>" />
239
  <?php
240
  // Show all the current actions (needed to submit the form)
241
  foreach($button->actions as $action) { ?>
242
+ <input type="hidden" name="actions[<?php echo esc_attr($action->id) ?>][id]" value="<?php echo esc_attr($action->id) ?>" />
243
  <?php } ?>
244
 
245
  <table class="form-table <?php if(!$hide_on_modal) { echo cnb_is_active_tab('basic_options'); } else { echo 'nav-tab-only'; } ?>" data-tab-name="basic_options">
251
  <th scope="row"><label for="cnb[name]">Button name</label></th>
252
 
253
  <td class="activated">
254
+ <label for="cnb[name]"><input type="text" name="cnb[name]" id="cnb[name]" required="required" value="<?php echo esc_attr($button->name); ?>" /></label>
255
  </td>
256
  </tr>
257
  <tr class="cnb_hide_on_modal">
271
  <select name="cnb[domain]" id="cnb[domain]">
272
  <?php
273
  foreach ($domains as $domain) { ?>
274
+ <option value="<?php echo esc_attr($domain->id) ?>"<?php selected($domain->id, $button->domain->id) ?>>
275
+ <?php echo esc_html($domain->name) ?>
276
  <?php if ($domain->id == $default_domain->id) { echo ' (current Wordpress domain)'; } ?>
277
  </option>
278
  <?php } ?>
343
  <tr>
344
  <th colspan="2">
345
  <h2>Colors for the Buttonbar are defined via the Actions.</h2>
346
+ <input name="cnb[options][iconBackgroundColor]" type="hidden" value="<?php echo esc_attr($button->options->iconBackgroundColor); ?>" />
347
+ <input name="cnb[options][iconColor]" type="hidden" value="<?php echo esc_attr($button->options->iconColor); ?>" />
348
  </th>
349
  </tr>
350
  <?php } else { ?>
355
  <tr>
356
  <th scope="row"><label for="cnb[options][iconBackgroundColor]">Background color</label></th>
357
  <td>
358
+ <input name="cnb[options][iconBackgroundColor]" id="cnb[options][iconBackgroundColor]" type="text" value="<?php echo esc_attr($button->options->iconBackgroundColor); ?>"
359
  class="cnb-iconcolor-field" data-default-color="#009900"/>
360
  <?php if ($button->type === 'MULTI') { ?>
361
  <p class="description"><span class="dashicons dashicons-info"></span>This color applies to the collapsable button only.</p>
365
  <tr>
366
  <th scope="row"><label for="cnb[options][iconColor]">Icon color</label></th>
367
  <td>
368
+ <input name="cnb[options][iconColor]" id="cnb[options][iconColor]" type="text" value="<?php echo esc_attr($button->options->iconColor); ?>"
369
  class="cnb-iconcolor-field" data-default-color="#FFFFFF"/>
370
  <?php if ($button->type === 'MULTI') { ?>
371
  <p class="description"><span class="dashicons dashicons-info"></span>This color applies to the collapsable button only.</p>
483
  </tr>
484
  <?php } else { ?>
485
  <?php foreach ($button->conditions as $condition) { ?>
486
+ <tr class="appearance cnb-condition" id="cnb_condition_<?php echo esc_attr($condition->id) ?>">
487
  <td colspan="2" style="padding: 0;">
488
  <table class="cnb_condition_rule">
489
  <tbody>
490
  <tr>
491
  <td>
492
+ <input type="hidden" name="condition[<?php echo esc_attr($condition->id) ?>][id]" value="<?php echo esc_attr($condition->id) ?>" />
493
+ <input type="hidden" name="condition[<?php echo esc_attr($condition->id) ?>][conditionType]" value="<?php echo esc_attr($condition->conditionType) ?>" />
494
+ <input type="hidden" name="condition[<?php echo esc_attr($condition->id) ?>][delete]" id="cnb_condition_<?php echo esc_attr($condition->id) ?>_delete" value="" />
495
+ <label for="condition[<?php echo esc_attr($condition->id) ?>][filterType]">
496
+ <select name="condition[<?php echo esc_attr($condition->id) ?>][filterType]" id="condition[<?php echo esc_attr($condition->id) ?>][filterType]">
497
  <option value="INCLUDE"<?php selected('INCLUDE', $condition->filterType) ?>>Include</option>
498
  <option value="EXCLUDE"<?php selected('EXCLUDE', $condition->filterType) ?>>Exclude</option>
499
  </select>
500
  </label>
501
  </td>
502
  <td>
503
+ <select name="condition[<?php echo esc_attr($condition->id) ?>][matchType]">
504
  <?php foreach (cnb_get_condition_match_types() as $condition_match_type_key => $condition_match_type_value) { ?>
505
+ <option value="<?php echo esc_attr($condition_match_type_key) ?>"<?php selected($condition_match_type_key, $condition->matchType) ?>>
506
+ <?php echo esc_html($condition_match_type_value) ?>
507
  </option>
508
  <?php } ?>
509
  </select>
510
  </td>
511
  <td class="max_width_column">
512
+ <input type="text" name="condition[<?php echo esc_attr($condition->id) ?>][matchValue]" value="<?php echo esc_attr($condition->matchValue); ?>"/>
513
  <a onclick="return cnb_remove_condition('<?php echo esc_js($condition->id) ?>');" title="Remove Condition" class="button-link button-link-delete"><span class="dashicons dashicons-no"></span></a>
514
  </td>
515
  </tr>
520
  </tr>
521
  <?php } ?>
522
  <tr class="cnb_advanced_view">
523
+ <td colspan="3" style="padding: 5px 10px"><div class="cnb_font_normal cnb_font_90">ID: <code class="cnb_font_90"><?php echo esc_html($condition->id) ?></code></div></td>
524
  </tr>
525
  </tbody>
526
  </table>
src/admin/button-overview.php CHANGED
@@ -40,7 +40,7 @@ function cnb_create_new_button($addional_classes='page-title-action', $link_text
40
  __('Create new button'),
41
  $addional_classes,
42
  __('Choose a Button type'),
43
- __(esc_html($link_text))
44
  );
45
  }
46
 
@@ -135,8 +135,8 @@ class Cnb_Button_List_Table extends WP_List_Table {
135
  $active_url = esc_url( $active_link );
136
 
137
  return array(
138
- 'all' => __("<a href='" . $all_url . "' " . (!$current_view_is_active ? "class='current'" : '') . ">All ".$all_count_str."</a>", CNB_NAME),
139
- 'active' => __("<a href='" . $active_url . "' " . ($current_view_is_active ? "class='current'" : '') . "'>Active ".$active_count_str."</a>", CNB_NAME)
140
  );
141
  }
142
  function prepare_items() {
40
  __('Create new button'),
41
  $addional_classes,
42
  __('Choose a Button type'),
43
+ esc_html__($link_text)
44
  );
45
  }
46
 
135
  $active_url = esc_url( $active_link );
136
 
137
  return array(
138
+ 'all' => "<a href='" . $all_url . "' " . (!$current_view_is_active ? "class='current'" : '') . ">" . __('All') . $all_count_str."</a>",
139
+ 'active' => "<a href='" . $active_url . "' " . ($current_view_is_active ? "class='current'" : '') . "'>" . __('Active') .$active_count_str."</a>"
140
  );
141
  }
142
  function prepare_items() {
src/admin/condition-edit.php CHANGED
@@ -177,18 +177,18 @@ function cnb_render_form_condition($condition) {
177
  <table class="form-table nav-tab-active">
178
  <tr>
179
  <th colspan="2"><h2>Basic Settings</h2>
180
- <input type="hidden" name="conditions[<?php esc_attr_e($condition->id) ?>][id]" value="<?php if ($condition->id !== null && $condition->id !== 'new') { esc_attr_e($condition->id); } ?>" />
181
- <input type="hidden" name="conditions[<?php esc_attr_e($condition->id) ?>][delete]" id="cnb_condition_<?php esc_attr_e($condition->id) ?>_delete" value="" />
182
- <input type="hidden" name="conditions[<?php esc_attr_e($condition->id) ?>][conditionType]" value="<?php esc_attr_e($condition->conditionType) ?>" />
183
  </th>
184
  </tr>
185
  <tr>
186
  <th scope="row"><label for="cnb_condition_filter_type">Filter Type</label></th>
187
  <td>
188
- <select id="cnb_condition_filter_type" name="conditions[<?php esc_attr_e($condition->id) ?>][filterType]">
189
  <?php foreach (cnb_get_condition_filter_types() as $condition_filter_type_key => $condition_filter_type_value) { ?>
190
- <option value="<?php esc_attr_e($condition_filter_type_key) ?>"<?php selected($condition_filter_type_key, $condition->filterType) ?>>
191
- <?php esc_html_e($condition_filter_type_value) ?>
192
  </option>
193
  <?php } ?>
194
  </select>
@@ -197,10 +197,10 @@ function cnb_render_form_condition($condition) {
197
  <tr>
198
  <th scope="row"><label for="cnb_condition_match_type">Match Type</label></th>
199
  <td>
200
- <select id="cnb_condition_match_type" name="conditions[<?php esc_attr_e($condition->id) ?>][matchType]">
201
  <?php foreach (cnb_get_condition_match_types() as $condition_match_type_key => $condition_match_type_value) { ?>
202
- <option value="<?php esc_attr_e($condition_match_type_key) ?>"<?php selected($condition_match_type_key, $condition->matchType) ?>>
203
- <?php esc_html_e($condition_match_type_value) ?>
204
  </option>
205
  <?php } ?>
206
  </select>
@@ -209,7 +209,7 @@ function cnb_render_form_condition($condition) {
209
  <tr>
210
  <th scope="row"><label for="cnb_condition_match_value">Match Value</label></th>
211
  <td>
212
- <input type="text" id="cnb_condition_match_value" class="regular-text" name="conditions[<?php esc_attr_e($condition->id) ?>][matchValue]" value="<?php esc_attr_e($condition->matchValue) ?>" />
213
  </td>
214
  </tr>
215
 
@@ -278,8 +278,8 @@ function cnb_admin_page_condition_edit_render() {
278
  <?php } ?>
279
  <form action="<?php echo $redirect_link; ?>" method="post">
280
  <input type="hidden" name="page" value="call-now-button-conditions" />
281
- <input type="hidden" name="bid" value="<?php esc_attr_e($bid) ?>" />
282
- <input type="hidden" name="condition_id" value="<?php esc_attr_e($condition->id) ?>" />
283
  <input type="hidden" name="action" value="<?php echo $condition_id === 'new' ? 'cnb_create_condition' :'cnb_update_condition' ?>" />
284
  <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce($condition->id === 'new' ? 'cnb_create_condition' : 'cnb_update_condition') ?>" />
285
  <?php
177
  <table class="form-table nav-tab-active">
178
  <tr>
179
  <th colspan="2"><h2>Basic Settings</h2>
180
+ <input type="hidden" name="conditions[<?php echo esc_attr($condition->id) ?>][id]" value="<?php if ($condition->id !== null && $condition->id !== 'new') { echo esc_attr($condition->id); } ?>" />
181
+ <input type="hidden" name="conditions[<?php echo esc_attr($condition->id) ?>][delete]" id="cnb_condition_<?php echo esc_attr($condition->id) ?>_delete" value="" />
182
+ <input type="hidden" name="conditions[<?php echo esc_attr($condition->id) ?>][conditionType]" value="<?php echo esc_attr($condition->conditionType) ?>" />
183
  </th>
184
  </tr>
185
  <tr>
186
  <th scope="row"><label for="cnb_condition_filter_type">Filter Type</label></th>
187
  <td>
188
+ <select id="cnb_condition_filter_type" name="conditions[<?php echo esc_attr($condition->id) ?>][filterType]">
189
  <?php foreach (cnb_get_condition_filter_types() as $condition_filter_type_key => $condition_filter_type_value) { ?>
190
+ <option value="<?php echo esc_attr($condition_filter_type_key) ?>"<?php selected($condition_filter_type_key, $condition->filterType) ?>>
191
+ <?php echo esc_html($condition_filter_type_value) ?>
192
  </option>
193
  <?php } ?>
194
  </select>
197
  <tr>
198
  <th scope="row"><label for="cnb_condition_match_type">Match Type</label></th>
199
  <td>
200
+ <select id="cnb_condition_match_type" name="conditions[<?php echo esc_attr($condition->id) ?>][matchType]">
201
  <?php foreach (cnb_get_condition_match_types() as $condition_match_type_key => $condition_match_type_value) { ?>
202
+ <option value="<?php echo esc_attr($condition_match_type_key) ?>"<?php selected($condition_match_type_key, $condition->matchType) ?>>
203
+ <?php echo esc_html($condition_match_type_value) ?>
204
  </option>
205
  <?php } ?>
206
  </select>
209
  <tr>
210
  <th scope="row"><label for="cnb_condition_match_value">Match Value</label></th>
211
  <td>
212
+ <input type="text" id="cnb_condition_match_value" class="regular-text" name="conditions[<?php echo esc_attr($condition->id) ?>][matchValue]" value="<?php echo esc_attr($condition->matchValue) ?>" />
213
  </td>
214
  </tr>
215
 
278
  <?php } ?>
279
  <form action="<?php echo $redirect_link; ?>" method="post">
280
  <input type="hidden" name="page" value="call-now-button-conditions" />
281
+ <input type="hidden" name="bid" value="<?php echo esc_attr($bid) ?>" />
282
+ <input type="hidden" name="condition_id" value="<?php echo esc_attr($condition->id) ?>" />
283
  <input type="hidden" name="action" value="<?php echo $condition_id === 'new' ? 'cnb_create_condition' :'cnb_update_condition' ?>" />
284
  <input type="hidden" name="_wpnonce" value="<?php echo wp_create_nonce($condition->id === 'new' ? 'cnb_create_condition' : 'cnb_update_condition') ?>" />
285
  <?php
src/admin/domain-edit.php CHANGED
@@ -233,7 +233,7 @@ function cnb_admin_page_domain_edit_render_form_plan_details($domain) {
233
  <tr>
234
  <th>Plan</th>
235
  <td>
236
- <code><?php esc_html_e($domain->type) ?></code>
237
  <?php
238
  if ($domain->type !== 'PRO' && !empty($domain->id)) {
239
  echo '<a href="' . $upgrade_url . '">Upgrade!</a>
@@ -309,7 +309,7 @@ function cnb_admin_page_domain_edit_render_form_button_display($domain) {
309
  <td><fieldset>
310
  <label class="cnb_slider_value" for="cnb_slider" onclick="jQuery('#cnb_slider:enabled')[0].stepDown();cnb_update_sliders()">Smaller&nbsp;&laquo;&nbsp;</label>
311
  <input type="range" min="0.7" max="1.3" step="0.1" name="domain[properties][scale]"
312
- value="<?php esc_attr_e($domain->properties->scale) ?>" class="slider" id="cnb_slider">
313
  <label class="cnb_slider_value" for="cnb_slider" onclick="jQuery('#cnb_slider:enabled')[0].stepUp();cnb_update_sliders()">&nbsp;&raquo;&nbsp;Bigger</label>
314
  </fieldset></td>
315
  </tr>
@@ -320,7 +320,7 @@ function cnb_admin_page_domain_edit_render_form_button_display($domain) {
320
  <td>
321
  <label class="cnb_slider_value" for="cnb_order_slider" onclick="jQuery('#cnb_order_slider:enabled')[0].stepDown();cnb_update_sliders()">Backwards&nbsp;&laquo;&nbsp;</label>
322
  <input type="range" min="1" max="10" name="domain[properties][zindex]"
323
- value="<?php esc_attr_e($domain_properties_zindex_order) ?>" class="slider2" id="cnb_order_slider"
324
  step="1">
325
  <label class="cnb_slider_value" for="cnb_order_slider" onclick="jQuery('#cnb_order_slider:enabled')[0].stepUp();cnb_update_sliders()">&nbsp;&raquo;&nbsp;Front</label>
326
  <p class="description">The default (and recommended) value is all the way to the front so the
@@ -346,16 +346,16 @@ function cnb_admin_page_domain_edit_render_form_advanced($domain, $header=true)
346
  <tr>
347
  <th scope="row"><label for="domain_name">Domain name</label></th>
348
  <td>
349
- <input type="hidden" name="domain[id]" value="<?php esc_attr_e($domain->id) ?>" />
350
  <?php if($show_advanced_view_only) { ?>
351
- <input type="text" id="domain_name" name="domain[name]" value="<?php esc_attr_e($domain->name) ?>" class="regular-text" <?php if(!empty($domain->id)) { echo 'disabled="disabled"'; } ?> required="required"/>
352
  <?php if(!empty($domain->id)) { ?>
353
  <p class="description">
354
  <strong>Warning</strong>: Changing your domain name means remapping all existing Buttons for that domain. Please use with caution. <a class="cnb_cursor_pointer" onclick="return jQuery('#domain_name').prop('disabled', false);">Click here to change your domain.</a>
355
  </p>
356
  <?php } ?>
357
  <?php } else {
358
- esc_html_e($domain->name);
359
  } ?>
360
  </td>
361
  </tr>
@@ -374,7 +374,7 @@ function cnb_admin_page_domain_edit_render_form_advanced($domain, $header=true)
374
  <br />WordPress is set to: <code><?php echo wp_timezone_string() ?></code>
375
  <?php } ?>
376
  <?php } else { ?>
377
- Currently set to <code><?php esc_html_e($domain->timezone) ?></code>.
378
  <?php } ?>
379
  </p>
380
  </td>
233
  <tr>
234
  <th>Plan</th>
235
  <td>
236
+ <code><?php echo esc_html($domain->type) ?></code>
237
  <?php
238
  if ($domain->type !== 'PRO' && !empty($domain->id)) {
239
  echo '<a href="' . $upgrade_url . '">Upgrade!</a>
309
  <td><fieldset>
310
  <label class="cnb_slider_value" for="cnb_slider" onclick="jQuery('#cnb_slider:enabled')[0].stepDown();cnb_update_sliders()">Smaller&nbsp;&laquo;&nbsp;</label>
311
  <input type="range" min="0.7" max="1.3" step="0.1" name="domain[properties][scale]"
312
+ value="<?php echo esc_attr($domain->properties->scale) ?>" class="slider" id="cnb_slider">
313
  <label class="cnb_slider_value" for="cnb_slider" onclick="jQuery('#cnb_slider:enabled')[0].stepUp();cnb_update_sliders()">&nbsp;&raquo;&nbsp;Bigger</label>
314
  </fieldset></td>
315
  </tr>
320
  <td>
321
  <label class="cnb_slider_value" for="cnb_order_slider" onclick="jQuery('#cnb_order_slider:enabled')[0].stepDown();cnb_update_sliders()">Backwards&nbsp;&laquo;&nbsp;</label>
322
  <input type="range" min="1" max="10" name="domain[properties][zindex]"
323
+ value="<?php echo esc_attr($domain_properties_zindex_order) ?>" class="slider2" id="cnb_order_slider"
324
  step="1">
325
  <label class="cnb_slider_value" for="cnb_order_slider" onclick="jQuery('#cnb_order_slider:enabled')[0].stepUp();cnb_update_sliders()">&nbsp;&raquo;&nbsp;Front</label>
326
  <p class="description">The default (and recommended) value is all the way to the front so the
346
  <tr>
347
  <th scope="row"><label for="domain_name">Domain name</label></th>
348
  <td>
349
+ <input type="hidden" name="domain[id]" value="<?php echo esc_attr($domain->id) ?>" />
350
  <?php if($show_advanced_view_only) { ?>
351
+ <input type="text" id="domain_name" name="domain[name]" value="<?php echo esc_attr($domain->name) ?>" class="regular-text" <?php if(!empty($domain->id)) { echo 'disabled="disabled"'; } ?> required="required"/>
352
  <?php if(!empty($domain->id)) { ?>
353
  <p class="description">
354
  <strong>Warning</strong>: Changing your domain name means remapping all existing Buttons for that domain. Please use with caution. <a class="cnb_cursor_pointer" onclick="return jQuery('#domain_name').prop('disabled', false);">Click here to change your domain.</a>
355
  </p>
356
  <?php } ?>
357
  <?php } else {
358
+ echo esc_html($domain->name);
359
  } ?>
360
  </td>
361
  </tr>
374
  <br />WordPress is set to: <code><?php echo wp_timezone_string() ?></code>
375
  <?php } ?>
376
  <?php } else { ?>
377
+ Currently set to <code><?php echo esc_html($domain->timezone) ?></code>.
378
  <?php } ?>
379
  </p>
380
  </td>
src/admin/legacy-edit.php CHANGED
@@ -79,7 +79,7 @@ function cnb_admin_page_leagcy_edit_render_zoom() {
79
  <th scope="row"><label for="cnb_slider">Button size <span id="cnb_slider_value"></span></label></th>
80
  <td>
81
  <label class="cnb_slider_value">Smaller&nbsp;&laquo;&nbsp;</label>
82
- <input type="range" min="0.7" max="1.3" name="cnb[zoom]" value="<?php esc_attr_e($cnb_options['zoom']) ?>" class="slider" id="cnb_slider" step="0.1">
83
  <label class="cnb_slider_value">&nbsp;&raquo;&nbsp;Bigger</label>
84
  </td>
85
  </tr>
@@ -95,7 +95,7 @@ function cnb_admin_page_leagcy_edit_render_zindex() {
95
  </a></th>
96
  <td>
97
  <label class="cnb_slider_value">Backwards&nbsp;&laquo;&nbsp;</label>
98
- <input type="range" min="1" max="10" name="cnb[z-index]" value="<?php esc_attr_e($cnb_options['z-index']) ?>" class="slider2" id="cnb_order_slider" step="1">
99
  <label class="cnb_slider_value">&nbsp;&raquo;&nbsp;Front</label>
100
  <p class="description">The default (and recommended) value is all the way to the front so the button sits on top of everything else. In case you have a specific usecase where you want something else to sit in front of the Call Now Button (e.g. a chat window or a cookie notice) you can move this backwards one step at a time to adapt it to your situation.</p>
101
  </td>
@@ -142,14 +142,14 @@ function cnb_admin_page_legacy_edit_render() {
142
  <th scope="row"><label for="cnb-number">Phone number</label> <a href="<?php echo CNB_SUPPORT ?>wordpress-free/basics/phone-number/<?php cnb_utm_params("question-mark", "phone-number"); ?>" target="_blank" class="cnb-nounderscore">
143
  <span class="dashicons dashicons-editor-help"></span>
144
  </a></th>
145
- <td><input type="text" id="cnb-number" name="cnb[number]" value="<?php esc_attr_e($cnb_options['number']) ?>" /></td>
146
  </tr>
147
  <tr class="button-text">
148
  <th scope="row"><label for="buttonTextField">Button text</label> <small style="font-weight: 400">(optional)</small> <a href="<?php echo CNB_SUPPORT ?>wordpress-free/basics/using-text-buttons/<?php cnb_utm_params("question-mark", "using-text-buttons"); ?>" target="_blank" class="cnb-nounderscore">
149
  <span class="dashicons dashicons-editor-help"></span>
150
  </a></th>
151
  <td>
152
- <input id="buttonTextField" type="text" name="cnb[text]" value="<?php esc_attr_e($cnb_options['text']) ?>" maxlength="30" />
153
  <p class="description">Leave this field empty to only show an icon.</p>
154
  </td>
155
  </tr>
@@ -162,11 +162,11 @@ function cnb_admin_page_legacy_edit_render() {
162
 
163
  <tr>
164
  <th scope="row">Button color</th>
165
- <td><input id="cnb-color" name="cnb[color]" type="text" value="<?php esc_attr_e($cnb_options['color']) ?>" class="cnb-color-field" data-default-color="#009900" /></td>
166
  </tr>
167
  <tr>
168
  <th scope="row">Icon color</th>
169
- <td><input name="cnb[iconcolor]" type="text" value="<?php esc_attr_e($cnb_options['iconcolor']) ?>" class="cnb-iconcolor-field" data-default-color="#ffffff" /></td>
170
  </tr>
171
  <tr>
172
  <th scope="row">Position <a href="<?php echo CNB_SUPPORT ?>wordpress-free/presentation/button-position/<?php cnb_utm_params("question-mark", "button-position"); ?>" target="_blank" class="cnb-nounderscore">
@@ -235,7 +235,7 @@ function cnb_admin_page_legacy_edit_render() {
235
  <span class="dashicons dashicons-editor-help"></span>
236
  </a></th>
237
  <td>
238
- <input type="text" id="cnb-show" name="cnb[show]" value="<?php esc_attr_e($cnb_options['show']) ?>" placeholder="E.g. 14, 345" />
239
  <p class="description">Enter IDs of the posts &amp; pages, separated by commas (leave blank for all). <a href="<?php echo CNB_SUPPORT ?>wordpress-free/presentation/limit-appearance/<?php cnb_utm_params("question-mark", "limit-appearance"); ?>" target="_blank">Learn more...</a></p>
240
  <div class="cnb-radio-item">
241
  <input id="limit1" type="radio" name="cnb[limit]" value="include" <?php checked('include', $cnb_options['limit']);?> />
79
  <th scope="row"><label for="cnb_slider">Button size <span id="cnb_slider_value"></span></label></th>
80
  <td>
81
  <label class="cnb_slider_value">Smaller&nbsp;&laquo;&nbsp;</label>
82
+ <input type="range" min="0.7" max="1.3" name="cnb[zoom]" value="<?php echo esc_attr($cnb_options['zoom']) ?>" class="slider" id="cnb_slider" step="0.1">
83
  <label class="cnb_slider_value">&nbsp;&raquo;&nbsp;Bigger</label>
84
  </td>
85
  </tr>
95
  </a></th>
96
  <td>
97
  <label class="cnb_slider_value">Backwards&nbsp;&laquo;&nbsp;</label>
98
+ <input type="range" min="1" max="10" name="cnb[z-index]" value="<?php echo esc_attr($cnb_options['z-index']) ?>" class="slider2" id="cnb_order_slider" step="1">
99
  <label class="cnb_slider_value">&nbsp;&raquo;&nbsp;Front</label>
100
  <p class="description">The default (and recommended) value is all the way to the front so the button sits on top of everything else. In case you have a specific usecase where you want something else to sit in front of the Call Now Button (e.g. a chat window or a cookie notice) you can move this backwards one step at a time to adapt it to your situation.</p>
101
  </td>
142
  <th scope="row"><label for="cnb-number">Phone number</label> <a href="<?php echo CNB_SUPPORT ?>wordpress-free/basics/phone-number/<?php cnb_utm_params("question-mark", "phone-number"); ?>" target="_blank" class="cnb-nounderscore">
143
  <span class="dashicons dashicons-editor-help"></span>
144
  </a></th>
145
+ <td><input type="text" id="cnb-number" name="cnb[number]" value="<?php echo esc_attr($cnb_options['number']) ?>" /></td>
146
  </tr>
147
  <tr class="button-text">
148
  <th scope="row"><label for="buttonTextField">Button text</label> <small style="font-weight: 400">(optional)</small> <a href="<?php echo CNB_SUPPORT ?>wordpress-free/basics/using-text-buttons/<?php cnb_utm_params("question-mark", "using-text-buttons"); ?>" target="_blank" class="cnb-nounderscore">
149
  <span class="dashicons dashicons-editor-help"></span>
150
  </a></th>
151
  <td>
152
+ <input id="buttonTextField" type="text" name="cnb[text]" value="<?php echo esc_attr($cnb_options['text']) ?>" maxlength="30" />
153
  <p class="description">Leave this field empty to only show an icon.</p>
154
  </td>
155
  </tr>
162
 
163
  <tr>
164
  <th scope="row">Button color</th>
165
+ <td><input id="cnb-color" name="cnb[color]" type="text" value="<?php echo esc_attr($cnb_options['color']) ?>" class="cnb-color-field" data-default-color="#009900" /></td>
166
  </tr>
167
  <tr>
168
  <th scope="row">Icon color</th>
169
+ <td><input name="cnb[iconcolor]" type="text" value="<?php echo esc_attr($cnb_options['iconcolor']) ?>" class="cnb-iconcolor-field" data-default-color="#ffffff" /></td>
170
  </tr>
171
  <tr>
172
  <th scope="row">Position <a href="<?php echo CNB_SUPPORT ?>wordpress-free/presentation/button-position/<?php cnb_utm_params("question-mark", "button-position"); ?>" target="_blank" class="cnb-nounderscore">
235
  <span class="dashicons dashicons-editor-help"></span>
236
  </a></th>
237
  <td>
238
+ <input type="text" id="cnb-show" name="cnb[show]" value="<?php echo esc_attr($cnb_options['show']) ?>" placeholder="E.g. 14, 345" />
239
  <p class="description">Enter IDs of the posts &amp; pages, separated by commas (leave blank for all). <a href="<?php echo CNB_SUPPORT ?>wordpress-free/presentation/limit-appearance/<?php cnb_utm_params("question-mark", "limit-appearance"); ?>" target="_blank">Learn more...</a></p>
240
  <div class="cnb-radio-item">
241
  <input id="limit1" type="radio" name="cnb[limit]" value="include" <?php checked('include', $cnb_options['limit']);?> />
src/admin/partials/domain-upgrade/overview.php CHANGED
@@ -20,10 +20,10 @@ function getProfileEditModal($additional_classes=null, $link_text='Enter or veri
20
  printf(
21
  '<a href="%1$s" title="%2$s" class="thickbox open-profile-details-modal %4$s" onclick="cnb_btn=\'%5$s\'">%3$s</a>',
22
  $full_url,
23
- __(esc_html($modal_header)),
24
- __(esc_html($link_text)),
25
  esc_attr($additional_classes),
26
- __(esc_attr($data_title))
27
  );
28
  }
29
  function cnb_domain_upgrade_overview($domain, $user) {
@@ -61,12 +61,12 @@ function cnb_domain_upgrade_overview($domain, $user) {
61
  });
62
  <?php } ?>
63
  </script>
64
- <p>Your domain is currently on the Premium <code><?php esc_html_e($domain->type) ?></code> plan.</p>
65
 
66
  <form id="wp_domain_upgrade" method="post">
67
- <input type="hidden" name="cnb_domain_id" id="cnb_domain_id" value="<?php esc_attr_e($domain->id) ?>">
68
 
69
- <h2>Select a plan that works best for <strong><?php esc_html_e($domain->name) ?></strong></h2>
70
 
71
  <h2 class="nav-tab-wrapper">
72
  <a href="#" data-cnb-currency="eur" class="cnb-currency-select cnb-currency-eur nav-tab<?php if($active_currency !== 'usd') {?> nav-tab-active<?php }?>">Euro (&euro;)</a>
@@ -93,7 +93,7 @@ function cnb_domain_upgrade_overview($domain, $user) {
93
  Billed at €29.88 annually
94
  </div>
95
  <?php getProfileEditModal('button button-primary', 'Upgrade', 'Enter or verify your information', 'powered-by-eur-yearly'); ?>
96
- <a class="button button-primary button-upgrade powered-by-eur-yearly" href="#" onclick="cnb_get_checkout('<?php _e($plan->id) ?>')">Upgrade</a>
97
  </div>
98
 
99
  <?php $plan = cnb_get_plan($plans, 'powered-by-eur-monthly'); ?>
@@ -105,7 +105,7 @@ function cnb_domain_upgrade_overview($domain, $user) {
105
  Billed monthly
106
  </div>
107
  <?php getProfileEditModal('button button-secondary', 'Upgrade', 'Enter or verify your information', 'powered-by-eur-monthly'); ?>
108
- <a class="button button-secondary button-upgrade powered-by-eur-monthly" href="#" onclick="cnb_get_checkout('<?php _e($plan->id) ?>')">Upgrade</a>
109
  </div>
110
  </div>
111
  <div class="currency-box currency-box-usd cnb-flexbox<?php if($active_currency === 'usd') {?> currency-box-active<?php }?>">
@@ -127,7 +127,7 @@ function cnb_domain_upgrade_overview($domain, $user) {
127
  Billed at $34.88 annually
128
  </div>
129
  <?php getProfileEditModal('button button-primary', 'Upgrade', 'Enter or verify your information', 'powered-by-usd-yearly'); ?>
130
- <a class="button button-primary button-upgrade powered-by-usd-yearly" href="#" onclick="cnb_get_checkout('<?php _e($plan->id) ?>')">Upgrade</a>
131
  </div>
132
  <?php $plan = cnb_get_plan($plans, 'powered-by-usd-monthly'); ?>
133
  <div class="pricebox">
@@ -138,7 +138,7 @@ function cnb_domain_upgrade_overview($domain, $user) {
138
  Billed monthly
139
  </div>
140
  <?php getProfileEditModal('button button-secondary', 'Upgrade', 'Enter or verify your information', 'powered-by-usd-monthly'); ?>
141
- <a class="button button-secondary button-upgrade powered-by-usd-monthly" href="#" onclick="cnb_get_checkout('<?php _e($plan->id) ?>')">Upgrade</a>
142
  </div>
143
  </div>
144
  </div>
20
  printf(
21
  '<a href="%1$s" title="%2$s" class="thickbox open-profile-details-modal %4$s" onclick="cnb_btn=\'%5$s\'">%3$s</a>',
22
  $full_url,
23
+ esc_html__($modal_header),
24
+ esc_html__($link_text),
25
  esc_attr($additional_classes),
26
+ esc_attr__($data_title)
27
  );
28
  }
29
  function cnb_domain_upgrade_overview($domain, $user) {
61
  });
62
  <?php } ?>
63
  </script>
64
+ <p>Your domain is currently on the Premium <code><?php echo esc_html($domain->type) ?></code> plan.</p>
65
 
66
  <form id="wp_domain_upgrade" method="post">
67
+ <input type="hidden" name="cnb_domain_id" id="cnb_domain_id" value="<?php echo esc_attr($domain->id) ?>">
68
 
69
+ <h2>Select a plan that works best for <strong><?php echo esc_html($domain->name) ?></strong></h2>
70
 
71
  <h2 class="nav-tab-wrapper">
72
  <a href="#" data-cnb-currency="eur" class="cnb-currency-select cnb-currency-eur nav-tab<?php if($active_currency !== 'usd') {?> nav-tab-active<?php }?>">Euro (&euro;)</a>
93
  Billed at €29.88 annually
94
  </div>
95
  <?php getProfileEditModal('button button-primary', 'Upgrade', 'Enter or verify your information', 'powered-by-eur-yearly'); ?>
96
+ <a class="button button-primary button-upgrade powered-by-eur-yearly" href="#" onclick="cnb_get_checkout('<?php echo esc_attr($plan->id) ?>')">Upgrade</a>
97
  </div>
98
 
99
  <?php $plan = cnb_get_plan($plans, 'powered-by-eur-monthly'); ?>
105
  Billed monthly
106
  </div>
107
  <?php getProfileEditModal('button button-secondary', 'Upgrade', 'Enter or verify your information', 'powered-by-eur-monthly'); ?>
108
+ <a class="button button-secondary button-upgrade powered-by-eur-monthly" href="#" onclick="cnb_get_checkout('<?php echo esc_attr($plan->id) ?>')">Upgrade</a>
109
  </div>
110
  </div>
111
  <div class="currency-box currency-box-usd cnb-flexbox<?php if($active_currency === 'usd') {?> currency-box-active<?php }?>">
127
  Billed at $34.88 annually
128
  </div>
129
  <?php getProfileEditModal('button button-primary', 'Upgrade', 'Enter or verify your information', 'powered-by-usd-yearly'); ?>
130
+ <a class="button button-primary button-upgrade powered-by-usd-yearly" href="#" onclick="cnb_get_checkout('<?php echo esc_attr($plan->id) ?>')">Upgrade</a>
131
  </div>
132
  <?php $plan = cnb_get_plan($plans, 'powered-by-usd-monthly'); ?>
133
  <div class="pricebox">
138
  Billed monthly
139
  </div>
140
  <?php getProfileEditModal('button button-secondary', 'Upgrade', 'Enter or verify your information', 'powered-by-usd-monthly'); ?>
141
+ <a class="button button-secondary button-upgrade powered-by-usd-monthly" href="#" onclick="cnb_get_checkout('<?php echo esc_attr($plan->id) ?>')">Upgrade</a>
142
  </div>
143
  </div>
144
  </div>
src/admin/partials/domain-upgrade/upgraded.php CHANGED
@@ -30,6 +30,6 @@ function cnb_domain_upgrade_upgraded($domain, $notice=null) {
30
  <?php echo $domain->renew == 1 ? ' renew automatically ' : ' expire '; ?>
31
  on <?php echo date('F d, Y', strtotime(esc_html($domain->expires))); ?>.
32
  <?php } ?>
33
- You can change this on the <a href="<?php esc_html_e(cnb_upgrade_create_settings_url()) ?>">settings page</a>.</p>
34
- <p>You can access and download your invoice via <a href="<?php esc_html_e($portal_url->url); ?>">the invoice dashboard</a>. For any questions, please head over to our <a href="https://callnowbutton.com/support/">help center</a>.</p>
35
  <?php } ?>
30
  <?php echo $domain->renew == 1 ? ' renew automatically ' : ' expire '; ?>
31
  on <?php echo date('F d, Y', strtotime(esc_html($domain->expires))); ?>.
32
  <?php } ?>
33
+ You can change this on the <a href="<?php echo esc_html(cnb_upgrade_create_settings_url()) ?>">settings page</a>.</p>
34
+ <p>You can access and download your invoice via <a href="<?php echo esc_html($portal_url->url); ?>">the invoice dashboard</a>. For any questions, please head over to our <a href="https://callnowbutton.com/support/">help center</a>.</p>
35
  <?php } ?>
src/admin/settings-profile.php CHANGED
@@ -337,14 +337,14 @@ function cnb_admin_page_profile_edit_render_form($modal = false) {
337
  <tr class="cnb_advanced_view">
338
  <th scope="row"><label for="user_id">ID</label></th>
339
  <td>
340
- <code><?php esc_html_e( $cnb_user->id ) ?></code>
341
  </td>
342
  </tr>
343
  <?php } ?>
344
  <tr>
345
  <th scope="row"><label for="user_email">Email</label></th>
346
  <td>
347
- <input type="text" id="user_email" name="user[email]" value="<?php esc_html_e( $cnb_user->email ) ?>"
348
  disabled class="regular-text ltr">
349
  <p class="description">Contact support to change your account email address.</p>
350
  </td>
@@ -353,7 +353,7 @@ function cnb_admin_page_profile_edit_render_form($modal = false) {
353
  <tr>
354
  <th scope="row"><label for="user[name]">Full name<span class="cnb_required">*</span></label></th>
355
  <td>
356
- <input type="text" id="user[name]" name="user[name]" value="<?php esc_html_e( $cnb_user->name ) ?>" required="required"
357
  class="regular-text ltr">
358
  </td>
359
  </tr>
@@ -361,7 +361,7 @@ function cnb_admin_page_profile_edit_render_form($modal = false) {
361
  <tr>
362
  <th scope="row"><label for="user[companyName]">Company name<span class="cnb_required cnb_vat_companies_show" style="display:none">*</span></label></th>
363
  <td>
364
- <input type="text" id="user[companyName]" name="user[companyName]" value="<?php esc_html_e( $cnb_user->companyName ) ?>"
365
  class="regular-text ltr cnb_vat_companies_required">
366
  </td>
367
  </tr>
@@ -400,14 +400,14 @@ function cnb_admin_page_profile_edit_render_form($modal = false) {
400
  <tr class="cnb_vat_companies_show" style="display:none">
401
  <th scope="row"><label for="user[address][line1]">Address<span class="cnb_required">*</span></label></th>
402
  <td>
403
- <input type="text" id="user[address][line1]" name="user[address][line1]" value="<?php esc_html_e( isset($cnb_user->address) ? $cnb_user->address->line1: '' ) ?>"
404
  class="regular-text ltr cnb_vat_companies_required cnb_eu_values_only">
405
  </td>
406
  </tr>
407
  <tr class="cnb_vat_companies_show" style="display:none">
408
  <th scope="row"><label for="user[address][line2]">Building, apartment, etc.</label></th>
409
  <td>
410
- <input type="text" id="user[address][line2]" name="user[address][line2]" value="<?php esc_html_e( isset($cnb_user->address) ? $cnb_user->address->line2 : '') ?>"
411
  class="regular-text ltr cnb_eu_values_only">
412
  </td>
413
  </tr>
@@ -416,7 +416,7 @@ function cnb_admin_page_profile_edit_render_form($modal = false) {
416
  <th scope="row"><label for="user[address][postalCode]"><span class="cnb_ie_only" style="display:none">Eircode/</span>Zip/Postal code<span class="cnb_required">*</span></label></th>
417
  <td>
418
  <input type="text" id="user[address][postalCode]" name="user[address][postalCode]"
419
- value="<?php esc_html_e( isset($cnb_user->address) ? $cnb_user->address->postalCode : '' ) ?>"
420
  class="regular-text ltr cnb_us_required cnb_vat_companies_required cnb_useu_values_only">
421
  </td>
422
  </tr>
@@ -424,7 +424,7 @@ function cnb_admin_page_profile_edit_render_form($modal = false) {
424
  <tr>
425
  <th scope="row"><label for="user[address][city]">City<span class="cnb_required">*</span></label></th>
426
  <td>
427
- <input type="text" id="user[address][city]" name="user[address][city]" value="<?php esc_html_e( isset($cnb_user->address) ? $cnb_user->address->city : '' ) ?>"
428
  required="required" class="regular-text ltr">
429
  </td>
430
  </tr>
@@ -432,7 +432,7 @@ function cnb_admin_page_profile_edit_render_form($modal = false) {
432
  <tr class="cnb_us_show" style="display:none">
433
  <th scope="row"><label for="user[address][state]">State<span class="cnb_required">*</span></label></th>
434
  <td>
435
- <input type="text" id="user[address][state]" name="user[address][state]" value="<?php esc_html_e( isset($cnb_user->address) ? $cnb_user->address->state : '' ) ?>"
436
  class="regular-text ltr cnb_us_required cnb_us_values_only">
437
  </td>
438
  </tr>
@@ -444,7 +444,7 @@ function cnb_admin_page_profile_edit_render_form($modal = false) {
444
  </th>
445
  <td>
446
  <input id="cnb_profile_vat" type="text" name="user[taxIds][0][value]"
447
- value="<?php esc_html_e( isset($cnb_user->taxIds[0]) ? $cnb_user->taxIds[0]->value : '' ) ?>"
448
  class="regular-text ltr cnb_vat_companies_required cnb_eu_values_only">
449
  <input id="cnb_user_taxids_type" type="hidden" name="user[taxIds][0][type]" value="eu_vat"
450
  class="regular-text ltr cnb_vat_companies_required cnb_eu_values_only">
337
  <tr class="cnb_advanced_view">
338
  <th scope="row"><label for="user_id">ID</label></th>
339
  <td>
340
+ <code><?php echo esc_html($cnb_user->id) ?></code>
341
  </td>
342
  </tr>
343
  <?php } ?>
344
  <tr>
345
  <th scope="row"><label for="user_email">Email</label></th>
346
  <td>
347
+ <input type="text" id="user_email" name="user[email]" value="<?php echo esc_html($cnb_user->email ) ?>"
348
  disabled class="regular-text ltr">
349
  <p class="description">Contact support to change your account email address.</p>
350
  </td>
353
  <tr>
354
  <th scope="row"><label for="user[name]">Full name<span class="cnb_required">*</span></label></th>
355
  <td>
356
+ <input type="text" id="user[name]" name="user[name]" value="<?php echo esc_html($cnb_user->name) ?>" required="required"
357
  class="regular-text ltr">
358
  </td>
359
  </tr>
361
  <tr>
362
  <th scope="row"><label for="user[companyName]">Company name<span class="cnb_required cnb_vat_companies_show" style="display:none">*</span></label></th>
363
  <td>
364
+ <input type="text" id="user[companyName]" name="user[companyName]" value="<?php echo esc_html($cnb_user->companyName) ?>"
365
  class="regular-text ltr cnb_vat_companies_required">
366
  </td>
367
  </tr>
400
  <tr class="cnb_vat_companies_show" style="display:none">
401
  <th scope="row"><label for="user[address][line1]">Address<span class="cnb_required">*</span></label></th>
402
  <td>
403
+ <input type="text" id="user[address][line1]" name="user[address][line1]" value="<?php echo esc_html( isset($cnb_user->address) ? $cnb_user->address->line1: '' ) ?>"
404
  class="regular-text ltr cnb_vat_companies_required cnb_eu_values_only">
405
  </td>
406
  </tr>
407
  <tr class="cnb_vat_companies_show" style="display:none">
408
  <th scope="row"><label for="user[address][line2]">Building, apartment, etc.</label></th>
409
  <td>
410
+ <input type="text" id="user[address][line2]" name="user[address][line2]" value="<?php echo esc_html( isset($cnb_user->address) ? $cnb_user->address->line2 : '') ?>"
411
  class="regular-text ltr cnb_eu_values_only">
412
  </td>
413
  </tr>
416
  <th scope="row"><label for="user[address][postalCode]"><span class="cnb_ie_only" style="display:none">Eircode/</span>Zip/Postal code<span class="cnb_required">*</span></label></th>
417
  <td>
418
  <input type="text" id="user[address][postalCode]" name="user[address][postalCode]"
419
+ value="<?php echo esc_html( isset($cnb_user->address) ? $cnb_user->address->postalCode : '' ) ?>"
420
  class="regular-text ltr cnb_us_required cnb_vat_companies_required cnb_useu_values_only">
421
  </td>
422
  </tr>
424
  <tr>
425
  <th scope="row"><label for="user[address][city]">City<span class="cnb_required">*</span></label></th>
426
  <td>
427
+ <input type="text" id="user[address][city]" name="user[address][city]" value="<?php echo esc_html( isset($cnb_user->address) ? $cnb_user->address->city : '' ) ?>"
428
  required="required" class="regular-text ltr">
429
  </td>
430
  </tr>
432
  <tr class="cnb_us_show" style="display:none">
433
  <th scope="row"><label for="user[address][state]">State<span class="cnb_required">*</span></label></th>
434
  <td>
435
+ <input type="text" id="user[address][state]" name="user[address][state]" value="<?php echo esc_html( isset($cnb_user->address) ? $cnb_user->address->state : '' ) ?>"
436
  class="regular-text ltr cnb_us_required cnb_us_values_only">
437
  </td>
438
  </tr>
444
  </th>
445
  <td>
446
  <input id="cnb_profile_vat" type="text" name="user[taxIds][0][value]"
447
+ value="<?php echo esc_html( isset($cnb_user->taxIds[0]) ? $cnb_user->taxIds[0]->value : '' ) ?>"
448
  class="regular-text ltr cnb_vat_companies_required cnb_eu_values_only">
449
  <input id="cnb_user_taxids_type" type="hidden" name="user[taxIds][0][type]" value="eu_vat"
450
  class="regular-text ltr cnb_vat_companies_required cnb_eu_values_only">
src/admin/settings.php CHANGED
@@ -418,15 +418,15 @@ function cnb_admin_settings_page() {
418
  <tr>
419
  <th scope="row">Account owner</th>
420
  <td>
421
- <?php esc_html_e($cnb_user->name) ?>
422
  <?php
423
- if ($cnb_user->email !== $cnb_user->name) { esc_html_e(' (' . $cnb_user->email . ')');
424
  } ?>
425
  </td>
426
  </tr>
427
  <tr>
428
  <th scope="row">Account ID</th>
429
- <td><code><?php esc_html_e($cnb_user->id) ?></code></td>
430
  </tr>
431
  <?php } ?>
432
  </table>
@@ -471,19 +471,19 @@ function cnb_admin_settings_page() {
471
  <th scope="row"><label for="cnb[cloud_use_id]">Domain</label></th>
472
  <td>
473
  <div>
474
- <p>Your domain: <strong><?php esc_html_e($cnb_clean_site_url) ?></strong></p>
475
  <?php if ($cnb_cloud_domain instanceof WP_Error) {
476
  CnbAdminNotices::get_instance()->warning('Almost there! Create your domain using the button at the top of this page.')
477
  ?>
478
  <?php } else { ?>
479
- <p class="description">Your domain <strong><?php esc_html_e($cnb_cloud_domain->name) ?></strong> is connected with ID <code><?php esc_html_e($cnb_cloud_domain->id) ?></code></p>
480
  <?php }?>
481
  <?php if (isset($cnb_options['cloud_use_id'])) { ?>
482
  <label><select name="cnb[cloud_use_id]" id="cnb[cloud_use_id]">
483
 
484
  <optgroup label="Account-wide">
485
  <option
486
- value="<?php esc_attr_e($cnb_user->id) ?>"
487
  <?php selected($cnb_user->id, $cnb_options['cloud_use_id']) ?>
488
  >
489
  Let the button decide
@@ -492,15 +492,15 @@ function cnb_admin_settings_page() {
492
  <optgroup label="Specific domain">
493
  <?php foreach ($cnb_cloud_domains as $domain) { ?>
494
  <option
495
- value="<?php esc_attr_e($domain->id) ?>"
496
  <?php selected($domain->id, $cnb_options['cloud_use_id']) ?>
497
  >
498
- <?php esc_html_e($domain->name) ?>
499
  </option>
500
  <?php } ?>
501
  </optgroup>
502
  </select></label>
503
- <p class="description">The current value is <code><?php esc_html_e($cnb_options['cloud_use_id']) ?></code></p>
504
  <?php } ?>
505
  </div>
506
  </td>
418
  <tr>
419
  <th scope="row">Account owner</th>
420
  <td>
421
+ <?php echo esc_html($cnb_user->name) ?>
422
  <?php
423
+ if ($cnb_user->email !== $cnb_user->name) { echo esc_html(' (' . $cnb_user->email . ')');
424
  } ?>
425
  </td>
426
  </tr>
427
  <tr>
428
  <th scope="row">Account ID</th>
429
+ <td><code><?php echo esc_html($cnb_user->id) ?></code></td>
430
  </tr>
431
  <?php } ?>
432
  </table>
471
  <th scope="row"><label for="cnb[cloud_use_id]">Domain</label></th>
472
  <td>
473
  <div>
474
+ <p>Your domain: <strong><?php echo esc_html($cnb_clean_site_url) ?></strong></p>
475
  <?php if ($cnb_cloud_domain instanceof WP_Error) {
476
  CnbAdminNotices::get_instance()->warning('Almost there! Create your domain using the button at the top of this page.')
477
  ?>
478
  <?php } else { ?>
479
+ <p class="description">Your domain <strong><?php echo esc_html($cnb_cloud_domain->name) ?></strong> is connected with ID <code><?php echo esc_html($cnb_cloud_domain->id) ?></code></p>
480
  <?php }?>
481
  <?php if (isset($cnb_options['cloud_use_id'])) { ?>
482
  <label><select name="cnb[cloud_use_id]" id="cnb[cloud_use_id]">
483
 
484
  <optgroup label="Account-wide">
485
  <option
486
+ value="<?php echo esc_attr($cnb_user->id) ?>"
487
  <?php selected($cnb_user->id, $cnb_options['cloud_use_id']) ?>
488
  >
489
  Let the button decide
492
  <optgroup label="Specific domain">
493
  <?php foreach ($cnb_cloud_domains as $domain) { ?>
494
  <option
495
+ value="<?php echo esc_attr($domain->id) ?>"
496
  <?php selected($domain->id, $cnb_options['cloud_use_id']) ?>
497
  >
498
+ <?php echo esc_html($domain->name) ?>
499
  </option>
500
  <?php } ?>
501
  </optgroup>
502
  </select></label>
503
+ <p class="description">The current value is <code><?php echo esc_html($cnb_options['cloud_use_id']) ?></code></p>
504
  <?php } ?>
505
  </div>
506
  </td>