Changeset 3598150 for subscription-system/trunk/subscription-system.php
- Timestamp:
- 07/06/2026 05:21:45 PM (4 months ago)
- File:
-
- 1 edited
-
subscription-system/trunk/subscription-system.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
subscription-system/trunk/subscription-system.php
r3587496 r3598150 17 17 * Plugin URI: https://mediahubster.in/subscription-system 18 18 * Description: A comprehensive subscription management system for WordPress. 19 * Version: 1.0.1 719 * Version: 1.0.18 20 20 * Author: Joe Youngblood 21 21 * Author URI: https://mediahubster.in … … 97 97 98 98 // Define plugin constants 99 define('SUBS_SYS_VERSION', '1.0.1 7');99 define('SUBS_SYS_VERSION', '1.0.18'); 100 100 define('SUBS_SYS_PLUGIN_DIR', plugin_dir_path(__FILE__)); 101 101 define('SUBS_SYS_PLUGIN_URL', plugin_dir_url(__FILE__)); 102 102 define('SUBS_SYS_PLUGIN_BASENAME', plugin_basename(__FILE__)); 103 104 /** 105 * Shared helper: enqueue interest-subscribe modal assets + localize script vars. 106 * Called by both the shortcode handler and the floating-button/auto-open renderer 107 * so the JS object is always fully populated regardless of which trigger is used. 108 * 109 * @param string $plugin_name Plugin slug. 110 * @param string $version Plugin version string. 111 */ 112 function subs_sys_enqueue_interest_modal_assets( $plugin_name, $version ) { 113 static $done = false; 114 if ( $done ) { 115 return; 116 } 117 $done = true; 118 119 wp_enqueue_style( 120 $plugin_name . '-interest-subscribe', 121 SUBS_SYS_PLUGIN_URL . 'public/css/interest-subscribe.css', 122 array(), 123 $version 124 ); 125 126 wp_enqueue_script( 127 $plugin_name . '-interest-subscribe', 128 SUBS_SYS_PLUGIN_URL . 'public/js/interest-subscribe.js', 129 array( 'jquery' ), 130 $version, 131 true 132 ); 133 134 $current_user = wp_get_current_user(); 135 $is_logged_in = $current_user->exists(); 136 137 wp_localize_script( 138 $plugin_name . '-interest-subscribe', 139 'ssInterestVars', 140 array( 141 'ajax_url' => admin_url( 'admin-ajax.php' ), 142 'nonce' => wp_create_nonce( 'interest_subscription_nonce' ), 143 'auto_open' => (int) get_option( 'subs_modal_auto_open', 0 ), 144 'auto_open_delay' => absint( get_option( 'subs_modal_auto_open_delay', 3 ) ), 145 'hide_fields_logged_in' => (int) get_option( 'subs_modal_hide_fields_logged_in', 1 ), 146 'is_logged_in' => $is_logged_in ? 1 : 0, 147 'i18n' => array( 148 'processing' => __( 'Processing...', 'subscription-system' ), 149 'submit' => __( 'Subscribe', 'subscription-system' ), 150 'error' => __( 'Something went wrong. Please try again.', 'subscription-system' ), 151 'select_plan' => __( 'Please select a subscription plan.', 'subscription-system' ), 152 ), 153 ) 154 ); 155 } 103 156 104 157 // Load Composer autoloader if it exists … … 312 365 KEY status (status) 313 366 ) $charset_collate;"; 367 368 // Create interest subscriptions table 369 $interest_table = $wpdb->prefix . 'subscription_interest_subscriptions'; 370 $sql_interest = "CREATE TABLE IF NOT EXISTS $interest_table ( 371 id mediumint(9) NOT NULL AUTO_INCREMENT, 372 user_id bigint(20) DEFAULT NULL, 373 plan_id mediumint(9) DEFAULT NULL, 374 subscriber_name varchar(100) NOT NULL, 375 subscriber_email varchar(100) NOT NULL, 376 category_ids text NOT NULL, 377 tag_ids text NOT NULL, 378 plan_type varchar(20) NOT NULL DEFAULT 'free', 379 status varchar(20) NOT NULL DEFAULT 'active', 380 payment_id varchar(100) DEFAULT NULL, 381 created_at datetime DEFAULT CURRENT_TIMESTAMP NOT NULL, 382 updated_at datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL, 383 PRIMARY KEY (id), 384 KEY user_id (user_id), 385 KEY plan_id (plan_id), 386 KEY subscriber_email (subscriber_email), 387 KEY status (status), 388 KEY plan_type (plan_type) 389 ) $charset_collate;"; 314 390 315 391 require_once(ABSPATH . 'wp-admin/includes/upgrade.php'); … … 324 400 dbDelta($sql_content_subscriptions); 325 401 dbDelta($sql_content_notifications); 402 dbDelta($sql_interest); 326 403 327 404 // Add version to options … … 364 441 $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}subscription_content_subscriptions"); 365 442 $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}subscription_content_notifications"); 443 $wpdb->query("DROP TABLE IF EXISTS {$wpdb->prefix}subscription_interest_subscriptions"); 366 444 367 445 // Delete options
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)