Plugin Directory

Changeset 3628440


Ignore:
Timestamp:
07/30/2026 11:02:41 AM (3 months ago)
Author:
gutefy
Message:

Version 1.2.1 - renamed to "Sticky Social Icons", trademarked term removed from name and tags, full uncompiled source (src/, package.json, webpack.config.js) and build instructions included

Location:
gf-social-icons/trunk
Files:
48 added
24 edited

Legend:

Unmodified
Added
Removed
  • gf-social-icons/trunk/README.txt

    r3546939 r3628440  
    1 === Sticky Social Icons - Floating Social Media, WhatsApp Chat, Click-to-Call & Email Icons ===
     1=== Sticky Social Icons ===
    22Contributors: gutefy
    3 Tags: social icons, floating social icons, whatsapp button, click to call, share buttons
     3Tags: social icons, floating social icons, sticky icons, contact buttons, click to call
    44Requires at least: 6.3
    55Requires PHP: 7.2
    6 Tested up to: 7.0
    7 Stable tag: 1.2.0
     6Tested up to: 7.0.2
     7Stable tag: 1.2.1
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Floating or inline social icons for any WordPress site: WhatsApp click-to-chat, click-to-call, email, Facebook, Instagram, X, YouTube, TikTok and more.
     11Floating or inline social and contact icons for any WordPress site — no code, live Customizer preview.
    1212
    1313== Description ==
    … …  
    1515**Sticky Social Icons** is a lightweight, mobile-friendly social media plugin that lets you add floating sticky social icons to any WordPress site — without writing a single line of code. Visitors get instant access to your WhatsApp, phone, email, and every social channel right from the side of the screen.
    1616
    17 Designed for businesses, creators, agencies, and stores, the plugin works out of the box with **Block Themes**, **Classic Themes**, **WooCommerce**, **Elementor**, **Bricks**, **Divi**, **Astra**, **Kadence**, **GeneratePress**, **Hello Theme**, **Hello Elementor**, and every popular page builder.
     17Designed for businesses, creators, agencies, and stores, the plugin works out of the box with both block and classic themes, and with the common page builders.
    1818
    1919Configure everything live in the **WordPress Customizer** — change colors, sizes, borders, radius, position, and per-device visibility and see the result update in real time.
    … …  
    4646
    4747Facebook, Facebook Messenger, Facebook (f), WhatsApp, Instagram, X (Twitter), YouTube, LinkedIn, TikTok, Telegram, Pinterest, Snapchat, Reddit, Skype, Tumblr, Discord, GitHub, Vimeo, Twitch, Behance, Dribbble, Email (envelope), Phone, and more — with new icons added in every release.
     48
     49= 🛠 Source Code and Build Process =
     50
     51Nothing in this plugin is obfuscated or minified by hand. The uncompiled source (JavaScript/JSX and SCSS) ships inside the plugin in `/src`, together with `package.json` and `webpack.config.js`, and is also published at https://github.com/syed-sajib/gutefy-social-icons
     52
     53The files in `/build` are generated from `/src` with @wordpress/scripts (webpack) by running `npm install` and then `npm run build`. See the "Source Code" section below for details.
    4854
    4955= 💼 Perfect For =
    … …  
    103109No. The plugin makes no external requests, sets no cookies, and does not track anything.
    104110
    105 == Screenshots ==
    106 1. Floating social icons rail on a typical homepage.
    107 2. Customizer panel — General section with Accounts List, drag-to-reorder, and Open in New Tab.
    108 3. Customizer panel — Design section with Normal/Hover tabs, colors, sizes, border, radius.
    109 4. Customizer panel — Advanced section with Device Visibility and Display Rules.
    110 5. Per-row WhatsApp pre-fill / mailto subject+body / SMS toggle.
    111 6. Per-row WhatsApp pre-fill, mailto subject+body, SMS toggle.
     111== Source Code ==
     112
     113The complete, human-readable source of this plugin — uncompiled JavaScript/JSX and SCSS — is available at:
     114
     115https://github.com/syed-sajib/gutefy-social-icons
     116
     117The files in `/build` are generated from `/src` with @wordpress/scripts (webpack). To build them yourself:
     118
     1191. `npm install`
     1202. `npm run build`
     121
     122Build configuration lives in `webpack.config.js`; the entry points are `src/customizer.js` and `src/view.js`. Development watch mode is `npm run start`. The `/src` directory is also shipped inside this plugin package, so no download is required to read the original source.
    112123
    113124== Changelog ==
     125
     126= 1.2.1 =
     127* **Changed:** Plugin display name simplified to **Sticky Social Icons** — removed the third-party trademarked term and the extra keywords from the name and the plugin tags.
     128* **Added:** Full uncompiled source (`/src`), `package.json`, and `webpack.config.js` are now included in the plugin package.
     129* **Added:** Readme now documents the public source repository and the exact build process for the files in `/build`.
     130* **Updated:** Repository URLs point to the new location, https://github.com/syed-sajib/gutefy-social-icons.
     131* No functional or feature changes.
    114132
    115133= 1.2.0 =
    … …  
    149167== Upgrade Notice ==
    150168
     169= 1.2.1 =
     170Maintenance release. Plugin name simplified, full source code and build instructions now included. No functional changes — safe update for everyone.
     171
    151172= 1.2.0 =
    152173Major feature release. Adds click-to-chat WhatsApp/Email/Phone, page-level visibility rules, role-based hiding, border-radius, per-device visibility, and accessibility (aria-label, noopener). Recommended for everyone.
  • gf-social-icons/trunk/composer.json

    r3157280 r3628440  
    44    "license": "GPL-2.0+",
    55    "require": {
    6         "php": ">=7.0"
     6        "php": ">=7.2"
    77    },
    88    "autoload": {
  • gf-social-icons/trunk/gf-social-icons.php

    r3546939 r3628440  
    22/**
    33 *
    4  * @link              https://github.com/dev-sajib/gutefy-social-icons
    5  * @since             1.2.0
     4 * @link              https://github.com/syed-sajib/gutefy-social-icons
     5 * @since             1.2.1
    66 * @package           Gutefy_Social_Icons
    77 *
    88 * @wordpress-plugin
    99 * Plugin Name:       Sticky Social Icons
    10  * Plugin URI:        https://github.com/dev-sajib/gutefy-social-icons
    11  * Description:       Add floating, sticky, or inline social media icons (Facebook, WhatsApp, Instagram, X/Twitter, YouTube, LinkedIn, TikTok, Email, Phone, more) with a no-code WordPress Customizer interface, shortcode, and Gutenberg block.
    12  * Version:           1.2.0
     10 * Plugin URI:        https://github.com/syed-sajib/gutefy-social-icons
     11 * Description:       Add floating, sticky social and contact icons (Facebook, Instagram, X/Twitter, YouTube, LinkedIn, TikTok, WhatsApp, Email, Phone and more) to any site, configured live in the WordPress Customizer.
     12 * Version:           1.2.1
    1313 * Author:            Gutefy
    1414 * Author URI:        https://profiles.wordpress.org/gutefy/
    … …  
    1616 * License URI:       http://www.gnu.org/licenses/gpl-2.0.txt
    1717 * Text Domain:       gf-social-icons
    18  * Domain Path:       /languages
    1918 * Requires at least: 6.3
    20  * Tested up to:      7.0
     19 * Tested up to:      7.0.2
    2120 * Requires PHP:      7.2
    2221 */
    … …  
    5150use GF_SOCIAL_ICONS\TemplateLoader;
    5251
    53 // Initialize the classes
    54 new Core();
     52// Activation hook and admin links must be registered while the plugin file loads.
    5553new Activate();
    56 EnqueueScripts::init();
    57 TemplateLoader::init();
     54
     55/**
     56 * Initialize the rest of the plugin on `init`.
     57 *
     58 * The Customizer panels, sections and controls carry translated labels, so they
     59 * must not be built before `init` — doing so triggers WordPress' "translation
     60 * loading was triggered too early" notice (see _load_textdomain_just_in_time()).
     61 */
     62add_action('init', function () {
     63    new Core();
     64    EnqueueScripts::init();
     65    TemplateLoader::init();
     66});
    5867
    5968?>
  • gf-social-icons/trunk/includes/BaseCustomizer.php

    r3546939 r3628440  
    22namespace GF_SOCIAL_ICONS;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48use GF_SOCIAL_ICONS\Types\Panel;
    59use GF_SOCIAL_ICONS\Types\Partial;
  • gf-social-icons/trunk/includes/Controls/BorderControl.php

    r3157280 r3628440  
    22namespace GF_SOCIAL_ICONS\Controls;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class BorderControl extends \WP_Customize_Control
    59{
  • gf-social-icons/trunk/includes/Controls/Checkbox.php

    r3546939 r3628440  
    22namespace GF_SOCIAL_ICONS\Controls;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class Checkbox extends \WP_Customize_Control
    59{
  • gf-social-icons/trunk/includes/Controls/Color.php

    r3157280 r3628440  
    22namespace  GF_SOCIAL_ICONS\Controls;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class Color extends \WP_Customize_Control
    59{
  • gf-social-icons/trunk/includes/Controls/ConditionalDisplay.php

    r3546939 r3628440  
    22namespace GF_SOCIAL_ICONS\Controls;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class ConditionalDisplay extends \WP_Customize_Control
    59{
  • gf-social-icons/trunk/includes/Controls/SelectDropdownControl.php

    r3157280 r3628440  
    22namespace GF_SOCIAL_ICONS\Controls;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class SelectDropdownControl extends \WP_Customize_Control
    59{
  • gf-social-icons/trunk/includes/Controls/SocialRepeater.php

    r3157280 r3628440  
    22namespace GF_SOCIAL_ICONS\Controls;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class SocialRepeater extends \WP_Customize_Control
    59{
  • gf-social-icons/trunk/includes/Controls/Tabs.php

    r3157280 r3628440  
    22namespace GF_SOCIAL_ICONS\Controls;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class Tabs extends \WP_Customize_Control
    59{
  • gf-social-icons/trunk/includes/Controls/Toggle.php

    r3157280 r3628440  
    22namespace GF_SOCIAL_ICONS\Controls;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class Toggle extends \WP_Customize_Control
    59{
  • gf-social-icons/trunk/includes/Controls/UnitInput.php

    r3157280 r3628440  
    22namespace GF_SOCIAL_ICONS\Controls;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class UnitInput extends \WP_Customize_Control
    59{
  • gf-social-icons/trunk/includes/Core.php

    r3546939 r3628440  
    33namespace GF_SOCIAL_ICONS;
    44
     5
     6if ( ! defined( 'ABSPATH' ) ) {
     7        exit; // Exit if accessed directly.
     8}
    59use GF_SOCIAL_ICONS\Global\Settings;
    610use GF_SOCIAL_ICONS\BaseCustomizer;
    … …  
    3034    $panels = array(
    3135      Settings::PANEL_CORE => [
    32         'title' => __('Sticky Social Icons', TEXT_DOMAIN),
    33         'description' => __('<p>Gutefy Extensions for floating social icons</p>', TEXT_DOMAIN),
     36        'title' => __('Sticky Social Icons', 'gf-social-icons'),
     37        'description' => __('Floating social and contact icons for your site.', 'gf-social-icons'),
    3438        'priority' => 31,
    3539      ]
    … …  
    5054    $section = array(
    5155      Settings::SECTION_GENERAL_SETTINGS => [
    52         'title' => __('General', TEXT_DOMAIN),
     56        'title' => __('General', 'gf-social-icons'),
    5357        'panel' => Settings::PANEL_CORE,
    5458        'priority' => 1,
    5559      ],
    5660      Settings::SECTION_STYLE_SETTINGS => [
    57         'title' => __('Design', TEXT_DOMAIN),
     61        'title' => __('Design', 'gf-social-icons'),
    5862        'panel' => Settings::PANEL_CORE,
    5963        'priority' => 2,
    6064      ],
    6165      Settings::SECTION_ADVANCED_SETTINGS => [
    62         'title' => __('Advanced', TEXT_DOMAIN),
     66        'title' => __('Advanced', 'gf-social-icons'),
    6367        'panel' => Settings::PANEL_CORE,
    6468        'priority' => 3,
    … …  
    102106        ],
    103107        'control_args' => [
    104           'label' => __('Accounts List', TEXT_DOMAIN),
     108          'label' => __('Accounts List', 'gf-social-icons'),
    105109          'section' => Settings::SECTION_GENERAL_SETTINGS,
    106110          'input_attrs' => array(
    … …  
    120124        ],
    121125        'control_args' => [
    122           'label' => __('Open in new Tab', TEXT_DOMAIN),
     126          'label' => __('Open in new Tab', 'gf-social-icons'),
    123127          'section' => Settings::SECTION_GENERAL_SETTINGS,
    124128          'input_attrs' => array(
    … …  
    156160        ],
    157161        'control_args' => [
    158           'label' => __('Device Visibility', TEXT_DOMAIN),
     162          'label' => __('Device Visibility', 'gf-social-icons'),
    159163          'section' => Settings::SECTION_ADVANCED_SETTINGS,
    160164          'priority' => 1,
    … …  
    185189        ],
    186190        'control_args' => [
    187           'label' => __('Icon Color', TEXT_DOMAIN),
     191          'label' => __('Icon Color', 'gf-social-icons'),
    188192          'section' => Settings::SECTION_STYLE_SETTINGS,
    189193          'input_attrs' => array(
    … …  
    215219        ],
    216220        'control_args' => [
    217           'label' => __('Icon background color', TEXT_DOMAIN),
     221          'label' => __('Icon background color', 'gf-social-icons'),
    218222          'section' => Settings::SECTION_STYLE_SETTINGS,
    219223          'input_attrs' => array(
    … …  
    245249        ],
    246250        'control_args' => [
    247           'label' => __('Icon color', TEXT_DOMAIN),
     251          'label' => __('Icon color', 'gf-social-icons'),
    248252          'section' => Settings::SECTION_STYLE_SETTINGS,
    249253          'input_attrs' => array(
    … …  
    275279        ],
    276280        'control_args' => [
    277           'label' => __('Icon background color', TEXT_DOMAIN),
     281          'label' => __('Icon background color', 'gf-social-icons'),
    278282          'section' => Settings::SECTION_STYLE_SETTINGS,
    279283          'input_attrs' => array(
    … …  
    305309        ],
    306310        'control_args' => [
    307           'label' => __('Icon Size', TEXT_DOMAIN),
     311          'label' => __('Icon Size', 'gf-social-icons'),
    308312          'section' => Settings::SECTION_STYLE_SETTINGS,
    309313          'input_attrs' => array(
    … …  
    335339        ],
    336340        'control_args' => [
    337           'label' => __('Icon Size', TEXT_DOMAIN),
     341          'label' => __('Icon Size', 'gf-social-icons'),
    338342          'section' => Settings::SECTION_STYLE_SETTINGS,
    339343          'input_attrs' => array(
    … …  
    373377        ],
    374378        'control_args' => [
    375           'label' => __('Icon Wrapper', TEXT_DOMAIN),
     379          'label' => __('Icon Wrapper', 'gf-social-icons'),
    376380          'section' => Settings::SECTION_STYLE_SETTINGS,
    377381          'input_attrs' => array(
    … …  
    403407        ],
    404408        'control_args' => [
    405           'label' => __('Icon Wrapper size', TEXT_DOMAIN),
     409          'label' => __('Icon Wrapper size', 'gf-social-icons'),
    406410          'section' => Settings::SECTION_STYLE_SETTINGS,
    407411          'input_attrs' => array(
    … …  
    434438        ],
    435439        'control_args' => [
    436           'label' => __('Vertical Gap', TEXT_DOMAIN),
     440          'label' => __('Vertical Gap', 'gf-social-icons'),
    437441          'section' => Settings::SECTION_STYLE_SETTINGS,
    438442          'input_attrs' => array(
    … …  
    463467        ],
    464468        'control_args' => [
    465           'label' => __('Adjust Vertical Position', TEXT_DOMAIN),
     469          'label' => __('Adjust Vertical Position', 'gf-social-icons'),
    466470          'section' => Settings::SECTION_STYLE_SETTINGS,
    467471          'input_attrs' => array(
    … …  
    484488        ],
    485489        'control_args' => [
    486           'label' => __('Horizontal Position', TEXT_DOMAIN),
     490          'label' => __('Horizontal Position', 'gf-social-icons'),
    487491          'section' => Settings::SECTION_STYLE_SETTINGS,
    488492          'input_attrs' => array(
    … …  
    514518        ],
    515519        'control_args' => [
    516           'label' => __('Border', TEXT_DOMAIN),
     520          'label' => __('Border', 'gf-social-icons'),
    517521          'section' => Settings::SECTION_STYLE_SETTINGS,
    518522          'input_attrs' => array(
    … …  
    543547        ],
    544548        'control_args' => [
    545           'label' => __('Border Radius', TEXT_DOMAIN),
     549          'label' => __('Border Radius', 'gf-social-icons'),
    546550          'section' => Settings::SECTION_STYLE_SETTINGS,
    547551          'input_attrs' => array(
    … …  
    571575        ],
    572576        'control_args' => [
    573           'label' => __('Border Radius', TEXT_DOMAIN),
     577          'label' => __('Border Radius', 'gf-social-icons'),
    574578          'section' => Settings::SECTION_STYLE_SETTINGS,
    575579          'input_attrs' => array(
    … …  
    594598        ],
    595599        'control_args' => [
    596           'label' => __('Display Rules', TEXT_DOMAIN),
     600          'label' => __('Display Rules', 'gf-social-icons'),
    597601          'section' => Settings::SECTION_ADVANCED_SETTINGS,
    598602          'priority' => 2,
  • gf-social-icons/trunk/includes/Global/Activate.php

    r3157280 r3628440  
    33namespace GF_SOCIAL_ICONS\Global;
    44
     5
     6if ( ! defined( 'ABSPATH' ) ) {
     7        exit; // Exit if accessed directly.
     8}
    59class Activate
    610{
  • gf-social-icons/trunk/includes/Global/EnqueueScripts.php

    r3157280 r3628440  
    22namespace GF_SOCIAL_ICONS\Global;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class EnqueueScripts
    59{
  • gf-social-icons/trunk/includes/Global/Settings.php

    r3546939 r3628440  
    22namespace GF_SOCIAL_ICONS\Global;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class Settings
    59{
  • gf-social-icons/trunk/includes/Sanitize.php

    r3546939 r3628440  
    22
    33namespace GF_SOCIAL_ICONS;
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class Sanitize {
    59
    … …  
    4246    // Ensure $value is an array
    4347    if (!is_array($value)) {
    44         error_log('Unexpected type encountered in gf_social_icons_custom_sanitize: ' . gettype($value));
    45         return [['facebook', 'http://facebook.com']]; // Return a default array or handle the unexpected type
     48        // Unexpected type — fall back to a safe default.
     49        return [['facebook', 'http://facebook.com']];
    4650    }
    4751
  • gf-social-icons/trunk/includes/TemplateLoader.php

    r3546939 r3628440  
    33
    44
     5
     6if ( ! defined( 'ABSPATH' ) ) {
     7        exit; // Exit if accessed directly.
     8}
    59class TemplateLoader
    610{
    … …  
    2731        $gf_social_icons_position_horizontally = get_option('gf_social_icons_position_horizontally', 'position--right');
    2832
    29         $html = "<div id='gf_social_icons__wrapper' class='gutefy-section-parent-wrapper " . esc_attr($gf_social_icons_position_horizontally) . "'>" . self::load_template() . "</div>";
    3033        self::generateStyle();
    3134
    32         echo $html;
     35        echo '<div id="gf_social_icons__wrapper" class="gutefy-section-parent-wrapper ' . esc_attr($gf_social_icons_position_horizontally) . '">';
     36        self::render_template();
     37        echo '</div>';
     38    }
     39
     40    /**
     41     * Tags and attributes allowed inside the bundled icon SVGs.
     42     *
     43     * The icon markup ships with the plugin (build/iconStore.json), but it is still
     44     * filtered through wp_kses() so nothing unexpected can ever reach the page.
     45     *
     46     * @return array
     47     */
     48    public static function svg_allowed_html()
     49    {
     50        $shared_attributes = array(
     51            'fill'             => true,
     52            'fill-rule'        => true,
     53            'fill-opacity'     => true,
     54            'stroke'           => true,
     55            'stroke-width'     => true,
     56            'stroke-linecap'   => true,
     57            'stroke-linejoin'  => true,
     58            'stroke-dasharray' => true,
     59            'opacity'          => true,
     60            'transform'        => true,
     61            'class'            => true,
     62            'style'            => true,
     63            'id'               => true,
     64        );
     65
     66        return array(
     67            'svg'      => $shared_attributes + array(
     68                'xmlns'               => true,
     69                'xmlns:xlink'         => true,
     70                'viewbox'             => true,
     71                'width'               => true,
     72                'height'              => true,
     73                'preserveaspectratio' => true,
     74                'role'                => true,
     75                'aria-hidden'         => true,
     76                'focusable'           => true,
     77                'version'             => true,
     78            ),
     79            'g'        => $shared_attributes,
     80            'title'    => array(),
     81            'defs'     => array(),
     82            'path'     => $shared_attributes + array('d' => true),
     83            'circle'   => $shared_attributes + array('cx' => true, 'cy' => true, 'r' => true),
     84            'ellipse'  => $shared_attributes + array('cx' => true, 'cy' => true, 'rx' => true, 'ry' => true),
     85            'rect'     => $shared_attributes + array('x' => true, 'y' => true, 'width' => true, 'height' => true, 'rx' => true, 'ry' => true),
     86            'line'     => $shared_attributes + array('x1' => true, 'y1' => true, 'x2' => true, 'y2' => true),
     87            'polygon'  => $shared_attributes + array('points' => true),
     88            'polyline' => $shared_attributes + array('points' => true),
     89            'use'      => $shared_attributes + array('href' => true, 'xlink:href' => true, 'x' => true, 'y' => true),
     90        );
    3391    }
    3492
    … …  
    82140        return true;
    83141    }
     142    /**
     143     * Returns the icon markup as a string.
     144     *
     145     * Kept for backward compatibility — render_template() is the printing version.
     146     *
     147     * @return string
     148     */
    84149    public static function load_template()
     150    {
     151        ob_start();
     152        self::render_template();
     153        return ob_get_clean();
     154    }
     155
     156    /**
     157     * Prints the icon list.
     158     */
     159    public static function render_template()
    85160    {
    86161        $social_icons_settings = get_option('gf_social_icons_general_settings', []);
    … …  
    93168        //check availablity
    94169        if (!file_exists($json_file_path)) {
    95             return 'Icon Json File Not Found';
     170            return;
    96171        }
    97172
    … …  
    101176
    102177        // Check if the JSON data was properly decoded
    103         if (json_last_error() !== JSON_ERROR_NONE) {
    104             return '<p>Error: Invalid JSON data.</p>';
    105         }
    106         ob_start();
     178        if (json_last_error() !== JSON_ERROR_NONE || !is_array($social_icons_data)) {
     179            return;
     180        }
     181
     182        $open_in_new_tab = (is_array($open_in_new_tab) && !empty($open_in_new_tab['value']));
     183        $allowed_svg = self::svg_allowed_html();
    107184
    108185        echo '<div class="gf_social_icons_social_float">';
    109         if (!empty($social_icons_settings)):
     186
     187        if (!empty($social_icons_settings)) {
    110188            foreach ($social_icons_settings as $icon) {
    111                 if ($icon[1]) {
    112                     $aria_label = ucwords(str_replace(['_', '-'], ' ', $icon[0]));
    113                     $options = (isset($icon[3]) && is_array($icon[3])) ? $icon[3] : [];
    114                     $href = self::build_href($icon[0], $icon[1], $options);
    115                     $is_protocol_href = (bool) preg_match('/^(mailto:|tel:|sms:)/i', $href);
    116                     ?>
    117 
    118                     <a class="gf_social_icons_social_icon" href="<?php echo $is_protocol_href ? esc_attr($href) : esc_url($href); ?>" aria-label="<?php echo esc_attr($aria_label); ?>" rel="noopener noreferrer" <?php
    119                     if ($open_in_new_tab['value'] && !$is_protocol_href) {
    120                         echo 'target="_blank"';
    121                     } ?>>
    122                         <span>
    123                             <?php echo ($social_icons_data[$icon[0]]['icon']) ?>
    124                         </span>
    125                     </a>
    126                     <?php
    127                 }
    128             }
    129             ;
    130         else: ?>
    131             <p class="empty-sms">Minimum One Url Required.</p>
    132         <?php endif;
     189                if (empty($icon[1]) || !isset($social_icons_data[$icon[0]]['icon'])) {
     190                    continue;
     191                }
     192
     193                $aria_label = ucwords(str_replace(['_', '-'], ' ', $icon[0]));
     194                $options = (isset($icon[3]) && is_array($icon[3])) ? $icon[3] : [];
     195                $href = self::build_href($icon[0], $icon[1], $options);
     196                $is_protocol_href = (bool) preg_match('/^(mailto:|tel:|sms:)/i', $href);
     197
     198                echo '<a class="gf_social_icons_social_icon" href="'
     199                    . ($is_protocol_href ? esc_attr($href) : esc_url($href))
     200                    . '" aria-label="' . esc_attr($aria_label) . '" rel="noopener noreferrer"'
     201                    . (($open_in_new_tab && !$is_protocol_href) ? ' target="_blank"' : '')
     202                    . '><span>'
     203                    . wp_kses($social_icons_data[$icon[0]]['icon'], $allowed_svg)
     204                    . '</span></a>';
     205            }
     206        } else {
     207            echo '<p class="empty-sms">' . esc_html__('Minimum One Url Required.', 'gf-social-icons') . '</p>';
     208        }
     209
    133210        echo '</div>';
    134         // Get the contents of the buffer and clean it
    135         return ob_get_clean();
    136211    }
    137212
  • gf-social-icons/trunk/includes/Types/Control.php

    r3157280 r3628440  
    33
    44
     5
     6if ( ! defined( 'ABSPATH' ) ) {
     7        exit; // Exit if accessed directly.
     8}
    59class Control{
    610 
  • gf-social-icons/trunk/includes/Types/Panel.php

    r3157280 r3628440  
    33
    44
     5
     6if ( ! defined( 'ABSPATH' ) ) {
     7        exit; // Exit if accessed directly.
     8}
    59class Panel{
    610 
  • gf-social-icons/trunk/includes/Types/Partial.php

    r3157280 r3628440  
    33
    44
     5
     6if ( ! defined( 'ABSPATH' ) ) {
     7        exit; // Exit if accessed directly.
     8}
    59class Partial{
    610 
  • gf-social-icons/trunk/includes/Types/Section.php

    r3157280 r3628440  
    22namespace GF_SOCIAL_ICONS\Types;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class Section {
    59        /**
  • gf-social-icons/trunk/includes/Validation.php

    r3546939 r3628440  
    22namespace GF_SOCIAL_ICONS;
    33
     4
     5if ( ! defined( 'ABSPATH' ) ) {
     6        exit; // Exit if accessed directly.
     7}
    48class Validation{
    59    public static function gf_social_icons_custom_url_validation($error_object, $value, $setting_object) {
Note: See TracChangeset for help on using the changeset viewer.