| @@ -39,9 +39,14 @@ | ||
| 39 | 39 | <div class="merchant-module-page-info"> |
| 40 | 40 | <div class="merchant-module-page-title"> |
| 41 | 41 | <?php esc_html_e( 'Global Settings', 'merchant' ); ?> |
| 42 | 42 | </div> |
| 43 | - <div class="merchant-module-page-desc"><?php esc_html_e( 'License activation, operating mode selection and custom code.', 'merchant' ); ?></div> | |
| 43 | + <div class="merchant-module-page-desc"> | |
| 44 | + <?php | |
| 45 | + $page_desc = defined( 'MERCHANT_PRO_VERSION' ) ? __( 'License activation, operating mode selection and custom code.', 'merchant' ) : __( 'Operating mode selection and custom code.', 'merchant' ); | |
| 46 | + echo esc_html( $page_desc ); | |
| 47 | + ?> | |
| 48 | + </div> | |
| 44 | 49 | </div> |
| 45 | 50 | </div> |
| 46 | 51 | |
| 47 | 52 | </div> |
| @@ -47,8 +52,10 @@ | ||
| 47 | 52 | </div> |
| 48 | 53 | |
| 49 | 54 | </div> |
| 50 | 55 | |
| 56 | + <?php require MERCHANT_DIR . 'admin/views/wpvibe-banner.php'; ?> | |
| 57 | + | |
| 51 | 58 | <div class="merchant-module-page-content mrc-w-100"> |
| 52 | 59 | |
| 53 | 60 | <?php |
| 54 | 61 | |
| @@ -58,13 +65,48 @@ | ||
| 58 | 65 | * @since 1.0 |
| 59 | 66 | */ |
| 60 | 67 | do_action( 'merchant_admin_settings_before_options' ); |
| 61 | 68 | |
| 69 | + // Save the WPVibe MCP toggle only when WPVibe is active to avoid overwriting the stored value with the unchecked-checkbox default. | |
| 70 | + if ( is_plugin_active( 'vibe-ai/vibe-ai.php' ) ) { | |
| 71 | + Merchant_Admin_Options::save_options( array( | |
| 72 | + 'module' => 'global-settings', | |
| 73 | + 'fields' => array( | |
| 74 | + array( | |
| 75 | + 'id' => 'wpvibe_mcp_write_access', | |
| 76 | + 'type' => 'switcher', | |
| 77 | + 'default' => false, | |
| 78 | + ), | |
| 79 | + ), | |
| 80 | + ) ); | |
| 81 | + } | |
| 82 | + | |
| 62 | 83 | Merchant_Admin_Options::create( array( |
| 63 | 84 | 'module' => 'global-settings', |
| 85 | + 'title' => esc_html__( 'Merchant Analytics', 'merchant' ), | |
| 86 | + 'fields' => array( | |
| 87 | + // Analytics toggle | |
| 88 | + array( | |
| 89 | + 'id' => 'analytics_toggle', | |
| 90 | + 'type' => 'switcher', | |
| 91 | + 'title' => __( 'Enable analytics', 'merchant' ), | |
| 92 | + 'desc' => __( 'Track revenue and performance insights from our modules. No personal data is collected. Disable this if you prefer not to track analytics.', 'merchant' ), | |
| 93 | + 'default' => true, | |
| 94 | + ), | |
| 95 | + array( | |
| 96 | + 'id' => 'usage_statistics_tracking', | |
| 97 | + 'type' => 'switcher', | |
| 98 | + 'title' => __( 'Enable modules usage tracking', 'merchant' ), | |
| 99 | + 'desc' => __( 'Track which modules are used on your site. This helps us improve our products and services. No personal data is collected.', 'merchant' ), | |
| 100 | + 'default' => false, | |
| 101 | + ), | |
| 102 | + ), | |
| 103 | + ) ); | |
| 104 | + | |
| 105 | + Merchant_Admin_Options::create( array( | |
| 106 | + 'module' => 'global-settings', | |
| 64 | 107 | 'title' => esc_html__( 'Merchant Operating Mode', 'merchant' ), |
| 65 | 108 | 'fields' => array( |
| 66 | - | |
| 67 | 109 | array( |
| 68 | 110 | 'id' => 'operating_mode', |
| 69 | 111 | 'type' => 'radio_alt', |
| 70 | 112 | 'options' => array( |
| @@ -82,9 +124,8 @@ | ||
| 82 | 124 | ), |
| 83 | 125 | ), |
| 84 | 126 | 'default' => 'active', |
| 85 | 127 | ), |
| 86 | - | |
| 87 | 128 | ), |
| 88 | 129 | ) ); |
| 89 | 130 | |
| 90 | 131 | Merchant_Admin_Options::create( array( |
| @@ -90,12 +131,11 @@ | ||
| 90 | 131 | Merchant_Admin_Options::create( array( |
| 91 | 132 | 'module' => 'global-settings', |
| 92 | 133 | 'title' => esc_html__( 'Global Customizations', 'merchant' ), |
| 93 | 134 | 'fields' => array( |
| 94 | - | |
| 95 | 135 | array( |
| 96 | 136 | 'type' => 'warning', |
| 97 | - 'content' => esc_html__( 'Do not modify these settings unless you\'re an experienced developer', 'merchant' ), | |
| 137 | + 'content' => esc_html__( 'These settings allow you to add custom code, and are recommended for developers or advanced users only', 'merchant' ), | |
| 98 | 138 | ), |
| 99 | 139 | |
| 100 | 140 | array( |
| 101 | 141 | 'type' => 'divider', |
| @@ -102,27 +142,15 @@ | ||
| 102 | 142 | ), |
| 103 | 143 | |
| 104 | 144 | array( |
| 105 | 145 | 'id' => 'custom_css', |
| 106 | - 'type' => 'textarea', | |
| 146 | + 'type' => 'textarea_code', | |
| 107 | 147 | 'title' => esc_html__( 'Custom CSS', 'merchant' ), |
| 108 | 148 | ), |
| 109 | 149 | |
| 110 | 150 | array( |
| 111 | - 'id' => 'custom_js_first', | |
| 112 | - 'type' => 'textarea', | |
| 113 | - 'title' => esc_html__( 'Custom JS First - runs at the beginning of Merchant', 'merchant' ), | |
| 114 | - ), | |
| 115 | - | |
| 116 | - array( | |
| 117 | - 'id' => 'custom_js_last', | |
| 118 | - 'type' => 'textarea', | |
| 119 | - 'title' => esc_html__( 'Custom JS Last - runs at the end of Merchant', 'merchant' ), | |
| 120 | - ), | |
| 121 | - | |
| 122 | - array( | |
| 123 | 151 | 'id' => 'custom_js', |
| 124 | - 'type' => 'textarea', | |
| 152 | + 'type' => 'textarea_code', | |
| 125 | 153 | 'title' => esc_html__( 'Custom JS', 'merchant' ), |
| 126 | 154 | ), |
| 127 | 155 | |
| 128 | 156 | ), |
| @@ -133,14 +161,9 @@ | ||
| 133 | 161 | * |
| 134 | 162 | * @since 1.0 |
| 135 | 163 | */ |
| 136 | 164 | do_action( 'merchant_admin_settings_after_options' ); |
| 137 | - | |
| 138 | 165 | ?> |
| 139 | - | |
| 140 | 166 | </div> |
| 141 | - | |
| 142 | 167 | </form> |
| 143 | - | |
| 144 | 168 | </div> |
| 145 | - | |
| 146 | 169 | </div> |