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:
s4luorth
2026-06-08 14:08:08 +02:00
parent c796400492
commit 2ef1d0769b
10 changed files with 101 additions and 11 deletions

View File

@@ -50,6 +50,9 @@ class CB_Settings {
$clean['custom_css'] = isset( $input['custom_css'] )
? wp_strip_all_tags( $input['custom_css'] )
: '';
// Hiding the promo badge only ever takes effect with an active unlimited
// licence (enforced again at render time), but we store the choice as-is.
$clean['hide_badge'] = ! empty( $input['hide_badge'] );
return $clean;
}
@@ -69,6 +72,7 @@ class CB_Settings {
'button_hover_bg' => '#1a369a',
'button_hover_text' => '#ffffff',
'custom_css' => '',
'hide_badge' => false,
];
}
@@ -666,6 +670,18 @@ class CB_Settings {
echo '<tr><th scope="row"><label>' . esc_html( $label ) . '</label></th>';
echo '<td><input type="text" class="cb-color-picker" name="' . esc_attr( CB_STYLE_OPTION . '[' . $key . ']' ) . '" value="' . $val . '" data-default-color="' . $val . '"></td></tr>';
}
// Promo-badge toggle — only effective with an active unlimited licence.
$unlimited = CB_License::is_unlimited();
echo '<tr><th scope="row">' . esc_html__( 'Werbe-Badge', 'gdpr-content-blocker' ) . '</th><td>';
echo '<label><input type="checkbox" name="' . esc_attr( CB_STYLE_OPTION . '[hide_badge]' ) . '" value="1" '
. checked( ! empty( $style['hide_badge'] ), true, false )
. ( $unlimited ? '' : ' disabled' ) . '> '
. esc_html__( 'Badge „GDPR Content Blocker" im Platzhalter ausblenden', 'gdpr-content-blocker' ) . '</label>';
if ( ! $unlimited ) {
echo '<p class="description">' . esc_html__( 'Das Ausblenden ist nur mit einer aktiven Unlimited-Lizenz möglich.', 'gdpr-content-blocker' ) . '</p>';
}
echo '</td></tr>';
echo '<tr><th scope="row"><label>' . esc_html__( 'Custom CSS', 'gdpr-content-blocker' ) . '</label></th>';
echo '<td><textarea name="' . esc_attr( CB_STYLE_OPTION . '[custom_css]' ) . '" rows="8" class="large-text code">' . esc_textarea( $style['custom_css'] ) . '</textarea>';
echo '<p class="description">' . esc_html__( 'Wird nach den CSS-Variablen eingebunden und kann diese überschreiben. Tipp: denselben Präfix verwenden, z. B. .cb-blocker .cb-blocker__button { … }', 'gdpr-content-blocker' ) . '</p>';