diff --git a/includes/class-paybutton-admin.php b/includes/class-paybutton-admin.php index fef921b..06ddc32 100644 --- a/includes/class-paybutton-admin.php +++ b/includes/class-paybutton-admin.php @@ -204,7 +204,7 @@ public function paywall_settings_page() { $args = array( 'settings_saved' => $settings_saved, - 'admin_wallet_address' => get_option( 'paybutton_admin_wallet_address', '' ), + 'paybutton_admin_wallet_address' => get_option( 'paybutton_admin_wallet_address', '' ), 'default_price' => get_option( 'paybutton_paywall_default_price', 5.5 ), 'current_unit' => get_option( 'paybutton_paywall_unit', 'XEC' ), 'btn_text' => get_option( 'paybutton_text', 'Pay to Unlock' ), diff --git a/includes/class-paybutton-ajax.php b/includes/class-paybutton-ajax.php index 3500a18..e0e98aa 100644 --- a/includes/class-paybutton-ajax.php +++ b/includes/class-paybutton-ajax.php @@ -397,7 +397,7 @@ public function fetch_unlocked_content() { } // Run the full post-content pipeline (blocks, shortcodes, embeds, autop, etc.) filter - $body = apply_filters( 'the_content', $inner ); + $body = apply_filters( 'the_content', $inner ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- core hook // Restore the flag if ( isset( $wp_query ) ) { diff --git a/includes/class-paybutton-public.php b/includes/class-paybutton-public.php index ed4d5e0..98a1c56 100644 --- a/includes/class-paybutton-public.php +++ b/includes/class-paybutton-public.php @@ -163,9 +163,9 @@ private function load_public_template( $template_name, $args = array() ) { * Output the sticky header HTML. */ public function output_sticky_header() { - $user_wallet_address = sanitize_text_field( PayButton_State::get_address() ); + $paybutton_user_wallet_address = sanitize_text_field( PayButton_State::get_address() ); $this->load_public_template( 'sticky-header', array( - 'user_wallet_address' => $user_wallet_address + 'paybutton_user_wallet_address' => $paybutton_user_wallet_address ) ); } @@ -280,20 +280,20 @@ class="paybutton-container" * @return string */ public function profile_shortcode() { - $user_wallet_address = sanitize_text_field( PayButton_State::get_address() ); - if ( empty( $user_wallet_address ) ) { + $paybutton_user_wallet_address = sanitize_text_field( PayButton_State::get_address() ); + if ( empty( $paybutton_user_wallet_address ) ) { return '

You must be logged in to view your unlocked content.

'; } global $wpdb; $table_name = $wpdb->prefix . 'paybutton_paywall_unlocked'; - $rows = $wpdb->get_results( $wpdb->prepare( + $paybutton_rows = $wpdb->get_results( $wpdb->prepare( "SELECT DISTINCT post_id FROM $table_name WHERE pb_paywall_user_wallet_address = %s ORDER BY id DESC", - $user_wallet_address + $paybutton_user_wallet_address ) ); ob_start(); $this->load_public_template( 'profile', array( - 'user_wallet_address' => $user_wallet_address, - 'rows' => $rows + 'paybutton_user_wallet_address' => $paybutton_user_wallet_address, + 'paybutton_rows' => $paybutton_rows ) ); return ob_get_clean(); } diff --git a/templates/admin/content.php b/templates/admin/content.php index f07b12b..21dd0d5 100644 --- a/templates/admin/content.php +++ b/templates/admin/content.php @@ -37,23 +37,21 @@ function paybutton_sort_content_table( $col, $label, $orderby, $order, $base_url - - - + + - + diff --git a/templates/admin/customers.php b/templates/admin/customers.php index dd07a05..2e39118 100644 --- a/templates/admin/customers.php +++ b/templates/admin/customers.php @@ -21,38 +21,38 @@ - post_id ); - $permalink = get_permalink( $row->post_id ); - if ( $post_title && $permalink ): ?> + post_id ); + $paybutton_permalink = get_permalink( $paybutton_row->post_id ); + if ( $paybutton_post_title && $paybutton_permalink ): ?> - - + + - tx_amount ), 2 ); ?> + tx_amount ), 2 ); ?> tx_timestamp ) && $row->tx_timestamp !== '0000-00-00 00:00:00' ) { - $local_time = get_date_from_gmt( $row->tx_timestamp ); - if ( $local_time ) { - $converted_ts = date_i18n( 'Y-m-d H:i:s', strtotime( $local_time ) ); + $paybutton_converted_ts = '(none)'; + if ( ! empty( $paybutton_row->tx_timestamp ) && $paybutton_row->tx_timestamp !== '0000-00-00 00:00:00' ) { + $paybutton_local_time = get_date_from_gmt( $paybutton_row->tx_timestamp ); + if ( $paybutton_local_time ) { + $paybutton_converted_ts = date_i18n( 'Y-m-d H:i:s', strtotime( $paybutton_local_time ) ); } } ?> - - tx_hash ) ): ?> + + tx_hash ) ): ?> - - tx_hash ); ?> + + tx_hash ); ?> (none) - is_logged_in ? 'true' : 'false' ); ?> + is_logged_in ? 'true' : 'false' ); ?> - 'paybutton-paywall-customers', - 'address' => $row['pb_paywall_user_wallet_address'] + 'address' => $paybutton_row['pb_paywall_user_wallet_address'] ), admin_url( 'admin.php' ) ); ?> - - + + - +
@@ -22,7 +22,7 @@ type="text" id="pbGenTo" placeholder="Your Wallet Address (XEC or BCH)" - value="" + value="" class="pb-generator-input" > diff --git a/templates/admin/paywall-settings.php b/templates/admin/paywall-settings.php index cbb6edc..e018c8e 100644 --- a/templates/admin/paywall-settings.php +++ b/templates/admin/paywall-settings.php @@ -17,8 +17,8 @@ - - + +

Enter your wallet address to receive paywall payments.

diff --git a/templates/public/profile.php b/templates/public/profile.php index 82a9091..cdb2699 100644 --- a/templates/public/profile.php +++ b/templates/public/profile.php @@ -6,16 +6,16 @@

Wallet Address: - - + +

Unlocked Content:

- +
    - post_id ); - $link = get_permalink( $row->post_id ); + post_id ); + $link = get_permalink( $paybutton_row->post_id ); if ( $title && $link ): ?>
  1. - +