Skip to content

v1.0.14: Activation Hook Fix

Latest

Choose a tag to compare

@utakapp utakapp released this 29 Jan 16:38

🔧 Version 1.0.14: Activation Hook Fix

🐛 Critical Bugfix

Activation Hook funktioniert jetzt korrekt!

Das Plugin erstellt die Datenbanktabelle nun automatisch bei Aktivierung.

Problem (vorher):

  • register_activation_hook() wurde im Constructor aufgerufen
  • Hook wurde nie ausgelöst
  • Tabelle musste manuell erstellt werden

Lösung (jetzt):

  • ✅ Hook außerhalb der Klasse registriert
  • ✅ activate() und deactivate() als static Methoden
  • ✅ Tabelle wird automatisch erstellt
  • ✅ Standard-Optionen werden gesetzt

✨ Neue Features

encryption_key Feld hinzugefügt:

  • Vollständige Unterstützung für Wallet-Verschlüsselung
  • encryption_key Spalte in der Datenbank
  • Jede Wallet hat ihren eigenen Verschlüsselungsschlüssel

🔧 Technical Changes

Activation Hook:

// Vorher (funktionierte nicht):
private function __construct() {
    register_activation_hook(__FILE__, array($this, 'activate'));
}

// Jetzt (funktioniert):
// Am Ende der Datei, außerhalb der Klasse:
register_activation_hook(__FILE__, array('Sui_User_Wallets', 'activate'));

// Methoden als static:
public static function activate() {
    self::create_tables_static();
    self::set_default_options_static();
}

Datenbank-Schema:

CREATE TABLE wp_sui_user_wallets (
    id bigint(20) NOT NULL AUTO_INCREMENT,
    user_id bigint(20) NOT NULL,
    wallet_address varchar(66) NOT NULL,
    encrypted_private_key text NOT NULL,
    encryption_key varchar(255) NOT NULL,  -- NEU!
    created_at datetime DEFAULT CURRENT_TIMESTAMP,
    last_balance_check datetime DEFAULT NULL,
    cached_balance varchar(50) DEFAULT '0',
    PRIMARY KEY (id),
    UNIQUE KEY user_id (user_id),
    UNIQUE KEY wallet_address (wallet_address)
);

📦 Installation

Download: sui-user-wallets-v1.0.14.zip

Schritte:

  1. Alte Version deaktivieren und löschen (optional)
  2. Neue Version hochladen: WordPress → Plugins → Installieren → Plugin hochladen
  3. Aktivieren
  4. ✅ Tabelle wird automatisch erstellt!

✅ Was funktioniert jetzt

  • ✅ Plugin aktivieren → Tabelle wird automatisch erstellt
  • ✅ Standard-Optionen werden gesetzt
  • ✅ Keine manuelle Datenbank-Einrichtung nötig
  • ✅ Alle bestehenden Features funktionieren weiterhin
  • ✅ Bulk User Creation (getestet mit 20+ Users gleichzeitig)
  • ✅ Automatische Wallet-Erstellung/-Löschung
  • ✅ Private Key Verschlüsselung

🧪 Testing

Getestet mit:

  • WordPress 6.9
  • PHP 8.3.30
  • MySQL 8.0
  • 20+ Users gleichzeitig erstellt
  • Performance: ~99ms pro User

Test-Ergebnisse:

✅ Plugin aktiviert
✅ Tabelle automatisch erstellt
✅ Standard-Optionen gesetzt
✅ Alle Felder vorhanden
✅ UNIQUE Constraints funktionieren
✅ Keine Duplikate

🔄 Update von älteren Versionen

Von v1.0.13 oder älter:

  • Einfach updaten, alle Daten bleiben erhalten
  • Bestehende Tabellen werden nicht verändert
  • Neue Installationen bekommen encryption_key Feld automatisch

Wichtig: Wenn Sie das Plugin NEU installieren, wird die Tabelle jetzt automatisch erstellt!


📝 Changelog

Bugfixes:

  • 🐛 Activation Hook funktioniert jetzt korrekt
  • 🐛 Tabelle wird bei Aktivierung erstellt

Features:

  • ✨ encryption_key Feld zur Datenbank hinzugefügt

Improvements:

  • 🔧 Statische Aktivierungs-Methoden
  • 🔧 Legacy-Wrapper für Abwärtskompatibilität
  • 🔧 Bessere Hooks-Registrierung

Vollständiger Changelog: v1.0.13...v1.0.14

Getestet: ✅ 100% Test Success Rate