Plugin Directory

Changeset 3801102


Ignore:
Timestamp:
11/13/2026 07:57:30 PM (less than one hour ago)
Author:
kaatai
Message:

3.41.15: Dienste ohne Pflichtangabe nicht mit Platzhalter ausgeben

Location:
kaatai-consent-manager
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • kaatai-consent-manager/tags/3.41.15/config/version.php

    r3799260 r3801102  
    88 *
    99 * @since 3.5.4.1
    10  * @version 3.41.14
     10 * @version 3.41.15
    1111 */
    1212
    … …  
    2020     * Used for: Plugin header, admin display, update checks
    2121     */
    22     'plugin'  => '3.41.14',
     22    'plugin'  => '3.41.15',
    2323
    2424    /**
    … …  
    4444     * Used for: Debugging, release notes
    4545     */
    46     'last_updated' => '2026-11-12T21:00:00Z',
     46    'last_updated' => '2026-11-13T21:00:00Z',
    4747
    4848    /**
    … …  
    5050     */
    5151    'changelog' => array(
     52        '3.41.15' => array(
     53            'date' => '2026-11-13',
     54            'type' => 'fix',
     55            'changes' => array(
     56                'FIX: Ein aktiver Dienst mit leerer Pflichtangabe (z. B. Clarity-Projekt-ID, GA4-Mess-ID) wird nicht mehr ausgegeben. Vorher lud er nach der Zustimmung mit rohem Platzhalter {{…}}, etwa clarity.ms/tag/{{project_id}} mit Antwort 400.',
     57                'FIX: Keine PHP-Deprecation mehr bei Diensten ohne Einstellungen (json_decode(null), PHP 8.1+).',
     58            ),
     59        ),
    5260        '3.41.14' => array(
    5361            'date' => '2026-11-12',
  • kaatai-consent-manager/tags/3.41.15/includes/frontend.php

    r3756374 r3801102  
    198198            $init_snippet = $vendor['init_snippet'];
    199199            $dependencies = $vendor['dependencies'];
    200             $params = json_decode($vendor['params_values'], true);
     200            // (string): params_values is NULL for vendors without settings; json_decode(null) is deprecated since PHP 8.1.
     201            $params = json_decode((string) $vendor['params_values'], true);
    201202
    202203            // Replace parameters in snippet and dependencies
    … …  
    206207                    $dependencies = str_replace('{{' . $key . '}}', sanitize_text_field($value), $dependencies);
    207208                }
     209            }
     210
     211            // A required parameter without a value (e.g. Clarity project ID) leaves the
     212            // code without its ID. Printing it sends a useless request to the vendor
     213            // after consent: clarity.ms/tag/{{project_id}} answered 400 on four shops.
     214            // Only parameters marked required count; optional ones keep the old behaviour.
     215            if (kccm_vendor_missing_required($vendor['params_config'] ?? '', $params)) {
     216                echo "<!-- CCM Artifact skipped (missing parameter): " . esc_html($vendor['name']) . " -->\n";
     217                continue;
    208218            }
    209219
    … …  
    243253}
    244254add_action('wp_head', 'kccm_inject_head_scripts', 1);
     255
     256/**
     257 * True when a parameter marked 'required' in the vendor's params_config has no
     258 * value in params_values (missing, not a scalar, or only whitespace).
     259 *
     260 * @param string|null $params_config JSON from the vendors table.
     261 * @param array|null  $params        Decoded params_values.
     262 */
     263function kccm_vendor_missing_required($params_config, $params)
     264{
     265    $config = json_decode((string) $params_config, true);
     266    if (!is_array($config)) {
     267        return false;
     268    }
     269    $params = is_array($params) ? $params : array();
     270    foreach ($config as $key => $def) {
     271        if (!is_array($def) || empty($def['required'])) {
     272            continue;
     273        }
     274        $value = $params[$key] ?? '';
     275        if (!is_scalar($value) || trim((string) $value) === '') {
     276            return true;
     277        }
     278    }
     279    return false;
     280}
    245281
    246282
  • kaatai-consent-manager/tags/3.41.15/kaatai-consent-manager.php

    r3799260 r3801102  
    44 * Plugin URI: https://consent-management.kaatai.de
    55 * Description: A lightweight GDPR-compliant consent management tool with Google Consent Mode v2 support, cookie scanning, and tracking script control.
    6  * Version: 3.41.14
     6 * Version: 3.41.15
    77 * Author: KaaTai
    88 * Author URI: https://consent-management.kaatai.de/about
  • kaatai-consent-manager/tags/3.41.15/readme.txt

    r3799260 r3801102  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 3.41.14
     7Stable tag: 3.41.15
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    222222== Changelog ==
    223223
     224= 3.41.15 -- November 13, 2026 =
     225* Fix: An active service whose required setting is empty (for example the Microsoft Clarity project ID or the GA4 measurement ID) is no longer printed. Before, it loaded after consent with a raw {{placeholder}} and the vendor answered with an error.
     226* Fix: No PHP deprecation notice for services without settings (PHP 8.1+).
     227
    224228= 3.41.14 -- November 12, 2026 =
    225229* Fix: Policy snapshots are now cleaned up by the daily log cleanup. Every snapshot a consent log refers to is kept, as are the latest one and all snapshots younger than a day. Before, no snapshot was ever deleted, so frequent configuration changes could make the table grow without limit.
    … …  
    438442== Upgrade Notice ==
    439443
     444= 3.41.15 =
     445Services with a missing required ID are no longer loaded with a placeholder.
     446
    440447= 3.41.14 =
    441448Removes policy snapshots that no consent log refers to. Consent evidence is kept.
  • kaatai-consent-manager/trunk/config/version.php

    r3799260 r3801102  
    88 *
    99 * @since 3.5.4.1
    10  * @version 3.41.14
     10 * @version 3.41.15
    1111 */
    1212
    … …  
    2020     * Used for: Plugin header, admin display, update checks
    2121     */
    22     'plugin'  => '3.41.14',
     22    'plugin'  => '3.41.15',
    2323
    2424    /**
    … …  
    4444     * Used for: Debugging, release notes
    4545     */
    46     'last_updated' => '2026-11-12T21:00:00Z',
     46    'last_updated' => '2026-11-13T21:00:00Z',
    4747
    4848    /**
    … …  
    5050     */
    5151    'changelog' => array(
     52        '3.41.15' => array(
     53            'date' => '2026-11-13',
     54            'type' => 'fix',
     55            'changes' => array(
     56                'FIX: Ein aktiver Dienst mit leerer Pflichtangabe (z. B. Clarity-Projekt-ID, GA4-Mess-ID) wird nicht mehr ausgegeben. Vorher lud er nach der Zustimmung mit rohem Platzhalter {{…}}, etwa clarity.ms/tag/{{project_id}} mit Antwort 400.',
     57                'FIX: Keine PHP-Deprecation mehr bei Diensten ohne Einstellungen (json_decode(null), PHP 8.1+).',
     58            ),
     59        ),
    5260        '3.41.14' => array(
    5361            'date' => '2026-11-12',
  • kaatai-consent-manager/trunk/includes/frontend.php

    r3756374 r3801102  
    198198            $init_snippet = $vendor['init_snippet'];
    199199            $dependencies = $vendor['dependencies'];
    200             $params = json_decode($vendor['params_values'], true);
     200            // (string): params_values is NULL for vendors without settings; json_decode(null) is deprecated since PHP 8.1.
     201            $params = json_decode((string) $vendor['params_values'], true);
    201202
    202203            // Replace parameters in snippet and dependencies
    … …  
    206207                    $dependencies = str_replace('{{' . $key . '}}', sanitize_text_field($value), $dependencies);
    207208                }
     209            }
     210
     211            // A required parameter without a value (e.g. Clarity project ID) leaves the
     212            // code without its ID. Printing it sends a useless request to the vendor
     213            // after consent: clarity.ms/tag/{{project_id}} answered 400 on four shops.
     214            // Only parameters marked required count; optional ones keep the old behaviour.
     215            if (kccm_vendor_missing_required($vendor['params_config'] ?? '', $params)) {
     216                echo "<!-- CCM Artifact skipped (missing parameter): " . esc_html($vendor['name']) . " -->\n";
     217                continue;
    208218            }
    209219
    … …  
    243253}
    244254add_action('wp_head', 'kccm_inject_head_scripts', 1);
     255
     256/**
     257 * True when a parameter marked 'required' in the vendor's params_config has no
     258 * value in params_values (missing, not a scalar, or only whitespace).
     259 *
     260 * @param string|null $params_config JSON from the vendors table.
     261 * @param array|null  $params        Decoded params_values.
     262 */
     263function kccm_vendor_missing_required($params_config, $params)
     264{
     265    $config = json_decode((string) $params_config, true);
     266    if (!is_array($config)) {
     267        return false;
     268    }
     269    $params = is_array($params) ? $params : array();
     270    foreach ($config as $key => $def) {
     271        if (!is_array($def) || empty($def['required'])) {
     272            continue;
     273        }
     274        $value = $params[$key] ?? '';
     275        if (!is_scalar($value) || trim((string) $value) === '') {
     276            return true;
     277        }
     278    }
     279    return false;
     280}
    245281
    246282
  • kaatai-consent-manager/trunk/kaatai-consent-manager.php

    r3799260 r3801102  
    44 * Plugin URI: https://consent-management.kaatai.de
    55 * Description: A lightweight GDPR-compliant consent management tool with Google Consent Mode v2 support, cookie scanning, and tracking script control.
    6  * Version: 3.41.14
     6 * Version: 3.41.15
    77 * Author: KaaTai
    88 * Author URI: https://consent-management.kaatai.de/about
  • kaatai-consent-manager/trunk/readme.txt

    r3799260 r3801102  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 3.41.14
     7Stable tag: 3.41.15
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    222222== Changelog ==
    223223
     224= 3.41.15 -- November 13, 2026 =
     225* Fix: An active service whose required setting is empty (for example the Microsoft Clarity project ID or the GA4 measurement ID) is no longer printed. Before, it loaded after consent with a raw {{placeholder}} and the vendor answered with an error.
     226* Fix: No PHP deprecation notice for services without settings (PHP 8.1+).
     227
    224228= 3.41.14 -- November 12, 2026 =
    225229* Fix: Policy snapshots are now cleaned up by the daily log cleanup. Every snapshot a consent log refers to is kept, as are the latest one and all snapshots younger than a day. Before, no snapshot was ever deleted, so frequent configuration changes could make the table grow without limit.
    … …  
    438442== Upgrade Notice ==
    439443
     444= 3.41.15 =
     445Services with a missing required ID are no longer loaded with a placeholder.
     446
    440447= 3.41.14 =
    441448Removes policy snapshots that no consent log refers to. Consent evidence is kept.
Note: See TracChangeset for help on using the changeset viewer.