From a0972b4bbf8fc84cd4a92d3c08b45aae6c257e2a Mon Sep 17 00:00:00 2001 From: s4luorth Date: Sun, 7 Jun 2026 15:27:34 +0200 Subject: [PATCH] feat: belegte domains als liste mit papierkorb + status-live-refresh - Bei voller Lizenz werden alle belegten Domains untereinander gelistet, je mit Papierkorb-Button + Bestaetigungsdialog (statt Dropdown). - Trash gibt die Domain frei (deaktiviert serverseitig) und aktiviert diese Seite. - Lizenz-Tab re-validiert den Status live (max alle 5 Min), damit eine an anderer Stelle freigegebene Domain hier sofort als ungueltig erscheint statt stale aktiv. - EN-Uebersetzung (122) aktualisiert. Co-Authored-By: Claude Opus 4.8 --- .../includes/class-license.php | 59 +++++++++++------- .../includes/class-settings.php | 19 ++++++ .../languages/gdpr-content-blocker-en_US.mo | Bin 11405 -> 11473 bytes .../languages/gdpr-content-blocker-en_US.po | 15 +++-- hilfsdaten/build-en-mo.py | 7 ++- 5 files changed, 69 insertions(+), 31 deletions(-) diff --git a/gdpr-content-blocker/includes/class-license.php b/gdpr-content-blocker/includes/class-license.php index 937ca04..7fd9e5a 100644 --- a/gdpr-content-blocker/includes/class-license.php +++ b/gdpr-content-blocker/includes/class-license.php @@ -323,7 +323,17 @@ class CB_License { } public static function render_tab(): void { - $lic = self::get_license(); + $lic = self::get_license(); + + // Keep the shown status honest: if this site was deactivated elsewhere + // (e.g. another site freed this slot), re-validate live when the tab is + // opened — throttled to at most once every 5 minutes. + if ( in_array( $lic['status'], [ 'active', 'invalid' ], true ) + && ( time() - (int) $lic['last_check'] ) > 5 * MINUTE_IN_SECONDS ) { + self::cron_check(); + $lic = self::get_license(); + } + $status = $lic['status']; $badge = match ( $status ) { @@ -349,27 +359,32 @@ class CB_License { - -
- - - - - - - - - -
+ +

+

+ +

+
diff --git a/gdpr-content-blocker/includes/class-settings.php b/gdpr-content-blocker/includes/class-settings.php index 30eea00..f085096 100644 --- a/gdpr-content-blocker/includes/class-settings.php +++ b/gdpr-content-blocker/includes/class-settings.php @@ -466,6 +466,25 @@ class CB_Settings { .cb-admin-wrap .cb-tab-content { padding-top: 20px; } + /* bound-domains list (license full) */ + .cb-admin-wrap .cb-domain-list { + margin: 10px 0 0; + max-width: 480px; + } + .cb-admin-wrap .cb-domain-list li { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + padding: 8px 12px; + margin: 0 0 6px; + background: #fff; + border: 1px solid #dcdcde; + border-radius: 4px; + } + .cb-admin-wrap .cb-domain-list form { + margin: 0; + } .cb-admin-wrap .cb-field label { display: block; font-weight: 600; diff --git a/gdpr-content-blocker/languages/gdpr-content-blocker-en_US.mo b/gdpr-content-blocker/languages/gdpr-content-blocker-en_US.mo index d49b61b71b415ffc0ee5a8075c40a8eb8cd5f7dc..f68aaee1ce041867a189ff1c06c9e7c1fb8f3b5f 100644 GIT binary patch delta 2431 zcmYM!e`u9e9LMo9=bUbCnQf+(>#Wt*Hk)QHb7C?z6V$Y+>9mNuyR+@lyXVTich1ep zU1+9|MqEoQQ4B&5G3*+Vi9)p^%_8lGh#H1}ID+VhkTs*;pFLL`clUM9x#!3Ce9w8F z?Tz0yCNGa3`i9|e1ONB&e?42Z+kao>8dFI14Bm?uaTwmf9Q-fSo-^E-yQr692y1Z+ z?!r6pFpk6%sPU(9l`%nESc?a+7%yQ7 z{)uqz6D7N9J5)T`Jn~1a2IMv+tK1)+=VAmkKJ;%tw3HtEzpb#)JFx>gBst9 zPvGmwP;(0F@hYY;SHwGebia^ zp;CJ`<0Y)6ehrDil-wT#JRJ-5{LiPrnr7u-gE8w-sd@z;#r=35&!H~iAsYmA0u|^P zW@*E z>on@@e@6v8fZBO6ZzuJ$NX%vus^4N%pes?AJdDXT6xLH{%;HjHIy}kjO8L{Mg`Y#E z?&XZ{;Bo3FQE#@M^5C)Bj66u@FlvE5%*G3-057BFxq)wDaRvF;1cxeu%XJiWmVKzm z&!bX&1C^N~(xL?{4#BCY_BvDs=OQ1ol&>7zi2b+;^?0{e26rTe3NTqo{&i_~(xBAs z$6t^=6SaZz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?3;eFnL$|?0+o{m8c$9p%=fxBdEg{u%ZJWLnS(h{AQUE)XK*&A3wx? zyolQKE?x~)bO_ZSMlEatRf#iL9HMcK1|O3|6c?7DGTw?hOkUJpKaEQCS=5T(LOnN* zMwv z8;r-9*!@3IrH|(X@iCcP=3zBnz*7~<%TBmqXr(p zhw%yQ!ITxzpV&t*iT()km3bGnfN4y{SyUy>%IN(J)FI7}S%zBRI_$%(8)+!u7nqFS z#`?dY0{(_7>1EVwcm=gZ>7~)%_}g#|{l>^gNmt?`XH#kt!*%J4Lmt~_b=W?)&ljY1 zhkuvb@dYgR&Y-i$W!*n<%-hNBEsky3j?cDwyLVZ4cG*sc-NtQqcfgw77q$X?z1QjT zSRVW8K*#P1THQYSjvcVAEw&T1tw7Kn40`N9Km!$CPr1Tp)7z7FL?cG(GPcJh&<-!m z$c+qTe!3tM$QelpH{=zzdSZ!nI)R|=aakL@em|l8n+a diff --git a/gdpr-content-blocker/languages/gdpr-content-blocker-en_US.po b/gdpr-content-blocker/languages/gdpr-content-blocker-en_US.po index 96376f3..1b1fe18 100644 --- a/gdpr-content-blocker/languages/gdpr-content-blocker-en_US.po +++ b/gdpr-content-blocker/languages/gdpr-content-blocker-en_US.po @@ -57,14 +57,17 @@ msgstr "Status" msgid "Domain" msgstr "Domain" -msgid "Domain freigeben" -msgstr "Release domain" +msgid "Belegte Domains" +msgstr "Bound domains" -msgid "Diese Lizenz ist bereits auf den genannten Domains aktiv. Wählen Sie eine zum Freigeben aus – sie wird deaktiviert und diese Seite stattdessen aktiviert." -msgstr "This license is already active on the domains listed. Choose one to release — it will be deactivated and this site activated instead." +msgid "Diese Lizenz ist bereits auf folgenden Domains aktiv. Entfernen Sie eine, um den Platz freizugeben – diese Seite wird anschließend automatisch aktiviert." +msgstr "This license is already active on the following domains. Remove one to free a seat — this site will then be activated automatically." -msgid "Freigeben und diese Seite aktivieren" -msgstr "Release and activate this site" +msgid "Diese Domain wirklich aus der Lizenz entfernen?" +msgstr "Really remove this domain from the license?" + +msgid "Domain entfernen" +msgstr "Remove domain" msgid "Aus Sicherheitsgründen verdeckt. Zum Ändern bitte zuerst deaktivieren." msgstr "Hidden for security. To change it, deactivate first." diff --git a/hilfsdaten/build-en-mo.py b/hilfsdaten/build-en-mo.py index 79811fa..2024822 100644 --- a/hilfsdaten/build-en-mo.py +++ b/hilfsdaten/build-en-mo.py @@ -22,9 +22,10 @@ EN = [ "Not activated", "Status", "Domain", - "Release domain", - "This license is already active on the domains listed. Choose one to release — it will be deactivated and this site activated instead.", - "Release and activate this site", + "Bound domains", + "This license is already active on the following domains. Remove one to free a seat — this site will then be activated automatically.", + "Really remove this domain from the license?", + "Remove domain", "Hidden for security. To change it, deactivate first.", "Deactivate license", "Try again",