Changeset 3463813
- Timestamp:
- 02/17/2026 08:28:28 PM (7 weeks ago)
- Location:
- stacks-mobile-app-builder
- Files:
-
- 20 added
- 30 deleted
- 2 edited
-
tags/4.6.9 (deleted)
-
tags/4.7 (deleted)
-
tags/4.7.1 (deleted)
-
tags/4.7.2 (deleted)
-
tags/4.7.3 (deleted)
-
tags/4.8 (deleted)
-
tags/4.8.1 (deleted)
-
tags/4.8.2 (deleted)
-
tags/4.8.3 (deleted)
-
tags/5.0 (deleted)
-
tags/5.0.1 (deleted)
-
tags/5.0.2 (deleted)
-
tags/5.0.3 (deleted)
-
tags/5.0.5 (deleted)
-
tags/5.0.6 (deleted)
-
tags/5.0.7 (deleted)
-
tags/5.0.8 (deleted)
-
tags/5.1 (deleted)
-
tags/5.1.1 (deleted)
-
tags/5.2.1 (deleted)
-
tags/5.2.2 (deleted)
-
tags/5.2.3 (deleted)
-
tags/6.5.1 (deleted)
-
tags/7.0 (added)
-
tags/7.0/api (added)
-
tags/7.0/api/categories.php (added)
-
tags/7.0/api/orders.php (added)
-
tags/7.0/api/products.php (added)
-
tags/7.0/api/users.php (added)
-
tags/7.0/assets (added)
-
tags/7.0/assets/css (added)
-
tags/7.0/assets/css/stacks-main.css (added)
-
tags/7.0/assets/images (added)
-
tags/7.0/assets/images/favicon.png (added)
-
tags/7.0/index.php (added)
-
tags/7.0/readme.txt (added)
-
tags/7.0/views (added)
-
tags/7.0/views/stacks-welcome-v7.php (added)
-
trunk/api/builder (deleted)
-
trunk/api/categories.php (added)
-
trunk/api/main.php (deleted)
-
trunk/api/mobile (deleted)
-
trunk/api/orders.php (added)
-
trunk/api/products.php (added)
-
trunk/api/users.php (added)
-
trunk/helper_functions.php (deleted)
-
trunk/index.php (modified) (2 diffs)
-
trunk/modules (deleted)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/vendor (deleted)
-
trunk/views/stacks-welcome-v7.php (added)
-
trunk/views/stacks-welcome.php (deleted)
Legend:
- Unmodified
- Added
- Removed
-
stacks-mobile-app-builder/trunk/index.php
r2958799 r3463813 3 3 /* 4 4 * Plugin Name: Stacks Mobile App Builder 5 * Plugin URI: https://stacksmarket.co 5 6 * Author: Stacks 6 * Author URI: stacksmarket.co 7 * Description: Enjoy the fast and easy experience of building your Ecommerce mobile application 8 * Version: 5.2.3 7 * Author URI: https://stacksmarket.co 8 * Description: Enjoy the fast and easy experience of building your Ecommerce mobile application. 9 * Version: 7.0 10 * Requires at least: 5.8 11 * Requires PHP: 7.4 12 * License: GPL-2.0-or-later 13 * License URI: https://www.gnu.org/licenses/gpl-2.0.html 14 * Text Domain: stacks-mobile-app-builder 9 15 */ 10 class stacks_app_builder { 16 if ( ! defined( 'ABSPATH' ) ) { 17 exit; // Exit if accessed directly. 18 } 19 20 class Stacks_App_Builder_V7 { 11 21 12 22 public function __construct() { 13 23 add_action('after_setup_theme', array($this, 'initialize')); 14 15 add_action( 'admin_menu', array( &$this, 'stacks_admin_menu' ) ); 16 17 add_action('admin_enqueue_scripts', array( &$this, 'stacks_admin_enqueue_scripts') ); 18 24 add_action( 'admin_menu', array( $this, 'stacks_admin_menu' ) ); 25 add_action('admin_enqueue_scripts', array( $this, 'stacks_admin_enqueue_scripts') ); 19 26 register_activation_hook(__FILE__, array($this, 'stacks_app_activate')); 20 21 27 } 22 28 23 29 public function initialize() { 24 require_once 'helper_functions.php'; 25 require_once 'api/main.php'; 26 require_once 'modules/main.php'; 30 $this->definitions(); 31 require_once plugin_dir_path( __FILE__ ) . 'api/categories.php'; 32 require_once plugin_dir_path( __FILE__ ) . 'api/orders.php'; 33 require_once plugin_dir_path( __FILE__ ) . 'api/products.php'; 34 require_once plugin_dir_path( __FILE__ ) . 'api/users.php'; 35 } 36 37 public function definitions() { 38 if ( ! defined( 'STACKS_APP_VERSION' ) ) { 39 define('STACKS_APP_VERSION', '7.0'); 40 } 41 if ( ! defined( 'STACKS_API' ) ) { 42 define('STACKS_API', 'https://builder.stacksmarket.co/wp-json/v4/'); 43 } 27 44 } 28 45 29 46 /** 30 * Make sure that there is no old versions of Stacks Plugin that is active , this should prevent conflicts47 * Make sure that there is no old versions of Stacks Plugin that is active. 31 48 * 32 * @param [type] $plugin33 49 * @return void 34 50 */ 35 51 public function stacks_app_activate() { 52 if ( ! function_exists( 'get_plugins' ) ) { 53 require_once ABSPATH . 'wp-admin/includes/plugin.php'; 54 } 36 55 $all_plugins = get_plugins(); 37 56 foreach ($all_plugins as $key => $value) { 38 if($value['Name'] == 'Stacks App') {57 if($value['Name'] === 'Stacks App') { 39 58 if(is_plugin_active($key)) { 40 59 deactivate_plugins( $key ); … … 42 61 } 43 62 } 44 45 63 flush_rewrite_rules(); 46 64 } 47 65 48 // adds stacks menu item to wordpress admin dashboard 49 function stacks_admin_menu() { 50 add_menu_page( __( 'Stacks Dashboard' ), 51 __( 'Stacks' ), 52 'manage_options', 53 'stacks-welcome', 54 array( &$this, 'stacks_admin_menu_page' ), plugin_dir_url( __FILE__ ) . '/assets/images/favicon.png' 66 /** 67 * Adds stacks menu item to wordpress admin dashboard. 68 */ 69 public function stacks_admin_menu() { 70 add_action('admin_init', array( $this, 'stacks_register_settings' )); 71 72 add_menu_page( 73 __( 'Stacks Dashboard', 'stacks-mobile-app-builder' ), 74 __( 'Stacks', 'stacks-mobile-app-builder' ), 75 'manage_options', 76 'stacks-welcome-v7', 77 array( $this, 'stacks_admin_menu_page' ), 78 plugin_dir_url( __FILE__ ) . 'assets/images/favicon.png' 55 79 ); 56 80 81 add_submenu_page( 82 'stacks-welcome-v7', 83 __( 'Stacks Settings', 'stacks-mobile-app-builder' ), 84 __( 'Settings', 'stacks-mobile-app-builder' ), 85 'manage_options', 86 'stacks-settings', 87 array($this, 'render_stacks_settings_page') 88 ); 89 } 90 91 /** 92 * Register plugin settings. 93 */ 94 public function stacks_register_settings() { 95 register_setting('stacks_settings_group', 'stacks_token', array( 96 'type' => 'string', 97 'sanitize_callback' => 'sanitize_text_field', 98 )); 99 register_setting('stacks_settings_group', 'stacks_project', array( 100 'type' => 'string', 101 'sanitize_callback' => 'sanitize_text_field', 102 )); 57 103 } 58 104 59 105 public function stacks_admin_menu_page() { 60 // Load home page 61 require_once untrailingslashit( __DIR__ ) . '/views/stacks-welcome.php'; 106 require_once plugin_dir_path( __FILE__ ) . 'views/stacks-welcome-v7.php'; 62 107 } 63 108 64 109 public function stacks_admin_enqueue_scripts(){ 65 66 $current_page = get_current_screen()->base; 67 68 wp_enqueue_style( 'stacks_main_css', plugins_url('assets/css/stacks-main.css', __FILE__), array()); 110 wp_enqueue_style( 111 'stacks_main_css', 112 plugin_dir_url( __FILE__ ) . 'assets/css/stacks-main.css', 113 array(), 114 STACKS_APP_VERSION 115 ); 116 } 69 117 118 public function render_stacks_settings_page() { 119 if ( ! current_user_can( 'manage_options' ) ) { 120 return; 121 } 122 $stacks_token = esc_attr( get_option( 'stacks_token', '' ) ); 123 $stacks_project = esc_attr( get_option( 'stacks_project', '' ) ); 124 ?> 125 <div class="wrap"> 126 <h1><?php esc_html_e( 'Stacks Settings', 'stacks-mobile-app-builder' ); ?></h1> 127 <form method="post" action="options.php"> 128 <?php 129 settings_fields('stacks_settings_group'); 130 do_settings_sections('stacks_settings_group'); 131 ?> 132 <table class="form-table"> 133 <tr> 134 <th scope="row"> 135 <label for="stacksTokenInput"><?php esc_html_e( 'Stacks Token', 'stacks-mobile-app-builder' ); ?></label> 136 </th> 137 <td> 138 <input type="text" 139 id="stacksTokenInput" 140 name="stacks_token" 141 value="<?php echo esc_attr( $stacks_token ); ?>" 142 placeholder="<?php esc_attr_e( 'Your Stacks Token', 'stacks-mobile-app-builder' ); ?>" 143 class="regular-text"> 144 </td> 145 </tr> 146 <tr> 147 <th scope="row"> 148 <label for="stacksProjectInput"><?php esc_html_e( 'Project ID', 'stacks-mobile-app-builder' ); ?></label> 149 </th> 150 <td> 151 <input type="text" 152 id="stacksProjectInput" 153 name="stacks_project" 154 value="<?php echo esc_attr( $stacks_project ); ?>" 155 placeholder="<?php esc_attr_e( 'Your Stacks Project ID', 'stacks-mobile-app-builder' ); ?>" 156 class="regular-text"> 157 </td> 158 </tr> 159 </table> 160 <?php submit_button( __( 'Save Settings', 'stacks-mobile-app-builder' ) ); ?> 161 </form> 162 </div> 163 <?php 70 164 } 71 165 72 166 } 73 167 74 new stacks_app_builder();168 new Stacks_App_Builder_V7(); -
stacks-mobile-app-builder/trunk/readme.txt
r3225082 r3463813 6 6 Requires PHP: 7.4 7 7 WC tested up to: 9.5.2 8 Stable tag: 6.5.18 Stable tag: 7.0 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 121 121 122 122 == Changelog == 123 124 = Version 7.0 = 125 126 Features 127 128 * Complete plugin rewrite with improved security 129 * Token-based REST API authentication for all endpoints 130 * Proper WordPress coding standards compliance 131 * WordPress Filesystem API for image handling 132 * Two-way sync for products, categories, and orders with Stacks platform 133 * Auth0 user migration support 134 * Settings page for Stacks token and project configuration 123 135 124 136 = Version 6.5.1 (19-1-2025) =
Note: See TracChangeset
for help on using the changeset viewer.