feat: Werbe-Badge im content blocker (unten rechts) + abschaltbar nur mit unlimited (v1.5.0)
- Kleines Badge "GDPR Content Blocker" unten rechts im platzhalter, verlinkt
auf die kaufseite (rel=nofollow sponsored). Server- und client-seitig.
- Wird IMMER angezeigt; abschaltbar via checkbox im Darstellung-tab
("Werbe-Badge ausblenden") - die checkbox ist aber nur mit aktiver
Unlimited-lizenz nutzbar (sonst disabled) und greift am render-punkt nur,
wenn is_unlimited() true ist.
- Dafuer speichert das plugin jetzt max_activations aus der backend-antwort
(activate/validate/swap) und bietet is_unlimited().
+ i18n DE/EN (134 strings). version 1.5.0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -107,8 +107,9 @@ class CB_Renderer {
|
||||
// Service data + i18n for client-side detection (JS-injected iframes such
|
||||
// as Elementor video widgets, sliders, …).
|
||||
wp_localize_script( 'cb-frontend', 'cbConfig', [
|
||||
'services' => self::services_for_js(),
|
||||
'i18n' => [
|
||||
'services' => self::services_for_js(),
|
||||
'showBadge' => self::show_badge(),
|
||||
'i18n' => [
|
||||
'recipient' => __( 'Empfänger:', 'gdpr-content-blocker' ),
|
||||
'purpose' => __( 'Zweck:', 'gdpr-content-blocker' ),
|
||||
'thirdCountry' => __( 'Datenübermittlung in ein Drittland außerhalb der EU/des EWR', 'gdpr-content-blocker' ),
|
||||
@@ -366,9 +367,25 @@ class CB_Renderer {
|
||||
. esc_html__( 'Diesen Dienst künftig immer laden', 'gdpr-content-blocker' )
|
||||
. '</label>'
|
||||
. '</div>'
|
||||
. ( self::show_badge() ? self::badge_html() : '' )
|
||||
. '</div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to show the promo badge. Always shown, EXCEPT when the site owner
|
||||
* has an active unlimited licence AND ticked "hide badge" in Appearance.
|
||||
*/
|
||||
public static function show_badge(): bool {
|
||||
$style = CB_Settings::get_style();
|
||||
return ! ( ! empty( $style['hide_badge'] ) && CB_License::is_unlimited() );
|
||||
}
|
||||
|
||||
/** Small "GDPR Content Blocker" badge in the bottom-right of the placeholder. */
|
||||
private static function badge_html(): string {
|
||||
return '<a class="cb-blocker__badge" href="https://lucas-orth.de/wp-plugins/gdpr-content-blocker/"'
|
||||
. ' target="_blank" rel="noopener noreferrer nofollow sponsored">GDPR Content Blocker</a>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Pull src + width + height out of an iframe string.
|
||||
* Height is also read from an inline style="height:NNNpx" if no attribute.
|
||||
|
||||
Reference in New Issue
Block a user