Plugin Directory

Changeset 3754380


Ignore:
Timestamp:
10/19/2026 09:15:08 AM (3 weeks ago)
Author:
wsxplugindev
Message:

Update plugin to version 3.0

Location:
logo-and-address-widget-with-schema
Files:
29 added
4 edited

Legend:

Unmodified
Added
Removed
  • logo-and-address-widget-with-schema/trunk/js/laawws-media-upload.js

    r1865364 r3754380  
    11jQuery(document).ready(function ($) {
    2  
    3    $(document).on("click", ".laawws_upload_image_button", function (e) {
    4       e.preventDefault();
    5       var $button = $(this);
    6  
    7  
    8       // Create the media frame.
    9       var file_frame = wp.media.frames.file_frame = wp.media({
    10          title: 'Select or upload image',
    11          library: { // remove these to show all
    12             type: 'image' // specific mime
    13          },
    14          button: {
    15             text: 'Select'
    16          },
    17          multiple: false  // Set to true to allow multiple files to be selected
    18       });
    19  
    20       // When an image is selected, run a callback.
    21       file_frame.on('select', function () {
    22          // We set multiple to false so only get one image from the uploader
    23          var attachment = file_frame.state().get('selection').first().toJSON();
    24  
    25          $button.siblings('input').val(attachment.url);
    26          $button.closest('form').find('input.widget-control-save').removeAttr("disabled");
    27  
    28       });
    29  
    30       // Finally, open the modal
    31       file_frame.open();
    32    });
    332
    34    // By default enable show the icons option for image field
    35    $('.laawws_image_radio_wrap').find('input[type=radio][value="left"]').attr('checked', true);
    36    
    37    // By default enable show the icons option for email/phone/fax fields
    38    $('.laawws_epf_radio_wrap').find('input[type=radio][value="icons"]').attr('checked', true);
    39    
    40    // // By default enable show the schema for address field
    41    $('.laawws_address_radio_wrap').find('input[type=radio][value="on"]').attr('checked', true);
     3        $(document).on('click', '.laawws_upload_image_button', function (e) {
     4                e.preventDefault();
     5                var $button = $(this);
    426
     7                // Create the media frame.
     8                var file_frame = wp.media.frames.file_frame = wp.media({
     9                        title: 'Select or upload image',
     10                        library: {
     11                                type: 'image'
     12                        },
     13                        button: {
     14                                text: 'Select'
     15                        },
     16                        multiple: false
     17                });
    4318
    44    // Address Icons change
    45    $('.laawws_address_radio_wrap').find('input[type=radio][value="icon"]').attr('checked', true);
    46    $('.laawws_address_radio_wrap').find('input[type=radio][value="font-awesome"]').attr('checked', true);
    47    $('.laawws_address_radio_wrap').find('input[type=radio][value="custom-image"]').attr('checked', true);
     19                // When an image is selected, run a callback.
     20                file_frame.on('select', function () {
     21                        var attachment = file_frame.state().get('selection').first().toJSON();
    4822
    49    $('.laawws_address_fawesome_wrap').hide();
    50    $('.laawws_address_custom_image_wrap').hide();
    51     // Uncheck the checkbox for weekdays if the checkbox Mon-Fri is selected
    52    $(document).on('click', ".laawws_address_radio_wrap input[type=radio]", function (){
     23                        $button.siblings('input').val(attachment.url);
     24                        $button.closest('.widget-inside, form').find('input.widget-control-save').prop('disabled', false);
     25                });
    5326
    54       if($(this).is(":checked")) {
    55          if($(this).val() == "font-awesome" ) {
    56             $('.laawws_address_fawesome_wrap').show();
    57             $('.laawws_address_custom_image_wrap').hide();
    58          } else if($(this).val() == "custom-image" ) {
    59             $('.laawws_address_fawesome_wrap').hide();
    60             $('.laawws_address_custom_image_wrap').show();         
    61          } else {
    62             $('.laawws_address_fawesome_wrap').hide();
    63             $('.laawws_address_custom_image_wrap').hide();
    64          }
    65       }
     27                file_frame.open();
     28        });
    6629
    67    });
    68    
     30        // Apply defaults only when nothing is selected yet (preserve saved settings).
     31        $('.laawws_image_radio_wrap').each(function () {
     32                if (!$(this).find('input[type=radio]:checked').length) {
     33                        $(this).find('input[type=radio][value="left"]').prop('checked', true);
     34                }
     35        });
    6936
    70    // Uncheck the checkbox for weekdays if the checkbox Mon-Fri is selected
    71    $(document).on('click', ".laawws-date-left.mon-fri input[type=checkbox]", function (){
     37        $('.laawws_epf_radio_wrap').each(function () {
     38                if (!$(this).find('input[type=radio]:checked').length) {
     39                        $(this).find('input[type=radio][value="icons"]').prop('checked', true);
     40                }
     41        });
    7242
    73       if($(this).is(":checked")) {
     43        $('.laawws_address_schema_radio_wrap').each(function () {
     44                if (!$(this).find('input[type=radio]:checked').length) {
     45                        $(this).find('input[type=radio][value="on"]').prop('checked', true);
     46                }
     47        });
    7448
    75          // alert("test");
     49        $('.laawws_address_radio_wrap').each(function () {
     50                var $wrap = $(this);
     51                if (!$wrap.find('input[name*="laawws_address_radio_buttons"]:checked').length) {
     52                        $wrap.find('input[type=radio][value="icon"]').prop('checked', true);
     53                }
     54        });
    7655
    77          $('.laawws-date-left.mon').find('input[type=checkbox]').attr('checked', false);
    78          $('.laawws-date-left.tue').find('input[type=checkbox]').attr('checked', false);
    79          $('.laawws-date-left.wed').find('input[type=checkbox]').attr('checked', false);
    80          $('.laawws-date-left.thu').find('input[type=checkbox]').attr('checked', false);
    81          $('.laawws-date-left.fri').find('input[type=checkbox]').attr('checked', false);
    82          $('.laawws-date-left.mon-fri input[type=checkbox]').attr('checked', true);
     56        // Address Icons change
     57        $(document).on('click', '.laawws_address_radio_wrap input[type=radio]', function () {
     58                var $wrap = $(this).closest('.laawws_address_radio_wrap');
    8359
    84       } else{
     60                if ($(this).is(':checked')) {
     61                        if ($(this).val() === 'font-awesome') {
     62                                $wrap.find('.laawws_address_fawesome_wrap').show();
     63                                $wrap.find('.laawws_address_custom_image_wrap').hide();
     64                        } else if ($(this).val() === 'custom-image') {
     65                                $wrap.find('.laawws_address_fawesome_wrap').hide();
     66                                $wrap.find('.laawws_address_custom_image_wrap').show();
     67                        } else {
     68                                $wrap.find('.laawws_address_fawesome_wrap').hide();
     69                                $wrap.find('.laawws_address_custom_image_wrap').hide();
     70                        }
     71                }
     72        });
    8573
    86          $('.laawws-date-left.mon').find('input[type=checkbox]').attr('checked', true);
    87          $('.laawws-date-left.tue').find('input[type=checkbox]').attr('checked', true);
    88          $('.laawws-date-left.wed').find('input[type=checkbox]').attr('checked', true);
    89          $('.laawws-date-left.thu').find('input[type=checkbox]').attr('checked', true);
    90          $('.laawws-date-left.fri').find('input[type=checkbox]').attr('checked', true);
    91          $('.laawws-date-left.mon-fri input[type=checkbox]').attr('checked', false);
    92       }
     74        // Uncheck weekday checkboxes if Mon-Fri is selected
     75        $(document).on('click', '.laawws-date-left.mon-fri input[type=checkbox]', function () {
     76                var $container = $(this).closest('.laawws-open-hrs-time-wrap');
    9377
    94    });
     78                if ($(this).is(':checked')) {
     79                        $container.find('.laawws-date-left.mon input[type=checkbox]').prop('checked', false);
     80                        $container.find('.laawws-date-left.tue input[type=checkbox]').prop('checked', false);
     81                        $container.find('.laawws-date-left.wed input[type=checkbox]').prop('checked', false);
     82                        $container.find('.laawws-date-left.thu input[type=checkbox]').prop('checked', false);
     83                        $container.find('.laawws-date-left.fri input[type=checkbox]').prop('checked', false);
     84                        $container.find('.laawws-date-left.mon-fri input[type=checkbox]').prop('checked', true);
     85                }
     86        });
    9587
    96    // Uncheck the checkbox Mon-Fri if any weekday is selected
    97    $(document).on('click', ".laawws-date-left.mon input[type=checkbox], .laawws-date-left.tue input[type=checkbox], .laawws-date-left.wed input[type=checkbox], .laawws-date-left.thu input[type=checkbox], .laawws-date-left.fri input[type=checkbox]", function (){
     88        // Uncheck Mon-Fri if any weekday is selected
     89        $(document).on('click', '.laawws-date-left.mon input[type=checkbox], .laawws-date-left.tue input[type=checkbox], .laawws-date-left.wed input[type=checkbox], .laawws-date-left.thu input[type=checkbox], .laawws-date-left.fri input[type=checkbox]', function () {
     90                var $container = $(this).closest('.laawws-open-hrs-time-wrap');
    9891
    99       if($(this).is(":checked")) {
    100          $('.laawws-date-left.mon-fri').find('input[type=checkbox]').attr('checked', false);
    101       }
     92                if ($(this).is(':checked')) {
     93                        $container.find('.laawws-date-left.mon-fri input[type=checkbox]').prop('checked', false);
     94                }
     95        });
    10296
    103    });
    104 
    105    // Show open hours or not.
    106    $(document).on('click', ".laawws-open-hrs-checkbox", function (){
    107 
    108       var laawws_address_check = $(this).is(":checked");
    109       if(laawws_address_check){
    110          $(".laawws-open-hrs-time-wrap").show();
    111       } else {
    112          $(".laawws-open-hrs-time-wrap").hide();
    113       } 
    114    });
     97        // Show open hours or not.
     98        $(document).on('click', '.laawws-open-hrs-checkbox', function () {
     99                var $wrap = $(this).closest('.widget-content, .widget-inside, form').find('.laawws-open-hrs-time-wrap');
     100                if ($(this).is(':checked')) {
     101                        $wrap.show();
     102                } else {
     103                        $wrap.hide();
     104                }
     105        });
    115106
    116107});
  • logo-and-address-widget-with-schema/trunk/logo-and-address-widget-with-schema.php

    r2863206 r3754380  
    11<?php
    2 /*
    3  *
     2/**
    43 * Plugin Name: Logo and Address Widget with Schema
    54 * Plugin URI:  https://www.webstix.com
    … …  
    76 * Author: Webstix
    87 * Author URI: https://www.webstix.com
    9  * Version: 2.9
    10  * License: GPL2
     8 * Version: 3.0
     9 * Requires at least: 4.7.5
     10 * Requires PHP: 7.0
     11 * License: GPL-2.0+
    1112 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
    1213 * Text Domain: logo-and-address-widget-with-schema
    13  * Tags: footer, logo-and-address, logo-and-address-widget, logo-and-address-widget-schema, logo-address
    14  *
    1514 */
    1615
    … …  
    2019}
    2120
    22 class Footer_Logo_and_Address  {
    23         /**
     21define( 'LAAWWS_VERSION', '3.0' );
     22define( 'LAAWWS_PLUGIN_FILE', __FILE__ );
     23define( 'LAAWWS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
     24define( 'LAAWWS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
     25
     26/**
     27 * Bootstrap the plugin.
     28 */
     29class Footer_Logo_and_Address {
     30
     31        /**
     32         * Plugin version.
     33         *
    2434         * @var string
    2535         */
    26         public $version = '1.0';
     36        public $version = LAAWWS_VERSION;
     37
     38        /**
     39         * Text domain.
     40         *
     41         * @var string
     42         */
    2743        public static $text_domain = 'logo-and-address-widget-with-schema';
    28         /**
    29          * @var Footer_Logo_and_Address The single instance of the class
     44
     45        /**
     46         * Single instance of the class.
     47         *
     48         * @var Footer_Logo_and_Address|null
    3049         */
    3150        protected static $_instance = null;
    3251
     52        /**
     53         * Constructor.
     54         */
    3355        protected function __construct() {
    3456                $this->laawws_init();
    35                 $laawws_hooks='';
    36                 $laawws_styles='';
    37                 $this->laawws_assets($laawws_hooks);
    38                 $this->laawws_styles($laawws_styles);
    39         }
     57        }
     58
     59        /**
     60         * Get singleton instance.
     61         *
     62         * @return Footer_Logo_and_Address
     63         */
    4064        public static function instance() {
    4165                if ( is_null( self::$_instance ) ) {
    … …  
    4569        }
    4670
     71        /**
     72         * Register hooks.
     73         */
    4774        public function laawws_init() {
    48                 add_action( 'widgets_init', function(){ register_widget( 'Logo_and_Address_Widget_with_Schema' );});
     75                add_action(
     76                        'widgets_init',
     77                        static function () {
     78                                register_widget( 'Logo_and_Address_Widget_with_Schema' );
     79                        }
     80                );
    4981                add_action( 'admin_enqueue_scripts', array( $this, 'laawws_assets' ) );
    50                 add_action( 'init', array( $this, 'laawws_styles' ) );
    51         }
    52 
    53         public function laawws_assets($laawws_hooks) {
    54                 if( $laawws_hooks != 'widgets.php' )
    55         return;
    56             wp_enqueue_media();
    57                 wp_register_script( 'laawws-media-upload', plugin_dir_url(__FILE__) . '/js/laawws-media-upload.js');
     82                add_action( 'wp_enqueue_scripts', array( $this, 'laawws_styles' ) );
     83                add_action( 'admin_enqueue_scripts', array( $this, 'laawws_styles' ) );
     84        }
     85
     86        /**
     87         * Enqueue admin scripts for the widgets screen (classic and block widget editor).
     88         *
     89         * @param string $hook Current admin page hook.
     90         */
     91        public function laawws_assets( $hook ) {
     92                $load_script = ( 'widgets.php' === $hook ) || ( 'customize.php' === $hook );
     93
     94                // Block-based widgets editor uses Appearance > Widgets (widgets.php) as well.
     95                if ( ! $load_script ) {
     96                        return;
     97                }
     98
     99                wp_enqueue_media();
     100
     101                wp_register_script(
     102                        'laawws-media-upload',
     103                        LAAWWS_PLUGIN_URL . 'js/laawws-media-upload.js',
     104                        array( 'jquery' ),
     105                        LAAWWS_VERSION,
     106                        true
     107                );
    58108                wp_enqueue_script( 'laawws-media-upload' );
    59 
    60         }
    61 
    62         public function laawws_styles($laawws_styles) {
    63                 wp_register_style('laawws-custom-styles', plugin_dir_url(__FILE__) . '/css/laawws-custom.css');
    64                 wp_register_style('laawws-fontawesome-styles', 'https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css');
    65 
    66                 wp_enqueue_style('laawws-custom-styles');
    67                 wp_enqueue_style('laawws-fontawesome-styles');
     109        }
     110
     111        /**
     112         * Register and enqueue front-end / admin styles.
     113         */
     114        public function laawws_styles() {
     115                wp_register_style(
     116                        'laawws-fontawesome-styles',
     117                        LAAWWS_PLUGIN_URL . 'css/font-awesome.min.css',
     118                        array(),
     119                        '4.7.0'
     120                );
     121                wp_register_style(
     122                        'laawws-custom-styles',
     123                        LAAWWS_PLUGIN_URL . 'css/laawws-custom.css',
     124                        array( 'laawws-fontawesome-styles' ),
     125                        LAAWWS_VERSION
     126                );
     127
     128                wp_enqueue_style( 'laawws-fontawesome-styles' );
     129                wp_enqueue_style( 'laawws-custom-styles' );
    68130        }
    69131}
    70132
    71 
    72 
     133/**
     134 * Logo and Address Widget with Schema.
     135 */
    73136class Logo_and_Address_Widget_with_Schema extends WP_Widget {
    74137
    75138        /**
     139         * Allowed business-hour time values.
     140         *
     141         * @var string[]
     142         */
     143        protected $allowed_times = array(
     144                ' ',
     145                '8:00 am',
     146                '8:30 am',
     147                '9:00 am',
     148                '9:30 am',
     149                '10:00 am',
     150                '10:30 am',
     151                '11:00 am',
     152                '11:30 am',
     153                '12:00 pm',
     154                '12:30 pm',
     155                '1:00 pm',
     156                '1:30 pm',
     157                '2:00 pm',
     158                '2:30 pm',
     159                '3:00 pm',
     160                '3:30 pm',
     161                '4:00 pm',
     162                '4:30 pm',
     163                '5:00 pm',
     164                '5:30 pm',
     165                '6:00 pm',
     166                '6:30 pm',
     167                '7:00 pm',
     168                '7:30 pm',
     169                '8:00 pm',
     170        );
     171
     172        /**
    76173         * Register widget with WordPress.
    77174         */
    78         function __construct() {
     175        public function __construct() {
    79176                parent::__construct(
    80                         'logo-and-address-widget-with-schema', // Base ID
    81                         'Logo and Address Widget with Schema', // Name
     177                        'logo-and-address-widget-with-schema',
     178                        __( 'Logo and Address Widget with Schema', 'logo-and-address-widget-with-schema' ),
    82179                        array(
    83                 'description' => __( 'Add a logo and address to the sidebar or footer', 'logo-and-address-widget-with-schema' )
    84             ) // Args
     180                                'description'           => __( 'Add a logo and address to the sidebar or footer', 'logo-and-address-widget-with-schema' ),
     181                                'classname'             => 'widget_logo_and_address_widget_with_schema',
     182                                'show_instance_in_rest' => true,
     183                        )
    85184                );
    86 
    87                  add_action('wp_ajax_list_items', array($this, 'laawws_time_picker'));
    88         }
    89 
    90         public function laawws_time_picker($laawws_hours) { ?>
    91 
    92         <option <?php selected( $laawws_hours, " "); ?> value=" " > </option>
    93         <option <?php selected( $laawws_hours, "8:00 am"); ?> value="8:00 am" >8:00 am</option>
    94                 <option <?php selected( $laawws_hours, "8:30 am"); ?> value="8:30 am" >8:30 am</option>
    95                 <option <?php selected( $laawws_hours, "9:00 am"); ?> value="9:00 am" >9:00 am</option>
    96                 <option <?php selected( $laawws_hours, "9:30 am"); ?> value="9:30 am" >9:30 am</option>
    97                 <option <?php selected( $laawws_hours, "10:00 am"); ?> value="10:00 am" >10:00 am</option>
    98                 <option <?php selected( $laawws_hours, "10:30 am"); ?> value="10:30 am" >10:30 am</option>
    99                 <option <?php selected( $laawws_hours, "11:00 am"); ?> value="11:00 am" >11:00 am</option>
    100                 <option <?php selected( $laawws_hours, "11:30 am"); ?> value="11:30 am" >11:30 am</option>
    101                 <option <?php selected( $laawws_hours, "12:00 pm"); ?> value="12:00 pm" >12:00 pm</option>
    102                 <option <?php selected( $laawws_hours, "12:30 pm"); ?> value="12:30 pm" >12:30 pm</option>
    103                 <option <?php selected( $laawws_hours, "1:00 pm"); ?> value="1:00 pm" >1:00 pm</option>
    104                 <option <?php selected( $laawws_hours, "1:30 pm"); ?> value="1:30 pm" >1:30 pm</option>
    105                 <option <?php selected( $laawws_hours, "2:00 pm"); ?> value="2:00 pm" >2:00 pm</option>
    106                 <option <?php selected( $laawws_hours, "2:30 pm"); ?> value="2:30 pm" >2:30 pm</option>
    107                 <option <?php selected( $laawws_hours, "3:00 pm"); ?> value="3:00 pm" >3:00 pm</option>
    108                 <option <?php selected( $laawws_hours, "3:30 pm"); ?> value="3:30 pm" >3:30 pm</option>
    109                 <option <?php selected( $laawws_hours, "4:00 pm"); ?> value="4:00 pm" >4:00 pm</option>
    110                 <option <?php selected( $laawws_hours, "4:30 pm"); ?> value="4:30 pm" >4:30 pm</option>
    111                 <option <?php selected( $laawws_hours, "5:00 pm"); ?> value="5:00 pm" >5:00 pm</option>
    112                 <option <?php selected( $laawws_hours, "5:30 pm"); ?> value="5:30 pm" >5:30 pm</option>
    113                 <option <?php selected( $laawws_hours, "6:00 pm"); ?> value="6:00 pm" >6:00 pm</option>
    114                 <option <?php selected( $laawws_hours, "6:30 pm"); ?> value="6:30 pm" >6:30 pm</option>
    115                 <option <?php selected( $laawws_hours, "7:00 pm"); ?> value="7:00 pm" >7:00 pm</option>
    116                 <option <?php selected( $laawws_hours, "7:30 pm"); ?> value="7:30 pm" >7:30 pm</option>
    117                 <option <?php selected( $laawws_hours, "8:00 pm"); ?> value="8:00 pm" >8:00 pm</option>
    118 
    119    <?php }
    120 
    121         /**
    122          * Back-end widget form creation
    123          *
    124          * @see WP_Widget::form()
     185        }
     186
     187        /**
     188         * Output time picker option tags.
     189         *
     190         * @param string $laawws_hours Selected time value.
     191         */
     192        public function laawws_time_picker( $laawws_hours ) {
     193                foreach ( $this->allowed_times as $time ) {
     194                        $label = ( ' ' === $time ) ? '' : $time;
     195                        printf(
     196                                '<option value="%1$s" %2$s>%3$s</option>',
     197                                esc_attr( $time ),
     198                                selected( $laawws_hours, $time, false ),
     199                                esc_html( $label )
     200                        );
     201                }
     202        }
     203
     204        /**
     205         * Get a sanitized string from a widget instance.
     206         *
     207         * @param array  $instance Widget instance.
     208         * @param string $key      Instance key.
     209         * @return string
     210         */
     211        protected function get_instance_text( $instance, $key ) {
     212                if ( empty( $instance[ $key ] ) ) {
     213                        return '';
     214                }
     215                return sanitize_text_field( $instance[ $key ] );
     216        }
     217
     218        /**
     219         * Sanitize a time select value against the allow-list.
     220         *
     221         * @param string $value Raw value.
     222         * @return string
     223         */
     224        protected function sanitize_time( $value ) {
     225                $value = sanitize_text_field( $value );
     226                return in_array( $value, $this->allowed_times, true ) ? $value : ' ';
     227        }
     228
     229        /**
     230         * Sanitize a value against an allow-list.
     231         *
     232         * @param string   $value   Raw value.
     233         * @param string[] $allowed Allowed values.
     234         * @param string   $default Default when not allowed.
     235         * @return string
     236         */
     237        protected function sanitize_choice( $value, $allowed, $default = '' ) {
     238                $value = sanitize_text_field( $value );
     239                return in_array( $value, $allowed, true ) ? $value : $default;
     240        }
     241
     242        /**
     243         * Back-end widget form.
    125244         *
    126245         * @param array $instance Previously saved values from database.
    127246         */
    128247        public function form( $instance ) {
    129                 // outputs the options form on admin
    130                         $laawws_widget_title = $laawws_footer_logo=$laawws_footer_logo_alt_text=$laawws_image_radio_buttons='';$laawws_address_line1='';$laawws_address_line2='';
    131                         $laawws_city=$laawws_state=$laawws_zip=$laawws_address_radio_buttons=$laawws_address_fawesome_icon='';$laawws_address_custom_image ='';$laawws_phone ='';
    132                         $laawws_fax =$laawws_email =$laawws_epf_radio_buttons =$laawws_open_hours =$laawws_open_hours_title ='';$laawws_open_hours_mon_fri ='';$laawws_close_hours_mon_fri ='';
    133                         $laawws_open_hours_mon_fri_checked =$laawws_open_hours_mon =$laawws_close_hours_mon =$laawws_open_hours_mon_checked =$laawws_open_hours_tue ='';
    134                         $laawws_close_hours_tue =$laawws_open_hours_tue_checked =$laawws_open_hours_wed =$laawws_close_hours_wed =$laawws_open_hours_wed_checked ='';
    135                         $laawws_open_hours_thu =$laawws_close_hours_thu =$laawws_open_hours_thu_checked =$laawws_open_hours_fri =$laawws_close_hours_fri =$laawws_open_hours_fri_checked ='';
    136                         $laawws_open_hours_sun2 =$laawws_close_hours_sun2 =$laawws_open_hours_sun_checked2 =$laawws_open_hours_sun =$laawws_close_hours_sun =$laawws_open_hours_sun_checked =$laawws_address_schema_buttons ='';
    137                 // Check values
    138                 if( $instance) {
    139 
    140                         // Logo Section
    141                         $laawws_widget_title = ! empty( sanitize_text_field($instance['laawws_widget_title'] )) ? sanitize_text_field($instance['laawws_widget_title']) : '';
    142 
    143                         $laawws_footer_logo = ! empty( sanitize_text_field($instance['laawws_footer_logo'] )) ? sanitize_text_field($instance['laawws_footer_logo']) : '';
    144 
    145                         $laawws_footer_logo_alt_text = ! empty( sanitize_text_field($instance['laawws_footer_logo_alt_text'] )) ? sanitize_text_field($instance['laawws_footer_logo_alt_text']) : '';
    146 
    147                         $laawws_image_radio_buttons = ! empty( sanitize_text_field($instance['laawws_image_radio_buttons'] )) ? sanitize_text_field($instance['laawws_image_radio_buttons']) : '';
    148 
    149 
    150                         // Address Section
    151                         $laawws_address_line1 = ! empty( sanitize_text_field($instance['laawws_address_line1'] )) ? sanitize_text_field($instance['laawws_address_line1']) : '';
    152 
    153                         $laawws_address_line2 = ! empty( sanitize_text_field($instance['laawws_address_line2'] )) ? sanitize_text_field($instance['laawws_address_line2']) : '';
    154 
    155                         $laawws_city = ! empty( sanitize_text_field($instance['laawws_city'] )) ? sanitize_text_field($instance['laawws_city']) : '';
    156 
    157                         $laawws_state = ! empty( sanitize_text_field($instance['laawws_state'] )) ? sanitize_text_field($instance['laawws_state']) : '';
    158 
    159                         $laawws_zip = ! empty( sanitize_text_field($instance['laawws_zip'] )) ? sanitize_text_field($instance['laawws_zip']) : '';
    160 
    161                         $laawws_address_radio_buttons = ! empty( sanitize_text_field($instance['laawws_address_radio_buttons'] )) ? sanitize_text_field($instance['laawws_address_radio_buttons']) : '';
    162 
    163                         $laawws_address_fawesome_icon = ! empty( sanitize_text_field($instance['laawws_address_fawesome_icon'] )) ? sanitize_text_field($instance['laawws_address_fawesome_icon']) : '';
    164                         $laawws_address_custom_image = ! empty( sanitize_text_field($instance['laawws_address_custom_image'] )) ? sanitize_text_field($instance['laawws_address_custom_image']) : '';
    165 
    166 
    167                         // Phone/Fax/Email Section
    168                         $laawws_phone = ! empty( sanitize_text_field($instance['laawws_phone'] )) ? sanitize_text_field($instance['laawws_phone']) : '';
    169 
    170                         $laawws_fax = ! empty( sanitize_text_field($instance['laawws_email'] )) ? sanitize_text_field($instance['laawws_fax']) : '';
    171 
    172                         $laawws_email = ! empty( sanitize_text_field($instance['laawws_email'] )) ? sanitize_text_field($instance['laawws_email']) : '';
    173 
    174                         // Enable/Disable Label/Fontawesome icons for Email, Phone and Fax. epf means email, phone and fax
    175                         $laawws_epf_radio_buttons = ! empty( sanitize_text_field($instance['laawws_epf_radio_buttons'] )) ? sanitize_text_field($instance['laawws_epf_radio_buttons']) : '';
    176 
    177 
    178                         // Open Hours Section
    179                         $laawws_open_hours = ! empty( sanitize_text_field($instance['laawws_open_hours'] )) ? sanitize_text_field($instance['laawws_open_hours']) : '';
    180 
    181                         // Hours Title
    182                         $laawws_open_hours_title = ! empty( sanitize_text_field($instance['laawws_open_hours_title'] )) ? sanitize_text_field($instance['laawws_open_hours_title']) : '';
    183 
    184 
    185                         // Monday - Friday
    186                         $laawws_open_hours_mon_fri = ! empty( sanitize_text_field($instance['laawws_open_hours_mon_fri'] )) ? sanitize_text_field($instance['laawws_open_hours_mon_fri']) : '';
    187 
    188                         $laawws_close_hours_mon_fri = ! empty( sanitize_text_field($instance['laawws_close_hours_mon_fri'] )) ? sanitize_text_field($instance['laawws_close_hours_mon_fri']) : '';
    189 
    190                         $laawws_open_hours_mon_fri_checked = ! empty( sanitize_text_field($instance['laawws_open_hours_mon_fri_checked'] )) ? sanitize_text_field($instance['laawws_open_hours_mon_fri_checked']) : '';
    191 
    192 
    193                         // Monday
    194                         $laawws_open_hours_mon = ! empty( sanitize_text_field($instance['laawws_open_hours_mon'] )) ? sanitize_text_field($instance['laawws_open_hours_mon']) : '';
    195 
    196                         $laawws_close_hours_mon = ! empty( sanitize_text_field($instance['laawws_close_hours_mon'] )) ? sanitize_text_field($instance['laawws_close_hours_mon']) : '';
    197 
    198                         $laawws_open_hours_mon_checked = ! empty( sanitize_text_field($instance['laawws_open_hours_mon_checked'] )) ? sanitize_text_field($instance['laawws_open_hours_mon_checked']) : '';
    199 
    200 
    201                         // Tuesday
    202                         $laawws_open_hours_tue = ! empty( sanitize_text_field($instance['laawws_open_hours_tue'] )) ? sanitize_text_field($instance['laawws_open_hours_tue']) : '';
    203 
    204                         $laawws_close_hours_tue = ! empty( sanitize_text_field($instance['laawws_close_hours_tue'] )) ? sanitize_text_field($instance['laawws_close_hours_tue']) : '';
    205 
    206                         $laawws_open_hours_tue_checked = ! empty( sanitize_text_field($instance['laawws_open_hours_tue_checked'] )) ? sanitize_text_field($instance['laawws_open_hours_tue_checked']) : '';
    207 
    208 
    209                         // Wednesday
    210                         $laawws_open_hours_wed = ! empty( sanitize_text_field($instance['laawws_open_hours_wed'] )) ? sanitize_text_field($instance['laawws_open_hours_wed']) : '';
    211 
    212                         $laawws_close_hours_wed = ! empty( sanitize_text_field($instance['laawws_close_hours_wed'] )) ? sanitize_text_field($instance['laawws_close_hours_wed']) : '';
    213 
    214                         $laawws_open_hours_wed_checked = ! empty( sanitize_text_field($instance['laawws_open_hours_wed_checked'] )) ? sanitize_text_field($instance['laawws_open_hours_wed_checked']) : '';
    215 
    216 
    217                         // Thursday
    218                         $laawws_open_hours_thu = ! empty( sanitize_text_field($instance['laawws_open_hours_thu'] )) ? sanitize_text_field($instance['laawws_open_hours_thu']) : '';
    219 
    220                         $laawws_close_hours_thu = ! empty( sanitize_text_field($instance['laawws_close_hours_thu'] )) ? sanitize_text_field($instance['laawws_close_hours_thu']) : '';
    221 
    222                         $laawws_open_hours_thu_checked = ! empty( sanitize_text_field($instance['laawws_open_hours_thu_checked'] )) ? sanitize_text_field($instance['laawws_open_hours_thu_checked']) : '';
    223 
    224 
    225                         // Friday
    226                         $laawws_open_hours_fri = ! empty( sanitize_text_field($instance['laawws_open_hours_fri'] )) ? sanitize_text_field($instance['laawws_open_hours_fri']) : '';
    227 
    228                         $laawws_close_hours_fri = ! empty( sanitize_text_field($instance['laawws_close_hours_fri'] )) ? sanitize_text_field($instance['laawws_close_hours_fri']) : '';
    229 
    230                         $laawws_open_hours_fri_checked = ! empty( sanitize_text_field($instance['laawws_open_hours_fri_checked'] )) ? sanitize_text_field($instance['laawws_open_hours_fri_checked']) : '';
    231 
    232 
    233                         // Saturday
    234                         $laawws_open_hours_sun2 = ! empty( sanitize_text_field($instance['laawws_open_hours_sun2'] )) ? sanitize_text_field($instance['laawws_open_hours_sun2']) : '';
    235 
    236                         $laawws_close_hours_sun2 = ! empty( sanitize_text_field($instance['laawws_close_hours_sun2'] )) ? sanitize_text_field($instance['laawws_close_hours_sun2']) : '';
    237 
    238                         $laawws_open_hours_sun_checked2 = ! empty( sanitize_text_field($instance['laawws_open_hours_sun_checked2'] )) ? sanitize_text_field($instance['laawws_open_hours_sun_checked2']) : '';
    239 
    240 
    241                         // Sunday
    242                         $laawws_open_hours_sun = ! empty( sanitize_text_field($instance['laawws_open_hours_sun'] )) ? sanitize_text_field($instance['laawws_open_hours_sun']) : '';
    243 
    244                         $laawws_close_hours_sun = ! empty( sanitize_text_field($instance['laawws_close_hours_sun'] )) ? sanitize_text_field($instance['laawws_close_hours_sun']) : '';
    245 
    246                         $laawws_open_hours_sun_checked = ! empty( sanitize_text_field($instance['laawws_open_hours_sun_checked'] )) ? sanitize_text_field($instance['laawws_open_hours_sun_checked']) : '';
    247 
    248                         // Address Schema
    249                         $laawws_address_schema_buttons = ! empty( sanitize_text_field($instance['laawws_address_schema_buttons'] )) ? sanitize_text_field($instance['laawws_address_schema_buttons']) : '';
    250 
    251                 } ?>
    252 
    253                 <h3 class="laawws-admin-logo"><i class="fa fa-image"></i> <span>Logo Section</span></h3>
    254                 <p>
    255                         <label for="<?php echo $this->get_field_id('laawws_widget_title'); ?>"><?php _e('Widget Title:', 'laawws_wp_widget_plugin'); ?></label>
    256                         <input class="widefat" id="<?php echo $this->get_field_id('laawws_widget_title'); ?>" name="<?php echo $this->get_field_name('laawws_widget_title'); ?>" type="text" value="<?php echo $laawws_widget_title; ?>" />
    257                 </p>
    258 
    259                 <p>
    260                    <label for="<?php echo $this->get_field_id( 'laawws_footer_logo' ); ?>"><?php _e( 'Select/Upload a Logo:' ); ?></label>
    261                    <input class="widefat" id="<?php echo $this->get_field_id( 'laawws_footer_logo' ); ?>" name="<?php echo $this->get_field_name( 'laawws_footer_logo' ); ?>" type="text" value="<?php echo esc_url( $laawws_footer_logo ); ?>" /><small class="laawws-small">(We suggest 250 pixels wide x 250 pixels high)</small><br><br>
    262 
    263                    <button class="laawws_upload_image_button button button-primary">Upload Image</button>
    264                 </p>
    265 
    266                 <p>
    267                         <label for="<?php echo $this->get_field_id('laawws_footer_logo_alt_text'); ?>"><?php _e('Logo Alternate Text:', 'laawws_wp_widget_plugin'); ?></label>
    268                         <input class="widefat" id="<?php echo $this->get_field_id('laawws_footer_logo_alt_text'); ?>" name="<?php echo $this->get_field_name('laawws_footer_logo_alt_text'); ?>" type="text" value="<?php echo $laawws_footer_logo_alt_text; ?>" />
     248                $laawws_widget_title              = $this->get_instance_text( $instance, 'laawws_widget_title' );
     249                $laawws_footer_logo               = ! empty( $instance['laawws_footer_logo'] ) ? esc_url( $instance['laawws_footer_logo'] ) : '';
     250                $laawws_footer_logo_alt_text      = $this->get_instance_text( $instance, 'laawws_footer_logo_alt_text' );
     251                $laawws_image_radio_buttons       = $this->get_instance_text( $instance, 'laawws_image_radio_buttons' );
     252                $laawws_address_line1             = $this->get_instance_text( $instance, 'laawws_address_line1' );
     253                $laawws_address_line2             = $this->get_instance_text( $instance, 'laawws_address_line2' );
     254                $laawws_city                      = $this->get_instance_text( $instance, 'laawws_city' );
     255                $laawws_state                     = $this->get_instance_text( $instance, 'laawws_state' );
     256                $laawws_zip                       = $this->get_instance_text( $instance, 'laawws_zip' );
     257                $laawws_address_radio_buttons     = $this->get_instance_text( $instance, 'laawws_address_radio_buttons' );
     258                $laawws_address_fawesome_icon     = $this->get_instance_text( $instance, 'laawws_address_fawesome_icon' );
     259                $laawws_address_custom_image      = ! empty( $instance['laawws_address_custom_image'] ) ? esc_url( $instance['laawws_address_custom_image'] ) : '';
     260                $laawws_phone                     = $this->get_instance_text( $instance, 'laawws_phone' );
     261                $laawws_fax                       = $this->get_instance_text( $instance, 'laawws_fax' );
     262                $laawws_email                     = $this->get_instance_text( $instance, 'laawws_email' );
     263                $laawws_epf_radio_buttons         = $this->get_instance_text( $instance, 'laawws_epf_radio_buttons' );
     264                $laawws_open_hours                = $this->get_instance_text( $instance, 'laawws_open_hours' );
     265                $laawws_open_hours_title          = $this->get_instance_text( $instance, 'laawws_open_hours_title' );
     266                $laawws_open_hours_mon_fri        = $this->get_instance_text( $instance, 'laawws_open_hours_mon_fri' );
     267                $laawws_close_hours_mon_fri       = $this->get_instance_text( $instance, 'laawws_close_hours_mon_fri' );
     268                $laawws_open_hours_mon_fri_checked = $this->get_instance_text( $instance, 'laawws_open_hours_mon_fri_checked' );
     269                $laawws_open_hours_mon            = $this->get_instance_text( $instance, 'laawws_open_hours_mon' );
     270                $laawws_close_hours_mon           = $this->get_instance_text( $instance, 'laawws_close_hours_mon' );
     271                $laawws_open_hours_mon_checked    = $this->get_instance_text( $instance, 'laawws_open_hours_mon_checked' );
     272                $laawws_open_hours_tue            = $this->get_instance_text( $instance, 'laawws_open_hours_tue' );
     273                $laawws_close_hours_tue           = $this->get_instance_text( $instance, 'laawws_close_hours_tue' );
     274                $laawws_open_hours_tue_checked    = $this->get_instance_text( $instance, 'laawws_open_hours_tue_checked' );
     275                $laawws_open_hours_wed            = $this->get_instance_text( $instance, 'laawws_open_hours_wed' );
     276                $laawws_close_hours_wed           = $this->get_instance_text( $instance, 'laawws_close_hours_wed' );
     277                $laawws_open_hours_wed_checked    = $this->get_instance_text( $instance, 'laawws_open_hours_wed_checked' );
     278                $laawws_open_hours_thu            = $this->get_instance_text( $instance, 'laawws_open_hours_thu' );
     279                $laawws_close_hours_thu           = $this->get_instance_text( $instance, 'laawws_close_hours_thu' );
     280                $laawws_open_hours_thu_checked    = $this->get_instance_text( $instance, 'laawws_open_hours_thu_checked' );
     281                $laawws_open_hours_fri            = $this->get_instance_text( $instance, 'laawws_open_hours_fri' );
     282                $laawws_close_hours_fri           = $this->get_instance_text( $instance, 'laawws_close_hours_fri' );
     283                $laawws_open_hours_fri_checked    = $this->get_instance_text( $instance, 'laawws_open_hours_fri_checked' );
     284                $laawws_open_hours_sun2           = $this->get_instance_text( $instance, 'laawws_open_hours_sun2' );
     285                $laawws_close_hours_sun2          = $this->get_instance_text( $instance, 'laawws_close_hours_sun2' );
     286                $laawws_open_hours_sun_checked2   = $this->get_instance_text( $instance, 'laawws_open_hours_sun_checked2' );
     287                $laawws_open_hours_sun            = $this->get_instance_text( $instance, 'laawws_open_hours_sun' );
     288                $laawws_close_hours_sun           = $this->get_instance_text( $instance, 'laawws_close_hours_sun' );
     289                $laawws_open_hours_sun_checked    = $this->get_instance_text( $instance, 'laawws_open_hours_sun_checked' );
     290                $laawws_address_schema_buttons    = $this->get_instance_text( $instance, 'laawws_address_schema_buttons' );
     291
     292                $laawws_address_style_fa = ( 'font-awesome' === $laawws_address_radio_buttons ) ? 'display:block;' : 'display:none;';
     293                $laawws_address_style_img = ( 'custom-image' === $laawws_address_radio_buttons ) ? 'display:block;' : 'display:none;';
     294                $pclass                  = ( 'open' === $laawws_open_hours ) ? 'display:block;' : 'display:none;';
     295                ?>
     296                <h3 class="laawws-admin-logo"><i class="fa fa-image" aria-hidden="true"></i> <span><?php esc_html_e( 'Logo Section', 'logo-and-address-widget-with-schema' ); ?></span></h3>
     297                <p>
     298                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_widget_title' ) ); ?>"><?php esc_html_e( 'Widget Title:', 'logo-and-address-widget-with-schema' ); ?></label>
     299                        <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_widget_title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_widget_title' ) ); ?>" type="text" value="<?php echo esc_attr( $laawws_widget_title ); ?>" />
     300                </p>
     301
     302                <p>
     303                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_footer_logo' ) ); ?>"><?php esc_html_e( 'Select/Upload a Logo:', 'logo-and-address-widget-with-schema' ); ?></label>
     304                        <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_footer_logo' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_footer_logo' ) ); ?>" type="text" value="<?php echo esc_url( $laawws_footer_logo ); ?>" />
     305                        <small class="laawws-small"><?php esc_html_e( '(We suggest 250 pixels wide x 250 pixels high)', 'logo-and-address-widget-with-schema' ); ?></small><br><br>
     306                        <button type="button" class="laawws_upload_image_button button button-primary"><?php esc_html_e( 'Upload Image', 'logo-and-address-widget-with-schema' ); ?></button>
     307                </p>
     308
     309                <p>
     310                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_footer_logo_alt_text' ) ); ?>"><?php esc_html_e( 'Logo Alternate Text:', 'logo-and-address-widget-with-schema' ); ?></label>
     311                        <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_footer_logo_alt_text' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_footer_logo_alt_text' ) ); ?>" type="text" value="<?php echo esc_attr( $laawws_footer_logo_alt_text ); ?>" />
    269312                </p>
    270313
    271314                <p class="laawws_image_radio_wrap">
    272                         <label for="<?php echo $this->get_field_id('laawws_image_radio_buttons'); ?>"><?php _e('Logo Alignment:', 'laawws_wp_widget_plugin'); ?></label><br>
    273                         <label for="<?php echo $this->get_field_id('laawws_image_radio_buttons'); ?>_1">
    274                        <input class="laawws_image_radio_button" id="<?php echo $this->get_field_id('laawws_image_radio_buttons'); ?>_1" name="<?php echo $this->get_field_name('laawws_image_radio_buttons'); ?>" type="radio" value="left" <?php if($laawws_image_radio_buttons === 'left'){ echo 'checked="checked"'; } ?>/><?php _e('Left'); ?>
    275                     </label>&nbsp;&nbsp;
    276                     <label for="<?php echo $this->get_field_id('laawws_image_radio_buttons'); ?>_2">
    277                        <input class="laawws_image_radio_button" id="<?php echo $this->get_field_id('laawws_image_radio_buttons'); ?>_2" name="<?php echo $this->get_field_name('laawws_image_radio_buttons'); ?>" type="radio" value="center" <?php if($laawws_image_radio_buttons === 'center'){ echo 'checked="checked"'; } ?> /><?php _e('Center'); ?>
    278                     </label>&nbsp;&nbsp;
    279                     <label for="<?php echo $this->get_field_id('laawws_image_radio_buttons'); ?>_3">
    280                        <input class="laawws_image_radio_button" id="<?php echo $this->get_field_id('laawws_image_radio_buttons'); ?>_3" name="<?php echo $this->get_field_name('laawws_image_radio_buttons'); ?>" type="radio" value="right" <?php if($laawws_image_radio_buttons === 'right'){ echo 'checked="checked"'; } ?> /><?php _e('Right'); ?>
    281                     </label>
    282                 </p>
    283 
    284 
    285                 <h3 class="laawws-admin-logo"><i class="fa fa-map-marker"></i> <span>Address Section</span></h3>
    286 
    287                 <p>
    288                         <label for="<?php echo $this->get_field_id('laawws_address_line1'); ?>"><?php _e('Address Line 1:', 'laawws_wp_widget_plugin'); ?></label>
    289                         <input class="widefat" id="<?php echo $this->get_field_id('laawws_address_line1'); ?>" name="<?php echo $this->get_field_name('laawws_address_line1'); ?>" type="text" value="<?php echo $laawws_address_line1; ?>" />
    290                 </p>
    291 
    292                 <p>
    293                         <label for="<?php echo $this->get_field_id('laawws_address_line2'); ?>"><?php _e('Address Line 2:', 'laawws_wp_widget_plugin'); ?></label>
    294                         <input class="widefat" id="<?php echo $this->get_field_id('laawws_address_line2'); ?>" name="<?php echo $this->get_field_name('laawws_address_line2'); ?>" type="text" value="<?php echo $laawws_address_line2; ?>" />
    295                 </p>
    296 
    297                 <p>
    298                         <label for="<?php echo $this->get_field_id('laawws_city'); ?>"><?php _e('City:', 'laawws_wp_widget_plugin'); ?></label>
    299                         <input class="widefat" id="<?php echo $this->get_field_id('laawws_city'); ?>" name="<?php echo $this->get_field_name('laawws_city'); ?>" type="text" value="<?php echo $laawws_city; ?>" />
    300                 </p>
    301 
    302                 <p>
    303                         <label for="<?php echo $this->get_field_id('laawws_state'); ?>"><?php _e('State:', 'laawws_wp_widget_plugin'); ?></label>
    304                         <input class="widefat" id="<?php echo $this->get_field_id('laawws_state'); ?>" name="<?php echo $this->get_field_name('laawws_state'); ?>" type="text" value="<?php echo $laawws_state; ?>" />
    305                 </p>
    306 
    307                 <p>
    308                         <label for="<?php echo $this->get_field_id('laawws_zip'); ?>"><?php _e('ZIP:', 'laawws_wp_widget_plugin'); ?></label>
    309                         <input class="widefat" id="<?php echo $this->get_field_id('laawws_zip'); ?>" name="<?php echo $this->get_field_name('laawws_zip'); ?>" type="text" value="<?php echo $laawws_zip; ?>" />
     315                        <label><?php esc_html_e( 'Logo Alignment:', 'logo-and-address-widget-with-schema' ); ?></label><br>
     316                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_image_radio_buttons' ) ); ?>_1">
     317                                <input class="laawws_image_radio_button" id="<?php echo esc_attr( $this->get_field_id( 'laawws_image_radio_buttons' ) ); ?>_1" name="<?php echo esc_attr( $this->get_field_name( 'laawws_image_radio_buttons' ) ); ?>" type="radio" value="left" <?php checked( $laawws_image_radio_buttons, 'left' ); ?> />
     318                                <?php esc_html_e( 'Left', 'logo-and-address-widget-with-schema' ); ?>
     319                        </label>&nbsp;&nbsp;
     320                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_image_radio_buttons' ) ); ?>_2">
     321                                <input class="laawws_image_radio_button" id="<?php echo esc_attr( $this->get_field_id( 'laawws_image_radio_buttons' ) ); ?>_2" name="<?php echo esc_attr( $this->get_field_name( 'laawws_image_radio_buttons' ) ); ?>" type="radio" value="center" <?php checked( $laawws_image_radio_buttons, 'center' ); ?> />
     322                                <?php esc_html_e( 'Center', 'logo-and-address-widget-with-schema' ); ?>
     323                        </label>&nbsp;&nbsp;
     324                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_image_radio_buttons' ) ); ?>_3">
     325                                <input class="laawws_image_radio_button" id="<?php echo esc_attr( $this->get_field_id( 'laawws_image_radio_buttons' ) ); ?>_3" name="<?php echo esc_attr( $this->get_field_name( 'laawws_image_radio_buttons' ) ); ?>" type="radio" value="right" <?php checked( $laawws_image_radio_buttons, 'right' ); ?> />
     326                                <?php esc_html_e( 'Right', 'logo-and-address-widget-with-schema' ); ?>
     327                        </label>
     328                </p>
     329
     330                <h3 class="laawws-admin-logo"><i class="fa fa-map-marker" aria-hidden="true"></i> <span><?php esc_html_e( 'Address Section', 'logo-and-address-widget-with-schema' ); ?></span></h3>
     331
     332                <p>
     333                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_address_line1' ) ); ?>"><?php esc_html_e( 'Address Line 1:', 'logo-and-address-widget-with-schema' ); ?></label>
     334                        <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_address_line1' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_address_line1' ) ); ?>" type="text" value="<?php echo esc_attr( $laawws_address_line1 ); ?>" />
     335                </p>
     336
     337                <p>
     338                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_address_line2' ) ); ?>"><?php esc_html_e( 'Address Line 2:', 'logo-and-address-widget-with-schema' ); ?></label>
     339                        <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_address_line2' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_address_line2' ) ); ?>" type="text" value="<?php echo esc_attr( $laawws_address_line2 ); ?>" />
     340                </p>
     341
     342                <p>
     343                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_city' ) ); ?>"><?php esc_html_e( 'City:', 'logo-and-address-widget-with-schema' ); ?></label>
     344                        <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_city' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_city' ) ); ?>" type="text" value="<?php echo esc_attr( $laawws_city ); ?>" />
     345                </p>
     346
     347                <p>
     348                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_state' ) ); ?>"><?php esc_html_e( 'State:', 'logo-and-address-widget-with-schema' ); ?></label>
     349                        <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_state' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_state' ) ); ?>" type="text" value="<?php echo esc_attr( $laawws_state ); ?>" />
     350                </p>
     351
     352                <p>
     353                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_zip' ) ); ?>"><?php esc_html_e( 'ZIP:', 'logo-and-address-widget-with-schema' ); ?></label>
     354                        <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_zip' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_zip' ) ); ?>" type="text" value="<?php echo esc_attr( $laawws_zip ); ?>" />
    310355                </p>
    311356
    312357                <p class="laawws_address_radio_wrap">
    313                         <label for="<?php echo $this->get_field_id('laawws_address_radio_buttons'); ?>"><?php _e('Address Icon:', 'laawws_wp_widget_plugin'); ?></label><br>
    314                         <label for="<?php echo $this->get_field_id('laawws_address_radio_buttons'); ?>_1">
    315                        <input class="laawws_image_radio_button" id="<?php echo $this->get_field_id('laawws_address_radio_buttons'); ?>_1" name="<?php echo $this->get_field_name('laawws_address_radio_buttons'); ?>" type="radio" value="icon" <?php if($laawws_address_radio_buttons === 'icon'){ echo 'checked="checked"'; } ?>/><?php _e('Icon (Default)'); ?>
    316                     </label><br>
    317                     <label for="<?php echo $this->get_field_id('laawws_address_radio_buttons'); ?>_2">
    318                        <input class="laawws_image_radio_button" id="<?php echo $this->get_field_id('laawws_address_radio_buttons'); ?>_2" name="<?php echo $this->get_field_name('laawws_address_radio_buttons'); ?>" type="radio" value="font-awesome" <?php if($laawws_address_radio_buttons === 'font-awesome'){ echo 'checked="checked"'; } ?> /><?php _e('Fontawesome Class'); ?>
    319                     </label><br>
    320 
    321                             <?php if($laawws_address_radio_buttons == "font-awesome") {
    322                                         $laawws_address_style = "style='display:block;'";
    323                                 } else {
    324                                         $laawws_address_style = "style='display:none;'";
    325                                 } ?>
    326 
    327                             <span class="laawws_address_fawesome_wrap" <?php echo $laawws_address_style; ?>>
    328                                         <label for="<?php echo $this->get_field_id('laawws_address_fawesome_icon'); ?>"><?php _e('<i class="fa fa-address-card"></i>&nbsp; Fontawesome Icon:', 'laawws_wp_widget_plugin'); ?></label>
    329                                         <input class="widefat" id="<?php echo $this->get_field_id('laawws_address_fawesome_icon'); ?>" name="<?php echo $this->get_field_name('laawws_address_fawesome_icon'); ?>" type="text" value="<?php echo $laawws_address_fawesome_icon; ?>" /><small class="laawws-small">(Example: location-arrow)</small>
    330                                 </span>
    331 
    332                     <label for="<?php echo $this->get_field_id('laawws_address_radio_buttons'); ?>_3">
    333                        <input class="laawws_image_radio_button" id="<?php echo $this->get_field_id('laawws_address_radio_buttons'); ?>_3" name="<?php echo $this->get_field_name('laawws_address_radio_buttons'); ?>" type="radio" value="custom-image" <?php if($laawws_address_radio_buttons === 'custom-image'){ echo 'checked="checked"'; } ?> /><?php _e('Custom Image'); ?>
    334                     </label>
    335 
    336                         <?php if($laawws_address_radio_buttons == "custom-image") {
    337                                         $laawws_address_style = "style='display:block;'";
    338                                 } else {
    339                                         $laawws_address_style = "style='display:none;'";
    340                                 } ?>
    341 
    342                                 <span class="laawws_address_custom_image_wrap" <?php echo $laawws_address_style; ?>>
    343                                    <label for="<?php echo $this->get_field_id( 'laawws_address_custom_image' ); ?>"><?php _e( 'Select/Upload an Icon:' ); ?></label>
    344                                    <input class="widefat" id="<?php echo $this->get_field_id( 'laawws_address_custom_image' ); ?>" name="<?php echo $this->get_field_name( 'laawws_address_custom_image' ); ?>" type="text" value="<?php echo esc_url( $laawws_address_custom_image ); ?>" /><small class="laawws-small">(We suggest 20 pixels wide x 20 pixels high)</small><br><br>
    345 
    346                                    <button class="laawws_upload_image_button button button-primary">Upload Image</button>
    347                                 </span>
    348 
    349                 </p>
    350 
    351 
    352                 <h3 class="laawws-admin-logo"><span>Phone/Fax/Email Section</span></h3>
    353 
    354                 <p>
    355                         <label for="<?php echo $this->get_field_id('laawws_phone'); ?>"><?php _e('<i class="fa fa-phone"></i>&nbsp; Phone:', 'laawws_wp_widget_plugin'); ?></label>
    356                         <input class="widefat" id="<?php echo $this->get_field_id('laawws_phone'); ?>" name="<?php echo $this->get_field_name('laawws_phone'); ?>" type="text" value="<?php echo $laawws_phone; ?>" />
    357                 </p>
    358 
    359                 <p>
    360                         <label for="<?php echo $this->get_field_id('laawws_fax'); ?>"><?php _e('<i class="fa fa-fax"></i>&nbsp; Fax:', 'laawws_wp_widget_plugin'); ?></label>
    361                         <input class="widefat" id="<?php echo $this->get_field_id('laawws_fax'); ?>" name="<?php echo $this->get_field_name('laawws_fax'); ?>" type="text" value="<?php echo $laawws_fax; ?>" />
    362                 </p>
    363 
    364                 <p>
    365                         <label for="<?php echo $this->get_field_id('laawws_email'); ?>"><?php _e('<i class="fa fa-envelope"></i>&nbsp; Email:', 'laawws_wp_widget_plugin'); ?></label>
    366                         <input class="widefat" id="<?php echo $this->get_field_id('laawws_email'); ?>" name="<?php echo $this->get_field_name('laawws_email'); ?>" type="text" value="<?php echo $laawws_email; ?>" />
    367                 </p>
    368 
     358                        <label><?php esc_html_e( 'Address Icon:', 'logo-and-address-widget-with-schema' ); ?></label><br>
     359                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_address_radio_buttons' ) ); ?>_1">
     360                                <input class="laawws_image_radio_button" id="<?php echo esc_attr( $this->get_field_id( 'laawws_address_radio_buttons' ) ); ?>_1" name="<?php echo esc_attr( $this->get_field_name( 'laawws_address_radio_buttons' ) ); ?>" type="radio" value="icon" <?php checked( $laawws_address_radio_buttons, 'icon' ); ?> />
     361                                <?php esc_html_e( 'Icon (Default)', 'logo-and-address-widget-with-schema' ); ?>
     362                        </label><br>
     363                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_address_radio_buttons' ) ); ?>_2">
     364                                <input class="laawws_image_radio_button" id="<?php echo esc_attr( $this->get_field_id( 'laawws_address_radio_buttons' ) ); ?>_2" name="<?php echo esc_attr( $this->get_field_name( 'laawws_address_radio_buttons' ) ); ?>" type="radio" value="font-awesome" <?php checked( $laawws_address_radio_buttons, 'font-awesome' ); ?> />
     365                                <?php esc_html_e( 'Fontawesome Class', 'logo-and-address-widget-with-schema' ); ?>
     366                        </label><br>
     367
     368                        <span class="laawws_address_fawesome_wrap" style="<?php echo esc_attr( $laawws_address_style_fa ); ?>">
     369                                <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_address_fawesome_icon' ) ); ?>">
     370                                        <i class="fa fa-address-card" aria-hidden="true"></i>&nbsp; <?php esc_html_e( 'Fontawesome Icon:', 'logo-and-address-widget-with-schema' ); ?>
     371                                </label>
     372                                <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_address_fawesome_icon' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_address_fawesome_icon' ) ); ?>" type="text" value="<?php echo esc_attr( $laawws_address_fawesome_icon ); ?>" />
     373                                <small class="laawws-small"><?php esc_html_e( '(Example: location-arrow)', 'logo-and-address-widget-with-schema' ); ?></small>
     374                        </span>
     375
     376                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_address_radio_buttons' ) ); ?>_3">
     377                                <input class="laawws_image_radio_button" id="<?php echo esc_attr( $this->get_field_id( 'laawws_address_radio_buttons' ) ); ?>_3" name="<?php echo esc_attr( $this->get_field_name( 'laawws_address_radio_buttons' ) ); ?>" type="radio" value="custom-image" <?php checked( $laawws_address_radio_buttons, 'custom-image' ); ?> />
     378                                <?php esc_html_e( 'Custom Image', 'logo-and-address-widget-with-schema' ); ?>
     379                        </label>
     380
     381                        <span class="laawws_address_custom_image_wrap" style="<?php echo esc_attr( $laawws_address_style_img ); ?>">
     382                                <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_address_custom_image' ) ); ?>"><?php esc_html_e( 'Select/Upload an Icon:', 'logo-and-address-widget-with-schema' ); ?></label>
     383                                <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_address_custom_image' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_address_custom_image' ) ); ?>" type="text" value="<?php echo esc_url( $laawws_address_custom_image ); ?>" />
     384                                <small class="laawws-small"><?php esc_html_e( '(We suggest 20 pixels wide x 20 pixels high)', 'logo-and-address-widget-with-schema' ); ?></small><br><br>
     385                                <button type="button" class="laawws_upload_image_button button button-primary"><?php esc_html_e( 'Upload Image', 'logo-and-address-widget-with-schema' ); ?></button>
     386                        </span>
     387                </p>
     388
     389                <h3 class="laawws-admin-logo"><span><?php esc_html_e( 'Phone/Fax/Email Section', 'logo-and-address-widget-with-schema' ); ?></span></h3>
     390
     391                <p>
     392                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_phone' ) ); ?>">
     393                                <i class="fa fa-phone" aria-hidden="true"></i>&nbsp; <?php esc_html_e( 'Phone:', 'logo-and-address-widget-with-schema' ); ?>
     394                        </label>
     395                        <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_phone' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_phone' ) ); ?>" type="text" value="<?php echo esc_attr( $laawws_phone ); ?>" />
     396                </p>
     397
     398                <p>
     399                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_fax' ) ); ?>">
     400                                <i class="fa fa-fax" aria-hidden="true"></i>&nbsp; <?php esc_html_e( 'Fax:', 'logo-and-address-widget-with-schema' ); ?>
     401                        </label>
     402                        <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_fax' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_fax' ) ); ?>" type="text" value="<?php echo esc_attr( $laawws_fax ); ?>" />
     403                </p>
     404
     405                <p>
     406                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_email' ) ); ?>">
     407                                <i class="fa fa-envelope" aria-hidden="true"></i>&nbsp; <?php esc_html_e( 'Email:', 'logo-and-address-widget-with-schema' ); ?>
     408                        </label>
     409                        <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_email' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_email' ) ); ?>" type="text" value="<?php echo esc_attr( $laawws_email ); ?>" />
     410                </p>
    369411
    370412                <p class="laawws_epf_radio_wrap">
    371                         <label for="<?php echo $this->get_field_id('laawws_epf_radio_buttons'); ?>_1">
    372                        <input class="laawws_epf_radio_button" id="<?php echo $this->get_field_id('laawws_epf_radio_buttons'); ?>_1" name="<?php echo $this->get_field_name('laawws_epf_radio_buttons'); ?>" type="radio" value="icons" <?php if($laawws_epf_radio_buttons === 'icons'){ echo 'checked="checked"'; } ?>/><?php _e('Show Icons'); ?>
    373                     </label>&nbsp;&nbsp;
    374                     <label for="<?php echo $this->get_field_id('laawws_epf_radio_buttons'); ?>_2">
    375                        <input class="laawws_epf_radio_button" id="<?php echo $this->get_field_id('laawws_epf_radio_buttons'); ?>_2" name="<?php echo $this->get_field_name('laawws_epf_radio_buttons'); ?>" type="radio" value="label" <?php if($laawws_epf_radio_buttons === 'label'){ echo 'checked="checked"'; } ?> /><?php _e('Show Label'); ?>
    376                     </label>
    377                 </p>
    378 
    379                 <h3 class="laawws-admin-logo"><i class="fa fa-address-card"></i> <span>Address Schema Section</span></h3>
    380 
    381                 <p class="laawws_address_radio_wrap">
    382 
    383                         <label for="<?php echo $this->get_field_id('laawws_address_schema_buttons'); ?>_1">
    384                        <input class="laawws_address_schema_button" id="<?php echo $this->get_field_id('laawws_address_schema_buttons'); ?>_1" name="<?php echo $this->get_field_name('laawws_address_schema_buttons'); ?>" type="radio" value="on" <?php if($laawws_address_schema_buttons === 'on'){ echo 'checked="checked"'; } ?>/><?php _e('On'); ?>
    385                     </label>&nbsp;&nbsp;
    386                     <label for="<?php echo $this->get_field_id('laawws_address_schema_buttons'); ?>_2">
    387                        <input class="laawws_address_schema_button" id="<?php echo $this->get_field_id('laawws_address_schema_buttons'); ?>_2" name="<?php echo $this->get_field_name('laawws_address_schema_buttons'); ?>" type="radio" value="off" <?php if($laawws_address_schema_buttons === 'off'){ echo 'checked="checked"'; } ?> /><?php _e('Off'); ?>
     413                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_epf_radio_buttons' ) ); ?>_1">
     414                                <input class="laawws_epf_radio_button" id="<?php echo esc_attr( $this->get_field_id( 'laawws_epf_radio_buttons' ) ); ?>_1" name="<?php echo esc_attr( $this->get_field_name( 'laawws_epf_radio_buttons' ) ); ?>" type="radio" value="icons" <?php checked( $laawws_epf_radio_buttons, 'icons' ); ?> />
     415                                <?php esc_html_e( 'Show Icons', 'logo-and-address-widget-with-schema' ); ?>
     416                        </label>&nbsp;&nbsp;
     417                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_epf_radio_buttons' ) ); ?>_2">
     418                                <input class="laawws_epf_radio_button" id="<?php echo esc_attr( $this->get_field_id( 'laawws_epf_radio_buttons' ) ); ?>_2" name="<?php echo esc_attr( $this->get_field_name( 'laawws_epf_radio_buttons' ) ); ?>" type="radio" value="label" <?php checked( $laawws_epf_radio_buttons, 'label' ); ?> />
     419                                <?php esc_html_e( 'Show Label', 'logo-and-address-widget-with-schema' ); ?>
    388420                        </label>
    389421                </p>
    390422
    391 
    392                 <br /><h3 class="laawws-admin-logo"><i class="fa fa-clock-o"></i> <span>Business Hours Section</span></h3>
    393 
    394                 <p>
    395                         <input id="<?php echo $this->get_field_id('laawws_open_hours'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours'); ?>" class="widefat laawws-open-hrs-checkbox" type="checkbox" value="open" <?php checked('open', $laawws_open_hours); ?> />
    396 
    397                         <label for="<?php echo $this->get_field_id('laawws_open_hours'); ?>">Show Business Hours</label>
    398 
    399                 </p>
    400 
    401                 <?php if($laawws_open_hours == "open") {
    402                         $pclass = "style='display:block;'";
    403                 } else {
    404                         $pclass = "style='display:none;'";
    405                 } ?>
    406 
    407                 <div class="laawws-open-hrs-time-wrap" <?php echo $pclass; ?>>
    408 
     423                <h3 class="laawws-admin-logo"><i class="fa fa-address-card" aria-hidden="true"></i> <span><?php esc_html_e( 'Address Schema Section', 'logo-and-address-widget-with-schema' ); ?></span></h3>
     424
     425                <p class="laawws_address_schema_radio_wrap">
     426                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_address_schema_buttons' ) ); ?>_1">
     427                                <input class="laawws_address_schema_button" id="<?php echo esc_attr( $this->get_field_id( 'laawws_address_schema_buttons' ) ); ?>_1" name="<?php echo esc_attr( $this->get_field_name( 'laawws_address_schema_buttons' ) ); ?>" type="radio" value="on" <?php checked( $laawws_address_schema_buttons, 'on' ); ?> />
     428                                <?php esc_html_e( 'On', 'logo-and-address-widget-with-schema' ); ?>
     429                        </label>&nbsp;&nbsp;
     430                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_address_schema_buttons' ) ); ?>_2">
     431                                <input class="laawws_address_schema_button" id="<?php echo esc_attr( $this->get_field_id( 'laawws_address_schema_buttons' ) ); ?>_2" name="<?php echo esc_attr( $this->get_field_name( 'laawws_address_schema_buttons' ) ); ?>" type="radio" value="off" <?php checked( $laawws_address_schema_buttons, 'off' ); ?> />
     432                                <?php esc_html_e( 'Off', 'logo-and-address-widget-with-schema' ); ?>
     433                        </label>
     434                </p>
     435
     436                <br /><h3 class="laawws-admin-logo"><i class="fa fa-clock-o" aria-hidden="true"></i> <span><?php esc_html_e( 'Business Hours Section', 'logo-and-address-widget-with-schema' ); ?></span></h3>
     437
     438                <p>
     439                        <input id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours' ) ); ?>" class="widefat laawws-open-hrs-checkbox" type="checkbox" value="open" <?php checked( 'open', $laawws_open_hours ); ?> />
     440                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours' ) ); ?>"><?php esc_html_e( 'Show Business Hours', 'logo-and-address-widget-with-schema' ); ?></label>
     441                </p>
     442
     443                <div class="laawws-open-hrs-time-wrap" style="<?php echo esc_attr( $pclass ); ?>">
    409444                        <p>
    410                                 <label for="<?php echo $this->get_field_id('laawws_open_hours_title'); ?>">Label:</label>
    411 
    412                                 <input class="widefat" id="<?php echo $this->get_field_id('laawws_open_hours_title'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_title'); ?>" type="text" value="<?php echo $laawws_open_hours_title; ?>" placeholder="Business Hours" /><br/>
     445                                <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_title' ) ); ?>"><?php esc_html_e( 'Label:', 'logo-and-address-widget-with-schema' ); ?></label>
     446                                <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_title' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_title' ) ); ?>" type="text" value="<?php echo esc_attr( $laawws_open_hours_title ); ?>" placeholder="<?php esc_attr_e( 'Business Hours', 'logo-and-address-widget-with-schema' ); ?>" /><br/>
    413447                        </p>
    414 
    415448
    416449                        <!-- Monday to Friday -->
    417450                        <p class="clearfix">
    418 
    419451                                <span class="laawws-date-left mon-fri">
    420 
    421                                         <input id="<?php echo $this->get_field_id('laawws_open_hours_mon_fri_checked'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_mon_fri_checked'); ?>" class="widefat" type="checkbox" value="monfri" <?php checked('monfri', $laawws_open_hours_mon_fri_checked); ?> />
    422 
    423                                         <label for="<?php echo $this->get_field_id('laawws_open_hours_mon_fri'); ?>"><?php _e('', 'laawws_open_hours_mon_fri'); ?> Mon-Fri:</label>
    424 
    425                                 </span>
    426 
     452                                        <input id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_mon_fri_checked' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_mon_fri_checked' ) ); ?>" class="widefat" type="checkbox" value="monfri" <?php checked( 'monfri', $laawws_open_hours_mon_fri_checked ); ?> />
     453                                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_mon_fri' ) ); ?>"><?php esc_html_e( 'Mon-Fri:', 'logo-and-address-widget-with-schema' ); ?></label>
     454                                </span>
    427455                                <span class="laawws-date-center">
    428 
    429                                         <!-- Starting time for Monday-->
    430                                         <select id="<?php echo $this->get_field_id('laawws_open_hours_mon_fri'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_mon_fri'); ?>" class="laawws-open-hrs-monfri" >
    431 
    432                                         <?php $this->laawws_time_picker($laawws_open_hours_mon_fri); ?>
    433 
    434                                 </select>
    435 
    436                         </span>
    437 
    438                         <span class="laawws-date-right">
    439 
    440                                         <!-- Closing time for Monday -->
    441                                 <select id="<?php echo $this->get_field_id('laawws_close_hours_mon_fri'); ?>" name="<?php echo $this->get_field_name('laawws_close_hours_mon_fri'); ?>">
    442 
    443                                                 <?php $this->laawws_time_picker($laawws_close_hours_mon_fri); ?>
    444 
    445                                 </select>
    446 
    447                                 </span>
    448 
    449                 </p>
    450 
    451                 <p style="text-align: center;"> - OR - </p>
    452 
     456                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_mon_fri' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_mon_fri' ) ); ?>" class="laawws-open-hrs-monfri">
     457                                                <?php $this->laawws_time_picker( $laawws_open_hours_mon_fri ); ?>
     458                                        </select>
     459                                </span>
     460                                <span class="laawws-date-right">
     461                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_close_hours_mon_fri' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_close_hours_mon_fri' ) ); ?>">
     462                                                <?php $this->laawws_time_picker( $laawws_close_hours_mon_fri ); ?>
     463                                        </select>
     464                                </span>
     465                        </p>
     466
     467                        <p style="text-align: center;"> - <?php esc_html_e( 'OR', 'logo-and-address-widget-with-schema' ); ?> - </p>
    453468
    454469                        <!-- Monday -->
    455470                        <p class="clearfix">
    456 
    457471                                <span class="laawws-date-left mon">
    458 
    459                                         <input id="<?php echo $this->get_field_id('laawws_open_hours_mon_checked'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_mon_checked'); ?>" class="widefat" type="checkbox" value="mon" <?php checked('mon', $laawws_open_hours_mon_checked); ?> />
    460 
    461                                         <label for="<?php echo $this->get_field_id('laawws_open_hours_mon'); ?>"><?php _e('', 'laawws_open_hours_mon'); ?>Mon: </label>
    462 
    463                                 </span>
    464 
     472                                        <input id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_mon_checked' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_mon_checked' ) ); ?>" class="widefat" type="checkbox" value="mon" <?php checked( 'mon', $laawws_open_hours_mon_checked ); ?> />
     473                                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_mon' ) ); ?>"><?php esc_html_e( 'Mon:', 'logo-and-address-widget-with-schema' ); ?></label>
     474                                </span>
    465475                                <span class="laawws-date-center">
    466 
    467                                         <!-- Starting time for Monday-->
    468                                         <select id="<?php echo $this->get_field_id('laawws_open_hours_mon'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_mon'); ?>" class="laawws-open-hrs-mon" >
    469 
    470                                         <?php $this->laawws_time_picker($laawws_open_hours_mon); ?>
    471 
    472                                 </select>
    473 
    474                         </span>
    475 
    476                         <span class="laawws-date-right">
    477 
    478                                         <!-- Closing time for Monday -->
    479                                 <select id="<?php echo $this->get_field_id('laawws_close_hours_mon'); ?>" name="<?php echo $this->get_field_name('laawws_close_hours_mon'); ?>">
    480 
    481                                                 <?php $this->laawws_time_picker($laawws_close_hours_mon); ?>
    482 
    483                                 </select>
    484                                 </span>
    485 
    486                 </p>
    487 
    488 
    489                 <!-- Tuesday -->
     476                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_mon' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_mon' ) ); ?>" class="laawws-open-hrs-mon">
     477                                                <?php $this->laawws_time_picker( $laawws_open_hours_mon ); ?>
     478                                        </select>
     479                                </span>
     480                                <span class="laawws-date-right">
     481                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_close_hours_mon' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_close_hours_mon' ) ); ?>">
     482                                                <?php $this->laawws_time_picker( $laawws_close_hours_mon ); ?>
     483                                        </select>
     484                                </span>
     485                        </p>
     486
     487                        <!-- Tuesday -->
    490488                        <p class="clearfix">
    491 
    492489                                <span class="laawws-date-left tue">
    493 
    494                                 <input id="<?php echo $this->get_field_id('laawws_open_hours_tue_checked'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_tue_checked'); ?>" class="widefat" type="checkbox" value="tue" <?php checked('tue', $laawws_open_hours_tue_checked); ?> />
    495 
    496                                         <label for="<?php echo $this->get_field_id('laawws_open_hours_tue'); ?>"><?php _e('', 'laawws_open_hours_tue'); ?>Tue: </label>
    497                                 </span>
    498 
     490                                        <input id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_tue_checked' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_tue_checked' ) ); ?>" class="widefat" type="checkbox" value="tue" <?php checked( 'tue', $laawws_open_hours_tue_checked ); ?> />
     491                                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_tue' ) ); ?>"><?php esc_html_e( 'Tue:', 'logo-and-address-widget-with-schema' ); ?></label>
     492                                </span>
    499493                                <span class="laawws-date-center">
    500                                         <!-- Starting time for Tuesday-->
    501                                         <select id="<?php echo $this->get_field_id('laawws_open_hours_tue'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_tue'); ?>" class="laawws-open-hrs-tue" >
    502 
    503                                         <?php $this->laawws_time_picker($laawws_open_hours_tue); ?>
    504 
    505                                 </select>
    506                         </span>
    507 
    508                         <span class="laawws-date-right">
    509 
    510                                         <!-- Closing time for Tuesday -->
    511                                 <select id="<?php echo $this->get_field_id('laawws_close_hours_tue'); ?>" name="<?php echo $this->get_field_name('laawws_close_hours_tue'); ?>">
    512 
    513                                         <?php $this->laawws_time_picker($laawws_close_hours_tue); ?>
    514 
    515                                 </select>
    516                                 </span>
    517 
    518                 </p>
    519 
    520 
    521                 <!-- Wednesday -->
    522                 <p class="clearfix">
    523 
    524                         <span class="laawws-date-left wed">
    525 
    526                                 <input id="<?php echo $this->get_field_id('laawws_open_hours_wed_checked'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_wed_checked'); ?>" class="widefat" type="checkbox" value="wed" <?php checked('wed', $laawws_open_hours_wed_checked); ?> />
    527 
    528                                 <label for="<?php echo $this->get_field_id('laawws_open_hours_wed'); ?>"><?php _e('', 'laawws_open_hours_wed'); ?>Wed: </label>
    529                                 </span>
    530 
     494                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_tue' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_tue' ) ); ?>" class="laawws-open-hrs-tue">
     495                                                <?php $this->laawws_time_picker( $laawws_open_hours_tue ); ?>
     496                                        </select>
     497                                </span>
     498                                <span class="laawws-date-right">
     499                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_close_hours_tue' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_close_hours_tue' ) ); ?>">
     500                                                <?php $this->laawws_time_picker( $laawws_close_hours_tue ); ?>
     501                                        </select>
     502                                </span>
     503                        </p>
     504
     505                        <!-- Wednesday -->
     506                        <p class="clearfix">
     507                                <span class="laawws-date-left wed">
     508                                        <input id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_wed_checked' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_wed_checked' ) ); ?>" class="widefat" type="checkbox" value="wed" <?php checked( 'wed', $laawws_open_hours_wed_checked ); ?> />
     509                                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_wed' ) ); ?>"><?php esc_html_e( 'Wed:', 'logo-and-address-widget-with-schema' ); ?></label>
     510                                </span>
    531511                                <span class="laawws-date-center">
    532 
    533                                         <!-- Starting time for Wednesday-->
    534                                         <select id="<?php echo $this->get_field_id('laawws_open_hours_wed'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_wed'); ?>" class="laawws-open-hrs-wed" >
    535 
    536                                         <?php $this->laawws_time_picker($laawws_open_hours_wed); ?>
    537 
    538                                 </select>
    539 
    540                                 </span>
    541 
     512                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_wed' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_wed' ) ); ?>" class="laawws-open-hrs-wed">
     513                                                <?php $this->laawws_time_picker( $laawws_open_hours_wed ); ?>
     514                                        </select>
     515                                </span>
    542516                                <span class="laawws-date-right">
    543 
    544                                         <!-- Closing time for Wednesday -->
    545                                 <select id="<?php echo $this->get_field_id('laawws_close_hours_wed'); ?>" name="<?php echo $this->get_field_name('laawws_close_hours_wed'); ?>">
    546 
    547                                         <?php $this->laawws_time_picker($laawws_close_hours_wed); ?>
    548 
    549                                 </select>
    550                                 </span>
    551 
    552                 </p>
    553 
    554 
    555                 <!-- Thursday -->
    556                 <p class="clearfix">
    557 
    558                         <span class="laawws-date-left thu">
    559 
    560                                 <input id="<?php echo $this->get_field_id('laawws_open_hours_thu_checked'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_thu_checked'); ?>" class="widefat" type="checkbox" value="thu" <?php checked('thu', $laawws_open_hours_thu_checked); ?> />
    561 
    562                                         <label for="<?php echo $this->get_field_id('laawws_open_hours_thu'); ?>"><?php _e('', 'laawws_open_hours_thu'); ?>Thu: </label>
    563 
    564                                 </span>
    565 
     517                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_close_hours_wed' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_close_hours_wed' ) ); ?>">
     518                                                <?php $this->laawws_time_picker( $laawws_close_hours_wed ); ?>
     519                                        </select>
     520                                </span>
     521                        </p>
     522
     523                        <!-- Thursday -->
     524                        <p class="clearfix">
     525                                <span class="laawws-date-left thu">
     526                                        <input id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_thu_checked' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_thu_checked' ) ); ?>" class="widefat" type="checkbox" value="thu" <?php checked( 'thu', $laawws_open_hours_thu_checked ); ?> />
     527                                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_thu' ) ); ?>"><?php esc_html_e( 'Thu:', 'logo-and-address-widget-with-schema' ); ?></label>
     528                                </span>
    566529                                <span class="laawws-date-center">
    567 
    568                                         <!-- Starting time for Thursday-->
    569                                         <select id="<?php echo $this->get_field_id('laawws_open_hours_thu'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_thu'); ?>" class="laawws-open-hrs-thu">
    570 
    571                                         <?php $this->laawws_time_picker($laawws_open_hours_thu); ?>
    572 
    573                                 </select>
    574 
    575                                 </span>
    576 
     530                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_thu' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_thu' ) ); ?>" class="laawws-open-hrs-thu">
     531                                                <?php $this->laawws_time_picker( $laawws_open_hours_thu ); ?>
     532                                        </select>
     533                                </span>
    577534                                <span class="laawws-date-right">
    578 
    579                                         <!-- Closing time for Monday -->
    580                                 <select id="<?php echo $this->get_field_id('laawws_close_hours_thu'); ?>" name="<?php echo $this->get_field_name('laawws_close_hours_thu'); ?>">
    581 
    582                                         <?php $this->laawws_time_picker($laawws_close_hours_thu); ?>
    583 
    584                                 </select>
    585                                 </span>
    586 
    587                 </p>
    588 
    589 
    590                 <!-- Friday -->
    591                 <p class="clearfix">
    592 
    593                         <span class="laawws-date-left fri">
    594 
    595                                 <input id="<?php echo $this->get_field_id('laawws_open_hours_fri_checked'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_fri_checked'); ?>" class="widefat" type="checkbox" value="fri" <?php checked('fri', $laawws_open_hours_fri_checked); ?> />
    596 
    597                                         <label for="<?php echo $this->get_field_id('laawws_open_hours_fri'); ?>"><?php _e('', 'laawws_open_hours_fri'); ?>Fri: </label>
    598 
    599                                 </span>
    600 
     535                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_close_hours_thu' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_close_hours_thu' ) ); ?>">
     536                                                <?php $this->laawws_time_picker( $laawws_close_hours_thu ); ?>
     537                                        </select>
     538                                </span>
     539                        </p>
     540
     541                        <!-- Friday -->
     542                        <p class="clearfix">
     543                                <span class="laawws-date-left fri">
     544                                        <input id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_fri_checked' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_fri_checked' ) ); ?>" class="widefat" type="checkbox" value="fri" <?php checked( 'fri', $laawws_open_hours_fri_checked ); ?> />
     545                                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_fri' ) ); ?>"><?php esc_html_e( 'Fri:', 'logo-and-address-widget-with-schema' ); ?></label>
     546                                </span>
    601547                                <span class="laawws-date-center">
    602 
    603                                         <!-- Starting time for Thursday-->
    604                                         <select id="<?php echo $this->get_field_id('laawws_open_hours_fri'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_fri'); ?>" class="laawws-open-hrs-fri">
    605 
    606                                         <?php $this->laawws_time_picker($laawws_open_hours_fri); ?>
    607 
    608                                 </select>
    609 
    610                                 </span>
    611 
     548                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_fri' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_fri' ) ); ?>" class="laawws-open-hrs-fri">
     549                                                <?php $this->laawws_time_picker( $laawws_open_hours_fri ); ?>
     550                                        </select>
     551                                </span>
    612552                                <span class="laawws-date-right">
    613 
    614                                         <!-- Closing time for Monday -->
    615                                 <select id="<?php echo $this->get_field_id('laawws_close_hours_fri'); ?>" name="<?php echo $this->get_field_name('laawws_close_hours_fri'); ?>">
    616 
    617                                         <?php $this->laawws_time_picker($laawws_close_hours_fri); ?>
    618 
    619                                 </select>
    620 
    621                                 </span>
    622 
     553                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_close_hours_fri' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_close_hours_fri' ) ); ?>">
     554                                                <?php $this->laawws_time_picker( $laawws_close_hours_fri ); ?>
     555                                        </select>
     556                                </span>
    623557                        </p>
    624 
    625558
    626559                        <!-- Saturday -->
    627560                        <p class="clearfix">
    628 
    629561                                <span class="laawws-date-left sats">
    630 
    631                                 <input id="<?php echo $this->get_field_id('laawws_open_hours_sun_checked2'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_sun_checked2'); ?>" class="widefat" type="checkbox" value="sun2" <?php checked('sun2', $laawws_open_hours_sun_checked2); ?> />
    632 
    633                                         <label for="<?php echo $this->get_field_id('laawws_open_hours_sun2'); ?>">Sat: </label>
    634 
    635                                 </span>
    636 
     562                                        <input id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_sun_checked2' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_sun_checked2' ) ); ?>" class="widefat" type="checkbox" value="sun2" <?php checked( 'sun2', $laawws_open_hours_sun_checked2 ); ?> />
     563                                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_sun2' ) ); ?>"><?php esc_html_e( 'Sat:', 'logo-and-address-widget-with-schema' ); ?></label>
     564                                </span>
    637565                                <span class="laawws-date-center">
    638 
    639                                         <!-- Starting time for Sunday-->
    640                                         <select id="<?php echo $this->get_field_id('laawws_open_hours_sun2'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_sun2'); ?>" class="laawws-open-hrs-sun2" >
    641 
    642                                                 <?php $this->laawws_time_picker($laawws_open_hours_sun2); ?>
    643 
    644                                         </select>
    645 
    646                                 </span>
    647 
     566                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_sun2' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_sun2' ) ); ?>" class="laawws-open-hrs-sun2">
     567                                                <?php $this->laawws_time_picker( $laawws_open_hours_sun2 ); ?>
     568                                        </select>
     569                                </span>
    648570                                <span class="laawws-date-right">
    649 
    650                                         <!-- Closing time for Sunday -->
    651                                 <select id="<?php echo $this->get_field_id('laawws_close_hours_sun2'); ?>" name="<?php echo $this->get_field_name('laawws_close_hours_sun2'); ?>">
    652 
    653                                         <?php $this->laawws_time_picker($laawws_close_hours_sun2); ?>
    654 
    655                                 </select>
    656                                 </span>
    657 
    658                 </p>
    659 
    660 
    661                 <!-- Sunday -->
     571                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_close_hours_sun2' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_close_hours_sun2' ) ); ?>">
     572                                                <?php $this->laawws_time_picker( $laawws_close_hours_sun2 ); ?>
     573                                        </select>
     574                                </span>
     575                        </p>
     576
     577                        <!-- Sunday -->
    662578                        <p class="clearfix">
    663 
    664579                                <span class="laawws-date-left sun">
    665 
    666                                 <input id="<?php echo $this->get_field_id('laawws_open_hours_sun_checked'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_sun_checked'); ?>" class="widefat" type="checkbox" value="sun" <?php checked('sun', $laawws_open_hours_sun_checked); ?> />
    667 
    668                                         <label for="<?php echo $this->get_field_id('laawws_open_hours_sun'); ?>">Sun: </label>
    669                                 </span>
    670 
     580                                        <input id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_sun_checked' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_sun_checked' ) ); ?>" class="widefat" type="checkbox" value="sun" <?php checked( 'sun', $laawws_open_hours_sun_checked ); ?> />
     581                                        <label for="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_sun' ) ); ?>"><?php esc_html_e( 'Sun:', 'logo-and-address-widget-with-schema' ); ?></label>
     582                                </span>
    671583                                <span class="laawws-date-center">
    672 
    673                                         <!-- Starting time for Sunday-->
    674                                         <select id="<?php echo $this->get_field_id('laawws_open_hours_sun'); ?>" name="<?php echo $this->get_field_name('laawws_open_hours_sun'); ?>" class="laawws-open-hrs-sun" >
    675 
    676                                                 <?php $this->laawws_time_picker($laawws_open_hours_sun); ?>
    677 
    678                                         </select>
    679 
    680                                 </span>
    681 
     584                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_open_hours_sun' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_open_hours_sun' ) ); ?>" class="laawws-open-hrs-sun">
     585                                                <?php $this->laawws_time_picker( $laawws_open_hours_sun ); ?>
     586                                        </select>
     587                                </span>
    682588                                <span class="laawws-date-right">
    683 
    684                                         <!-- Closing time for Sunday -->
    685                                 <select id="<?php echo $this->get_field_id('laawws_close_hours_sun'); ?>" name="<?php echo $this->get_field_name('laawws_close_hours_sun'); ?>">
    686 
    687                                         <?php $this->laawws_time_picker($laawws_close_hours_sun); ?>
    688 
    689                                 </select>
    690 
    691                                 </span>
    692 
    693                 </p>
    694 
    695                 <hr class="laawws-btm-line">
    696 
     589                                        <select id="<?php echo esc_attr( $this->get_field_id( 'laawws_close_hours_sun' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'laawws_close_hours_sun' ) ); ?>">
     590                                                <?php $this->laawws_time_picker( $laawws_close_hours_sun ); ?>
     591                                        </select>
     592                                </span>
     593                        </p>
     594
     595                        <hr class="laawws-btm-line">
    697596                </div>
    698 
    699597                <?php
    700 
    701         } // Function close
     598        }
     599
     600        /**
     601         * Sanitize widget form values as they are saved.
     602         *
     603         * @param array $new_instance Values just sent to be saved.
     604         * @param array $old_instance Previously saved values from database.
     605         * @return array
     606         */
     607        public function update( $new_instance, $old_instance ) {
     608                $instance = array();
     609
     610                $instance['laawws_widget_title']         = isset( $new_instance['laawws_widget_title'] ) ? sanitize_text_field( $new_instance['laawws_widget_title'] ) : '';
     611                $instance['laawws_footer_logo']          = isset( $new_instance['laawws_footer_logo'] ) ? esc_url_raw( $new_instance['laawws_footer_logo'] ) : '';
     612                $instance['laawws_footer_logo_alt_text'] = isset( $new_instance['laawws_footer_logo_alt_text'] ) ? sanitize_text_field( $new_instance['laawws_footer_logo_alt_text'] ) : '';
     613                $instance['laawws_image_radio_buttons']  = isset( $new_instance['laawws_image_radio_buttons'] )
     614                        ? $this->sanitize_choice( $new_instance['laawws_image_radio_buttons'], array( 'left', 'center', 'right' ), 'left' )
     615                        : 'left';
     616
     617                $instance['laawws_address_line1']         = isset( $new_instance['laawws_address_line1'] ) ? sanitize_text_field( $new_instance['laawws_address_line1'] ) : '';
     618                $instance['laawws_address_line2']         = isset( $new_instance['laawws_address_line2'] ) ? sanitize_text_field( $new_instance['laawws_address_line2'] ) : '';
     619                $instance['laawws_city']                  = isset( $new_instance['laawws_city'] ) ? sanitize_text_field( $new_instance['laawws_city'] ) : '';
     620                $instance['laawws_state']                 = isset( $new_instance['laawws_state'] ) ? sanitize_text_field( $new_instance['laawws_state'] ) : '';
     621                $instance['laawws_zip']                   = isset( $new_instance['laawws_zip'] ) ? sanitize_text_field( $new_instance['laawws_zip'] ) : '';
     622                $instance['laawws_address_radio_buttons'] = isset( $new_instance['laawws_address_radio_buttons'] )
     623                        ? $this->sanitize_choice( $new_instance['laawws_address_radio_buttons'], array( 'icon', 'font-awesome', 'custom-image' ), 'icon' )
     624                        : 'icon';
     625                $instance['laawws_address_fawesome_icon'] = isset( $new_instance['laawws_address_fawesome_icon'] )
     626                        ? preg_replace( '/[^a-z0-9\-]/', '', strtolower( sanitize_text_field( $new_instance['laawws_address_fawesome_icon'] ) ) )
     627                        : '';
     628                $instance['laawws_address_custom_image']  = isset( $new_instance['laawws_address_custom_image'] ) ? esc_url_raw( $new_instance['laawws_address_custom_image'] ) : '';
     629
     630                $instance['laawws_phone']             = isset( $new_instance['laawws_phone'] ) ? sanitize_text_field( $new_instance['laawws_phone'] ) : '';
     631                $instance['laawws_fax']               = isset( $new_instance['laawws_fax'] ) ? sanitize_text_field( $new_instance['laawws_fax'] ) : '';
     632                $instance['laawws_email']             = isset( $new_instance['laawws_email'] ) ? sanitize_email( $new_instance['laawws_email'] ) : '';
     633                $instance['laawws_epf_radio_buttons'] = isset( $new_instance['laawws_epf_radio_buttons'] )
     634                        ? $this->sanitize_choice( $new_instance['laawws_epf_radio_buttons'], array( 'icons', 'label' ), 'icons' )
     635                        : 'icons';
     636
     637                $instance['laawws_open_hours']       = ( ! empty( $new_instance['laawws_open_hours'] ) && 'open' === $new_instance['laawws_open_hours'] ) ? 'open' : '';
     638                $instance['laawws_open_hours_title'] = isset( $new_instance['laawws_open_hours_title'] ) ? sanitize_text_field( $new_instance['laawws_open_hours_title'] ) : '';
     639
     640                $instance['laawws_open_hours_mon_fri']         = isset( $new_instance['laawws_open_hours_mon_fri'] ) ? $this->sanitize_time( $new_instance['laawws_open_hours_mon_fri'] ) : ' ';
     641                $instance['laawws_close_hours_mon_fri']        = isset( $new_instance['laawws_close_hours_mon_fri'] ) ? $this->sanitize_time( $new_instance['laawws_close_hours_mon_fri'] ) : ' ';
     642                $instance['laawws_open_hours_mon_fri_checked'] = ( ! empty( $new_instance['laawws_open_hours_mon_fri_checked'] ) && 'monfri' === $new_instance['laawws_open_hours_mon_fri_checked'] ) ? 'monfri' : '';
     643
     644                $instance['laawws_open_hours_mon']         = isset( $new_instance['laawws_open_hours_mon'] ) ? $this->sanitize_time( $new_instance['laawws_open_hours_mon'] ) : ' ';
     645                $instance['laawws_close_hours_mon']        = isset( $new_instance['laawws_close_hours_mon'] ) ? $this->sanitize_time( $new_instance['laawws_close_hours_mon'] ) : ' ';
     646                $instance['laawws_open_hours_mon_checked'] = ( ! empty( $new_instance['laawws_open_hours_mon_checked'] ) && 'mon' === $new_instance['laawws_open_hours_mon_checked'] ) ? 'mon' : '';
     647
     648                $instance['laawws_open_hours_tue']         = isset( $new_instance['laawws_open_hours_tue'] ) ? $this->sanitize_time( $new_instance['laawws_open_hours_tue'] ) : ' ';
     649                $instance['laawws_close_hours_tue']        = isset( $new_instance['laawws_close_hours_tue'] ) ? $this->sanitize_time( $new_instance['laawws_close_hours_tue'] ) : ' ';
     650                $instance['laawws_open_hours_tue_checked'] = ( ! empty( $new_instance['laawws_open_hours_tue_checked'] ) && 'tue' === $new_instance['laawws_open_hours_tue_checked'] ) ? 'tue' : '';
     651
     652                $instance['laawws_open_hours_wed']         = isset( $new_instance['laawws_open_hours_wed'] ) ? $this->sanitize_time( $new_instance['laawws_open_hours_wed'] ) : ' ';
     653                $instance['laawws_close_hours_wed']        = isset( $new_instance['laawws_close_hours_wed'] ) ? $this->sanitize_time( $new_instance['laawws_close_hours_wed'] ) : ' ';
     654                $instance['laawws_open_hours_wed_checked'] = ( ! empty( $new_instance['laawws_open_hours_wed_checked'] ) && 'wed' === $new_instance['laawws_open_hours_wed_checked'] ) ? 'wed' : '';
     655
     656                $instance['laawws_open_hours_thu']         = isset( $new_instance['laawws_open_hours_thu'] ) ? $this->sanitize_time( $new_instance['laawws_open_hours_thu'] ) : ' ';
     657                $instance['laawws_close_hours_thu']        = isset( $new_instance['laawws_close_hours_thu'] ) ? $this->sanitize_time( $new_instance['laawws_close_hours_thu'] ) : ' ';
     658                $instance['laawws_open_hours_thu_checked'] = ( ! empty( $new_instance['laawws_open_hours_thu_checked'] ) && 'thu' === $new_instance['laawws_open_hours_thu_checked'] ) ? 'thu' : '';
     659
     660                $instance['laawws_open_hours_fri']         = isset( $new_instance['laawws_open_hours_fri'] ) ? $this->sanitize_time( $new_instance['laawws_open_hours_fri'] ) : ' ';
     661                $instance['laawws_close_hours_fri']        = isset( $new_instance['laawws_close_hours_fri'] ) ? $this->sanitize_time( $new_instance['laawws_close_hours_fri'] ) : ' ';
     662                $instance['laawws_open_hours_fri_checked'] = ( ! empty( $new_instance['laawws_open_hours_fri_checked'] ) && 'fri' === $new_instance['laawws_open_hours_fri_checked'] ) ? 'fri' : '';
     663
     664                $instance['laawws_open_hours_sun2']          = isset( $new_instance['laawws_open_hours_sun2'] ) ? $this->sanitize_time( $new_instance['laawws_open_hours_sun2'] ) : ' ';
     665                $instance['laawws_close_hours_sun2']         = isset( $new_instance['laawws_close_hours_sun2'] ) ? $this->sanitize_time( $new_instance['laawws_close_hours_sun2'] ) : ' ';
     666                $instance['laawws_open_hours_sun_checked2']  = ( ! empty( $new_instance['laawws_open_hours_sun_checked2'] ) && 'sun2' === $new_instance['laawws_open_hours_sun_checked2'] ) ? 'sun2' : '';
     667
     668                $instance['laawws_open_hours_sun']         = isset( $new_instance['laawws_open_hours_sun'] ) ? $this->sanitize_time( $new_instance['laawws_open_hours_sun'] ) : ' ';
     669                $instance['laawws_close_hours_sun']        = isset( $new_instance['laawws_close_hours_sun'] ) ? $this->sanitize_time( $new_instance['laawws_close_hours_sun'] ) : ' ';
     670                $instance['laawws_open_hours_sun_checked'] = ( ! empty( $new_instance['laawws_open_hours_sun_checked'] ) && 'sun' === $new_instance['laawws_open_hours_sun_checked'] ) ? 'sun' : '';
     671
     672                $instance['laawws_address_schema_buttons'] = isset( $new_instance['laawws_address_schema_buttons'] )
     673                        ? $this->sanitize_choice( $new_instance['laawws_address_schema_buttons'], array( 'on', 'off' ), 'on' )
     674                        : 'on';
     675
     676                return $instance;
     677        }
    702678
    703679        /**
    704680         * Front-end display of widget.
    705681         *
    706          * @see WP_Widget::widget()
    707          *
    708          * @param array $args Widget arguments.
     682         * @param array $args     Widget arguments.
    709683         * @param array $instance Saved values from database.
    710684         */
    711         public function update($new_instance, $old_instance) {
    712 
    713                 $instance = $old_instance;
    714 
    715                 // Widget Title
    716                 $instance['laawws_widget_title'] = ( ! empty( $new_instance['laawws_widget_title'] ) ) ? $new_instance['laawws_widget_title'] : '';
    717 
    718                 // Logo Section
    719                 $instance['laawws_footer_logo'] = ( ! empty( $new_instance['laawws_footer_logo'] ) ) ? esc_attr($new_instance['laawws_footer_logo']) : '';
    720 
    721                 $instance['laawws_footer_logo_alt_text'] = ( ! empty( $new_instance['laawws_footer_logo_alt_text'] ) ) ? esc_attr($new_instance['laawws_footer_logo_alt_text']) : '';
    722 
    723                 $instance['laawws_image_radio_buttons'] = ! empty( ($new_instance['laawws_image_radio_buttons'] )) ? esc_attr($new_instance['laawws_image_radio_buttons']) : '';
    724 
    725                 // Address Section
    726                 $instance['laawws_address_line1'] = ( ! empty( $new_instance['laawws_address_line1'] ) ) ? esc_attr($new_instance['laawws_address_line1']) : '';
    727 
    728                 $instance['laawws_address_line2'] = ( ! empty( $new_instance['laawws_address_line2'] ) ) ? esc_attr($new_instance['laawws_address_line2']) : '';
    729 
    730                 $instance['laawws_city'] = ( ! empty( $new_instance['laawws_city'] ) ) ? esc_attr($new_instance['laawws_city']) : '';
    731 
    732                 $instance['laawws_state'] = ( ! empty( $new_instance['laawws_state'] ) ) ? esc_attr($new_instance['laawws_state']) : '';
    733 
    734                 $instance['laawws_zip'] = ( ! empty( $new_instance['laawws_zip'] ) ) ? esc_attr($new_instance['laawws_zip']) : '';
    735 
    736                 $instance['laawws_address_radio_buttons'] = ( ! empty( $new_instance['laawws_address_radio_buttons'] ) ) ? esc_attr($new_instance['laawws_address_radio_buttons']) : '';
    737 
    738                 $instance['laawws_address_fawesome_icon'] = ( ! empty( $new_instance['laawws_address_fawesome_icon'] ) ) ? esc_attr($new_instance['laawws_address_fawesome_icon']) : '';
    739 
    740                 $instance['laawws_address_custom_image'] = ( ! empty( $new_instance['laawws_address_custom_image'] ) ) ? esc_attr($new_instance['laawws_address_custom_image']) : '';
    741 
    742 
    743                 // Phone/Fax/Email Section
    744                 $instance['laawws_phone'] = ( ! empty( $new_instance['laawws_phone'] ) ) ? esc_attr($new_instance['laawws_phone']) : '';
    745 
    746                 $instance['laawws_fax'] = ( ! empty( $new_instance['laawws_fax'] ) ) ? esc_attr($new_instance['laawws_fax']) : '';
    747 
    748                 $instance['laawws_email'] = ( ! empty( $new_instance['laawws_email'] ) ) ? esc_attr($new_instance['laawws_email']) : '';
    749 
    750                 $instance['laawws_epf_radio_buttons'] = ( ! empty( $new_instance['laawws_epf_radio_buttons'] ) ) ? esc_attr($new_instance['laawws_epf_radio_buttons']) : '';
    751 
    752 
    753                 // Open Hours Section
    754                 $instance['laawws_open_hours'] = ( ! empty( $new_instance['laawws_open_hours'] ) ) ? esc_attr($new_instance['laawws_open_hours']) : '';
    755 
    756                 // Hours Title
    757                 $instance['laawws_open_hours_title'] = ( ! empty( $new_instance['laawws_open_hours_title'] ) ) ? esc_attr($new_instance['laawws_open_hours_title']) : '';
    758 
    759 
    760                 // Monday - Friday
    761                 $instance['laawws_open_hours_mon_fri'] = ( ! empty( $new_instance['laawws_open_hours_mon_fri'] ) ) ? esc_attr($new_instance['laawws_open_hours_mon_fri']) : '';
    762 
    763                 $instance['laawws_close_hours_mon_fri'] = ( ! empty( $new_instance['laawws_close_hours_mon_fri'] ) ) ? esc_attr($new_instance['laawws_close_hours_mon_fri']) : '';
    764 
    765                 $instance['laawws_open_hours_mon_fri_checked'] = ( ! empty( $new_instance['laawws_open_hours_mon_fri_checked'] ) ) ? esc_attr($new_instance['laawws_open_hours_mon_fri_checked']) : '';
    766 
    767 
    768                 // Monday
    769                 $instance['laawws_open_hours_mon'] = ( ! empty( $new_instance['laawws_open_hours_mon'] ) ) ? esc_attr($new_instance['laawws_open_hours_mon']) : '';
    770 
    771                 $instance['laawws_close_hours_mon'] = ( ! empty( $new_instance['laawws_close_hours_mon'] ) ) ? esc_attr($new_instance['laawws_close_hours_mon']) : '';
    772 
    773                 $instance['laawws_open_hours_mon_checked'] = ( ! empty( $new_instance['laawws_open_hours_mon_checked'] ) ) ? esc_attr($new_instance['laawws_open_hours_mon_checked']) : '';
    774 
    775                 // Tuesday
    776                 $instance['laawws_open_hours_tue'] = ( ! empty( $new_instance['laawws_open_hours_tue'] ) ) ? esc_attr($new_instance['laawws_open_hours_tue']) : '';
    777 
    778                 $instance['laawws_close_hours_tue'] = ( ! empty( $new_instance['laawws_close_hours_tue'] ) ) ? esc_attr($new_instance['laawws_close_hours_tue']) : '';
    779 
    780                 $instance['laawws_open_hours_tue_checked'] = ( ! empty( $new_instance['laawws_open_hours_tue_checked'] ) ) ? esc_attr($new_instance['laawws_open_hours_tue_checked']) : '';
    781 
    782                 // Wedneday
    783                 $instance['laawws_open_hours_wed'] = ( ! empty( $new_instance['laawws_open_hours_wed'] ) ) ? esc_attr($new_instance['laawws_open_hours_wed']) : '';
    784 
    785                 $instance['laawws_close_hours_wed'] = ( ! empty( $new_instance['laawws_close_hours_wed'] ) ) ? esc_attr($new_instance['laawws_close_hours_wed']) : '';
    786 
    787                 $instance['laawws_open_hours_wed_checked'] = ( ! empty( $new_instance['laawws_open_hours_wed_checked'] ) ) ? esc_attr($new_instance['laawws_open_hours_wed_checked']) : '';
    788 
    789                 // Thursday
    790                 $instance['laawws_open_hours_thu'] = ( ! empty( $new_instance['laawws_open_hours_thu'] ) ) ? esc_attr($new_instance['laawws_open_hours_thu']) : '';
    791 
    792                 $instance['laawws_close_hours_thu'] = ( ! empty( $new_instance['laawws_close_hours_thu'] ) ) ? esc_attr($new_instance['laawws_close_hours_thu']) : '';
    793 
    794                 $instance['laawws_open_hours_thu_checked'] = ( ! empty( $new_instance['laawws_open_hours_thu_checked'] ) ) ? esc_attr($new_instance['laawws_open_hours_thu_checked']) : '';
    795 
    796                 // Friday
    797                 $instance['laawws_open_hours_fri'] = ( ! empty( $new_instance['laawws_open_hours_fri'] ) ) ? esc_attr($new_instance['laawws_open_hours_fri']) : '';
    798 
    799                 $instance['laawws_close_hours_fri'] = ( ! empty( $new_instance['laawws_close_hours_fri'] ) ) ? esc_attr($new_instance['laawws_close_hours_fri']) : '';
    800 
    801                 $instance['laawws_open_hours_fri_checked'] = ( ! empty( $new_instance['laawws_open_hours_fri_checked'] ) ) ? esc_attr($new_instance['laawws_open_hours_fri_checked']) : '';
    802 
    803                 // Saturday
    804                 $instance['laawws_open_hours_sun2'] = ( ! empty( $new_instance['laawws_open_hours_sun2'] ) ) ? esc_attr($new_instance['laawws_open_hours_sun2']) : '';
    805 
    806                 $instance['laawws_close_hours_sun2'] = ( ! empty( $new_instance['laawws_close_hours_sun2'] ) ) ? esc_attr($new_instance['laawws_close_hours_sun2']) : '';
    807 
    808                 $instance['laawws_open_hours_sun_checked2'] = ( ! empty( $new_instance['laawws_open_hours_sun_checked2'] ) ) ? esc_attr($new_instance['laawws_open_hours_sun_checked2']) : '';
    809 
    810                 // Sunday
    811                 $instance['laawws_open_hours_sun'] = ( ! empty( $new_instance['laawws_open_hours_sun'] ) ) ? esc_attr($new_instance['laawws_open_hours_sun']) : '';
    812 
    813                 $instance['laawws_close_hours_sun'] = ( ! empty( $new_instance['laawws_close_hours_sun'] ) ) ? esc_attr($new_instance['laawws_close_hours_sun']) : '';
    814 
    815                 $instance['laawws_open_hours_sun_checked'] = ( ! empty( $new_instance['laawws_open_hours_sun_checked'] ) ) ? esc_attr($new_instance['laawws_open_hours_sun_checked']) : '';
    816 
    817 
    818                 // Address Schema
    819                 $instance['laawws_address_schema_buttons'] = ( ! empty( $new_instance['laawws_address_schema_buttons'] ) ) ? esc_attr($new_instance['laawws_address_schema_buttons']) : '';
    820 
    821 
    822                 return $instance;
    823         }
    824 
    825 
    826         // Display widget
    827         public function widget($args, $instance) {
    828 
    829         extract( $args );
    830 
    831         // Widget Title
    832         $laawws_widget_title = ! empty( $instance['laawws_widget_title'] ) ? $instance['laawws_widget_title'] : '';
    833 
    834         // Logo Section
    835         $laawws_footer_logo = ! empty( $instance['laawws_footer_logo'] ) ? $instance['laawws_footer_logo'] : '';
    836         $laawws_footer_logo_alt_text = ! empty( $instance['laawws_footer_logo_alt_text'] ) ? $instance['laawws_footer_logo_alt_text'] : '';
    837         $laawws_image_radio_buttons = ! empty( $instance['laawws_image_radio_buttons'] ) ? $instance['laawws_image_radio_buttons'] : '';
    838 
    839         // Address Section
    840         $laawws_address_line1 = ! empty( $instance['laawws_address_line1'] ) ? $instance['laawws_address_line1'] : '';
    841         $laawws_address_line2 = ! empty( $instance['laawws_address_line2'] ) ? $instance['laawws_address_line2'] : '';
    842         $laawws_city = ! empty( $instance['laawws_city'] ) ? $instance['laawws_city'] : '';
    843         $laawws_state = ! empty( $instance['laawws_state'] ) ? $instance['laawws_state'] : '';
    844         $laawws_zip = ! empty( $instance['laawws_zip'] ) ? $instance['laawws_zip'] : '';
    845         $laawws_address_radio_buttons = ! empty( $instance['laawws_address_radio_buttons'] ) ? $instance['laawws_address_radio_buttons'] : '';
    846         $laawws_address_fawesome_icon = ! empty( $instance['laawws_address_fawesome_icon'] ) ? $instance['laawws_address_fawesome_icon'] : '';
    847         $laawws_address_custom_image = ! empty( $instance['laawws_address_custom_image'] ) ? $instance['laawws_address_custom_image'] : '';
    848 
    849 
    850         // Email/Phone/Fax Section Section
    851         $laawws_email = ! empty( $instance['laawws_email'] ) ? $instance['laawws_email'] : '';
    852         $laawws_phone = ! empty( $instance['laawws_phone'] ) ? $instance['laawws_phone'] : '';
    853         $laawws_fax = ! empty( $instance['laawws_fax'] ) ? $instance['laawws_fax'] : '';
    854         $laawws_epf_radio_buttons = ! empty( $instance['laawws_epf_radio_buttons'] ) ? $instance['laawws_epf_radio_buttons'] : '';
    855 
    856 
    857         // Open Hours Section
    858         $laawws_open_hours = ! empty( $instance['laawws_open_hours'] ) ? $instance['laawws_open_hours'] : '';
    859 
    860         // Hours title
    861         $laawws_open_hours_title = ! empty( $instance['laawws_open_hours_title'] ) ? $instance['laawws_open_hours_title'] : '';
    862 
    863         // Monday - Friday
    864         $laawws_open_hours_mon_fri = ! empty( $instance['laawws_open_hours_mon_fri'] ) ? $instance['laawws_open_hours_mon_fri'] : '';
    865         $laawws_close_hours_mon_fri = ! empty( $instance['laawws_close_hours_mon_fri'] ) ? $instance['laawws_close_hours_mon_fri'] : '';
    866         $laawws_open_hours_mon_fri_checked = ! empty( $instance['laawws_open_hours_mon_fri_checked'] ) ? $instance['laawws_open_hours_mon_fri_checked'] : '';
    867 
    868         // Monday
    869         $laawws_open_hours_mon = ! empty( $instance['laawws_open_hours_mon'] ) ? $instance['laawws_open_hours_mon'] : '';
    870         $laawws_close_hours_mon = ! empty( $instance['laawws_close_hours_mon'] ) ? $instance['laawws_close_hours_mon'] : '';
    871         $laawws_open_hours_mon_checked = ! empty( $instance['laawws_open_hours_mon_checked'] ) ? $instance['laawws_open_hours_mon_checked'] : '';
    872 
    873         // Tuesday
    874         $laawws_open_hours_tue = ! empty( $instance['laawws_open_hours_tue'] ) ? $instance['laawws_open_hours_tue'] : '';
    875         $laawws_close_hours_tue = ! empty( $instance['laawws_close_hours_tue'] ) ? $instance['laawws_close_hours_tue'] : '';
    876         $laawws_open_hours_tue_checked = ! empty( $instance['laawws_open_hours_tue_checked'] ) ? $instance['laawws_open_hours_tue_checked'] : '';
    877 
    878         // Wednesday
    879         $laawws_open_hours_wed = ! empty( $instance['laawws_open_hours_wed'] ) ? $instance['laawws_open_hours_wed'] : '';
    880         $laawws_close_hours_wed = ! empty( $instance['laawws_close_hours_wed'] ) ? $instance['laawws_close_hours_wed'] : '';
    881         $laawws_open_hours_wed_checked = ! empty( $instance['laawws_open_hours_wed_checked'] ) ? $instance['laawws_open_hours_wed_checked'] : '';
    882 
    883         // Thursday
    884         $laawws_open_hours_thu = ! empty( $instance['laawws_open_hours_thu'] ) ? $instance['laawws_open_hours_thu'] : '';
    885         $laawws_close_hours_thu = ! empty( $instance['laawws_close_hours_thu'] ) ? $instance['laawws_close_hours_thu'] : '';
    886         $laawws_open_hours_thu_checked = ! empty( $instance['laawws_open_hours_thu_checked'] ) ? $instance['laawws_open_hours_thu_checked'] : '';
    887 
    888         // Friday
    889         $laawws_open_hours_fri = ! empty( $instance['laawws_open_hours_fri'] ) ? $instance['laawws_open_hours_fri'] : '';
    890         $laawws_close_hours_fri = ! empty( $instance['laawws_close_hours_fri'] ) ? $instance['laawws_close_hours_fri'] : '';
    891         $laawws_open_hours_fri_checked = ! empty( $instance['laawws_open_hours_fri_checked'] ) ? $instance['laawws_open_hours_fri_checked'] : '';
    892 
    893         // Saturday
    894         $laawws_open_hours_sun2 = ! empty( $instance['laawws_open_hours_sun2'] ) ? $instance['laawws_open_hours_sun2'] : '';
    895         $laawws_close_hours_sun2 = ! empty( $instance['laawws_close_hours_sun2'] ) ? $instance['laawws_close_hours_sun2'] : '';
    896         $laawws_open_hours_sun_checked2 = ! empty( $instance['laawws_open_hours_sun_checked2'] ) ? $instance['laawws_open_hours_sun_checked2'] : '';
    897 
    898         // Sunday
    899         $laawws_open_hours_sun = ! empty( $instance['laawws_open_hours_sun'] ) ? $instance['laawws_open_hours_sun'] : '';
    900         $laawws_close_hours_sun = ! empty( $instance['laawws_close_hours_sun'] ) ? $instance['laawws_close_hours_sun'] : '';
    901         $laawws_open_hours_sun_checked = ! empty( $instance['laawws_open_hours_sun_checked'] ) ? $instance['laawws_open_hours_sun_checked'] : '';
    902 
    903 
    904         // Address Schema
    905         $laawws_address_schema_buttons = ! empty( $instance['laawws_address_schema_buttons'] ) ? $instance['laawws_address_schema_buttons'] : '';
    906 
    907         // Get website name and URL
    908         $laawws_blog_url = get_site_url();
    909         $laawws_blog_name = get_bloginfo('name');
    910 
    911         ob_start();
    912         echo $before_widget;
    913 
    914         // Display the widget
    915         echo '<div class="widget-text laawws-footer-logo-address ">';
    916         echo '<div class="clearfix">';
    917 
    918         // Check if title is set
    919         if ( $laawws_widget_title ) {
    920                 echo $before_title . $laawws_widget_title . $after_title ;
    921         }
    922 
    923         // Check if Logo details are set
    924         if($laawws_image_radio_buttons == "left") {
    925                 $laawws_img_class = " alignleft";
    926         } elseif ($laawws_image_radio_buttons == "center") {
    927                 $laawws_img_class = " aligncenter";
    928         } else {
    929                 $laawws_img_class = " alignright";
    930         }
    931 
    932         // Check if Logo is set
    933         if ( $laawws_footer_logo  ) {
    934                 if($laawws_footer_logo_alt_text ) {
    935                         echo '<div class="wsx-ft-clsFooterlogo"><a href="'.$laawws_blog_url.'" title="'.$laawws_footer_logo_alt_text.'"><img class='. $laawws_img_class.' src="'.$laawws_footer_logo.'" alt="'.$laawws_footer_logo_alt_text.'"></a></div>';
     685        public function widget( $args, $instance ) {
     686                $before_widget = isset( $args['before_widget'] ) ? $args['before_widget'] : '';
     687                $after_widget  = isset( $args['after_widget'] ) ? $args['after_widget'] : '';
     688                $before_title  = isset( $args['before_title'] ) ? $args['before_title'] : '';
     689                $after_title   = isset( $args['after_title'] ) ? $args['after_title'] : '';
     690
     691                $laawws_widget_title              = $this->get_instance_text( $instance, 'laawws_widget_title' );
     692                $laawws_footer_logo               = ! empty( $instance['laawws_footer_logo'] ) ? esc_url( $instance['laawws_footer_logo'] ) : '';
     693                $laawws_footer_logo_alt_text      = $this->get_instance_text( $instance, 'laawws_footer_logo_alt_text' );
     694                $laawws_image_radio_buttons       = $this->get_instance_text( $instance, 'laawws_image_radio_buttons' );
     695                $laawws_address_line1             = $this->get_instance_text( $instance, 'laawws_address_line1' );
     696                $laawws_address_line2             = $this->get_instance_text( $instance, 'laawws_address_line2' );
     697                $laawws_city                      = $this->get_instance_text( $instance, 'laawws_city' );
     698                $laawws_state                     = $this->get_instance_text( $instance, 'laawws_state' );
     699                $laawws_zip                       = $this->get_instance_text( $instance, 'laawws_zip' );
     700                $laawws_address_radio_buttons     = $this->get_instance_text( $instance, 'laawws_address_radio_buttons' );
     701                $laawws_address_fawesome_icon     = $this->get_instance_text( $instance, 'laawws_address_fawesome_icon' );
     702                $laawws_address_custom_image      = ! empty( $instance['laawws_address_custom_image'] ) ? esc_url( $instance['laawws_address_custom_image'] ) : '';
     703                $laawws_email                     = $this->get_instance_text( $instance, 'laawws_email' );
     704                $laawws_phone                     = $this->get_instance_text( $instance, 'laawws_phone' );
     705                $laawws_fax                       = $this->get_instance_text( $instance, 'laawws_fax' );
     706                $laawws_epf_radio_buttons         = $this->get_instance_text( $instance, 'laawws_epf_radio_buttons' );
     707                $laawws_open_hours                = $this->get_instance_text( $instance, 'laawws_open_hours' );
     708                $laawws_open_hours_title          = $this->get_instance_text( $instance, 'laawws_open_hours_title' );
     709                $laawws_open_hours_mon_fri        = $this->get_instance_text( $instance, 'laawws_open_hours_mon_fri' );
     710                $laawws_close_hours_mon_fri       = $this->get_instance_text( $instance, 'laawws_close_hours_mon_fri' );
     711                $laawws_open_hours_mon_fri_checked = $this->get_instance_text( $instance, 'laawws_open_hours_mon_fri_checked' );
     712                $laawws_open_hours_mon            = $this->get_instance_text( $instance, 'laawws_open_hours_mon' );
     713                $laawws_close_hours_mon           = $this->get_instance_text( $instance, 'laawws_close_hours_mon' );
     714                $laawws_open_hours_mon_checked    = $this->get_instance_text( $instance, 'laawws_open_hours_mon_checked' );
     715                $laawws_open_hours_tue            = $this->get_instance_text( $instance, 'laawws_open_hours_tue' );
     716                $laawws_close_hours_tue           = $this->get_instance_text( $instance, 'laawws_close_hours_tue' );
     717                $laawws_open_hours_tue_checked    = $this->get_instance_text( $instance, 'laawws_open_hours_tue_checked' );
     718                $laawws_open_hours_wed            = $this->get_instance_text( $instance, 'laawws_open_hours_wed' );
     719                $laawws_close_hours_wed           = $this->get_instance_text( $instance, 'laawws_close_hours_wed' );
     720                $laawws_open_hours_wed_checked    = $this->get_instance_text( $instance, 'laawws_open_hours_wed_checked' );
     721                $laawws_open_hours_thu            = $this->get_instance_text( $instance, 'laawws_open_hours_thu' );
     722                $laawws_close_hours_thu           = $this->get_instance_text( $instance, 'laawws_close_hours_thu' );
     723                $laawws_open_hours_thu_checked    = $this->get_instance_text( $instance, 'laawws_open_hours_thu_checked' );
     724                $laawws_open_hours_fri            = $this->get_instance_text( $instance, 'laawws_open_hours_fri' );
     725                $laawws_close_hours_fri           = $this->get_instance_text( $instance, 'laawws_close_hours_fri' );
     726                $laawws_open_hours_fri_checked    = $this->get_instance_text( $instance, 'laawws_open_hours_fri_checked' );
     727                $laawws_open_hours_sun2           = $this->get_instance_text( $instance, 'laawws_open_hours_sun2' );
     728                $laawws_close_hours_sun2          = $this->get_instance_text( $instance, 'laawws_close_hours_sun2' );
     729                $laawws_open_hours_sun_checked2   = $this->get_instance_text( $instance, 'laawws_open_hours_sun_checked2' );
     730                $laawws_open_hours_sun            = $this->get_instance_text( $instance, 'laawws_open_hours_sun' );
     731                $laawws_close_hours_sun           = $this->get_instance_text( $instance, 'laawws_close_hours_sun' );
     732                $laawws_open_hours_sun_checked    = $this->get_instance_text( $instance, 'laawws_open_hours_sun_checked' );
     733                $laawws_address_schema_buttons    = $this->get_instance_text( $instance, 'laawws_address_schema_buttons' );
     734
     735                $laawws_blog_url  = home_url( '/' );
     736                $laawws_blog_name = get_bloginfo( 'name' );
     737
     738                // Theme-provided wrappers are printed unescaped (WordPress widget convention).
     739                echo $before_widget; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     740
     741                echo '<div class="widget-text laawws-footer-logo-address ">';
     742                echo '<div class="clearfix">';
     743
     744                if ( $laawws_widget_title ) {
     745                        echo $before_title . esc_html( $laawws_widget_title ) . $after_title; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     746                }
     747
     748                if ( 'left' === $laawws_image_radio_buttons ) {
     749                        $laawws_img_class = 'alignleft';
     750                } elseif ( 'center' === $laawws_image_radio_buttons ) {
     751                        $laawws_img_class = 'aligncenter';
    936752                } else {
    937                         echo '<div class="wsx-ft-clsFooterlogo"><a href="'.$laawws_blog_url.'" title="'.$laawws_blog_name.'"><img class='. $laawws_img_class.' src="'.$laawws_footer_logo.'" alt="'.$laawws_blog_name.'"></a></div>';
    938                 }
    939         }
    940 
    941         // Check if Address is set
    942         if ( $laawws_address_line1 || $laawws_address_line2) {
    943 
    944                 if($laawws_epf_radio_buttons == "label") {
    945 
    946                         echo '<div class="wsx-ft-office-location"><div class="clearfix laawws-btm-address"><span class="style3 wsx-ft-address">';
    947 
    948                         echo '<span class="laawws-address-line1">'.nl2br(html_entity_decode($laawws_address_line1)).'</span>';
    949 
    950                         echo '<span class="laawws-address-line2">'. html_entity_decode($laawws_address_line2).'</span>';
    951 
    952                         echo html_entity_decode($laawws_city).', '. html_entity_decode($laawws_state).' '. html_entity_decode($laawws_zip).'';
    953 
    954                         echo '</span></div></div>';
    955 
    956                 } else {
    957 
    958                                 // Check if Address section needs Fontawesome icon
    959                                 if($laawws_address_radio_buttons == "font-awesome") {
    960                                         echo '<div class="wsx-ft-office-location"><div class="clearfix laawws-btm-address"><i class="fa fa-'.$laawws_address_fawesome_icon.'"></i><span class="style3 wsx-ft-address">';
    961                                 } elseif ($laawws_address_radio_buttons == "custom-image") { // Check if Address section needs custom Background Image
    962                                         echo '<div class="wsx-ft-office-location" style="background: url('.$laawws_address_custom_image.')  no-repeat scroll left top; padding-left: 30px"><div class="clearfix laawws-btm-address"><span class="style3 wsx-ft-address">';
     753                        $laawws_img_class = 'alignright';
     754                }
     755
     756                if ( $laawws_footer_logo ) {
     757                        $logo_alt = $laawws_footer_logo_alt_text ? $laawws_footer_logo_alt_text : $laawws_blog_name;
     758                        printf(
     759                                '<div class="wsx-ft-clsFooterlogo"><a href="%1$s" title="%2$s"><img class="%3$s" src="%4$s" alt="%2$s"></a></div>',
     760                                esc_url( $laawws_blog_url ),
     761                                esc_attr( $logo_alt ),
     762                                esc_attr( $laawws_img_class ),
     763                                esc_url( $laawws_footer_logo )
     764                        );
     765                }
     766
     767                if ( $laawws_address_line1 || $laawws_address_line2 ) {
     768                        if ( 'label' === $laawws_epf_radio_buttons ) {
     769                                echo '<div class="wsx-ft-office-location"><div class="clearfix laawws-btm-address"><span class="style3 wsx-ft-address">';
     770                                echo '<span class="laawws-address-line1">' . esc_html( $laawws_address_line1 ) . '</span>';
     771                                echo '<span class="laawws-address-line2">' . esc_html( $laawws_address_line2 ) . '</span>';
     772                                echo esc_html( $laawws_city ) . ', ' . esc_html( $laawws_state ) . ' ' . esc_html( $laawws_zip );
     773                                echo '</span></div></div>';
     774                        } else {
     775                                if ( 'font-awesome' === $laawws_address_radio_buttons ) {
     776                                        printf(
     777                                                '<div class="wsx-ft-office-location"><div class="clearfix laawws-btm-address"><i class="fa fa-%s" aria-hidden="true"></i><span class="style3 wsx-ft-address">',
     778                                                esc_attr( $laawws_address_fawesome_icon )
     779                                        );
     780                                } elseif ( 'custom-image' === $laawws_address_radio_buttons ) {
     781                                        printf(
     782                                                '<div class="wsx-ft-office-location" style="background: url(%s) no-repeat scroll left top; padding-left: 30px"><div class="clearfix laawws-btm-address"><span class="style3 wsx-ft-address">',
     783                                                esc_url( $laawws_address_custom_image )
     784                                        );
    963785                                } else {
    964                                         // Use default fa-map-marker icon
    965                                         echo '<div class="wsx-ft-office-location"><div class="clearfix laawws-btm-address"><i class="fa fa-map-marker"></i><span class="style3 wsx-ft-address">';
     786                                        echo '<div class="wsx-ft-office-location"><div class="clearfix laawws-btm-address"><i class="fa fa-map-marker" aria-hidden="true"></i><span class="style3 wsx-ft-address">';
    966787                                }
    967788
    968                                 echo '<span class="laawws-address-line1">'.nl2br(html_entity_decode($laawws_address_line1)).'</span>';
    969 
    970                                 echo '<span class="laawws-address-line2">'. html_entity_decode($laawws_address_line2).'</span>';
    971 
    972                                 echo '<span class="laawws-address-line3">'. html_entity_decode($laawws_city).', '. html_entity_decode($laawws_state).' '. html_entity_decode($laawws_zip).'</span>';
    973 
     789                                echo '<span class="laawws-address-line1">' . esc_html( $laawws_address_line1 ) . '</span>';
     790                                echo '<span class="laawws-address-line2">' . esc_html( $laawws_address_line2 ) . '</span>';
     791                                echo '<span class="laawws-address-line3">' . esc_html( $laawws_city ) . ', ' . esc_html( $laawws_state ) . ' ' . esc_html( $laawws_zip ) . '</span>';
    974792                                echo '</span></div></div>';
    975                 }
    976         }
    977 
    978         // Add the address schema if enabled
    979         if($laawws_address_schema_buttons == "on") {
    980 
    981                 $laawws_address_schema = '<script type="application/ld+json">';
    982                 $laawws_address_schema .= '{';
    983                 $laawws_address_schema .= '"@context": "http://www.schema.org",
    984                   "@type": "Organization",';
    985 
    986                 if($laawws_blog_name != "") {
    987                   $laawws_address_schema .= '"name": "'.$laawws_blog_name.'",';
    988                 }
    989 
    990                 $laawws_address_schema .= '"address": {';
    991                         $laawws_address_schema .= '"@type": "PostalAddress",';
    992                         if($laawws_address_line1 != "") {
    993                                 $laawws_address_schema .= '"streetAddress": "'.$laawws_address_line1.'",';
    994                         }
    995                         if($laawws_zip != "") {
    996                                 $laawws_address_schema .= '"postOfficeBoxNumber": "'.$laawws_zip.'",';
    997                         }
    998                         if($laawws_city != "") {
    999                                         $laawws_address_schema .= '"addressLocality": "'.$laawws_city.'",';
     793                        }
     794                }
     795
     796                if ( 'on' === $laawws_address_schema_buttons ) {
     797                        $schema = array(
     798                                '@context' => 'https://schema.org',
     799                                '@type'    => 'Organization',
     800                        );
     801
     802                        if ( '' !== $laawws_blog_name ) {
     803                                $schema['name'] = $laawws_blog_name;
     804                        }
     805
     806                        $address = array(
     807                                '@type' => 'PostalAddress',
     808                        );
     809
     810                        if ( '' !== $laawws_address_line1 ) {
     811                                $address['streetAddress'] = $laawws_address_line1;
     812                        }
     813                        if ( '' !== $laawws_zip ) {
     814                                // Keep legacy field for backward-compatible schema output.
     815                                $address['postOfficeBoxNumber'] = $laawws_zip;
     816                        }
     817                        if ( '' !== $laawws_city ) {
     818                                $address['addressLocality'] = $laawws_city;
     819                        }
     820                        if ( '' !== $laawws_state ) {
     821                                $address['addressRegion'] = $laawws_state;
     822                        }
     823                        if ( '' !== $laawws_zip ) {
     824                                $address['postalCode'] = $laawws_zip;
     825                        }
     826
     827                        $schema['address'] = $address;
     828
     829                        $contact_point = array(
     830                                '@type' => 'ContactPoint',
     831                        );
     832                        if ( '' !== $laawws_phone ) {
     833                                $contact_point['telephone'] = $laawws_phone;
     834                        }
     835                        $schema['contactPoint'] = $contact_point;
     836
     837                        printf(
     838                                '<script type="application/ld+json">%s</script>',
     839                                wp_json_encode( $schema, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE )
     840                        );
     841                }
     842
     843                if ( $laawws_phone ) {
     844                        if ( 'label' === $laawws_epf_radio_buttons ) {
     845                                printf(
     846                                        '<span class="wsx-ft-phone">%1$s <a href="%2$s">%3$s</a></span>',
     847                                        esc_html__( 'Phone:', 'logo-and-address-widget-with-schema' ),
     848                                        esc_url( 'tel:' . preg_replace( '/[^0-9+\-().\s]/', '', $laawws_phone ) ),
     849                                        esc_html( $laawws_phone )
     850                                );
     851                        } else {
     852                                printf(
     853                                        '<span class="wsx-ft-phone"><i class="fa fa-phone" aria-hidden="true"></i><a href="%1$s">%2$s</a></span>',
     854                                        esc_url( 'tel:' . preg_replace( '/[^0-9+\-().\s]/', '', $laawws_phone ) ),
     855                                        esc_html( $laawws_phone )
     856                                );
     857                        }
     858                }
     859
     860                if ( $laawws_fax ) {
     861                        if ( 'label' === $laawws_epf_radio_buttons ) {
     862                                printf(
     863                                        '<span class="wsx-ft-fax">%1$s %2$s</span>',
     864                                        esc_html__( 'Fax:', 'logo-and-address-widget-with-schema' ),
     865                                        esc_html( $laawws_fax )
     866                                );
     867                        } else {
     868                                printf(
     869                                        '<span class="wsx-ft-fax"><i class="fa fa-fax" aria-hidden="true"></i> %s</span>',
     870                                        esc_html( $laawws_fax )
     871                                );
     872                        }
     873                }
     874
     875                if ( $laawws_email ) {
     876                        $email_display = antispambot( $laawws_email );
     877                        $email_href    = antispambot( $laawws_email, 1 );
     878                        if ( 'label' === $laawws_epf_radio_buttons ) {
     879                                printf(
     880                                        '<span class="wsx-ft-email">%1$s <a href="mailto:%2$s">%3$s</a></span>',
     881                                        esc_html__( 'Email:', 'logo-and-address-widget-with-schema' ),
     882                                        esc_attr( $email_href ),
     883                                        esc_html( $email_display )
     884                                );
     885                        } else {
     886                                printf(
     887                                        '<span class="wsx-ft-email"><i class="fa fa-envelope" aria-hidden="true"></i><a href="mailto:%1$s">%2$s</a></span>',
     888                                        esc_attr( $email_href ),
     889                                        esc_html( $email_display )
     890                                );
     891                        }
     892                }
     893
     894                if ( 'open' === $laawws_open_hours ) {
     895                        $hours_title = ( '' !== $laawws_open_hours_title )
     896                                ? $laawws_open_hours_title
     897                                : __( 'Business Hours', 'logo-and-address-widget-with-schema' );
     898
     899                        echo '<div class="laawws-open-hrs"><h4>' . esc_html( $hours_title ) . '</h4></div>';
     900
     901                        if ( 'monfri' === $laawws_open_hours_mon_fri_checked ) {
     902                                if ( ' ' !== $laawws_open_hours_mon_fri && ' ' !== $laawws_close_hours_mon_fri ) {
     903                                        printf(
     904                                                '<span class="clearfix laawws-mon-fri-time-wrap"><span class="laawws-day-label mon-fri">%1$s</span><span class="laawws-mon-fri-time">%2$s - %3$s</span></span>',
     905                                                esc_html__( 'Mon - Fri:', 'logo-and-address-widget-with-schema' ),
     906                                                esc_html( $laawws_open_hours_mon_fri ),
     907                                                esc_html( $laawws_close_hours_mon_fri )
     908                                        );
    1000909                                }
    1001                                 if($laawws_state != "") {
    1002                                 $laawws_address_schema .= '"addressRegion": "'.$laawws_state.'",';
    1003                         }
    1004                         if($laawws_zip != "") {
    1005                                 $laawws_address_schema .= '"postalCode": "'.$laawws_zip.'",';
    1006                         }
    1007                 $laawws_address_schema .= '},';
    1008                 $laawws_address_schema .= '"contactPoint": {';
    1009                         $laawws_address_schema .= '"@type": "ContactPoint",';
    1010                         if($laawws_zip != "") {
    1011                                 $laawws_address_schema .= '"telephone": "'.$laawws_phone.'"';
    1012                         }
    1013                 $laawws_address_schema .= '}}';
    1014 
    1015                 $laawws_address_schema .= '</script>';
    1016 
    1017                 echo $laawws_address_schema;
    1018         }
    1019 
    1020 
    1021         // Check if Phone is set
    1022         if ( $laawws_phone) {
    1023                 if($laawws_epf_radio_buttons == "label") {
    1024                         echo '<span class="wsx-ft-phone">Phone: <a href="tel:'.$laawws_phone.'">'.$laawws_phone.'</a></span>';
    1025                 } else {
    1026                         echo '<span class="wsx-ft-phone"><i class="fa fa-phone"></i><a href="tel:'.$laawws_phone.'">'.$laawws_phone.'</a></span>';
    1027                 }
    1028         }
    1029 
    1030         // Check if Fax is set
    1031         if ( $laawws_fax) {
    1032                 if($laawws_epf_radio_buttons == "label") {
    1033                         echo '<span class="wsx-ft-fax">Fax: '.$laawws_fax.'</span>';
    1034                 } else {
    1035                         echo '<span class="wsx-ft-fax"><i class="fa fa-fax"></i> '.$laawws_fax.'</span>';
    1036                 }
    1037         }
    1038 
    1039         // Check if Email is set
    1040         if ( $laawws_email) {
    1041                 if($laawws_epf_radio_buttons == "label") {
    1042                         echo '<span class="wsx-ft-email">Email: <a href="mailto:'.antispambot($laawws_email, 1).'">'.$laawws_email.'</a></span>';
    1043                 } else {
    1044                         echo '<span class="wsx-ft-email"><i class="fa fa-envelope"></i><a href="mailto:'.antispambot($laawws_email, 1).'">'.$laawws_email.'</a></span>';
    1045                 }
    1046         }
    1047 
    1048         // Show Business hours starts here
    1049         if($laawws_open_hours == "open") {
    1050 
    1051                 // Show Business Hours Title
    1052                 if($laawws_open_hours_title != "") {
    1053 
    1054                         echo '<div class="laawws-open-hrs"><h4>'.$laawws_open_hours_title.'</h4></div>';
    1055 
    1056                 } else {
    1057 
    1058                         echo '<div class="laawws-open-hrs"><h4>Business Hours</h4></div>';
    1059                 }
    1060 
    1061 
    1062 
    1063                 // Check if the operational hours is set for Monday
    1064                 if($laawws_open_hours_mon_fri_checked == "monfri") {
    1065 
    1066                         if($laawws_open_hours_mon_fri_checked == " "|| $laawws_close_hours_mon_fri == " ") {
    1067 
    1068910                        } else {
    1069                                 echo '<span class="clearfix laawws-mon-fri-time-wrap"><span class="laawws-day-label mon-fri">Mon - Fri:</span><span class="laawws-mon-fri-time">'.$laawws_open_hours_mon_fri.' - '.$laawws_close_hours_mon_fri .'</span></span>';
    1070                         }
    1071 
    1072                 } else {
    1073 
    1074                         // Check if the operational hours is set for Monday
    1075                         if($laawws_open_hours_mon_checked == "mon") {
    1076                                 if($laawws_open_hours_mon == " "|| $laawws_close_hours_mon == " ") {
    1077                                 } else {                        echo '<span class="clearfix"><span class="laawws-day-label">Mon:</span><span class="laawws-mon-time">'.$laawws_open_hours_mon.' - '.$laawws_close_hours_mon .'</span></span>';
     911                                if ( 'mon' === $laawws_open_hours_mon_checked && ' ' !== $laawws_open_hours_mon && ' ' !== $laawws_close_hours_mon ) {
     912                                        printf(
     913                                                '<span class="clearfix"><span class="laawws-day-label">%1$s</span><span class="laawws-mon-time">%2$s - %3$s</span></span>',
     914                                                esc_html__( 'Mon:', 'logo-and-address-widget-with-schema' ),
     915                                                esc_html( $laawws_open_hours_mon ),
     916                                                esc_html( $laawws_close_hours_mon )
     917                                        );
    1078918                                }
    1079                         }
    1080 
    1081                         // Check if the operational hours is set for Tuesday
    1082 
    1083                         if($laawws_open_hours_tue_checked == "tue") {
    1084                                 if($laawws_open_hours_tue == " "|| $laawws_close_hours_tue == " ") {
    1085                                 } else {
    1086                                         echo '<span class="clearfix"><span class="laawws-day-label">Tue:</span><span class="laawws-tue-time"> '.$laawws_open_hours_tue.' - '.$laawws_close_hours_tue .'</span></span>';
     919                                if ( 'tue' === $laawws_open_hours_tue_checked && ' ' !== $laawws_open_hours_tue && ' ' !== $laawws_close_hours_tue ) {
     920                                        printf(
     921                                                '<span class="clearfix"><span class="laawws-day-label">%1$s</span><span class="laawws-tue-time"> %2$s - %3$s</span></span>',
     922                                                esc_html__( 'Tue:', 'logo-and-address-widget-with-schema' ),
     923                                                esc_html( $laawws_open_hours_tue ),
     924                                                esc_html( $laawws_close_hours_tue )
     925                                        );
    1087926                                }
    1088                         }
    1089 
    1090                         // Check if the operational hours is set for Wednesday
    1091                         if($laawws_open_hours_wed_checked == "wed") {
    1092                                 if($laawws_open_hours_wed == " "|| $laawws_open_hours_wed == " ") {
    1093                                 } else {
    1094                                         echo '<span class="clearfix"><span class="laawws-day-label">Wed:</span><span class="laawws-wed-time"> '.$laawws_open_hours_wed.' - '.$laawws_close_hours_wed .'</span></span>';
     927                                if ( 'wed' === $laawws_open_hours_wed_checked && ' ' !== $laawws_open_hours_wed && ' ' !== $laawws_close_hours_wed ) {
     928                                        printf(
     929                                                '<span class="clearfix"><span class="laawws-day-label">%1$s</span><span class="laawws-wed-time"> %2$s - %3$s</span></span>',
     930                                                esc_html__( 'Wed:', 'logo-and-address-widget-with-schema' ),
     931                                                esc_html( $laawws_open_hours_wed ),
     932                                                esc_html( $laawws_close_hours_wed )
     933                                        );
    1095934                                }
    1096                         }
    1097 
    1098                         // Check if the operational hours is set for Thursday
    1099                         if($laawws_open_hours_thu_checked == "thu") {
    1100                                 if($laawws_open_hours_thu == " "|| $laawws_close_hours_thu == " ") {
    1101                                 } else {
    1102                                         echo '<span class="clearfix"><span class="laawws-day-label">Thu:</span><span class="laawws-thu-time"> '.$laawws_open_hours_thu.' - '.$laawws_close_hours_thu .'</span></span>';
     935                                if ( 'thu' === $laawws_open_hours_thu_checked && ' ' !== $laawws_open_hours_thu && ' ' !== $laawws_close_hours_thu ) {
     936                                        printf(
     937                                                '<span class="clearfix"><span class="laawws-day-label">%1$s</span><span class="laawws-thu-time"> %2$s - %3$s</span></span>',
     938                                                esc_html__( 'Thu:', 'logo-and-address-widget-with-schema' ),
     939                                                esc_html( $laawws_open_hours_thu ),
     940                                                esc_html( $laawws_close_hours_thu )
     941                                        );
    1103942                                }
    1104                         }
    1105 
    1106                         // Check if the operational hours is set for Friday
    1107                         if($laawws_open_hours_fri_checked == "fri") {
    1108                                 if($laawws_open_hours_fri == " "|| $laawws_close_hours_fri == " ") {
    1109                                 } else {
    1110                                         echo '<span class="clearfix"><span class="laawws-day-label fri">Fri:</span><span class="laawws-fri-time"> '.$laawws_open_hours_fri.' - '.$laawws_close_hours_fri .'</span></span>';
     943                                if ( 'fri' === $laawws_open_hours_fri_checked && ' ' !== $laawws_open_hours_fri && ' ' !== $laawws_close_hours_fri ) {
     944                                        printf(
     945                                                '<span class="clearfix"><span class="laawws-day-label fri">%1$s</span><span class="laawws-fri-time"> %2$s - %3$s</span></span>',
     946                                                esc_html__( 'Fri:', 'logo-and-address-widget-with-schema' ),
     947                                                esc_html( $laawws_open_hours_fri ),
     948                                                esc_html( $laawws_close_hours_fri )
     949                                        );
    1111950                                }
    1112951                        }
    1113                 }
    1114 
    1115 
    1116                 // Check if the operational hours is set for Saturday
    1117                 if($laawws_open_hours_sun_checked2 == "sun2") {
    1118                         if($laawws_open_hours_sun2 == " " || $laawws_close_hours_sun2 == " ") {
    1119                         } else {
    1120                                 echo '<span class="clearfix"><span class="laawws-day-label">Sat:</span><span class="laawws-sat-time"> '.$laawws_open_hours_sun2.' - '.$laawws_close_hours_sun2 .'</span></span>';
    1121                         }
    1122                 }
    1123 
    1124                 // Check if the operational hours is set for Sunday
    1125                 if($laawws_open_hours_sun_checked == "sun") {
    1126                         if($laawws_open_hours_sun == " " || $laawws_close_hours_sun == " ") {
    1127                         } else {
    1128                                 echo '<span class="clearfix"><span class="laawws-day-label">Sun:</span><span class="laawws-sun-time"> '.$laawws_open_hours_sun.' - '.$laawws_close_hours_sun .'</span></span>';
    1129                         }
    1130                 }
    1131 
    1132         } // Show Business hours ends here
    1133 
    1134         echo '</div></div>';
    1135 
    1136         echo $after_widget;
    1137         ob_end_flush();
    1138         }
    1139 
     952
     953                        if ( 'sun2' === $laawws_open_hours_sun_checked2 && ' ' !== $laawws_open_hours_sun2 && ' ' !== $laawws_close_hours_sun2 ) {
     954                                printf(
     955                                        '<span class="clearfix"><span class="laawws-day-label">%1$s</span><span class="laawws-sat-time"> %2$s - %3$s</span></span>',
     956                                        esc_html__( 'Sat:', 'logo-and-address-widget-with-schema' ),
     957                                        esc_html( $laawws_open_hours_sun2 ),
     958                                        esc_html( $laawws_close_hours_sun2 )
     959                                );
     960                        }
     961
     962                        if ( 'sun' === $laawws_open_hours_sun_checked && ' ' !== $laawws_open_hours_sun && ' ' !== $laawws_close_hours_sun ) {
     963                                printf(
     964                                        '<span class="clearfix"><span class="laawws-day-label">%1$s</span><span class="laawws-sun-time"> %2$s - %3$s</span></span>',
     965                                        esc_html__( 'Sun:', 'logo-and-address-widget-with-schema' ),
     966                                        esc_html( $laawws_open_hours_sun ),
     967                                        esc_html( $laawws_close_hours_sun )
     968                                );
     969                        }
     970                }
     971
     972                echo '</div></div>';
     973
     974                echo $after_widget; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
     975        }
    1140976}
    1141 Footer_Logo_and_Address::instance(); ?>
     977
     978Footer_Logo_and_Address::instance();
  • logo-and-address-widget-with-schema/trunk/readme.txt

    r2863206 r3754380  
    11=== Logo and Address Widget with Schema ===
    22Contributors: wsxplugindev
    3 Tags: logo-and-address, address-widget-with-schema, logo-address-widget-with-schema, logo-address-widget, manage-different-locations, manage-address-business-hours
     3Tags: logo-and-address, address-widget-with-schema, logo-address-widget, business-hours, schema
    44Requires at least: 4.7.5
    5 Tested up to: 6.1.1
    6 Stable tag: 4.7
     5Requires PHP: 7.0
     6Tested up to: 7.1
     7Stable tag: 3.0
    78License: GPLv2 or later
    89License URI: http://www.gnu.org/licenses/gpl-2.0.html
    910
    10 == Short Description ==
    1111Widget to add your company logo, address, and business hours with schema.
    1212
    … …  
    5757
    5858= How do I display operational hours? =
    59 Enable the Business Hours section, then choose the "Mon-Fri" option by checking the checkbox then enter your business hours. If you are open on weekends, you can specify those hours as well.   
     59Enable the Business Hours section, then choose the "Mon-Fri" option by checking the checkbox then enter your business hours. If you are open on weekends, you can specify those hours as well.
    6060
    6161== Screenshots ==
    … …  
    6666== Changelog ==
    6767
    68 = 1.0 =
    69 * Added schema for the Address section.
     68= 3.0 =
     69* Compatibility update for WordPress 7.1 and PHP 7.0+.
     70* Improved sanitization, escaping, and internationalization.
     71* Host Font Awesome locally (removed remote CDN dependency).
     72* Valid JSON-LD schema output via wp_json_encode.
     73* Fixed admin form fax field reading and default radio/checkbox handling.
     74* Added show_instance_in_rest support for the block-based widgets editor.
     75* Cleaned up asset loading and uninstall option removal.
     76
     77= 2.9 =
     78* PHP error fixed
     79* Updated the plugin to be compatible with 6.1.1
     80
     81= 2.8 =
     82* Updated the plugin to be compatible with 6.0.1
     83
     84= 2.7 =
     85* Updated the plugin to be compatible with 6.0
     86
     87= 2.6 =
     88* Updated the plugin to be compatible with 5.9.3
     89
     90= 2.5 =
     91* Updated the plugin to be compatible with 5.9.2
     92
     93= 2.4 =
     94* Updated the plugin to be compatible with 5.9.1
     95
     96= 2.3 =
     97* Updated the plugin to be compatible with 5.9
     98
     99= 2.2 =
     100* Updated the plugin to be compatible with 5.8.3
     101
     102= 2.1 =
     103* Updated the plugin to be compatible with 5.8.2
     104
     105= 2.0 =
     106* Updated the plugin to be compatible with 5.8.1
     107
     108= 1.10 =
     109* Updated the plugin to be compatible with 5.8
     110
     111= 1.9 =
     112* Updated the plugin to be compatible with 5.8
     113
     114= 1.8 =
     115* Updated the plugin to be compatible with 5.7.2
     116
     117= 1.7 =
     118* Updated the plugin to be compatible with 5.6
     119
     120= 1.6 =
     121* Updated the plugin to be compatible with 5.5.1
     122
     123= 1.5 =
     124* Updated the plugin to be compatible with 5.4.2
     125
     126= 1.4 =
     127* Updated the plugin to be compatible with 5.4
     128
     129= 1.3 =
     130* Updated the plugin to be compatible with 5.3.2
     131
     132= 1.2 =
     133* Updated the plugin to be compatible with 5.2.2
    70134
    71135= 1.1 =
    … …  
    73137* Updated the plugin to be compatible with 5.0
    74138
    75 = 1.2 =
    76 * Updated the plugin to be compatible with 5.2.2
     139= 1.0 =
     140* Added schema for the Address section.
    77141
    78 = 1.3 =
    79 * Updated the plugin to be compatible with 5.3.2
     142== Upgrade Notice ==
    80143
    81 = 1.4 =
    82 * Updated the plugin to be compatible with 5.4
    83 
    84 = 1.5 =
    85 * Updated the plugin to be compatible with 5.4.2
    86 
    87 = 1.6 =
    88 * Updated the plugin to be compatible with 5.5.1
    89 
    90 = 1.7 =
    91 * Updated the plugin to be compatible with 5.6
    92 
    93 = 1.8 =
    94 * Updated the plugin to be compatible with 5.7.2
    95 
    96 = 1.9 =
    97 * Updated the plugin to be compatible with 5.8
    98 
    99 = 1.10 =
    100 * Updated the plugin to be compatible with 5.8
    101 
    102 = 2.0 =
    103 * Updated the plugin to be compatible with 5.8.1
    104 
    105 = 2.1 =
    106 * Updated the plugin to be compatible with 5.8.2
    107 
    108 = 2.2 =
    109 * Updated the plugin to be compatible with 5.8.3
    110 
    111 = 2.3 =
    112 * Updated the plugin to be compatible with 5.9
    113 
    114 = 2.4 =
    115 * Updated the plugin to be compatible with 5.9.1
    116 
    117 = 2.5 =
    118 * Updated the plugin to be compatible with 5.9.2
    119 
    120 = 2.6 =
    121 * Updated the plugin to be compatible with 5.9.3
    122 
    123 = 2.7 =
    124 * Updated the plugin to be compatible with 6.0
    125 
    126 = 2.8 =
    127 * Updated the plugin to be compatible with 6.0.1
    128 
    129 = 2.9 =
    130 * PHP error fixed
    131 * Updated the plugin to be compatible with 6.1.1
     144= 3.0 =
     145Security and WordPress 7.1 compatibility update. Font Awesome is now bundled locally; no functional changes expected for existing widget settings.
  • logo-and-address-widget-with-schema/trunk/uninstall.php

    r1857717 r3754380  
    11<?php
    2 
    32/**
    43 * Fired when the plugin is uninstalled.
    54 *
    6  * When populating this file, consider the following flow
    7  * of control:
    8  *
    9  * - This method should be static
    10  * - Check if the $_REQUEST content actually is the plugin name
    11  * - Run an admin referrer check to make sure it goes through authentication
    12  * - Verify the output of $_GET makes sense
    13  * - Repeat with other user roles. Best directly by using the links/query string parameters.
    14  * - Repeat things for multisite. Once for a single site in the network, once sitewide.
    15  *
    16  * This file may be updated more in future version of the Boilerplate; however, this is the
    17  * general skeleton and outline for how the file should work.
    18  *
    19  *
    20  * @link       https://webstix.com
    21  * @since      1.0
    22  *
    23  * @package    Logo_and_Address_widget_with_Schema
     5 * @package Logo_and_Address_widget_with_Schema
    246 */
    257
    … …  
    2810        exit;
    2911}
     12
     13/**
     14 * Remove widget option data stored by WP_Widget.
     15 */
     16delete_option( 'widget_logo-and-address-widget-with-schema' );
     17
     18if ( is_multisite() ) {
     19        $laawws_sites = get_sites( array( 'fields' => 'ids' ) );
     20
     21        foreach ( $laawws_sites as $laawws_blog_id ) {
     22                switch_to_blog( (int) $laawws_blog_id );
     23                delete_option( 'widget_logo-and-address-widget-with-schema' );
     24                restore_current_blog();
     25        }
     26}
Note: See TracChangeset for help on using the changeset viewer.