Plugin Directory

Changeset 3171012


Ignore:
Timestamp:
10/17/2024 08:42:11 PM (16 months ago)
Author:
digireturn
Message:

Update Footer Contacts to v1.7

Location:
dn-footer-contacts
Files:
56 added
8 edited

Legend:

Unmodified
Added
Removed
  • dn-footer-contacts/trunk/dn-footer-contacts.php

    r3067189 r3171012  
    11<?php /*
    2     Plugin Name: DN Footer Contacts
     2    Plugin Name: Footer Contacts D
    33    Description: Elegant bottom bar with "Call to Action" buttons to be contacted immediately and easily and clicks statistics.
    4     Version: 1.6.3
     4    Version: 1.7
    55    Author: Digireturn
    66    Author URI: https://digireturn.it/
    7     License: GPLv2 or later License
    8     URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
     7    License: GPLv2 or later
     8    License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    99    Text Domain: dn-footer-contacts
    1010    Domain Path: /languages
    11 */
     11*/
     12
    1213if(!defined('ABSPATH'))die('Invalid request.');
    1314define('DN_FOOTER_CONTACTS_PATH',dirname(__file__).'/');
    1415define('DN_FOOTER_CONTACTS_NAME','Footer Contacts');
    15 define('DN_FOOTER_CONTACTS_VERSION','1.6.3');
     16define('DN_FOOTER_CONTACTS_VERSION','1.7');
    1617define('DN_FOOTER_CONTACTS_HOME','admin.php?page=dn_footer_contacts_manage');
    1718define('DN_FOOTER_CONTACTS_REPOSITARY','https://wordpress.org/plugins/dn-footer-contacts/');
     
    2526    add_action('dn_footer','dn_footer_contacts_dn_footer',200);
    2627    add_action('wp_footer','dn_footer_contacts_wp_footer',200);
    27     add_action('wp_enqueue_scripts','dn_footer_contacts_wp_enqueue_scripts',200);   
     28    add_action('wp_enqueue_scripts','dn_footer_contacts_wp_enqueue_scripts',200);
    2829}
    2930add_action('wp_ajax_dn_footer_contacts_call_to_action','dn_footer_contacts_call_to_action');
    3031add_action('wp_ajax_nopriv_dn_footer_contacts_call_to_action','dn_footer_contacts_call_to_action');
    3132add_filter('plugin_action_links_'.plugin_basename(__FILE__),'dn_footer_contacts_plugin_action_links');
    32 function dn_footer_contacts_plugin_action_links($links=array()) {
    33     $links=array_merge($links,array(
    34         '<a href="' . admin_url(DN_FOOTER_CONTACTS_HOME) . '">'.__('Settings','dn-footer-contacts').'</a>'
     33
     34function dn_footer_contacts_plugin_action_links($links=array()){
     35    return array_merge($links,array(
     36        sprintf('<a href="%s">%s</a>',admin_url(DN_FOOTER_CONTACTS_HOME),esc_html(__('Settings','dn-footer-contacts')))
    3537    ));
    36     return $links;
    3738}
    3839?>
  • dn-footer-contacts/trunk/includes/admin-about.php

    r3007402 r3171012  
    22function dn_footer_contacts_manage_about(){
    33    echo dn_footer_contacts_html_box(''
    4         .dn_footer_contacts_html_title('<h1>DN '.DN_FOOTER_CONTACTS_NAME.'</h1>')
     4        .dn_footer_contacts_html_title('<h1>'.DN_FOOTER_CONTACTS_NAME.'</h1>')
    55        .'<hr />'
    66        .dn_footer_contacts_html_title('<i>'.__('Author','dn-footer-contacts').'</i>: <a href="https://digireturn.it/" target="_blank">Digireturn</a>')
  • dn-footer-contacts/trunk/includes/admin-functions.php

    r3007402 r3171012  
    11<?php
    22function dn_footer_contacts_html_items_row($content='',$class='',$id=''){
    3     return '<div class="dn_footer_contacts-items_row'.(!empty($class)?' dn_footer_contacts-items_row-'.esc_attr($class):'').'" '.(!empty($id)?'id="'.esc_attr($id).'"':'').'>'
    4             .$content.'<div class="dn_footer_contacts-clear"></div></div>';
     3    return sprintf(
     4        '<div class="dn_footer_contacts-items_row%s" %s>%s<div class="dn_footer_contacts-clear"></div></div>'
     5        ,!empty($class)?' dn_footer_contacts-items_row-'.esc_attr($class):''
     6        ,!empty($id)?'id="'.esc_attr($id).'"':''
     7        ,$content
     8    );
    59}
    610function dn_footer_contacts_html_items_col($content='',$class=''){
    7     return '<div class="dn_footer_contacts-items_col'.(!empty($class)?' dn_footer_contacts-items_col-'.esc_attr($class):'').'">'
    8             .$content.'</div>';
     11    return sprintf(
     12        '<div class="dn_footer_contacts-items_col%s">%s</div>'
     13        ,!empty($class)?' dn_footer_contacts-items_col-'.esc_attr($class):''
     14        ,$content
     15    );
    916}
    1017function dn_footer_contacts_html_box($content='',$class='',$id=''){
    11     return '<div class="dn_footer_contacts-box dn_footer_contacts-box_'.$class.'" '.(!empty($id)?'id="'.esc_attr($id).'"':'').'>'.$content.'<div class="dn_footer_contacts-clear"></div></div>';
     18    return sprintf(
     19        '<div class="dn_footer_contacts-box dn_footer_contacts-box_%s" %s>%s<div class="dn_footer_contacts-clear"></div></div>'
     20        ,esc_attr($class)
     21        ,!empty($id)?'id="'.esc_attr($id).'"':''
     22        ,$content
     23    );
    1224}
    1325function dn_footer_contacts_html_alert($content=''){
    14     return '<div class="dn_footer_contacts-box-alert">'.$content.'<div class="dn_footer_contacts-clear"></div></div>';
     26    return sprintf(
     27        '<div class="dn_footer_contacts-box-alert">%s<div class="dn_footer_contacts-clear"></div></div>'
     28        ,$content
     29    );
    1530}
    1631function dn_footer_contacts_html_cell($content='',$class=''){
    17     return '<div class="dn_footer_contacts-box-cell dn_footer_contacts-col_'.$class.'">'.$content.'</div>';
     32    return sprintf(
     33        '<div class="dn_footer_contacts-box-cell dn_footer_contacts-col_%s">%s</div>'
     34        ,esc_attr($class)
     35        ,$content
     36    );
    1837}
    1938function dn_footer_contacts_html_title($content=''){
    20     return '<div class="dn_footer_contacts-box-title">'.$content.'</div>';
     39    return sprintf('<div class="dn_footer_contacts-box-title">%s</div>',$content);
    2140}
    2241function dn_footer_contacts_html_row($label='',$value=''){
    23     return '<div class="dn_footer_contacts-box-row">
    24         <div class="dn_footer_contacts-box-cell-left">'.$label.'</div>
    25         <div class="dn_footer_contacts-box-cell-right">'.$value.'</div>
    26         </div>';
     42    return '<div class="dn_footer_contacts-box-row">'
     43        .sprintf('<div class="dn_footer_contacts-box-cell-left">%s</div>',$label)
     44        .sprintf('<div class="dn_footer_contacts-box-cell-right">%s</div>',$value)
     45        .'</div>';
    2746}
    2847function dn_footer_contacts_html_row2($label='',$value=''){
     
    3756    $class=isset($attrs['class'])?$attrs['class']:false;
    3857   
    39     $html='<select '.($name?'name="'.esc_attr($name).'"':'').' '.($class?'class="'.esc_attr($class).'"':'').'>';
     58    $html=sprintf('<select name="%s" class="%s">',esc_attr($name),esc_attr($class));
    4059    foreach($options as $value=>$label)
    41         $html.='<option value="'.esc_attr($value).'" '.($selected==$value?'selected':'').'>'.esc_html($label).'</option>';
     60        $html.=sprintf('<option value="%s" %s>%s</option>',esc_attr($value),$selected===$value?'selected':'',esc_html($label));
    4261    $html.='</select>';
    4362    return $html;
    44 }function dn_footer_contacts_html_color($name,$value='',$label=''){ $alpha=1;   $hex=array();   $rgba=array();  if(strpos(strtolower($value),'rgba')!==false){      $value=str_replace(array('rgba','(',')'),'',$value);        foreach(explode(',',$value) as $v){         $rgba[]=trim(sanitize_text_field($v));          if(count($hex)<3)$hex[]=dechex(intval(sanitize_text_field($v)));            else $alpha=floatval(trim(sanitize_text_field($v)));        }   }elseif(strpos(strtolower($value),'rgb')!==false){      $value=str_replace(array('rgb','(',')'),'',$value);     foreach(explode(',',$value) as $v){         $rgba[]=trim(sanitize_text_field($v));          if(count($hex)<3)$hex[]=dechex(trim(sanitize_text_field($v)));      }   }elseif(strpos(strtolower($value),'#')!==false&&(strlen($value)==7||strlen($value)==9)){        $value=str_replace(array('#'),'',$value);       $hex=str_split(substr($value,0,6),2);       foreach(str_split($value,2) as $v){         $rgba[]=hexdec(trim(sanitize_text_field($v)));          if(count($rgba)>3)$alpha=round(hexdec(trim(sanitize_text_field($v)))/255,2);        }   }else{      $hex=array('00','00','00');     $rgba=array(0,0,0,1);   }   foreach($hex as $i=>$v)if(strlen($v)==1)$hex[$i]='0'.$hex[$i];  $html='<div class="dn_footer_contacts_css_colorinput">'     .(!empty($label)?'<span>'.esc_html($label).'</span>':'')        .'<input type="hidden"  name="'.esc_attr($name).'" value="rgba('.esc_attr(implode(',',$rgba)).')" />'       .'<br /><input type="color" value="#'.esc_attr(implode('',$hex)).'" style="opacity:'.esc_attr($alpha).'" oninput="dn_footer_contacts_js_color(this)" />'        .'<span></span>'        .'<br /><input type="range" value="'.esc_attr(intval($alpha*100)).'" style="background-image:linear-gradient(to right,rgba(0,0,0,0),#'.esc_attr(implode('',$hex)).')" oninput="dn_footer_contacts_js_alpha(this)" />'       .'</div>';  return $html;}
     63}
     64function dn_footer_contacts_html_color($name,$value='',$label=''){
     65    $alpha=1;
     66    $hex=array();
     67    $rgba=array();
     68    if(strpos(strtolower($value),'rgba')!==false){
     69        $value=str_replace(array('rgba','(',')'),'',$value);
     70        foreach(explode(',',$value) as $v){
     71            $rgba[]=trim(sanitize_text_field($v));
     72            if(count($hex)<3)$hex[]=dechex(intval(sanitize_text_field($v)));
     73            else $alpha=floatval(trim(sanitize_text_field($v)));
     74        }
     75    }elseif(strpos(strtolower($value),'rgb')!==false){
     76        $value=str_replace(array('rgb','(',')'),'',$value);
     77        foreach(explode(',',$value) as $v){
     78            $rgba[]=trim(sanitize_text_field($v));
     79            if(count($hex)<3)$hex[]=dechex(trim(sanitize_text_field($v)));
     80        }
     81    }elseif(strpos(strtolower($value),'#')!==false&&(strlen($value)==7||strlen($value)==9)){
     82        $value=str_replace(array('#'),'',$value);
     83        $hex=str_split(substr($value,0,6),2);
     84        foreach(str_split($value,2) as $v){
     85            $rgba[]=hexdec(trim(sanitize_text_field($v)));
     86            if(count($rgba)>3)$alpha=round(hexdec(trim(sanitize_text_field($v)))/255,2);
     87        }
     88    }else{
     89        $hex=array('00','00','00');
     90        $rgba=array(0,0,0,1);
     91    }
     92    foreach($hex as $i=>$v)if(strlen($v)==1)$hex[$i]='0'.$hex[$i];
     93   
     94    $html='<div class="dn_footer_contacts_css_colorinput">'
     95        .(!empty($label)?'<span>'.esc_html($label).'</span>':'')
     96        .'<input type="hidden"  name="'.esc_attr($name).'" value="rgba('.esc_attr(implode(',',$rgba)).')" />'
     97        .'<br /><input type="color" value="#'.esc_attr(implode('',$hex)).'" style="opacity:'.esc_attr($alpha).'" oninput="dn_footer_contacts_js_color(this)" />'
     98        .'<span></span>'
     99        .'<br /><input type="range" value="'.esc_attr(intval($alpha*100)).'" style="background-image:linear-gradient(to right,rgba(0,0,0,0),#'.esc_attr(implode('',$hex)).')" oninput="dn_footer_contacts_js_alpha(this)" />'
     100        .'</div>';
     101    return $html;
     102}
    45103function dn_footer_contacts_html_img($options=array()){
    46104    $src=isset($options['src'])?$options['src']:false;
    47105    if(!$src||!dn_footer_contacts_is_url($src))return false;
    48106    $alt=isset($options['alt'])?$options['alt']:'';
    49     return '<img src="'.esc_url($src).'" alt="'.esc_attr($alt).'" class="dn_footer_contacts-responsive" />';
     107    return sprintf(
     108        '<img src="%s" alt="%s" class="dn_footer_contacts-responsive" />'
     109        ,esc_url($src)
     110        ,esc_attr($alt)
     111    );
    50112}
    51113function dn_footer_contacts_get_month($nMonth=0){
  • dn-footer-contacts/trunk/includes/admin-notify.php

    r2886496 r3171012  
    1212    return in_array($k,array('success','info'))?true:false;
    1313}
    14 function dn_footer_contacts_notify_has($k){return (isset($_SESSION['dn_footer_contacts_'.$k])&&strlen($_SESSION['dn_footer_contacts_'.$k])>0)?true:false;}
     14function dn_footer_contacts_notify_has($k){
     15    return (isset($_SESSION['dn_footer_contacts_'.$k])&&strlen($_SESSION['dn_footer_contacts_'.$k])>0)?true:false;
     16}
    1517function dn_footer_contacts_notify_read($k){
    1618    if(!dn_footer_contacts_notify_has($k))return;
     
    2123add_action('admin_notices','dn_footer_contacts_notify_admin_notice');
    2224function dn_footer_contacts_notify_admin_notice(){
    23     if(dn_footer_contacts_notify_has('success'))echo '<div class="notice notice-success is-dismissible"><p>'.dn_footer_contacts_notify_read('success').'</p></div>';
    24     if(dn_footer_contacts_notify_has('error'))echo '<div class="notice notice-error"><p>'.dn_footer_contacts_notify_read('error').'</p></div>';
     25    if(dn_footer_contacts_notify_has('success'))echo sprintf('<div class="notice notice-success is-dismissible"><p>%s</p></div>',dn_footer_contacts_notify_read('success'));
     26    if(dn_footer_contacts_notify_has('error'))echo sprintf('<div class="notice notice-error"><p>%s</p></div>',dn_footer_contacts_notify_read('error'));
    2527}
    2628function dn_footer_contacts_notify_invitation(){
  • dn-footer-contacts/trunk/includes/admin-stats.php

    r3007402 r3171012  
    2222    );
    2323    echo '<div class="dn_footer_contacts-menu">'
    24         .'<a href="'.esc_url(DN_FOOTER_CONTACTS_HOME).'&view=stats" class="'.($what=='days'?'active':'').'">'.__('For days','dn-footer-contacts').'</a>'
    25         .'<a href="'.esc_url(DN_FOOTER_CONTACTS_HOME).'&view=stats&what=months" class="'.($what=='months'?'active':'').'">'.__('For months','dn-footer-contacts').'</a>'
    26         .'<a href="'.esc_url(DN_FOOTER_CONTACTS_HOME).'&view=stats&what=years" class="'.($what=='years'?'active':'').'">'.__('For years','dn-footer-contacts').'</a>'
     24        .sprintf('<a href="%s&view=stats" class="%s">%s</a>',esc_url(DN_FOOTER_CONTACTS_HOME),$what=='days'?'active':'',esc_html(__('For days','dn-footer-contacts')))
     25        .sprintf('<a href="%s&view=stats&what=months" class="%s">%s</a>',esc_url(DN_FOOTER_CONTACTS_HOME),$what=='months'?'active':'',esc_html(__('For months','dn-footer-contacts')))
     26        .sprintf('<a href="%s&view=stats&what=years" class="%s">%s</a>',esc_url(DN_FOOTER_CONTACTS_HOME),$what=='years'?'active':'',esc_html(__('For years','dn-footer-contacts')))
    2727    .'</div>';
    2828    $fields=dn_footer_contacts_get_fields();
    2929    $stats=dn_footer_contacts_get_stats();
    30     $html='<table class="dn_footer_contacts-table"><thead><tr>
    31         <th width="80">'.__('Date','dn-footer-contacts').'</th>
    32         <th width="50">'.__('Total click','dn-footer-contacts').'</th>';
     30    $html='<table class="dn_footer_contacts-table"><thead><tr>'
     31        .sprintf('<th width="80">%s</th>',esc_html(__('Date','dn-footer-contacts')))
     32        .sprintf('<th width="50">%s</th>',esc_html(__('Total click','dn-footer-contacts')));
    3333    $columns=2+count($fields);
    3434    foreach($fields as $contact)if(($contact=dn_footer_contacts_field($contact)))
    35         $html.='<th width="42">'
    36             .dn_footer_contacts_html_button_icon($contact)
    37             .'</th>';
     35        $html.=sprintf('<th width="42">%s</th>',dn_footer_contacts_html_button_icon($contact));
    3836    $html.='<th></th></tr></thead><tbody>';
    3937    $i=-1;
  • dn-footer-contacts/trunk/readme.txt

    r3067189 r3171012  
    1 === DN Footer Contacts ===
     1=== Footer Contacts D ===
    22Contributors: digireturn
    33Tags: bar, button, float buttons, fontawesome, call to action, fixed bar, call button, whatsapp button, facebook button, responsive bar, phone, call, toolbar
    44Requires at least: 5.0
    5 Tested up to: 6.5
     5Tested up to: 6.6.2
    66Requires PHP: 5.6
    7 Stable tag: 1.6.3
     7Stable tag: 1.7
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
Note: See TracChangeset for help on using the changeset viewer.