@@ -23,27 +23,12 @@ public static function activate() {
2323 }
2424
2525 private static function migrate_old_option () {
26- // --- 1. admin wallet address ---
27- $ old_admin_addr = get_option ( 'pb_paywall_admin_wallet_address ' , '' );
28- $ new_admin_addr = get_option ( 'paybutton_admin_wallet_address ' , '' );
29- if ( ! empty ( $ old_admin_addr ) && empty ( $ new_admin_addr ) ) {
30- update_option ( 'paybutton_admin_wallet_address ' , $ old_admin_addr );
31- delete_option ( 'pb_paywall_admin_wallet_address ' );
32- }
33-
34- // --- 2. unlocked‑indicator colours ---
35- $ bg_old = get_option ( 'unlocked_indicator_bg_color ' , '' );
36- $ bg_new = get_option ( 'paybutton_unlocked_indicator_bg_color ' , '' );
37- if ( ! empty ( $ bg_old ) && empty ( $ bg_new ) ) {
38- update_option ( 'paybutton_unlocked_indicator_bg_color ' , $ bg_old );
39- delete_option ( 'unlocked_indicator_bg_color ' );
40- }
41-
42- $ txt_old = get_option ( 'unlocked_indicator_text_color ' , '' );
43- $ txt_new = get_option ( 'paybutton_unlocked_indicator_text_color ' , '' );
26+ // --- 1. unlocked‑indicator colours ---
27+ $ txt_old = get_option ( 'paybutton_unlocked_indicator_text_color ' , '' );
28+ $ txt_new = get_option ( 'paybutton_unlocked_indicator_color ' , '' );
4429 if ( ! empty ( $ txt_old ) && empty ( $ txt_new ) ) {
45- update_option ( 'paybutton_unlocked_indicator_text_color ' , $ txt_old );
46- delete_option ( 'unlocked_indicator_text_color ' );
30+ update_option ( 'paybutton_unlocked_indicator_color ' , $ txt_old );
31+ delete_option ( 'paybutton_unlocked_indicator_text_color ' );
4732 }
4833 }
4934
@@ -74,31 +59,6 @@ public static function create_tables() {
7459 require_once ( ABSPATH . 'wp-admin/includes/upgrade.php ' );
7560 dbDelta ( $ sql );
7661
77- // Rename old 'ecash_address' column to 'pb_paywall_user_wallet_address', if it still exists
78- $ old_col_check = $ wpdb ->get_var (
79- "SHOW COLUMNS FROM $ table_name LIKE 'ecash_address' "
80- );
81- $ new_col_check = $ wpdb ->get_var (
82- "SHOW COLUMNS FROM $ table_name LIKE 'pb_paywall_user_wallet_address' "
83- );
84-
85- if ( $ old_col_check && ! $ new_col_check ) {
86- $ wpdb ->query ("ALTER TABLE $ table_name CHANGE ecash_address pb_paywall_user_wallet_address VARCHAR(255) NOT NULL " );
87- }
88-
89- // Rename old index 'ecash_address_idx' to 'pb_paywall_user_wallet_address_idx'
90- $ old_idx_check = $ wpdb ->get_var ("
91- SHOW INDEX FROM $ table_name WHERE Key_name = 'ecash_address_idx'
92- " );
93- $ new_idx_check = $ wpdb ->get_var ("
94- SHOW INDEX FROM $ table_name WHERE Key_name = 'pb_paywall_user_wallet_address_idx'
95- " );
96- if ( $ old_idx_check && ! $ new_idx_check ) {
97- // Drop the old index
98- $ wpdb ->query ("ALTER TABLE $ table_name DROP INDEX ecash_address_idx " );
99- // Add the new one
100- $ wpdb ->query ("ALTER TABLE $ table_name ADD INDEX pb_paywall_user_wallet_address_idx (pb_paywall_user_wallet_address) " );
101- }
10262 }
10363
10464 /**
0 commit comments