Plugin Directory

Changeset 3823932


Ignore:
Timestamp:
11/25/2026 08:23:54 PM (less than one hour ago)
Author:
aminshah74
Message:

Version 1.5.11: WordPress 7.2 compatibility, security hardening and fixes

Location:
amin-chat-button
Files:
2 edited
5 copied

Legend:

Unmodified
Added
Removed
  • amin-chat-button/tags/1.5.12/chat-button.php

    r3823846 r3823932  
    44 * Plugin URI: https://wordpress.org/plugins/amin-chat-button/
    55 * Description: WhatsApp Chat🔥. Adds a pulsating WhatsApp or Telegram button 🍀 to your website. Fast and easy installation. Setting up target id GTM and YandexMetrics. Setting pre-filled Message.
    6  * Version: 1.5.11
     6 * Version: 1.5.12
    77 * Requires at least: 5.6
    88 * Requires PHP: 7.0
    … …  
    1818}
    1919
    20 define('AMIN_CHAT_BUTTON_VERSION', '1.5.11');
     20define('AMIN_CHAT_BUTTON_VERSION', '1.5.12');
    2121
    2222/**
    … …  
    434434}
    435435
     436/**
     437 * URL of the page being viewed.
     438 *
     439 * Scheme and host come from the site settings rather than the Host header;
     440 * the path and query come from the request. The home path is not prepended,
     441 * because the request path already contains it (a subdirectory install or a
     442 * language prefix in the home URL would otherwise be doubled).
     443 *
     444 * @return string Current URL, or an empty string when it cannot be determined.
     445 */
     446function amin_chat_button_current_url() {
     447    if (!isset($_SERVER['REQUEST_URI'])) {
     448        return '';
     449    }
     450
     451    $request_uri = esc_url_raw(wp_unslash($_SERVER['REQUEST_URI']));
     452    $home        = wp_parse_url(home_url());
     453
     454    if (empty($home['host'])) {
     455        return $request_uri;
     456    }
     457
     458    $origin = (isset($home['scheme']) ? $home['scheme'] : 'https') . '://' . $home['host'];
     459    if (isset($home['port'])) {
     460        $origin .= ':' . $home['port'];
     461    }
     462
     463    return $origin . $request_uri;
     464}
     465
    436466function amin_chat_button_plugin_add_button() {
    437467    if (get_option('amin_chat_button_plugin_enabled', '0') !== '1') return;
    … …  
    461491    );
    462492
    463     // Current URL, built by core instead of raw $_SERVER input
    464     $current_url = home_url(add_query_arg(array(), null));
     493    $current_url = amin_chat_button_current_url();
    465494
    466495    // Do not display the button on prohibited URLs
  • amin-chat-button/tags/1.5.12/readme.txt

    r3823846 r3823932  
    44Requires at least: 5.6
    55Tested up to: 7.2
    6 Stable tag: 1.5.11
     6Stable tag: 1.5.12
    77Requires PHP: 7.0
    88License: GPLv2 or later
    … …  
    7171== Upgrade Notice ==
    7272
     73= 1.5.12 =
     74Important fix: since 1.5.9 the plugin did not see the address of the current page, so "Prohibited URLs" and the per-language phone number and message had no effect. Please update.
     75
    7376= 1.5.11 =
    7477Compatibility with WordPress 7.2. Security hardening of the button click handler and fixes for the prohibited URLs list, the direct link mode, the localization codes and the default button position.
    … …  
    8184
    8285== Changelog ==
     86
     87= 1.5.12 =
     88* Fixed a regression introduced in 1.5.9: the address of the current page was not detected, so the button was shown on pages listed in "Prohibited URLs", and the phone number, message and link for other localizations were not applied.
     89* The current address no longer repeats the home path on sites installed in a subdirectory or with a language prefix in the site address.
    8390
    8491= 1.5.11 =
  • amin-chat-button/trunk/chat-button.php

    r3823846 r3823932  
    44 * Plugin URI: https://wordpress.org/plugins/amin-chat-button/
    55 * Description: WhatsApp Chat🔥. Adds a pulsating WhatsApp or Telegram button 🍀 to your website. Fast and easy installation. Setting up target id GTM and YandexMetrics. Setting pre-filled Message.
    6  * Version: 1.5.11
     6 * Version: 1.5.12
    77 * Requires at least: 5.6
    88 * Requires PHP: 7.0
    … …  
    1818}
    1919
    20 define('AMIN_CHAT_BUTTON_VERSION', '1.5.11');
     20define('AMIN_CHAT_BUTTON_VERSION', '1.5.12');
    2121
    2222/**
    … …  
    434434}
    435435
     436/**
     437 * URL of the page being viewed.
     438 *
     439 * Scheme and host come from the site settings rather than the Host header;
     440 * the path and query come from the request. The home path is not prepended,
     441 * because the request path already contains it (a subdirectory install or a
     442 * language prefix in the home URL would otherwise be doubled).
     443 *
     444 * @return string Current URL, or an empty string when it cannot be determined.
     445 */
     446function amin_chat_button_current_url() {
     447    if (!isset($_SERVER['REQUEST_URI'])) {
     448        return '';
     449    }
     450
     451    $request_uri = esc_url_raw(wp_unslash($_SERVER['REQUEST_URI']));
     452    $home        = wp_parse_url(home_url());
     453
     454    if (empty($home['host'])) {
     455        return $request_uri;
     456    }
     457
     458    $origin = (isset($home['scheme']) ? $home['scheme'] : 'https') . '://' . $home['host'];
     459    if (isset($home['port'])) {
     460        $origin .= ':' . $home['port'];
     461    }
     462
     463    return $origin . $request_uri;
     464}
     465
    436466function amin_chat_button_plugin_add_button() {
    437467    if (get_option('amin_chat_button_plugin_enabled', '0') !== '1') return;
    … …  
    461491    );
    462492
    463     // Current URL, built by core instead of raw $_SERVER input
    464     $current_url = home_url(add_query_arg(array(), null));
     493    $current_url = amin_chat_button_current_url();
    465494
    466495    // Do not display the button on prohibited URLs
  • amin-chat-button/trunk/readme.txt

    r3823846 r3823932  
    44Requires at least: 5.6
    55Tested up to: 7.2
    6 Stable tag: 1.5.11
     6Stable tag: 1.5.12
    77Requires PHP: 7.0
    88License: GPLv2 or later
    … …  
    7171== Upgrade Notice ==
    7272
     73= 1.5.12 =
     74Important fix: since 1.5.9 the plugin did not see the address of the current page, so "Prohibited URLs" and the per-language phone number and message had no effect. Please update.
     75
    7376= 1.5.11 =
    7477Compatibility with WordPress 7.2. Security hardening of the button click handler and fixes for the prohibited URLs list, the direct link mode, the localization codes and the default button position.
    … …  
    8184
    8285== Changelog ==
     86
     87= 1.5.12 =
     88* Fixed a regression introduced in 1.5.9: the address of the current page was not detected, so the button was shown on pages listed in "Prohibited URLs", and the phone number, message and link for other localizations were not applied.
     89* The current address no longer repeats the home path on sites installed in a subdirectory or with a language prefix in the site address.
    8390
    8491= 1.5.11 =
Note: See TracChangeset for help on using the changeset viewer.