Changeset 3833938
- Timestamp:
- 11/29/2026 11:11:27 PM (less than one hour ago)
- Location:
- extnify-fee
- Files:
-
- 46 added
- 2 deleted
- 24 edited
- 1 copied
-
tags/1.1.0 (copied) (copied from extnify-fee/trunk )
-
tags/1.1.0/admin/controller.php (modified) (17 diffs)
-
tags/1.1.0/admin/model.php (modified) (4 diffs)
-
tags/1.1.0/assets/css/admin.css (modified) (1 diff)
-
tags/1.1.0/assets/css/theme.css (modified) (72 diffs)
-
tags/1.1.0/assets/js/admin.js (modified) (12 diffs)
-
tags/1.1.0/bootstrap.php (modified) (3 diffs)
-
tags/1.1.0/extnify-fee.php (modified) (5 diffs)
-
tags/1.1.0/extnify.json (modified) (1 diff)
-
tags/1.1.0/front/class-fee.php (modified) (5 diffs)
-
tags/1.1.0/readme.txt (modified) (5 diffs)
-
tags/1.1.0/system/extnify-core (added)
-
tags/1.1.0/system/extnify-core/traits (added)
-
tags/1.1.0/system/extnify-core/traits/debug-log.php (added)
-
tags/1.1.0/system/extnify-core/ui (added)
-
tags/1.1.0/system/extnify-core/ui/autoloader.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements (added)
-
tags/1.1.0/system/extnify-core/ui/elements/autofill.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/bare.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/base.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/checkbox.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/checkgroup.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/checkrow.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/datetime.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/image.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/input.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/inputgroup.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/radio.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/radiorow.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/range.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/select.php (added)
-
tags/1.1.0/system/extnify-core/ui/elements/textarea.php (added)
-
tags/1.1.0/system/extnify-core/ui/form.php (added)
-
tags/1.1.0/system/extnify-core/ui/misc.php (added)
-
tags/1.1.0/system/framework/traits/woo-helpers.php (modified) (3 diffs)
-
tags/1.1.0/system/library (deleted)
-
tags/1.1.0/uninstall.php (modified) (1 diff)
-
trunk/admin/controller.php (modified) (17 diffs)
-
trunk/admin/model.php (modified) (4 diffs)
-
trunk/assets/css/admin.css (modified) (1 diff)
-
trunk/assets/css/theme.css (modified) (72 diffs)
-
trunk/assets/js/admin.js (modified) (12 diffs)
-
trunk/bootstrap.php (modified) (3 diffs)
-
trunk/extnify-fee.php (modified) (5 diffs)
-
trunk/extnify.json (modified) (1 diff)
-
trunk/front/class-fee.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (5 diffs)
-
trunk/system/extnify-core (added)
-
trunk/system/extnify-core/traits (added)
-
trunk/system/extnify-core/traits/debug-log.php (added)
-
trunk/system/extnify-core/ui (added)
-
trunk/system/extnify-core/ui/autoloader.php (added)
-
trunk/system/extnify-core/ui/elements (added)
-
trunk/system/extnify-core/ui/elements/autofill.php (added)
-
trunk/system/extnify-core/ui/elements/bare.php (added)
-
trunk/system/extnify-core/ui/elements/base.php (added)
-
trunk/system/extnify-core/ui/elements/checkbox.php (added)
-
trunk/system/extnify-core/ui/elements/checkgroup.php (added)
-
trunk/system/extnify-core/ui/elements/checkrow.php (added)
-
trunk/system/extnify-core/ui/elements/datetime.php (added)
-
trunk/system/extnify-core/ui/elements/image.php (added)
-
trunk/system/extnify-core/ui/elements/input.php (added)
-
trunk/system/extnify-core/ui/elements/inputgroup.php (added)
-
trunk/system/extnify-core/ui/elements/radio.php (added)
-
trunk/system/extnify-core/ui/elements/radiorow.php (added)
-
trunk/system/extnify-core/ui/elements/range.php (added)
-
trunk/system/extnify-core/ui/elements/select.php (added)
-
trunk/system/extnify-core/ui/elements/textarea.php (added)
-
trunk/system/extnify-core/ui/form.php (added)
-
trunk/system/extnify-core/ui/misc.php (added)
-
trunk/system/framework/traits/woo-helpers.php (modified) (3 diffs)
-
trunk/system/library (deleted)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
extnify-fee/tags/1.1.0/admin/controller.php
r3772791 r3833938 1 1 <?php 2 use Extnify\ XFee\Ocm\Form;3 use Extnify\ XFee\Ocm\Misc;2 use Extnify\Fee\Ui\Form; 3 use Extnify\Fee\Ui\Misc; 4 4 defined( 'ABSPATH' ) || exit; 5 5 … … 12 12 * 13 13 * Shared identity with Pro (so the data table stays compatible): 14 * • global option / field prefix / nonce group = ` x_feepro`15 * • per-method field prefix = ` xfeepro`14 * • global option / field prefix / nonce group = `extnify_fee` 15 * • per-method field prefix = `extnify_fee` 16 16 * The admin PAGE slug is `extnify-fee` (same as Pro). 17 17 */ 18 class XFee_Back {19 20 use XFee_Woo_Helpers; // ajax_get_zones() for the Shipping Zone field18 class Extnify_Fee_Back { 19 20 use Extnify_Fee_Woo_Helpers; // ajax_get_zones() for the Shipping Zone field 21 21 22 22 /** @var Form */ private $form; 23 23 /** @var Misc */ private $misc; 24 /** @var XFee_Model */ private $model;24 /** @var Extnify_Fee_Model */ private $model; 25 25 /** @var array */ private $langs_data; 26 26 27 private static function group() { return ' x_feepro'; } // shared option + field prefix + nonce27 private static function group() { return 'extnify_fee'; } // shared option + field prefix + nonce 28 28 private static function slug() { return 'extnify-fee'; } // admin page slug 29 29 30 public function __construct( XFee_Model $model ) {30 public function __construct( Extnify_Fee_Model $model ) { 31 31 $this->model = $model; 32 32 $this->form = new Form(); … … 40 40 41 41 // AJAX action names are prefixed with this plugin's unique group 42 // (e.g. wp_ajax_ x_feepro_load_method) so two active Extnify plugins never42 // (e.g. wp_ajax_extnify_fee_load_method) so two active Extnify plugins never 43 43 // register the same hook — otherwise both handlers fire on one request. 44 44 $ajax = array( 'load_method', 'save_method', 'delete_method', … … 167 167 168 168 private function tab_gs_general( array $setting ) { 169 // Default the global Sort Order to 0 when unset (new installs show 0, not blank). 170 $setting = array_merge( array( 'sort_order' => '0' ), $setting ); 169 171 $this->form->setPreset( $setting ); 170 172 $html = '<table class="form-table" role="presentation"><tbody>'; … … 177 179 178 180 /** 179 * "Available in Pro Version" placeholder. On the wp.org build ( XFEE_UPGRADE_URL181 * "Available in Pro Version" placeholder. On the wp.org build (EXTNIFY_FEE_UPGRADE_URL 180 182 * set) it links to the Pro product page; on the WooCommerce build (constant 181 183 * empty) it stays plain text — no external upsell link (Marketplace rules). 182 184 */ 183 185 private function pro_placeholder( $text = null, $icon = 'dashicons-lock' ) { 184 $url = defined( ' XFEE_UPGRADE_URL' ) ? (string) XFEE_UPGRADE_URL : '';186 $url = defined( 'EXTNIFY_FEE_UPGRADE_URL' ) ? (string) EXTNIFY_FEE_UPGRADE_URL : ''; 185 187 $label = ( null === $text ) ? esc_html__( 'Available in Pro Version', 'extnify-fee' ) : esc_html( $text ); 186 188 $body = ( '' !== $url ) … … 195 197 /** Help & Support — support links only (the live debug log is a Pro feature). */ 196 198 private function tab_gs_help() { 197 $ver = defined( ' XFEE_PLUGIN_VERSION' ) ? XFEE_PLUGIN_VERSION : '1.0.0';199 $ver = defined( 'EXTNIFY_FEE_PLUGIN_VERSION' ) ? EXTNIFY_FEE_PLUGIN_VERSION : '1.0.0'; 198 200 $wp_ver = get_bloginfo( 'version' ); 199 201 $php_ver = preg_replace( '/^(\d+\.\d+).*/', '$1', PHP_VERSION ); … … 234 236 // (WordPress.org build). The WooCommerce build ships an empty URL, so the 235 237 // card is dropped entirely (the marketplace owns the upsell there). 236 if ( defined( ' XFEE_UPGRADE_URL' ) && XFEE_UPGRADE_URL ) {237 $html .= '<a href="' . esc_url( XFEE_UPGRADE_URL ) . '" target="_blank" rel="noopener" class="ext-hs-card ext-hs-upgrade">'238 if ( defined( 'EXTNIFY_FEE_UPGRADE_URL' ) && EXTNIFY_FEE_UPGRADE_URL ) { 239 $html .= '<a href="' . esc_url( EXTNIFY_FEE_UPGRADE_URL ) . '" target="_blank" rel="noopener" class="ext-hs-card ext-hs-upgrade">' 238 240 . '<span class="ext-hs-card-icon dashicons dashicons-star-filled"></span>' 239 241 . '<span class="ext-hs-card-text"><strong>' . esc_html__( 'Upgrade to Pro', 'extnify-fee' ) . '</strong>' … … 328 330 } 329 331 330 $extnify = null; // the Extnify shipping method (free ' x_shipping' or pro 'x_shipping_pro').332 $extnify = null; // the Extnify shipping method (free 'extnify_shipping' or pro 'extnify_shipping_pro'). 331 333 foreach ( WC()->shipping()->get_shipping_methods() as $method ) { 332 if ( in_array( $method->id, array( ' x_shipping', 'x_shipping_pro' ), true ) ) {334 if ( in_array( $method->id, array( 'extnify_shipping', 'extnify_shipping_pro' ), true ) ) { 333 335 $extnify = $method; // expanded into rows below — don't list the collapsed type. 334 336 continue; … … 339 341 if ( $extnify ) { 340 342 global $wpdb; 341 $table = $wpdb->prefix . ' xshippingpro_methods';343 $table = $wpdb->prefix . 'extnify_shipping_methods'; 342 344 // phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- checking existence of a fixed prefixed table. 343 345 if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table ) ) === $table ) { … … 376 378 'shipping_all' => '1', 377 379 'tax_class_id' => '', 378 'sort_order' => ' ',380 'sort_order' => '0', 379 381 'status' => '1', 380 382 'rate_type' => 'flat', … … 390 392 391 393 $this->form 392 ->setBasename( ' xfeepro' )394 ->setBasename( 'extnify_fee' ) 393 395 ->setPreset( $method_data ) 394 396 ->setIDPostfix( $postfix ) … … 498 500 $mdata = $row ? $row['method_data'] : array(); 499 501 500 $this->form->setBasename( ' xfeepro' )->setLangs( $this->langs_data );502 $this->form->setBasename( 'extnify_fee' )->setLangs( $this->langs_data ); 501 503 $id_postfix = $id ? (string) $id : ( $postfix ?: 'new' ); 502 504 wp_send_json_success( array( 'html' => $this->get_form_data( $mdata, $id, $id_postfix ), 'id' => $id ) ); … … 506 508 $this->check_ajax_auth(); 507 509 $id = isset( $_POST['ext_method_id'] ) ? sanitize_text_field( wp_unslash( $_POST['ext_method_id'] ) ) : 'new'; // phpcs:ignore WordPress.Security.NonceVerification.Missing -- nonce verified in check_ajax_auth() 508 $posted = isset( $_POST[' xfeepro'] ) ? (array) wp_unslash( $_POST['xfeepro'] ) : array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- nonce verified in check_ajax_auth(); sanitized in sanitize_method()510 $posted = isset( $_POST['extnify_fee'] ) ? (array) wp_unslash( $_POST['extnify_fee'] ) : array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- nonce verified in check_ajax_auth(); sanitized in sanitize_method() 509 511 $is_new = ( 'new' === $id || ! $id ); 510 512 $mdata = $this->sanitize_method( $posted, $is_new ? 0 : (int) $id ); … … 542 544 $this->check_ajax_auth(); 543 545 $limit = isset( $_REQUEST['limit'] ) ? max( 1, min( 500, (int) $_REQUEST['limit'] ) ) : 60; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- nonce verified in check_ajax_auth(); value is int-clamped 544 $log = get_transient( ' x_feepro_debug_log' );546 $log = get_transient( 'extnify_fee_debug_log' ); 545 547 $entries = array(); 546 548 if ( is_array( $log ) ) { … … 559 561 public function ajax_debug_clear() { 560 562 $this->check_ajax_auth(); 561 delete_transient( ' x_feepro_debug_log' );563 delete_transient( 'extnify_fee_debug_log' ); 562 564 wp_send_json_success(); 563 565 } … … 606 608 return; 607 609 } 608 $theme_path = XFEE_PLUGIN_PATH . 'assets/css/theme.css';609 $css_path = XFEE_PLUGIN_PATH . 'assets/css/admin.css';610 $js_path = XFEE_PLUGIN_PATH . 'assets/js/admin.js';610 $theme_path = EXTNIFY_FEE_PLUGIN_PATH . 'assets/css/theme.css'; 611 $css_path = EXTNIFY_FEE_PLUGIN_PATH . 'assets/css/admin.css'; 612 $js_path = EXTNIFY_FEE_PLUGIN_PATH . 'assets/js/admin.js'; 611 613 // Shared Extnify theme (brand tokens + components) loads first… 612 wp_enqueue_style( 'extnify-theme', XFEE_PLUGIN_URL . 'assets/css/theme.css', array(), file_exists( $theme_path ) ? filemtime( $theme_path ) : XFEE_PLUGIN_VERSION );614 wp_enqueue_style( 'extnify-theme', EXTNIFY_FEE_PLUGIN_URL . 'assets/css/theme.css', array(), file_exists( $theme_path ) ? filemtime( $theme_path ) : EXTNIFY_FEE_PLUGIN_VERSION ); 613 615 // …then this plugin's own overrides, so they win via the cascade. 614 wp_enqueue_style( 'extnify-fee-admin', XFEE_PLUGIN_URL . 'assets/css/admin.css', array( 'extnify-theme' ), file_exists( $css_path ) ? filemtime( $css_path ) : XFEE_PLUGIN_VERSION );615 wp_enqueue_script( 'extnify-fee-admin', XFEE_PLUGIN_URL . 'assets/js/admin.js', array( 'jquery', 'jquery-ui-sortable' ), file_exists( $js_path ) ? filemtime( $js_path ) : XFEE_PLUGIN_VERSION, true );616 wp_enqueue_style( 'extnify-fee-admin', EXTNIFY_FEE_PLUGIN_URL . 'assets/css/admin.css', array( 'extnify-theme' ), file_exists( $css_path ) ? filemtime( $css_path ) : EXTNIFY_FEE_PLUGIN_VERSION ); 617 wp_enqueue_script( 'extnify-fee-admin', EXTNIFY_FEE_PLUGIN_URL . 'assets/js/admin.js', array( 'jquery', 'jquery-ui-sortable' ), file_exists( $js_path ) ? filemtime( $js_path ) : EXTNIFY_FEE_PLUGIN_VERSION, true ); 616 618 wp_localize_script( 'extnify-fee-admin', 'extnifyFeeAdmin', array( 617 619 'ajaxUrl' => admin_url( 'admin-ajax.php' ), … … 634 636 // basename() strips any path components, so $template can only resolve to a 635 637 // file inside admin/views/ — no directory traversal via the include below. 636 $file = XFEE_PLUGIN_PATH . 'admin/views/' . basename( (string) $template ) . '.php';638 $file = EXTNIFY_FEE_PLUGIN_PATH . 'admin/views/' . basename( (string) $template ) . '.php'; 637 639 if ( ! file_exists( $file ) ) { 638 640 return; -
extnify-fee/tags/1.1.0/admin/model.php
r3751128 r3833938 4 4 * 5 5 * IMPORTANT: this reads/writes the SAME table as the paid Extnify Fee Rules Pro 6 * (`{prefix} xfeepro_methods`) so a customer can move between free and paid6 * (`{prefix}extnify_fee_methods`) so a customer can move between free and paid 7 7 * without losing their configured methods. Pro writes a superset of fields into 8 8 * the `method_data` JSON; the free plugin simply reads the subset it understands … … 11 11 defined( 'ABSPATH' ) || exit; 12 12 13 class XFee_Model {13 class Extnify_Fee_Model { 14 14 15 15 private $table; … … 17 17 public function __construct() { 18 18 global $wpdb; 19 $this->table = $wpdb->prefix . ' xfeepro_methods';19 $this->table = $wpdb->prefix . 'extnify_fee_methods'; 20 20 } 21 21 22 22 // ── Schema (shared table — CREATE IF NOT EXISTS, so either plugin may make it) ─ 23 23 24 /** DB schema version -- bump when the table schema below changes. */ 25 const DB_VERSION = '1.0.0'; 26 /** Per-plugin option storing the installed schema version. */ 27 const DB_VERSION_OPTION = 'extnify_fee_db_version'; 28 29 /** 30 * Idempotent schema sync. Runs on activation AND on every request (cheap option 31 * check); when the stored version is behind the code it re-runs dbDelta, so a 32 * plugin UPDATE that adds a column actually alters the live table (the activation 33 * hook does not fire on updates). dbDelta only adds/modifies columns, never drops. 34 */ 35 public static function maybe_upgrade() { 36 global $wpdb; 37 if ( get_option( self::DB_VERSION_OPTION ) === self::DB_VERSION ) { 38 // Version says current — but verify the table actually EXISTS before trusting 39 // it. An uninstall/DB-reset can drop the table yet leave this option behind, 40 // which would otherwise block re-creation. Self-heal if it's gone. 41 $table = ( new self() )->table; 42 if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table ) ) === $table ) { 43 return; 44 } 45 } 46 self::create_table(); 47 update_option( self::DB_VERSION_OPTION, self::DB_VERSION ); 48 } 49 24 50 public static function create_table() { 25 51 global $wpdb; 26 $table = $wpdb->prefix . ' xfeepro_methods';52 $table = $wpdb->prefix . 'extnify_fee_methods'; 27 53 $charset_collate = $wpdb->get_charset_collate(); 28 54 $sql = "CREATE TABLE IF NOT EXISTS {$table} ( … … 39 65 public static function drop_table() { 40 66 global $wpdb; 41 $table = $wpdb->prefix . ' xfeepro_methods';67 $table = $wpdb->prefix . 'extnify_fee_methods'; 42 68 // phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter -- table name is $wpdb->prefix + a fixed string; identifiers can't be bound via prepare(). 43 69 $wpdb->query( "DROP TABLE IF EXISTS {$table}" ); -
extnify-fee/tags/1.1.0/assets/css/admin.css
r3751128 r3833938 3 3 4 4 The shared look (brand tokens + all components) lives in the Extnify theme: 5 assets/css/theme.css, injected at build from shared-resources -wp/common/theme/.5 assets/css/theme.css, injected at build from shared-resources/theme/. 6 6 It loads FIRST; this file loads after it, so anything here overrides the theme. 7 7 -
extnify-fee/tags/1.1.0/assets/css/theme.css
r3751128 r3833938 8 8 -------------------------------------------------------------------------- */ 9 9 :root { 10 /* Accent - WooCommerce purple */ 11 --extnify-accent: #7f54b3; 12 --extnify-accent-dark: #6d3f9e; 13 --extnify-accent-darker: #5a3a8a; 14 --extnify-accent-tint: #f5f0fb; 15 --extnify-accent-tint-2: #efe9fa; 16 --extnify-accent-border: #c4aee3; 10 /* Accent - Extnify blue */ 11 --extnify-accent: #3863e9; 12 --extnify-accent-dark: #2a4ed2; /* hover */ 13 --extnify-accent-darker: #1f3eb0; /* pressed */ 14 --extnify-accent-tint: #eef2fd; /* selected background */ 15 --extnify-accent-tint-2: #e1e7fc; /* hover background */ 16 --extnify-accent-border: #b4c4f7; 17 --extnify-accent-ring: rgba(56, 99, 233, .2); /* focus ring */ 17 18 18 19 /* Text (WordPress admin neutrals) */ … … 26 27 --extnify-bg: #f6f7f7; 27 28 --extnify-bg-soft: #f0f0f1; 28 --extnify-border: #c3c4c7; 29 --extnify-border-light: #e2e2e4; 29 --extnify-border: #dcdcde; 30 --extnify-border-light: #e2e4e7; 31 --extnify-border-input: #8c8f94; 30 32 31 33 /* Semantic */ 32 --extnify-link: # 2271b1;34 --extnify-link: #3863e9; 33 35 --extnify-danger: #d63638; 34 --extnify-success: #4b8a5c; 36 --extnify-danger-tint: #fcf0f1; 37 --extnify-success: #007a3d; 38 --extnify-success-tint: #e6f4ea; 39 --extnify-warning: #996800; 40 41 /* Shape */ 42 --extnify-radius-sm: 6px; /* inputs, buttons, list items */ 43 --extnify-radius: 8px; /* small cards */ 44 --extnify-radius-lg: 12px; /* page-level cards */ 45 --extnify-shadow: 0 1px 2px rgba(0, 0, 0, .04); 35 46 36 47 /* Typography */ … … 43 54 .ext-wrap { 44 55 max-width: 100%; 56 } 57 58 /* -------------------------------------------------------------------------- 59 Buttons — one system for every Extnify screen. 60 WordPress 7 gives core .button a 40px min-height, 38px line-height and 61 2px corners, and any padding we add stacks on top of that (52px-tall 62 square buttons). Reset it once here: 36px, 6px corners, centred content. 63 `.ext-wrap .button` (0,2,0) beats `.wp-core-ui .button` by load order. 64 .button → secondary (white, grey border) 65 .button.button-primary → primary (accent) 66 .button.button-small → compact (30px) 67 -------------------------------------------------------------------------- */ 68 .ext-wrap .button { 69 display: inline-flex; 70 align-items: center; 71 justify-content: center; 72 gap: 6px; 73 min-height: 36px; 74 height: auto; 75 padding: 0 14px; 76 line-height: 1.2; 77 font-size: 13px; 78 font-weight: 600; 79 color: var(--extnify-text-soft); 80 background: var(--extnify-surface); 81 border: 1px solid var(--extnify-border); 82 border-radius: var(--extnify-radius-sm); 83 box-shadow: 0 1px 2px rgba(0, 0, 0, .05); 84 text-decoration: none; 85 vertical-align: middle; 86 cursor: pointer; 87 transition: background .15s, border-color .15s, color .15s, box-shadow .15s; 88 } 89 90 .ext-wrap .button:hover { 91 color: var(--extnify-accent-dark); 92 background: var(--extnify-accent-tint); 93 border-color: var(--extnify-accent-border); 94 } 95 96 .ext-wrap .button:active { 97 background: var(--extnify-accent-tint-2); 98 box-shadow: none; 99 } 100 101 .ext-wrap .button:focus { 102 outline: none; 103 color: var(--extnify-accent-dark); 104 border-color: var(--extnify-accent); 105 box-shadow: 0 0 0 3px var(--extnify-accent-ring); 106 } 107 108 .ext-wrap .button.button-primary { 109 color: #fff; 110 background: var(--extnify-accent); 111 border-color: var(--extnify-accent); 112 box-shadow: 0 1px 2px color-mix(in srgb, var(--extnify-accent) 35%, transparent); 113 } 114 115 .ext-wrap .button.button-primary:hover { 116 color: #fff; 117 background: var(--extnify-accent-dark); 118 border-color: var(--extnify-accent-dark); 119 } 120 121 .ext-wrap .button.button-primary:active { 122 background: var(--extnify-accent-darker); 123 border-color: var(--extnify-accent-darker); 124 box-shadow: none; 125 } 126 127 .ext-wrap .button.button-primary:focus { 128 color: #fff; 129 border-color: var(--extnify-accent); 130 box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--extnify-accent); 131 } 132 133 .ext-wrap .button.button-small { 134 min-height: 30px; 135 padding: 0 10px; 136 font-size: 12px; 137 } 138 139 .ext-wrap .button:disabled, 140 .ext-wrap .button[disabled], 141 .ext-wrap .button.disabled { 142 opacity: .55; 143 cursor: not-allowed; 144 box-shadow: none; 145 } 146 147 .ext-wrap .button .dashicons { 148 font-size: 16px; 149 width: 16px; 150 height: 16px; 151 line-height: 1; 152 margin: 0; 153 flex-shrink: 0; 45 154 } 46 155 … … 99 208 min-height: 600px; 100 209 background: var(--extnify-surface); 101 border: 1px solid var(--extnify-border); 102 border-radius: 4px; 210 border: 1px solid var(--extnify-border-light); 211 border-radius: var(--extnify-radius-lg); 212 box-shadow: var(--extnify-shadow); 103 213 overflow: hidden; 104 214 } … … 111 221 flex-shrink: 0; 112 222 /* background: #fafafa; */ 113 border-right: 1px solid #e0e0e2;223 border-right: 1px solid var(--extnify-border-light); 114 224 min-height: 600px; 115 225 display: flex; … … 118 228 119 229 .ext-sidebar-section { 120 border-bottom: 1px solid #e0e0e2;230 border-bottom: 1px solid var(--extnify-border-light); 121 231 } 122 232 … … 176 286 flex-direction: column; 177 287 gap: 5px; 178 background: #fafafa288 background: var(--extnify-bg) 179 289 } 180 290 … … 187 297 cursor: pointer; 188 298 font-size: 12.5px; 189 color: #2c2c2c;299 color: var(--extnify-text); 190 300 background: var(--extnify-surface); 191 301 border: 1px solid var(--extnify-border-light); 192 border-radius: 6px; 193 border-left: 3px solid #d0c8e0; 302 border-radius: var(--extnify-radius); 194 303 transition: border-color .15s, box-shadow .15s, background .15s; 195 304 position: relative; … … 197 306 198 307 .ext-method-item:hover { 199 border-color: #b49fd4; 200 border-left-color: var(--extnify-accent); 201 box-shadow: 0 1px 4px rgba(127,84,179,.1); 202 background: #faf8fd; 308 border-color: var(--extnify-accent-border); 309 background: var(--extnify-accent-tint); 203 310 } 204 311 … … 210 317 .ext-method-item.ui-sortable-helper { 211 318 cursor: grabbing; 212 box-shadow: 0 4px 12px rgba(127,84,179,.25);319 box-shadow: 0 4px 12px color-mix(in srgb, var(--extnify-accent) 25%, transparent); 213 320 } 214 321 215 322 .ext-sort-placeholder { 216 border: 1px dashed #b49fd4!important;323 border: 1px dashed var(--extnify-accent-border) !important; 217 324 background: var(--extnify-accent-tint) !important; 325 border-radius: var(--extnify-radius); 218 326 visibility: visible !important; 219 327 } … … 222 330 background: var(--extnify-accent-tint); 223 331 border-color: var(--extnify-accent); 224 border-left-color: var(--extnify-accent); 225 border-left-width: 4px; 226 box-shadow: 0 2px 6px rgba(127,84,179,.15); 227 color: var(--extnify-accent-darker); 332 box-shadow: 0 0 0 3px var(--extnify-accent-ring); 333 color: var(--extnify-accent); 228 334 font-weight: 600; 229 335 } 230 336 231 337 .ext-method-item.ext-nav-active .ext-method-label { 232 color: var(--extnify-accent -darker);338 color: var(--extnify-accent); 233 339 } 234 340 … … 255 361 256 362 .ext-method-active .ext-method-status-dot { 257 background: #eafbea;258 color: #2a7a2e;259 border: 1px solid #b3e6b5;363 background: var(--extnify-success-tint); 364 color: var(--extnify-success); 365 border: 1px solid transparent; 260 366 content: 'On'; 261 367 } 262 368 263 369 .ext-method-inactive .ext-method-status-dot { 264 background: #fdf0f0;265 color: #a02020;266 border: 1px solid #f5c6c6;370 background: var(--extnify-danger-tint); 371 color: var(--extnify-danger); 372 border: 1px solid transparent; 267 373 } 268 374 … … 283 389 .ext-add-method-wrap { 284 390 padding: 12px 14px; 285 border-top: 1px solid #e0e0e2;391 border-top: 1px solid var(--extnify-border-light); 286 392 margin-top: auto; 287 background: #fafafa;393 background: var(--extnify-bg); 288 394 } 289 395 290 396 .ext-add-method-wrap .button { 291 397 width: 100%; 292 justify-content: center; 293 display: flex; 294 align-items: center; 295 gap: 6px; 398 min-height: 40px; 399 color: #fff; 296 400 background: var(--extnify-accent); 297 401 border-color: var(--extnify-accent); 298 color: var(--extnify-surface); 299 font-weight: 600; 300 font-size: 13px; 301 padding: 7px 0; 302 height: auto; 303 border-radius: 4px; 304 box-shadow: none; 305 transition: background .15s, border-color .15s; 402 box-shadow: 0 1px 2px color-mix(in srgb, var(--extnify-accent) 35%, transparent); 306 403 } 307 404 … … 310 407 background: var(--extnify-accent-dark); 311 408 border-color: var(--extnify-accent-dark); 312 color: var(--extnify-surface); 313 box-shadow: none; 409 color: #fff; 314 410 } 315 411 316 412 .ext-add-method-wrap .button .dashicons { 317 font-size: 15px; 318 width: 15px; 319 height: 15px; 320 line-height: 1; 321 margin-top: 1px; 322 flex-shrink: 0; 413 font-size: 16px; 414 width: 16px; 415 height: 16px; 323 416 } 324 417 … … 348 441 align-items: flex-end; 349 442 justify-content: space-between; 350 border-bottom: 2px solid var(--extnify-border-light);443 border-bottom: 1px solid var(--extnify-border); 351 444 margin-bottom: 20px; 352 445 gap: 12px; … … 362 455 363 456 .ext-global-save-wrap .button { 364 display: inline-flex; 365 align-items: center; 366 font-size: 13px; 367 font-weight: 600; 368 padding: 5px 16px; 369 height: auto; 370 line-height: 1.6; 371 box-shadow: none; 372 transition: background .15s, border-color .15s; 457 /* Sizing comes from the shared button system above. */ 458 flex-shrink: 0; 373 459 } 374 460 … … 377 463 width: 16px; 378 464 height: 16px; 379 line-height: 1;380 display: flex;381 align-items: center;382 justify-content: center;383 465 } 384 466 385 467 .ext-global-save-wrap .button-primary { 386 468 background: var(--extnify-accent); 387 border-color: var(--extnify-accent -dark);469 border-color: var(--extnify-accent); 388 470 } 389 471 … … 391 473 .ext-global-save-wrap .button-primary:focus { 392 474 background: var(--extnify-accent-dark); 393 border-color: #5c3185;475 border-color: var(--extnify-accent-darker); 394 476 box-shadow: none; 395 477 } … … 414 496 background: transparent; 415 497 border: none; 416 border-bottom: 3px solid transparent;498 border-bottom: 2px solid transparent; 417 499 border-radius: 0; 418 500 padding: 8px 14px; 419 margin-bottom: - 2px;501 margin-bottom: -1px; 420 502 text-decoration: none; 421 503 transition: color .15s, border-color .15s; … … 434 516 .ext-subtab-nav .nav-tab-active:hover { 435 517 color: var(--extnify-accent); 436 font-weight: 700;518 font-weight: 600; 437 519 background: transparent; 438 border-bottom: 3px solid var(--extnify-accent);520 border-bottom: 2px solid var(--extnify-accent); 439 521 box-shadow: none; 440 522 } … … 474 556 } 475 557 476 /* Icon-only action buttons (label shown via the native title tooltip) */477 .ext-icon-btn { 478 display: inline-flex !important;479 align-items: center; 480 justify-content: center;481 width: 32px;482 height: 30px;483 min-height: 30px;484 padding: 0 !important;558 /* Icon-only action buttons (label shown via the native title tooltip). 559 Save = primary; Copy / Clear cache = secondary; Delete = secondary with a 560 red icon. One accent, never a row of differently colored blocks. */ 561 .ext-wrap .ext-icon-btn { 562 width: 36px; 563 min-width: 36px; 564 min-height: 36px; 565 height: 36px; 566 padding: 0; 485 567 font-size: 0; /* collapse the helper's trailing */ 486 border: none !important; 487 border-radius: 4px; 488 color: var(--extnify-surface) !important; 489 transition: filter .12s ease, transform .06s ease; 490 } 491 492 .ext-icon-btn:hover { filter: brightness(1.08); } 493 .ext-icon-btn:active { transform: translateY(1px); } 494 495 .ext-icon-btn .dashicons { 568 } 569 570 .ext-wrap .ext-icon-btn .dashicons { 496 571 font-size: 18px; 497 width: 17px; 498 height: 17px; 499 line-height: 1; 500 margin-bottom: 15px; 501 color: var(--extnify-surface); 502 } 503 504 /* Solid colored actions (OpenCart-style) */ 505 .ext-method-save { background: #2ea043 !important; } /* green */ 506 .ext-method-copy { background: #f0ad4e !important; } /* orange */ 507 .ext-method-delete { background: #e5484d !important; } /* red */ 508 .ext-toolbar-save { background: var(--extnify-accent) !important; } /* purple */ 509 .ext-clear-cache { background: #2f6fed !important; } /* blue */ 572 width: 18px; 573 height: 18px; 574 } 575 576 .ext-wrap .ext-method-save, 577 .ext-wrap .ext-toolbar-save { 578 color: #fff; 579 background: var(--extnify-accent); 580 border-color: var(--extnify-accent); 581 box-shadow: 0 1px 2px color-mix(in srgb, var(--extnify-accent) 35%, transparent); 582 } 583 584 .ext-wrap .ext-method-save:hover, 585 .ext-wrap .ext-toolbar-save:hover, 586 .ext-wrap .ext-method-save:focus, 587 .ext-wrap .ext-toolbar-save:focus { 588 color: #fff; 589 background: var(--extnify-accent-dark); 590 border-color: var(--extnify-accent-dark); 591 } 592 593 .ext-wrap .ext-method-delete { 594 color: var(--extnify-danger); 595 } 596 597 .ext-wrap .ext-method-delete:hover, 598 .ext-wrap .ext-method-delete:focus { 599 color: var(--extnify-danger); 600 background: var(--extnify-danger-tint); 601 border-color: var(--extnify-danger); 602 } 603 604 .ext-wrap .ext-method-delete:focus { 605 box-shadow: 0 0 0 3px color-mix(in srgb, var(--extnify-danger) 20%, transparent); 606 } 510 607 511 608 .ext-method-id-badge { … … 513 610 background: var(--extnify-bg-soft); 514 611 padding: 2px 8px; 515 border-radius: 3px;612 border-radius: 4px; 516 613 font-family: monospace; 517 614 font-size: 13px; … … 525 622 margin-bottom: 20px; 526 623 padding-bottom: 0; 527 border-bottom: 2px solid var(--extnify-border-light);624 border-bottom: 1px solid var(--extnify-border); 528 625 } 529 626 … … 534 631 background: transparent; 535 632 border: none; 536 border-bottom: 3px solid transparent;633 border-bottom: 2px solid transparent; 537 634 border-radius: 0; 538 635 padding: 8px 14px; 539 margin-bottom: - 2px;636 margin-bottom: -1px; 540 637 text-decoration: none; 541 638 transition: color .15s, border-color .15s; … … 554 651 .ext-mtab-nav .nav-tab-active:hover { 555 652 color: var(--extnify-accent); 556 font-weight: 700;653 font-weight: 600; 557 654 background: transparent; 558 border-bottom: 3px solid var(--extnify-accent);655 border-bottom: 2px solid var(--extnify-accent); 559 656 box-shadow: none; 560 657 } … … 600 697 padding: 6px 10px; 601 698 height: auto; 602 border-radius: 4px;699 border-radius: var(--extnify-radius-sm); 603 700 border: 1px solid var(--extnify-border); 604 701 box-shadow: none; … … 621 718 padding: 0px 8px; 622 719 height: auto; 623 border-radius: 4px;720 border-radius: var(--extnify-radius-sm); 624 721 border: 1px solid var(--extnify-border); 625 722 min-width: 175px; … … 638 735 font-size: 13px; 639 736 padding: 6px 10px; 640 border-radius: 4px;737 border-radius: var(--extnify-radius-sm); 641 738 border: 1px solid var(--extnify-border); 642 739 width: 100%; … … 689 786 /* Alternating row tint */ 690 787 .ext-wrap .form-table tr:nth-child(even) { 691 background: #fafafa;788 background: var(--extnify-bg); 692 789 } 693 790 … … 743 840 font-size: 13px; 744 841 border-color: var(--extnify-accent-border); 745 border-radius: 4px;842 border-radius: var(--extnify-radius-sm); 746 843 } 747 844 … … 756 853 max-height: 180px; 757 854 overflow-y: auto; 758 border: 1px solid #e0d8ef;759 border-radius: 4px;855 border: 1px solid var(--extnify-border-light); 856 border-radius: var(--extnify-radius-sm); 760 857 padding: 8px 10px; 761 858 background: var(--extnify-surface); … … 805 902 height: 36px; 806 903 border-color: var(--extnify-accent-border); 807 border-radius: 4px;904 border-radius: var(--extnify-radius-sm); 808 905 flex-shrink: 0; 809 906 } … … 821 918 min-width: 250px; 822 919 border: 1px solid var(--extnify-accent-border); 823 border-radius: 4px;920 border-radius: var(--extnify-radius-sm); 824 921 background: var(--extnify-surface); 825 922 padding: 5px 8px; … … 865 962 background: var(--extnify-surface); 866 963 border: 1px solid var(--extnify-border); 867 border-radius: 3px;964 border-radius: 4px; 868 965 box-shadow: 0 2px 8px rgba(0,0,0,.12); 869 966 max-height: 180px; … … 910 1007 text-decoration: none; 911 1008 padding: 4px 12px; 912 border-radius: 4px;913 background: #e0e0e0;1009 border-radius: var(--extnify-radius-sm); 1010 background: var(--extnify-border-light); 914 1011 transition: background-color .15s ease, color .15s ease; 915 1012 } … … 962 1059 color: var(--extnify-surface); 963 1060 padding: 2px 6px; 964 border-radius: 3px;1061 border-radius: 4px; 965 1062 font-size: 12px; 966 1063 } … … 983 1080 background: var(--extnify-surface); 984 1081 border: 1px solid var(--extnify-border); 985 border-radius: 3px;1082 border-radius: 4px; 986 1083 box-shadow: 0 2px 8px rgba(0,0,0,.12); 987 1084 min-width: 240px; … … 1070 1167 .ext-range-container td { 1071 1168 padding: 4px 6px; 1072 border: 1px solid #e0e0e0;1169 border: 1px solid var(--extnify-border-light); 1073 1170 vertical-align: middle; 1074 1171 } … … 1107 1204 padding: 4px 8px; 1108 1205 border: 1px solid #dcdcde; 1109 border-radius: 3px;1206 border-radius: 4px; 1110 1207 } 1111 1208 … … 1191 1288 letter-spacing: 0.06em; 1192 1289 padding: 8px 12px; 1193 border: 1px solid #e0d8ef;1290 border: 1px solid var(--extnify-border-light); 1194 1291 text-align: left; 1195 1292 white-space: nowrap; … … 1201 1298 .ext-group-table td { 1202 1299 padding: 6px 10px; 1203 border: 1px solid #ebebed;1300 border: 1px solid var(--extnify-border-light); 1204 1301 vertical-align: middle; 1205 1302 background: var(--extnify-surface); … … 1207 1304 1208 1305 .ext-group-table tbody tr:nth-child(even) td { 1209 background: #faf8fd;1306 background: var(--extnify-accent-tint); 1210 1307 } 1211 1308 … … 1225 1322 padding: 4px 6px; 1226 1323 height: auto; 1227 border-radius: 3px;1324 border-radius: 4px; 1228 1325 border: 1px solid var(--extnify-border); 1229 1326 box-shadow: none; … … 1244 1341 padding: 4px 8px; 1245 1342 height: auto; 1246 border-radius: 3px;1343 border-radius: 4px; 1247 1344 border: 1px solid var(--extnify-border); 1248 1345 width: 100%; … … 1266 1363 gap: 10px; 1267 1364 background: var(--extnify-accent-tint); 1268 border: 1px solid #d4c4ef;1365 border: 1px solid var(--extnify-accent-border); 1269 1366 border-left: 4px solid var(--extnify-accent); 1270 border-radius: 4px;1367 border-radius: var(--extnify-radius-sm); 1271 1368 padding: 12px 14px; 1272 1369 margin-bottom: 16px; … … 1286 1383 margin: 0 0 4px; 1287 1384 line-height: 1.5; 1288 color: #3d2664;1385 color: var(--extnify-text-soft); 1289 1386 } 1290 1387 … … 1318 1415 1319 1416 .ext-callout-body code { 1320 background: rgba(127,84,179,.12);1417 background: color-mix(in srgb, var(--extnify-accent) 12%, transparent); 1321 1418 color: var(--extnify-accent-darker); 1322 1419 padding: 1px 5px; 1323 border-radius: 3px;1420 border-radius: 4px; 1324 1421 font-size: 12px; 1325 1422 font-family: monospace; … … 1334 1431 .ext-hs { 1335 1432 display: grid; 1336 grid-template-columns: minmax(320px, 430px) minmax(0, 480px); 1337 justify-content: space-between; 1433 /* Help column on the left; the log lives in a flexible track (1fr) that can never 1434 overflow the container — so the panel stays on the right AND is always fully 1435 visible, however wide the admin screen is (no more clipping at the edge). */ 1436 grid-template-columns: minmax(320px, 430px) minmax(0, 1fr); 1338 1437 gap: 22px; 1339 1438 align-items: stretch; 1340 padding: 8px 2px 24px;1439 padding: 8px 8px 24px; 1341 1440 } 1342 1441 .ext-hs[data-log-open="0"] { grid-template-columns: minmax(320px, 430px); } … … 1410 1509 .ext-hs-update .ext-hs-card-icon { background: #e7f6ec; color: #38a355; } 1411 1510 .ext-hs-ext .ext-hs-card-icon { background: #fdf1dc; color: #e0921a; } 1511 .ext-hs-upgrade .ext-hs-card-icon { background: var(--extnify-accent); color: #fff; } 1412 1512 1413 1513 .ext-hs-card-text { display: flex; flex-direction: column; flex: 1; line-height: 1.35; } … … 1427 1527 border-radius: 16px; box-shadow: 0 2px 12px rgba(0, 0, 0, .04); 1428 1528 overflow: hidden; 1429 /* Fixed height so the panel is the same size on every filter (All/Info/Warn/1430 Error/Debug) — the body just scrolls within it. Sized to the viewport so1431 header + body + footer stay on-screen (no page scroll). */1432 1529 min-height: 0; 1530 /* Fallback height before JS runs. The real sizing is done by hsSizeLog() in 1531 admin.js, which measures the panel's ACTUAL top offset and sets the height so 1532 the whole panel (incl. footer) fits the viewport, whatever sits above it. */ 1433 1533 height: calc(100vh - 280px); 1434 1534 align-self: start; 1535 /* Sit at the right of the flexible track, at a sensible reading width. The track 1536 bounds it, so it can't be clipped; margin-left:auto pins it to the right. */ 1537 width: 100%; 1538 max-width: 520px; 1539 margin-left: auto; 1435 1540 } 1436 1541 .ext-hs-log-head { 1437 1542 display: flex; align-items: center; gap: 12px; 1438 padding: 15px 18px; border-bottom: 1px solid #f0f0f4;1543 padding: 15px 18px; border-bottom: 1px solid var(--extnify-bg-soft); 1439 1544 background: var(--extnify-accent-dark); 1440 1545 } … … 1462 1567 .ext-hs-log-tools { 1463 1568 display: flex; align-items: center; gap: 12px; 1464 padding: 11px 16px; border-bottom: 1px solid #f4f4f7;1569 padding: 11px 16px; border-bottom: 1px solid var(--extnify-bg-soft); 1465 1570 } 1466 1571 .ext-hs-filters { display: flex; gap: 3px; flex: 1; flex-wrap: wrap; } … … 1469 1574 font-size: 13px; color: #6b6f76; padding: 5px 12px; border-radius: 20px; 1470 1575 } 1471 .ext-hs-filter:hover { background: #f4f4f7; }1576 .ext-hs-filter:hover { background: var(--extnify-bg-soft); } 1472 1577 .ext-hs-filter.active { background: var(--extnify-text); color: var(--extnify-surface); } 1473 1578 .ext-hs-tools-right { display: flex; align-items: center; gap: 12px; } … … 1535 1640 1536 1641 .ext-hs-lvl-info .ext-hs-bubble { background: #f3f8fd; border-color: #dcebf8; } 1537 .ext-hs-lvl-debug .ext-hs-bubble { background: #f7f4fc; border-color: #e6dcf4; }1642 .ext-hs-lvl-debug .ext-hs-bubble { background: var(--extnify-accent-tint); border-color: var(--extnify-accent-tint-2); } 1538 1643 .ext-hs-lvl-warn .ext-hs-bubble { background: #fdf8ec; border-color: #f2e4c3; } 1539 1644 .ext-hs-lvl-error .ext-hs-bubble { background: #fdf1f1; border-color: #f4d4d4; } … … 1542 1647 .ext-hs-log-foot { 1543 1648 display: flex; align-items: center; justify-content: space-between; 1544 padding: 12px 16px; border-top: 1px solid #f0f0f4;1649 padding: 12px 16px; border-top: 1px solid var(--extnify-bg-soft); 1545 1650 } 1546 1651 .ext-hs-conn { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #82868b; } 1547 .ext- hs .ext-hs-history.button {1652 .ext-wrap .ext-hs .ext-hs-history.button { 1548 1653 background: var(--extnify-text); border-color: var(--extnify-text); color: var(--extnify-surface); 1549 border-radius: 8px; box-shadow: none; 1550 display: inline-flex; align-items: center; gap: 5px; padding: 5px 13px; height: auto; 1551 } 1552 .ext-hs .ext-hs-history.button:hover { background: #000; border-color: #000; } 1553 .ext-hs .ext-hs-history .dashicons { font-size: 15px; width: 15px; height: 27px; } 1654 } 1655 .ext-wrap .ext-hs .ext-hs-history.button:hover, 1656 .ext-wrap .ext-hs .ext-hs-history.button:focus { background: #000; border-color: #000; color: var(--extnify-surface); } 1554 1657 1555 1658 @media (max-width: 1100px) { 1556 1659 .ext-hs, .ext-hs[data-log-open="1"] { grid-template-columns: 1fr; } 1660 /* Stacked: full-width instead of a right-pinned 520px panel. */ 1661 .ext-hs-log { max-width: none; margin-left: 0; } 1557 1662 } 1558 1663 … … 1564 1669 background: var(--extnify-surface); 1565 1670 border: 1px solid var(--extnify-border); 1566 border-radius: 4px;1671 border-radius: var(--extnify-radius-sm); 1567 1672 } 1568 1673 … … 1605 1710 gap: 12px; 1606 1711 background: var(--extnify-surface); 1607 border: 1px solid #e0d8ef;1712 border: 1px solid var(--extnify-border-light); 1608 1713 border-radius: 6px; 1609 1714 padding: 18px 20px; … … 1615 1720 gap: 8px; 1616 1721 padding-bottom: 10px; 1617 border-bottom: 1px solid #f0ebfa;1722 border-bottom: 1px solid var(--extnify-accent-tint-2); 1618 1723 } 1619 1724 … … 1649 1754 border: 1px solid #f0c040; 1650 1755 border-left: 3px solid #dba617; 1651 border-radius: 3px;1756 border-radius: 4px; 1652 1757 padding: 7px 10px; 1653 1758 font-size: 12px; … … 1683 1788 1684 1789 .ext-wrap .ext-file-label { 1685 display: inline-flex;1686 align-items: center;1687 gap: 5px;1688 font-size: 12px;1689 cursor: pointer;1690 1790 flex-shrink: 0; 1691 padding: 4px 10px; 1692 height: auto; 1693 line-height: 1; 1694 } 1695 1696 .ext-file-label:focus-within { 1791 } 1792 1793 .ext-wrap .ext-file-label:focus-within { 1697 1794 border-color: var(--extnify-accent); 1698 box-shadow: 0 0 0 1px var(--extnify-accent);1795 box-shadow: 0 0 0 3px var(--extnify-accent-ring); 1699 1796 } 1700 1797 … … 1725 1822 .ext-wrap a.ext-io-btn:link, 1726 1823 .ext-wrap a.ext-io-btn:visited { 1727 display: inline-flex; 1728 align-items: center; 1729 gap: 6px; 1824 color: #fff; 1730 1825 background: var(--extnify-accent); 1731 border-color: var(--extnify-accent-dark); 1732 color: var(--extnify-surface); 1733 font-weight: 600; 1734 font-size: 13px; 1735 padding: 6px 14px; 1736 height: auto; 1737 box-shadow: none; 1738 text-decoration: none; 1739 transition: background .15s, border-color .15s; 1826 border-color: var(--extnify-accent); 1827 box-shadow: 0 1px 2px color-mix(in srgb, var(--extnify-accent) 35%, transparent); 1740 1828 } 1741 1829 … … 1743 1831 .ext-wrap .ext-io-btn:focus { 1744 1832 background: var(--extnify-accent-dark); 1745 border-color: #5c3185; 1746 color: var(--extnify-surface); 1747 box-shadow: none; 1833 border-color: var(--extnify-accent-dark); 1834 color: #fff; 1748 1835 } 1749 1836 1750 1837 .ext-wrap .ext-io-btn .dashicons, 1751 1838 .ext-wrap .ext-file-label .dashicons { 1752 font-size: 15px; 1753 width: 15px; 1754 height: 15px; 1755 line-height: 1; 1756 flex-shrink: 0; 1757 vertical-align: middle; 1839 font-size: 16px; 1840 width: 16px; 1841 height: 16px; 1758 1842 } 1759 1843 … … 1761 1845 .ext-wrap a.ext-io-btn-export:link, 1762 1846 .ext-wrap a.ext-io-btn-export:visited { 1763 background: var(--extnify-link); 1764 border-color: #135e96; 1765 color: var(--extnify-surface); 1847 color: #fff; 1766 1848 } 1767 1849 1768 1850 .ext-wrap .ext-io-btn-export:hover, 1769 1851 .ext-wrap .ext-io-btn-export:focus { 1770 background: #135e96; 1771 border-color: #0a4b78; 1772 color: var(--extnify-surface); 1852 color: #fff; 1773 1853 } 1774 1854 … … 1804 1884 border-left: none; 1805 1885 border: 1px solid var(--extnify-border); 1806 border-radius: 3px;1886 border-radius: 4px; 1807 1887 padding: 6px 10px; 1808 1888 } … … 2007 2087 group rows and align its label + dropdown with the columns above. */ 2008 2088 .ext-group-table tfoot .ext-group-foot-row td { 2009 border-top: 2px solid #d9cded;2089 border-top: 2px solid var(--extnify-accent-border); 2010 2090 background: var(--extnify-accent-tint); 2011 2091 } … … 2121 2201 font-style: normal; 2122 2202 text-decoration: none; 2123 border: 1px solid #b7d3ea;2203 border: 1px solid var(--extnify-accent-border); 2124 2204 border-radius: 20px; 2125 background: #f0f6fc;2205 background: var(--extnify-accent-tint); 2126 2206 } 2127 2207 … … 2137 2217 padding: 12px 14px; 2138 2218 background: var(--extnify-bg); 2139 border: 1px solid #e0e0e0;2140 border-radius: 4px;2219 border: 1px solid var(--extnify-border-light); 2220 border-radius: var(--extnify-radius-sm); 2141 2221 font-size: 13px; 2142 2222 line-height: 1.5; … … 2153 2233 background: #e5f4fb; 2154 2234 border: 1px solid #b6def0; 2155 border-radius: 4px;2235 border-radius: var(--extnify-radius-sm); 2156 2236 font-size: 13px; 2157 2237 line-height: 1.5; … … 2288 2368 .ext-ph-table td { 2289 2369 padding: 5px 10px; 2290 border: 1px solid #e0e0e0;2370 border: 1px solid var(--extnify-border-light); 2291 2371 vertical-align: top; 2292 2372 background: var(--extnify-surface); … … 2304 2384 background: #eef2f5; 2305 2385 padding: 1px 5px; 2306 border-radius: 3px;2386 border-radius: 4px; 2307 2387 font-size: 12px; 2308 2388 } … … 2321 2401 background: #909090; 2322 2402 border-color: #909090; 2323 border-radius: 4px;2403 border-radius: var(--extnify-radius-sm); 2324 2404 /* Fixed metrics so both (default .button and .button-small) render identically. */ 2325 2405 padding: 3px 11px; … … 2356 2436 padding: 6px; 2357 2437 background: var(--extnify-surface); 2358 border: 1px solid #b7d3ea;2359 border-radius: 4px;2438 border: 1px solid var(--extnify-accent-border); 2439 border-radius: var(--extnify-radius-sm); 2360 2440 box-shadow: 0 6px 18px rgba(0,0,0,.14); 2361 2441 column-count: 1; /* one option per line (base uses 2 columns) */ … … 2412 2492 background: var(--extnify-accent); 2413 2493 color: var(--extnify-surface); 2414 border-radius: 4px;2494 border-radius: var(--extnify-radius-sm); 2415 2495 font-size: 12px; 2416 2496 line-height: 1.6; -
extnify-fee/tags/1.1.0/assets/js/admin.js
r3751128 r3833938 144 144 // Load a blank method form into a new pane keyed by a temporary id. The 145 145 // method is NOT persisted until the user clicks Save / Save All. 146 function loadNewMethodPane( tempId, label ) {146 function loadNewMethodPane( tempId, label, seq ) { 147 147 var $loading = $( '#ext-method-loading' ); 148 148 var $content = $( '#ext-method-content' ); … … 164 164 // Seed the admin name with the default label so the sidebar 165 165 // and the persisted record agree ("Untitled Method N"). 166 $pane.find( '[name="xfeepro[display]"]' ).val( label ); 166 $pane.find( '[name="extnify_fee[display]"]' ).val( label ); 167 // Give the customer-facing Method Title a matching number too. 168 if ( seq ) { 169 $pane.find( '[name="extnify_fee[name]"]' ).val( 'Fee Title ' + seq ); 170 } 167 171 } else { 168 172 $content.append( '<div class="ext-method-pane"><p class="ext-error">' + ( i18n.loadError || 'Error loading method.' ) + '</p></div>' ); … … 184 188 var $item = addMethodSidebarItem( tempId, label, true ); 185 189 sidebarItemActive( $item ); 186 loadNewMethodPane( tempId, label );190 loadNewMethodPane( tempId, label, newMethodSeq ); 187 191 }); 188 192 … … 250 254 // real DB id. Falls back to creating an item if none is found. 251 255 function updateSidebarItem( $form, oldId, newId, display ) { 252 var status = $form.find( '[name=" xfeepro[status]"]' ).val();256 var status = $form.find( '[name="extnify_fee[status]"]' ).val(); 253 257 var isActive = status === '1'; 254 258 var statusClass = isActive ? 'ext-method-active' : 'ext-method-inactive'; … … 267 271 268 272 // ── Live sidebar label: reflect the Admin Name as you type ───────────────── 269 $( document ).on( 'input', '.ext-method-form [name=" xfeepro[display]"]', function () {273 $( document ).on( 'input', '.ext-method-form [name="extnify_fee[display]"]', function () { 270 274 var val = $( this ).val(); 271 275 if ( ! val.trim() ) return; // don't blank the sidebar item … … 275 279 276 280 // ── Live sidebar status: reflect the Status select as you change it ──────── 277 $( document ).on( 'change', '.ext-method-form [name=" xfeepro[status]"]', function () {281 $( document ).on( 'change', '.ext-method-form [name="extnify_fee[status]"]', function () { 278 282 var isActive = $( this ).val() === '1'; 279 283 var id = $( this ).closest( '.ext-method-pane' ).attr( 'data-method-id' ); … … 329 333 .done( function ( resp ) { 330 334 if ( resp.success ) { 331 var enabled = $form.find( '[name=" xfeepro[status]"]' ).val() === '1';335 var enabled = $form.find( '[name="extnify_fee[status]"]' ).val() === '1'; 332 336 var $item = addMethodSidebarItem( resp.data.id, resp.data.display, enabled ); 333 337 sidebarItemActive( $item ); … … 401 405 // ── Rate-type dependency logic ──────────────────────────────────────────── 402 406 403 $( document ).on( 'change', '[name^=" xfeepro"][name$="[rate_type]"]', function () {407 $( document ).on( 'change', '[name^="extnify_fee"][name$="[rate_type]"]', function () { 404 408 updateRateDeps( $( this ).closest( '.ext-method-form' ) ); 405 409 }); … … 710 714 $form.find( 'tr.ext-zone-row .ocm-checkgroup-checkbox' ).append( 711 715 '<label class="ext-cz-label">' 712 + '<input type="checkbox" name=" xfeepro[zone][]" value="' + escAttr( val ) + '" checked /> '716 + '<input type="checkbox" name="extnify_fee[zone][]" value="' + escAttr( val ) + '" checked /> ' 713 717 + escHtml( cLabel + ' — ' + label ) 714 718 + '</label>' … … 928 932 // chosen product (hidden id + name); otherwise it stays empty. 929 933 function rangeRowHtml( idx ) { 930 var n = ' xfeepro[ranges][' + idx + ']';934 var n = 'extnify_fee[ranges][' + idx + ']'; 931 935 // Free plugin: Start / End / Cost / Remove only (blocks, partial, per-product 932 936 // are Pro). Keep this in sync with get_ranges_html() in the controller. … … 966 970 var $list = $( this ).closest( 'div' ).siblings( '.ext-sub-options-list' ); 967 971 subOptIndex = $list.find( '.ext-sub-opt-row' ).length; 968 var n = ' xfeepro[sub_options][' + subOptIndex + ']';972 var n = 'extnify_fee[sub_options][' + subOptIndex + ']'; 969 973 $list.append( 970 974 '<div class="ext-sub-opt-row" data-index="' + subOptIndex + '">' … … 1079 1083 $list.empty(); 1080 1084 $.each( rows, function ( i, row ) { 1081 var n = ' xfeepro[sub_options][' + i + ']';1085 var n = 'extnify_fee[sub_options][' + i + ']'; 1082 1086 $list.append( 1083 1087 '<div class="ext-sub-opt-row" data-index="' + i + '">' -
extnify-fee/tags/1.1.0/bootstrap.php
r3751128 r3833938 2 2 defined( 'ABSPATH' ) || exit; 3 3 4 class XFee_Plugin {4 class Extnify_Fee_Plugin { 5 5 6 6 private static $instance = null; … … 20 20 private function includes(): void { 21 21 // Model + fee engine: needed on both frontend and admin. 22 require_once XFEE_PLUGIN_PATH . 'admin/model.php'; 23 require_once XFEE_PLUGIN_PATH . 'front/class-fee.php'; 22 require_once EXTNIFY_FEE_PLUGIN_PATH . 'admin/model.php'; 23 Extnify_Fee_Model::maybe_upgrade(); // sync DB schema (handles updates, not just activation) 24 require_once EXTNIFY_FEE_PLUGIN_PATH . 'front/class-fee.php'; 24 25 25 26 if ( is_admin() ) { 26 require_once XFEE_PLUGIN_PATH . 'system/library/ocm/autoloader.php'; 27 require_once XFEE_PLUGIN_PATH . 'admin/controller.php'; 28 new XFee_Back( new XFee_Model() ); 27 require_once EXTNIFY_FEE_PLUGIN_PATH . 'system/extnify-core/ui/autoloader.php'; 28 require_once EXTNIFY_FEE_PLUGIN_PATH . 'system/framework/traits/woo-helpers.php'; 29 require_once EXTNIFY_FEE_PLUGIN_PATH . 'admin/controller.php'; 30 new Extnify_Fee_Back( new Extnify_Fee_Model() ); 29 31 } 30 32 } … … 50 52 return; 51 53 } 52 ( new XFee_Fee() )->apply( $cart );54 ( new Extnify_Fee_Fee() )->apply( $cart ); 53 55 } 54 56 -
extnify-fee/tags/1.1.0/extnify-fee.php
r3772791 r3833938 4 4 * Plugin URI: https://extnify.com/platforms/woocommerce 5 5 * Description: Conditional cart fees for WooCommerce — flat or percentage fees, gated by shipping zone, payment method or shipping method. 6 * Version: 1. 0.16 * Version: 1.1.0 7 7 * Author: Extnify Labs LLC 8 8 * Author URI: https://extnify.com … … 22 22 defined( 'ABSPATH' ) || exit; 23 23 24 // Build identity: FALSE = free build → no license verification, no phone-home.25 // Free and Pro ship under the SAME slug + main file, so they can never be active26 // together (installing one replaces the other in place) — this free build always27 // defines the flag.28 defined( 'EXTNIFY_DISTRIBUTION' ) || define( 'EXTNIFY_DISTRIBUTION', false );29 30 24 register_activation_hook( __FILE__, function() { 31 25 require_once plugin_dir_path( __FILE__ ) . 'admin/model.php'; 32 XFee_Model::create_table();26 Extnify_Fee_Model::maybe_upgrade(); 33 27 } ); 34 28 35 29 // Metadata single-source-of-truth (keep the PHP header above in sync — WordPress 36 // reads that directly). Constants are uniquely prefixed ( XFEE_*) so this free30 // reads that directly). Constants are uniquely prefixed (EXTNIFY_FEE_*) so this free 37 31 // plugin can never collide with the paid Extnify Fee Rules Pro (which uses EXTNIFY_*). 38 32 // Closure-wrapped so $meta stays function-scoped (no global variable). … … 40 34 $meta = json_decode( file_get_contents( plugin_dir_path( __FILE__ ) . 'extnify.json' ), true ); 41 35 42 define( ' XFEE_PLUGIN_VERSION', $meta['version'] );43 define( ' XFEE_PLUGIN_NAME', $meta['name'] );44 define( ' XFEE_PLUGIN_TEXT_DOMAIN', $meta['text_domain'] );45 define( ' XFEE_PLUGIN_REQUIRES_WC', $meta['requires_wc'] );46 define( ' XFEE_PLUGIN_TESTED_WC', $meta['tested_wc'] );47 define( ' XFEE_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );48 define( ' XFEE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );49 define( ' XFEE_PLUGIN_FILE', __FILE__ );36 define( 'EXTNIFY_FEE_PLUGIN_VERSION', $meta['version'] ); 37 define( 'EXTNIFY_FEE_PLUGIN_NAME', $meta['name'] ); 38 define( 'EXTNIFY_FEE_PLUGIN_TEXT_DOMAIN', $meta['text_domain'] ); 39 define( 'EXTNIFY_FEE_PLUGIN_REQUIRES_WC', $meta['requires_wc'] ); 40 define( 'EXTNIFY_FEE_PLUGIN_TESTED_WC', $meta['tested_wc'] ); 41 define( 'EXTNIFY_FEE_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); 42 define( 'EXTNIFY_FEE_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 43 define( 'EXTNIFY_FEE_PLUGIN_FILE', __FILE__ ); 50 44 51 45 // Build-set "Upgrade to Pro" target. The WordPress.org build ships a URL (shows 52 46 // the card); the WooCommerce build ships "" (hides it, WooCommerce owns the upsell). 53 define( ' XFEE_UPGRADE_URL', isset( $meta['upgrade_url'] ) ? (string) $meta['upgrade_url'] : '' );47 define( 'EXTNIFY_FEE_UPGRADE_URL', isset( $meta['upgrade_url'] ) ? (string) $meta['upgrade_url'] : '' ); 54 48 } )(); 55 49 … … 69 63 add_action( 'admin_notices', function() { 70 64 echo '<div class="error"><p>' 71 . esc_html( XFEE_PLUGIN_NAME . ' requires WooCommerce to be installed and active.' )65 . esc_html( EXTNIFY_FEE_PLUGIN_NAME . ' requires WooCommerce to be installed and active.' ) 72 66 . '</p></div>'; 73 67 } ); … … 75 69 } 76 70 77 require_once XFEE_PLUGIN_PATH . 'bootstrap.php';78 XFee_Plugin::instance();71 require_once EXTNIFY_FEE_PLUGIN_PATH . 'bootstrap.php'; 72 Extnify_Fee_Plugin::instance(); 79 73 80 74 } ); -
extnify-fee/tags/1.1.0/extnify.json
r3772791 r3833938 2 2 "name": "Extnify Fee Rules", 3 3 "title": "Extnify Fee Rules for WooCommerce", 4 "version": "1. 0.1",4 "version": "1.1.0", 5 5 "description": "Conditional cart fees for WooCommerce — flat or percentage fees, gated by shipping zone, payment method or shipping method.", 6 6 "author": "Extnify Labs LLC", -
extnify-fee/tags/1.1.0/front/class-fee.php
r3751128 r3833938 17 17 defined( 'ABSPATH' ) || exit; 18 18 19 class XFee_Fee { 19 require_once __DIR__ . '/../system/extnify-core/traits/debug-log.php'; 20 21 class Extnify_Fee_Fee { 22 23 use Extnify_Debug_Log; 20 24 21 25 /** Free understands only the flat rate type. */ … … 23 27 24 28 /** Whether the global Debugging setting is on (computed per calculation). */ 25 private $debug = false;29 private $debug = null; 26 30 27 31 /** … … 34 38 // When it is disabled, NO fees are applied — matching OpenCart. Absent = 35 39 // enabled (so a fresh install with configured fees works out of the box). 36 $global = (array) get_option( ' x_feepro', array() );40 $global = (array) get_option( 'extnify_fee', array() ); 37 41 $status = isset( $global['status'] ) ? (string) $global['status'] : '1'; 38 42 if ( '1' !== $status ) { … … 41 45 } 42 46 43 $model = new XFee_Model();47 $model = new Extnify_Fee_Model(); 44 48 $rows = $model->getData(); 45 49 if ( empty( $rows ) ) { … … 194 198 // ── Debug log (gated by the global Debugging setting) ───────────────────── 195 199 196 private function debug_enabled(): bool { 197 $s = (array) get_option( 'x_feepro', array() ); 198 return isset( $s['debug'] ) && '1' === (string) $s['debug']; 199 } 200 201 /** 202 * Append one entry to the debug log — only when Debugging is enabled. 203 * Stored in the database (a capped transient), never written to a file. 204 */ 205 private function log( string $level, string $message ): void { 206 if ( ! $this->debug ) { 207 return; 208 } 209 $entries = get_transient( 'x_feepro_debug_log' ); 210 if ( ! is_array( $entries ) ) { 211 $entries = array(); 212 } 213 $entries[] = array( 214 'time' => current_time( 'H:i:s' ), 215 'level' => strtolower( $level ), 216 'message' => $message, 217 ); 218 if ( count( $entries ) > 300 ) { 219 $entries = array_slice( $entries, -300 ); 220 } 221 set_transient( 'x_feepro_debug_log', $entries, WEEK_IN_SECONDS ); 222 } 200 protected function debug_option_key(): string { return 'extnify_fee'; } 201 protected function debug_log_key(): string { return 'extnify_fee_debug_log'; } 223 202 224 203 /** The free subset of a method's fields. */ -
extnify-fee/tags/1.1.0/readme.txt
r3772791 r3833938 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1. 0.17 Stable tag: 1.1.0 8 8 Requires Plugins: woocommerce 9 9 WC requires at least: 7.1.0 … … 20 20 Create as many fees as you need, set each one as a flat amount or a percentage of the subtotal, and limit when it applies by shipping zone, payment method and shipping method. A positive amount adds a fee; a negative amount shows as a discount. Everything is managed from one simple screen, and a built-in live log shows you exactly why a fee did or didn't apply. 21 21 22 [Read the documentation »](https://extnify.com/docs/woocommerce/extnify-fee-rules-woocommerce) | [Try the live demo »](https://wc-dev.extnify.com/?auto_login=extnify-fee)22 [Read the documentation »](https://extnify.com/docs/woocommerce/extnify-fee-rules-woocommerce) | [Try backend »](https://extnify-fee.extnify.com/wp-admin/) | [Try frontend »](https://extnify-fee.extnify.com/shop/) 23 23 24 24 **See it in action:** … … 88 88 = More plugins by Extnify = 89 89 90 * **Extnify Shipping Rules** — build your own conditional WooCommerce shipping methods and rates. 91 * **Extnify Offer Rules** — let customers pick selectable discounts or add-ons at checkout. 90 * **Extnify Discount Rules** — rule-based product discounts shown as a sale across your store. [Free](https://wordpress.org/plugins/extnify-discount/) · [Pro](https://extnify.com/products/extnify-discount-rules-pro) 91 * **Extnify Offer Rules** — selectable discounts and optional add-ons for the cart and checkout. [Free](https://wordpress.org/plugins/extnify-offer/) · [Pro](https://extnify.com/products/extnify-offer-rules-pro-for-woocommerce) 92 * **Extnify Shipping Rules** — build your own conditional WooCommerce shipping methods and rates. [Free](https://wordpress.org/plugins/extnify-shipping/) · [Pro](https://extnify.com/products/extnify-shipping-pro-woocommerce) 92 93 93 94 Extnify Fee Rules is built by Extnify, the team behind the X-FeePro extension for OpenCart. … … 141 142 == Changelog == 142 143 144 = 1.1.0 = 145 * Rebuilt on the shared Extnify core, consistent with the other Extnify plugins. 146 * Your existing fees and settings are moved to the new storage automatically on update — nothing to re-enter. 147 * The database table now updates itself automatically after plugin updates. 148 * New fees get a numbered default title (Fee Title 2, Fee Title 3, …). 149 * Readme: new backend and frontend demo links. 150 143 151 = 1.0.1 = 144 152 * Expanded the plugin listing (features, demo, FAQ). … … 150 158 == Upgrade Notice == 151 159 160 = 1.1.0 = 161 Your fees and settings are moved to the new storage automatically. As always, back up your site before updating. 162 152 163 = 1.0.1 = 153 164 Refreshed the plugin listing and corrected the in-admin Documentation link. -
extnify-fee/tags/1.1.0/system/framework/traits/woo-helpers.php
r3751128 r3833938 1 1 <?php 2 2 /** 3 * XFee_Woo_Helpers — WooCommerce-specific admin helpers shared across plugins:3 * Extnify_Fee_Woo_Helpers — WooCommerce-specific admin helpers shared across plugins: 4 4 * shipping-rate cache busting, zone (country→state) lookup, and brand 5 5 * taxonomy detection. Composed into an admin controller. … … 7 7 defined( 'ABSPATH' ) || exit; 8 8 9 trait XFee_Woo_Helpers {9 trait Extnify_Fee_Woo_Helpers { 10 10 11 11 public function ajax_get_zones() { … … 27 27 $zones[] = array( 28 28 'value' => $code . ':' . $state_code, 29 'name' => \Extnify\ XFee\Ocm\Misc::decode( $country_name . ' — ' . $state_name ),29 'name' => \Extnify\Fee\Ui\Misc::decode( $country_name . ' — ' . $state_name ), 30 30 ); 31 31 } -
extnify-fee/tags/1.1.0/uninstall.php
r3751128 r3833938 12 12 13 13 // The debug log is transient (ephemeral) data — always clear it. 14 delete_transient( ' x_feepro_debug_log' );14 delete_transient( 'extnify_fee_debug_log' ); 15 15 16 delete_option( 'x_feepro' ); 16 delete_option( 'extnify_fee' ); 17 // Drop the stored schema version so a later reinstall recreates the table. 18 delete_option( 'extnify_fee_db_version' ); 17 19 require_once plugin_dir_path( __FILE__ ) . 'admin/model.php'; 18 XFee_Model::drop_table();20 Extnify_Fee_Model::drop_table(); -
extnify-fee/trunk/admin/controller.php
r3772791 r3833938 1 1 <?php 2 use Extnify\ XFee\Ocm\Form;3 use Extnify\ XFee\Ocm\Misc;2 use Extnify\Fee\Ui\Form; 3 use Extnify\Fee\Ui\Misc; 4 4 defined( 'ABSPATH' ) || exit; 5 5 … … 12 12 * 13 13 * Shared identity with Pro (so the data table stays compatible): 14 * • global option / field prefix / nonce group = ` x_feepro`15 * • per-method field prefix = ` xfeepro`14 * • global option / field prefix / nonce group = `extnify_fee` 15 * • per-method field prefix = `extnify_fee` 16 16 * The admin PAGE slug is `extnify-fee` (same as Pro). 17 17 */ 18 class XFee_Back {19 20 use XFee_Woo_Helpers; // ajax_get_zones() for the Shipping Zone field18 class Extnify_Fee_Back { 19 20 use Extnify_Fee_Woo_Helpers; // ajax_get_zones() for the Shipping Zone field 21 21 22 22 /** @var Form */ private $form; 23 23 /** @var Misc */ private $misc; 24 /** @var XFee_Model */ private $model;24 /** @var Extnify_Fee_Model */ private $model; 25 25 /** @var array */ private $langs_data; 26 26 27 private static function group() { return ' x_feepro'; } // shared option + field prefix + nonce27 private static function group() { return 'extnify_fee'; } // shared option + field prefix + nonce 28 28 private static function slug() { return 'extnify-fee'; } // admin page slug 29 29 30 public function __construct( XFee_Model $model ) {30 public function __construct( Extnify_Fee_Model $model ) { 31 31 $this->model = $model; 32 32 $this->form = new Form(); … … 40 40 41 41 // AJAX action names are prefixed with this plugin's unique group 42 // (e.g. wp_ajax_ x_feepro_load_method) so two active Extnify plugins never42 // (e.g. wp_ajax_extnify_fee_load_method) so two active Extnify plugins never 43 43 // register the same hook — otherwise both handlers fire on one request. 44 44 $ajax = array( 'load_method', 'save_method', 'delete_method', … … 167 167 168 168 private function tab_gs_general( array $setting ) { 169 // Default the global Sort Order to 0 when unset (new installs show 0, not blank). 170 $setting = array_merge( array( 'sort_order' => '0' ), $setting ); 169 171 $this->form->setPreset( $setting ); 170 172 $html = '<table class="form-table" role="presentation"><tbody>'; … … 177 179 178 180 /** 179 * "Available in Pro Version" placeholder. On the wp.org build ( XFEE_UPGRADE_URL181 * "Available in Pro Version" placeholder. On the wp.org build (EXTNIFY_FEE_UPGRADE_URL 180 182 * set) it links to the Pro product page; on the WooCommerce build (constant 181 183 * empty) it stays plain text — no external upsell link (Marketplace rules). 182 184 */ 183 185 private function pro_placeholder( $text = null, $icon = 'dashicons-lock' ) { 184 $url = defined( ' XFEE_UPGRADE_URL' ) ? (string) XFEE_UPGRADE_URL : '';186 $url = defined( 'EXTNIFY_FEE_UPGRADE_URL' ) ? (string) EXTNIFY_FEE_UPGRADE_URL : ''; 185 187 $label = ( null === $text ) ? esc_html__( 'Available in Pro Version', 'extnify-fee' ) : esc_html( $text ); 186 188 $body = ( '' !== $url ) … … 195 197 /** Help & Support — support links only (the live debug log is a Pro feature). */ 196 198 private function tab_gs_help() { 197 $ver = defined( ' XFEE_PLUGIN_VERSION' ) ? XFEE_PLUGIN_VERSION : '1.0.0';199 $ver = defined( 'EXTNIFY_FEE_PLUGIN_VERSION' ) ? EXTNIFY_FEE_PLUGIN_VERSION : '1.0.0'; 198 200 $wp_ver = get_bloginfo( 'version' ); 199 201 $php_ver = preg_replace( '/^(\d+\.\d+).*/', '$1', PHP_VERSION ); … … 234 236 // (WordPress.org build). The WooCommerce build ships an empty URL, so the 235 237 // card is dropped entirely (the marketplace owns the upsell there). 236 if ( defined( ' XFEE_UPGRADE_URL' ) && XFEE_UPGRADE_URL ) {237 $html .= '<a href="' . esc_url( XFEE_UPGRADE_URL ) . '" target="_blank" rel="noopener" class="ext-hs-card ext-hs-upgrade">'238 if ( defined( 'EXTNIFY_FEE_UPGRADE_URL' ) && EXTNIFY_FEE_UPGRADE_URL ) { 239 $html .= '<a href="' . esc_url( EXTNIFY_FEE_UPGRADE_URL ) . '" target="_blank" rel="noopener" class="ext-hs-card ext-hs-upgrade">' 238 240 . '<span class="ext-hs-card-icon dashicons dashicons-star-filled"></span>' 239 241 . '<span class="ext-hs-card-text"><strong>' . esc_html__( 'Upgrade to Pro', 'extnify-fee' ) . '</strong>' … … 328 330 } 329 331 330 $extnify = null; // the Extnify shipping method (free ' x_shipping' or pro 'x_shipping_pro').332 $extnify = null; // the Extnify shipping method (free 'extnify_shipping' or pro 'extnify_shipping_pro'). 331 333 foreach ( WC()->shipping()->get_shipping_methods() as $method ) { 332 if ( in_array( $method->id, array( ' x_shipping', 'x_shipping_pro' ), true ) ) {334 if ( in_array( $method->id, array( 'extnify_shipping', 'extnify_shipping_pro' ), true ) ) { 333 335 $extnify = $method; // expanded into rows below — don't list the collapsed type. 334 336 continue; … … 339 341 if ( $extnify ) { 340 342 global $wpdb; 341 $table = $wpdb->prefix . ' xshippingpro_methods';343 $table = $wpdb->prefix . 'extnify_shipping_methods'; 342 344 // phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- checking existence of a fixed prefixed table. 343 345 if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table ) ) === $table ) { … … 376 378 'shipping_all' => '1', 377 379 'tax_class_id' => '', 378 'sort_order' => ' ',380 'sort_order' => '0', 379 381 'status' => '1', 380 382 'rate_type' => 'flat', … … 390 392 391 393 $this->form 392 ->setBasename( ' xfeepro' )394 ->setBasename( 'extnify_fee' ) 393 395 ->setPreset( $method_data ) 394 396 ->setIDPostfix( $postfix ) … … 498 500 $mdata = $row ? $row['method_data'] : array(); 499 501 500 $this->form->setBasename( ' xfeepro' )->setLangs( $this->langs_data );502 $this->form->setBasename( 'extnify_fee' )->setLangs( $this->langs_data ); 501 503 $id_postfix = $id ? (string) $id : ( $postfix ?: 'new' ); 502 504 wp_send_json_success( array( 'html' => $this->get_form_data( $mdata, $id, $id_postfix ), 'id' => $id ) ); … … 506 508 $this->check_ajax_auth(); 507 509 $id = isset( $_POST['ext_method_id'] ) ? sanitize_text_field( wp_unslash( $_POST['ext_method_id'] ) ) : 'new'; // phpcs:ignore WordPress.Security.NonceVerification.Missing -- nonce verified in check_ajax_auth() 508 $posted = isset( $_POST[' xfeepro'] ) ? (array) wp_unslash( $_POST['xfeepro'] ) : array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- nonce verified in check_ajax_auth(); sanitized in sanitize_method()510 $posted = isset( $_POST['extnify_fee'] ) ? (array) wp_unslash( $_POST['extnify_fee'] ) : array(); // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- nonce verified in check_ajax_auth(); sanitized in sanitize_method() 509 511 $is_new = ( 'new' === $id || ! $id ); 510 512 $mdata = $this->sanitize_method( $posted, $is_new ? 0 : (int) $id ); … … 542 544 $this->check_ajax_auth(); 543 545 $limit = isset( $_REQUEST['limit'] ) ? max( 1, min( 500, (int) $_REQUEST['limit'] ) ) : 60; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- nonce verified in check_ajax_auth(); value is int-clamped 544 $log = get_transient( ' x_feepro_debug_log' );546 $log = get_transient( 'extnify_fee_debug_log' ); 545 547 $entries = array(); 546 548 if ( is_array( $log ) ) { … … 559 561 public function ajax_debug_clear() { 560 562 $this->check_ajax_auth(); 561 delete_transient( ' x_feepro_debug_log' );563 delete_transient( 'extnify_fee_debug_log' ); 562 564 wp_send_json_success(); 563 565 } … … 606 608 return; 607 609 } 608 $theme_path = XFEE_PLUGIN_PATH . 'assets/css/theme.css';609 $css_path = XFEE_PLUGIN_PATH . 'assets/css/admin.css';610 $js_path = XFEE_PLUGIN_PATH . 'assets/js/admin.js';610 $theme_path = EXTNIFY_FEE_PLUGIN_PATH . 'assets/css/theme.css'; 611 $css_path = EXTNIFY_FEE_PLUGIN_PATH . 'assets/css/admin.css'; 612 $js_path = EXTNIFY_FEE_PLUGIN_PATH . 'assets/js/admin.js'; 611 613 // Shared Extnify theme (brand tokens + components) loads first… 612 wp_enqueue_style( 'extnify-theme', XFEE_PLUGIN_URL . 'assets/css/theme.css', array(), file_exists( $theme_path ) ? filemtime( $theme_path ) : XFEE_PLUGIN_VERSION );614 wp_enqueue_style( 'extnify-theme', EXTNIFY_FEE_PLUGIN_URL . 'assets/css/theme.css', array(), file_exists( $theme_path ) ? filemtime( $theme_path ) : EXTNIFY_FEE_PLUGIN_VERSION ); 613 615 // …then this plugin's own overrides, so they win via the cascade. 614 wp_enqueue_style( 'extnify-fee-admin', XFEE_PLUGIN_URL . 'assets/css/admin.css', array( 'extnify-theme' ), file_exists( $css_path ) ? filemtime( $css_path ) : XFEE_PLUGIN_VERSION );615 wp_enqueue_script( 'extnify-fee-admin', XFEE_PLUGIN_URL . 'assets/js/admin.js', array( 'jquery', 'jquery-ui-sortable' ), file_exists( $js_path ) ? filemtime( $js_path ) : XFEE_PLUGIN_VERSION, true );616 wp_enqueue_style( 'extnify-fee-admin', EXTNIFY_FEE_PLUGIN_URL . 'assets/css/admin.css', array( 'extnify-theme' ), file_exists( $css_path ) ? filemtime( $css_path ) : EXTNIFY_FEE_PLUGIN_VERSION ); 617 wp_enqueue_script( 'extnify-fee-admin', EXTNIFY_FEE_PLUGIN_URL . 'assets/js/admin.js', array( 'jquery', 'jquery-ui-sortable' ), file_exists( $js_path ) ? filemtime( $js_path ) : EXTNIFY_FEE_PLUGIN_VERSION, true ); 616 618 wp_localize_script( 'extnify-fee-admin', 'extnifyFeeAdmin', array( 617 619 'ajaxUrl' => admin_url( 'admin-ajax.php' ), … … 634 636 // basename() strips any path components, so $template can only resolve to a 635 637 // file inside admin/views/ — no directory traversal via the include below. 636 $file = XFEE_PLUGIN_PATH . 'admin/views/' . basename( (string) $template ) . '.php';638 $file = EXTNIFY_FEE_PLUGIN_PATH . 'admin/views/' . basename( (string) $template ) . '.php'; 637 639 if ( ! file_exists( $file ) ) { 638 640 return; -
extnify-fee/trunk/admin/model.php
r3751128 r3833938 4 4 * 5 5 * IMPORTANT: this reads/writes the SAME table as the paid Extnify Fee Rules Pro 6 * (`{prefix} xfeepro_methods`) so a customer can move between free and paid6 * (`{prefix}extnify_fee_methods`) so a customer can move between free and paid 7 7 * without losing their configured methods. Pro writes a superset of fields into 8 8 * the `method_data` JSON; the free plugin simply reads the subset it understands … … 11 11 defined( 'ABSPATH' ) || exit; 12 12 13 class XFee_Model {13 class Extnify_Fee_Model { 14 14 15 15 private $table; … … 17 17 public function __construct() { 18 18 global $wpdb; 19 $this->table = $wpdb->prefix . ' xfeepro_methods';19 $this->table = $wpdb->prefix . 'extnify_fee_methods'; 20 20 } 21 21 22 22 // ── Schema (shared table — CREATE IF NOT EXISTS, so either plugin may make it) ─ 23 23 24 /** DB schema version -- bump when the table schema below changes. */ 25 const DB_VERSION = '1.0.0'; 26 /** Per-plugin option storing the installed schema version. */ 27 const DB_VERSION_OPTION = 'extnify_fee_db_version'; 28 29 /** 30 * Idempotent schema sync. Runs on activation AND on every request (cheap option 31 * check); when the stored version is behind the code it re-runs dbDelta, so a 32 * plugin UPDATE that adds a column actually alters the live table (the activation 33 * hook does not fire on updates). dbDelta only adds/modifies columns, never drops. 34 */ 35 public static function maybe_upgrade() { 36 global $wpdb; 37 if ( get_option( self::DB_VERSION_OPTION ) === self::DB_VERSION ) { 38 // Version says current — but verify the table actually EXISTS before trusting 39 // it. An uninstall/DB-reset can drop the table yet leave this option behind, 40 // which would otherwise block re-creation. Self-heal if it's gone. 41 $table = ( new self() )->table; 42 if ( $wpdb->get_var( $wpdb->prepare( 'SHOW TABLES LIKE %s', $table ) ) === $table ) { 43 return; 44 } 45 } 46 self::create_table(); 47 update_option( self::DB_VERSION_OPTION, self::DB_VERSION ); 48 } 49 24 50 public static function create_table() { 25 51 global $wpdb; 26 $table = $wpdb->prefix . ' xfeepro_methods';52 $table = $wpdb->prefix . 'extnify_fee_methods'; 27 53 $charset_collate = $wpdb->get_charset_collate(); 28 54 $sql = "CREATE TABLE IF NOT EXISTS {$table} ( … … 39 65 public static function drop_table() { 40 66 global $wpdb; 41 $table = $wpdb->prefix . ' xfeepro_methods';67 $table = $wpdb->prefix . 'extnify_fee_methods'; 42 68 // phpcs:ignore WordPress.DB.DirectDatabaseQuery, WordPress.DB.PreparedSQL.InterpolatedNotPrepared, PluginCheck.Security.DirectDB.UnescapedDBParameter -- table name is $wpdb->prefix + a fixed string; identifiers can't be bound via prepare(). 43 69 $wpdb->query( "DROP TABLE IF EXISTS {$table}" ); -
extnify-fee/trunk/assets/css/admin.css
r3751128 r3833938 3 3 4 4 The shared look (brand tokens + all components) lives in the Extnify theme: 5 assets/css/theme.css, injected at build from shared-resources -wp/common/theme/.5 assets/css/theme.css, injected at build from shared-resources/theme/. 6 6 It loads FIRST; this file loads after it, so anything here overrides the theme. 7 7 -
extnify-fee/trunk/assets/css/theme.css
r3751128 r3833938 8 8 -------------------------------------------------------------------------- */ 9 9 :root { 10 /* Accent - WooCommerce purple */ 11 --extnify-accent: #7f54b3; 12 --extnify-accent-dark: #6d3f9e; 13 --extnify-accent-darker: #5a3a8a; 14 --extnify-accent-tint: #f5f0fb; 15 --extnify-accent-tint-2: #efe9fa; 16 --extnify-accent-border: #c4aee3; 10 /* Accent - Extnify blue */ 11 --extnify-accent: #3863e9; 12 --extnify-accent-dark: #2a4ed2; /* hover */ 13 --extnify-accent-darker: #1f3eb0; /* pressed */ 14 --extnify-accent-tint: #eef2fd; /* selected background */ 15 --extnify-accent-tint-2: #e1e7fc; /* hover background */ 16 --extnify-accent-border: #b4c4f7; 17 --extnify-accent-ring: rgba(56, 99, 233, .2); /* focus ring */ 17 18 18 19 /* Text (WordPress admin neutrals) */ … … 26 27 --extnify-bg: #f6f7f7; 27 28 --extnify-bg-soft: #f0f0f1; 28 --extnify-border: #c3c4c7; 29 --extnify-border-light: #e2e2e4; 29 --extnify-border: #dcdcde; 30 --extnify-border-light: #e2e4e7; 31 --extnify-border-input: #8c8f94; 30 32 31 33 /* Semantic */ 32 --extnify-link: # 2271b1;34 --extnify-link: #3863e9; 33 35 --extnify-danger: #d63638; 34 --extnify-success: #4b8a5c; 36 --extnify-danger-tint: #fcf0f1; 37 --extnify-success: #007a3d; 38 --extnify-success-tint: #e6f4ea; 39 --extnify-warning: #996800; 40 41 /* Shape */ 42 --extnify-radius-sm: 6px; /* inputs, buttons, list items */ 43 --extnify-radius: 8px; /* small cards */ 44 --extnify-radius-lg: 12px; /* page-level cards */ 45 --extnify-shadow: 0 1px 2px rgba(0, 0, 0, .04); 35 46 36 47 /* Typography */ … … 43 54 .ext-wrap { 44 55 max-width: 100%; 56 } 57 58 /* -------------------------------------------------------------------------- 59 Buttons — one system for every Extnify screen. 60 WordPress 7 gives core .button a 40px min-height, 38px line-height and 61 2px corners, and any padding we add stacks on top of that (52px-tall 62 square buttons). Reset it once here: 36px, 6px corners, centred content. 63 `.ext-wrap .button` (0,2,0) beats `.wp-core-ui .button` by load order. 64 .button → secondary (white, grey border) 65 .button.button-primary → primary (accent) 66 .button.button-small → compact (30px) 67 -------------------------------------------------------------------------- */ 68 .ext-wrap .button { 69 display: inline-flex; 70 align-items: center; 71 justify-content: center; 72 gap: 6px; 73 min-height: 36px; 74 height: auto; 75 padding: 0 14px; 76 line-height: 1.2; 77 font-size: 13px; 78 font-weight: 600; 79 color: var(--extnify-text-soft); 80 background: var(--extnify-surface); 81 border: 1px solid var(--extnify-border); 82 border-radius: var(--extnify-radius-sm); 83 box-shadow: 0 1px 2px rgba(0, 0, 0, .05); 84 text-decoration: none; 85 vertical-align: middle; 86 cursor: pointer; 87 transition: background .15s, border-color .15s, color .15s, box-shadow .15s; 88 } 89 90 .ext-wrap .button:hover { 91 color: var(--extnify-accent-dark); 92 background: var(--extnify-accent-tint); 93 border-color: var(--extnify-accent-border); 94 } 95 96 .ext-wrap .button:active { 97 background: var(--extnify-accent-tint-2); 98 box-shadow: none; 99 } 100 101 .ext-wrap .button:focus { 102 outline: none; 103 color: var(--extnify-accent-dark); 104 border-color: var(--extnify-accent); 105 box-shadow: 0 0 0 3px var(--extnify-accent-ring); 106 } 107 108 .ext-wrap .button.button-primary { 109 color: #fff; 110 background: var(--extnify-accent); 111 border-color: var(--extnify-accent); 112 box-shadow: 0 1px 2px color-mix(in srgb, var(--extnify-accent) 35%, transparent); 113 } 114 115 .ext-wrap .button.button-primary:hover { 116 color: #fff; 117 background: var(--extnify-accent-dark); 118 border-color: var(--extnify-accent-dark); 119 } 120 121 .ext-wrap .button.button-primary:active { 122 background: var(--extnify-accent-darker); 123 border-color: var(--extnify-accent-darker); 124 box-shadow: none; 125 } 126 127 .ext-wrap .button.button-primary:focus { 128 color: #fff; 129 border-color: var(--extnify-accent); 130 box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--extnify-accent); 131 } 132 133 .ext-wrap .button.button-small { 134 min-height: 30px; 135 padding: 0 10px; 136 font-size: 12px; 137 } 138 139 .ext-wrap .button:disabled, 140 .ext-wrap .button[disabled], 141 .ext-wrap .button.disabled { 142 opacity: .55; 143 cursor: not-allowed; 144 box-shadow: none; 145 } 146 147 .ext-wrap .button .dashicons { 148 font-size: 16px; 149 width: 16px; 150 height: 16px; 151 line-height: 1; 152 margin: 0; 153 flex-shrink: 0; 45 154 } 46 155 … … 99 208 min-height: 600px; 100 209 background: var(--extnify-surface); 101 border: 1px solid var(--extnify-border); 102 border-radius: 4px; 210 border: 1px solid var(--extnify-border-light); 211 border-radius: var(--extnify-radius-lg); 212 box-shadow: var(--extnify-shadow); 103 213 overflow: hidden; 104 214 } … … 111 221 flex-shrink: 0; 112 222 /* background: #fafafa; */ 113 border-right: 1px solid #e0e0e2;223 border-right: 1px solid var(--extnify-border-light); 114 224 min-height: 600px; 115 225 display: flex; … … 118 228 119 229 .ext-sidebar-section { 120 border-bottom: 1px solid #e0e0e2;230 border-bottom: 1px solid var(--extnify-border-light); 121 231 } 122 232 … … 176 286 flex-direction: column; 177 287 gap: 5px; 178 background: #fafafa288 background: var(--extnify-bg) 179 289 } 180 290 … … 187 297 cursor: pointer; 188 298 font-size: 12.5px; 189 color: #2c2c2c;299 color: var(--extnify-text); 190 300 background: var(--extnify-surface); 191 301 border: 1px solid var(--extnify-border-light); 192 border-radius: 6px; 193 border-left: 3px solid #d0c8e0; 302 border-radius: var(--extnify-radius); 194 303 transition: border-color .15s, box-shadow .15s, background .15s; 195 304 position: relative; … … 197 306 198 307 .ext-method-item:hover { 199 border-color: #b49fd4; 200 border-left-color: var(--extnify-accent); 201 box-shadow: 0 1px 4px rgba(127,84,179,.1); 202 background: #faf8fd; 308 border-color: var(--extnify-accent-border); 309 background: var(--extnify-accent-tint); 203 310 } 204 311 … … 210 317 .ext-method-item.ui-sortable-helper { 211 318 cursor: grabbing; 212 box-shadow: 0 4px 12px rgba(127,84,179,.25);319 box-shadow: 0 4px 12px color-mix(in srgb, var(--extnify-accent) 25%, transparent); 213 320 } 214 321 215 322 .ext-sort-placeholder { 216 border: 1px dashed #b49fd4!important;323 border: 1px dashed var(--extnify-accent-border) !important; 217 324 background: var(--extnify-accent-tint) !important; 325 border-radius: var(--extnify-radius); 218 326 visibility: visible !important; 219 327 } … … 222 330 background: var(--extnify-accent-tint); 223 331 border-color: var(--extnify-accent); 224 border-left-color: var(--extnify-accent); 225 border-left-width: 4px; 226 box-shadow: 0 2px 6px rgba(127,84,179,.15); 227 color: var(--extnify-accent-darker); 332 box-shadow: 0 0 0 3px var(--extnify-accent-ring); 333 color: var(--extnify-accent); 228 334 font-weight: 600; 229 335 } 230 336 231 337 .ext-method-item.ext-nav-active .ext-method-label { 232 color: var(--extnify-accent -darker);338 color: var(--extnify-accent); 233 339 } 234 340 … … 255 361 256 362 .ext-method-active .ext-method-status-dot { 257 background: #eafbea;258 color: #2a7a2e;259 border: 1px solid #b3e6b5;363 background: var(--extnify-success-tint); 364 color: var(--extnify-success); 365 border: 1px solid transparent; 260 366 content: 'On'; 261 367 } 262 368 263 369 .ext-method-inactive .ext-method-status-dot { 264 background: #fdf0f0;265 color: #a02020;266 border: 1px solid #f5c6c6;370 background: var(--extnify-danger-tint); 371 color: var(--extnify-danger); 372 border: 1px solid transparent; 267 373 } 268 374 … … 283 389 .ext-add-method-wrap { 284 390 padding: 12px 14px; 285 border-top: 1px solid #e0e0e2;391 border-top: 1px solid var(--extnify-border-light); 286 392 margin-top: auto; 287 background: #fafafa;393 background: var(--extnify-bg); 288 394 } 289 395 290 396 .ext-add-method-wrap .button { 291 397 width: 100%; 292 justify-content: center; 293 display: flex; 294 align-items: center; 295 gap: 6px; 398 min-height: 40px; 399 color: #fff; 296 400 background: var(--extnify-accent); 297 401 border-color: var(--extnify-accent); 298 color: var(--extnify-surface); 299 font-weight: 600; 300 font-size: 13px; 301 padding: 7px 0; 302 height: auto; 303 border-radius: 4px; 304 box-shadow: none; 305 transition: background .15s, border-color .15s; 402 box-shadow: 0 1px 2px color-mix(in srgb, var(--extnify-accent) 35%, transparent); 306 403 } 307 404 … … 310 407 background: var(--extnify-accent-dark); 311 408 border-color: var(--extnify-accent-dark); 312 color: var(--extnify-surface); 313 box-shadow: none; 409 color: #fff; 314 410 } 315 411 316 412 .ext-add-method-wrap .button .dashicons { 317 font-size: 15px; 318 width: 15px; 319 height: 15px; 320 line-height: 1; 321 margin-top: 1px; 322 flex-shrink: 0; 413 font-size: 16px; 414 width: 16px; 415 height: 16px; 323 416 } 324 417 … … 348 441 align-items: flex-end; 349 442 justify-content: space-between; 350 border-bottom: 2px solid var(--extnify-border-light);443 border-bottom: 1px solid var(--extnify-border); 351 444 margin-bottom: 20px; 352 445 gap: 12px; … … 362 455 363 456 .ext-global-save-wrap .button { 364 display: inline-flex; 365 align-items: center; 366 font-size: 13px; 367 font-weight: 600; 368 padding: 5px 16px; 369 height: auto; 370 line-height: 1.6; 371 box-shadow: none; 372 transition: background .15s, border-color .15s; 457 /* Sizing comes from the shared button system above. */ 458 flex-shrink: 0; 373 459 } 374 460 … … 377 463 width: 16px; 378 464 height: 16px; 379 line-height: 1;380 display: flex;381 align-items: center;382 justify-content: center;383 465 } 384 466 385 467 .ext-global-save-wrap .button-primary { 386 468 background: var(--extnify-accent); 387 border-color: var(--extnify-accent -dark);469 border-color: var(--extnify-accent); 388 470 } 389 471 … … 391 473 .ext-global-save-wrap .button-primary:focus { 392 474 background: var(--extnify-accent-dark); 393 border-color: #5c3185;475 border-color: var(--extnify-accent-darker); 394 476 box-shadow: none; 395 477 } … … 414 496 background: transparent; 415 497 border: none; 416 border-bottom: 3px solid transparent;498 border-bottom: 2px solid transparent; 417 499 border-radius: 0; 418 500 padding: 8px 14px; 419 margin-bottom: - 2px;501 margin-bottom: -1px; 420 502 text-decoration: none; 421 503 transition: color .15s, border-color .15s; … … 434 516 .ext-subtab-nav .nav-tab-active:hover { 435 517 color: var(--extnify-accent); 436 font-weight: 700;518 font-weight: 600; 437 519 background: transparent; 438 border-bottom: 3px solid var(--extnify-accent);520 border-bottom: 2px solid var(--extnify-accent); 439 521 box-shadow: none; 440 522 } … … 474 556 } 475 557 476 /* Icon-only action buttons (label shown via the native title tooltip) */477 .ext-icon-btn { 478 display: inline-flex !important;479 align-items: center; 480 justify-content: center;481 width: 32px;482 height: 30px;483 min-height: 30px;484 padding: 0 !important;558 /* Icon-only action buttons (label shown via the native title tooltip). 559 Save = primary; Copy / Clear cache = secondary; Delete = secondary with a 560 red icon. One accent, never a row of differently colored blocks. */ 561 .ext-wrap .ext-icon-btn { 562 width: 36px; 563 min-width: 36px; 564 min-height: 36px; 565 height: 36px; 566 padding: 0; 485 567 font-size: 0; /* collapse the helper's trailing */ 486 border: none !important; 487 border-radius: 4px; 488 color: var(--extnify-surface) !important; 489 transition: filter .12s ease, transform .06s ease; 490 } 491 492 .ext-icon-btn:hover { filter: brightness(1.08); } 493 .ext-icon-btn:active { transform: translateY(1px); } 494 495 .ext-icon-btn .dashicons { 568 } 569 570 .ext-wrap .ext-icon-btn .dashicons { 496 571 font-size: 18px; 497 width: 17px; 498 height: 17px; 499 line-height: 1; 500 margin-bottom: 15px; 501 color: var(--extnify-surface); 502 } 503 504 /* Solid colored actions (OpenCart-style) */ 505 .ext-method-save { background: #2ea043 !important; } /* green */ 506 .ext-method-copy { background: #f0ad4e !important; } /* orange */ 507 .ext-method-delete { background: #e5484d !important; } /* red */ 508 .ext-toolbar-save { background: var(--extnify-accent) !important; } /* purple */ 509 .ext-clear-cache { background: #2f6fed !important; } /* blue */ 572 width: 18px; 573 height: 18px; 574 } 575 576 .ext-wrap .ext-method-save, 577 .ext-wrap .ext-toolbar-save { 578 color: #fff; 579 background: var(--extnify-accent); 580 border-color: var(--extnify-accent); 581 box-shadow: 0 1px 2px color-mix(in srgb, var(--extnify-accent) 35%, transparent); 582 } 583 584 .ext-wrap .ext-method-save:hover, 585 .ext-wrap .ext-toolbar-save:hover, 586 .ext-wrap .ext-method-save:focus, 587 .ext-wrap .ext-toolbar-save:focus { 588 color: #fff; 589 background: var(--extnify-accent-dark); 590 border-color: var(--extnify-accent-dark); 591 } 592 593 .ext-wrap .ext-method-delete { 594 color: var(--extnify-danger); 595 } 596 597 .ext-wrap .ext-method-delete:hover, 598 .ext-wrap .ext-method-delete:focus { 599 color: var(--extnify-danger); 600 background: var(--extnify-danger-tint); 601 border-color: var(--extnify-danger); 602 } 603 604 .ext-wrap .ext-method-delete:focus { 605 box-shadow: 0 0 0 3px color-mix(in srgb, var(--extnify-danger) 20%, transparent); 606 } 510 607 511 608 .ext-method-id-badge { … … 513 610 background: var(--extnify-bg-soft); 514 611 padding: 2px 8px; 515 border-radius: 3px;612 border-radius: 4px; 516 613 font-family: monospace; 517 614 font-size: 13px; … … 525 622 margin-bottom: 20px; 526 623 padding-bottom: 0; 527 border-bottom: 2px solid var(--extnify-border-light);624 border-bottom: 1px solid var(--extnify-border); 528 625 } 529 626 … … 534 631 background: transparent; 535 632 border: none; 536 border-bottom: 3px solid transparent;633 border-bottom: 2px solid transparent; 537 634 border-radius: 0; 538 635 padding: 8px 14px; 539 margin-bottom: - 2px;636 margin-bottom: -1px; 540 637 text-decoration: none; 541 638 transition: color .15s, border-color .15s; … … 554 651 .ext-mtab-nav .nav-tab-active:hover { 555 652 color: var(--extnify-accent); 556 font-weight: 700;653 font-weight: 600; 557 654 background: transparent; 558 border-bottom: 3px solid var(--extnify-accent);655 border-bottom: 2px solid var(--extnify-accent); 559 656 box-shadow: none; 560 657 } … … 600 697 padding: 6px 10px; 601 698 height: auto; 602 border-radius: 4px;699 border-radius: var(--extnify-radius-sm); 603 700 border: 1px solid var(--extnify-border); 604 701 box-shadow: none; … … 621 718 padding: 0px 8px; 622 719 height: auto; 623 border-radius: 4px;720 border-radius: var(--extnify-radius-sm); 624 721 border: 1px solid var(--extnify-border); 625 722 min-width: 175px; … … 638 735 font-size: 13px; 639 736 padding: 6px 10px; 640 border-radius: 4px;737 border-radius: var(--extnify-radius-sm); 641 738 border: 1px solid var(--extnify-border); 642 739 width: 100%; … … 689 786 /* Alternating row tint */ 690 787 .ext-wrap .form-table tr:nth-child(even) { 691 background: #fafafa;788 background: var(--extnify-bg); 692 789 } 693 790 … … 743 840 font-size: 13px; 744 841 border-color: var(--extnify-accent-border); 745 border-radius: 4px;842 border-radius: var(--extnify-radius-sm); 746 843 } 747 844 … … 756 853 max-height: 180px; 757 854 overflow-y: auto; 758 border: 1px solid #e0d8ef;759 border-radius: 4px;855 border: 1px solid var(--extnify-border-light); 856 border-radius: var(--extnify-radius-sm); 760 857 padding: 8px 10px; 761 858 background: var(--extnify-surface); … … 805 902 height: 36px; 806 903 border-color: var(--extnify-accent-border); 807 border-radius: 4px;904 border-radius: var(--extnify-radius-sm); 808 905 flex-shrink: 0; 809 906 } … … 821 918 min-width: 250px; 822 919 border: 1px solid var(--extnify-accent-border); 823 border-radius: 4px;920 border-radius: var(--extnify-radius-sm); 824 921 background: var(--extnify-surface); 825 922 padding: 5px 8px; … … 865 962 background: var(--extnify-surface); 866 963 border: 1px solid var(--extnify-border); 867 border-radius: 3px;964 border-radius: 4px; 868 965 box-shadow: 0 2px 8px rgba(0,0,0,.12); 869 966 max-height: 180px; … … 910 1007 text-decoration: none; 911 1008 padding: 4px 12px; 912 border-radius: 4px;913 background: #e0e0e0;1009 border-radius: var(--extnify-radius-sm); 1010 background: var(--extnify-border-light); 914 1011 transition: background-color .15s ease, color .15s ease; 915 1012 } … … 962 1059 color: var(--extnify-surface); 963 1060 padding: 2px 6px; 964 border-radius: 3px;1061 border-radius: 4px; 965 1062 font-size: 12px; 966 1063 } … … 983 1080 background: var(--extnify-surface); 984 1081 border: 1px solid var(--extnify-border); 985 border-radius: 3px;1082 border-radius: 4px; 986 1083 box-shadow: 0 2px 8px rgba(0,0,0,.12); 987 1084 min-width: 240px; … … 1070 1167 .ext-range-container td { 1071 1168 padding: 4px 6px; 1072 border: 1px solid #e0e0e0;1169 border: 1px solid var(--extnify-border-light); 1073 1170 vertical-align: middle; 1074 1171 } … … 1107 1204 padding: 4px 8px; 1108 1205 border: 1px solid #dcdcde; 1109 border-radius: 3px;1206 border-radius: 4px; 1110 1207 } 1111 1208 … … 1191 1288 letter-spacing: 0.06em; 1192 1289 padding: 8px 12px; 1193 border: 1px solid #e0d8ef;1290 border: 1px solid var(--extnify-border-light); 1194 1291 text-align: left; 1195 1292 white-space: nowrap; … … 1201 1298 .ext-group-table td { 1202 1299 padding: 6px 10px; 1203 border: 1px solid #ebebed;1300 border: 1px solid var(--extnify-border-light); 1204 1301 vertical-align: middle; 1205 1302 background: var(--extnify-surface); … … 1207 1304 1208 1305 .ext-group-table tbody tr:nth-child(even) td { 1209 background: #faf8fd;1306 background: var(--extnify-accent-tint); 1210 1307 } 1211 1308 … … 1225 1322 padding: 4px 6px; 1226 1323 height: auto; 1227 border-radius: 3px;1324 border-radius: 4px; 1228 1325 border: 1px solid var(--extnify-border); 1229 1326 box-shadow: none; … … 1244 1341 padding: 4px 8px; 1245 1342 height: auto; 1246 border-radius: 3px;1343 border-radius: 4px; 1247 1344 border: 1px solid var(--extnify-border); 1248 1345 width: 100%; … … 1266 1363 gap: 10px; 1267 1364 background: var(--extnify-accent-tint); 1268 border: 1px solid #d4c4ef;1365 border: 1px solid var(--extnify-accent-border); 1269 1366 border-left: 4px solid var(--extnify-accent); 1270 border-radius: 4px;1367 border-radius: var(--extnify-radius-sm); 1271 1368 padding: 12px 14px; 1272 1369 margin-bottom: 16px; … … 1286 1383 margin: 0 0 4px; 1287 1384 line-height: 1.5; 1288 color: #3d2664;1385 color: var(--extnify-text-soft); 1289 1386 } 1290 1387 … … 1318 1415 1319 1416 .ext-callout-body code { 1320 background: rgba(127,84,179,.12);1417 background: color-mix(in srgb, var(--extnify-accent) 12%, transparent); 1321 1418 color: var(--extnify-accent-darker); 1322 1419 padding: 1px 5px; 1323 border-radius: 3px;1420 border-radius: 4px; 1324 1421 font-size: 12px; 1325 1422 font-family: monospace; … … 1334 1431 .ext-hs { 1335 1432 display: grid; 1336 grid-template-columns: minmax(320px, 430px) minmax(0, 480px); 1337 justify-content: space-between; 1433 /* Help column on the left; the log lives in a flexible track (1fr) that can never 1434 overflow the container — so the panel stays on the right AND is always fully 1435 visible, however wide the admin screen is (no more clipping at the edge). */ 1436 grid-template-columns: minmax(320px, 430px) minmax(0, 1fr); 1338 1437 gap: 22px; 1339 1438 align-items: stretch; 1340 padding: 8px 2px 24px;1439 padding: 8px 8px 24px; 1341 1440 } 1342 1441 .ext-hs[data-log-open="0"] { grid-template-columns: minmax(320px, 430px); } … … 1410 1509 .ext-hs-update .ext-hs-card-icon { background: #e7f6ec; color: #38a355; } 1411 1510 .ext-hs-ext .ext-hs-card-icon { background: #fdf1dc; color: #e0921a; } 1511 .ext-hs-upgrade .ext-hs-card-icon { background: var(--extnify-accent); color: #fff; } 1412 1512 1413 1513 .ext-hs-card-text { display: flex; flex-direction: column; flex: 1; line-height: 1.35; } … … 1427 1527 border-radius: 16px; box-shadow: 0 2px 12px rgba(0, 0, 0, .04); 1428 1528 overflow: hidden; 1429 /* Fixed height so the panel is the same size on every filter (All/Info/Warn/1430 Error/Debug) — the body just scrolls within it. Sized to the viewport so1431 header + body + footer stay on-screen (no page scroll). */1432 1529 min-height: 0; 1530 /* Fallback height before JS runs. The real sizing is done by hsSizeLog() in 1531 admin.js, which measures the panel's ACTUAL top offset and sets the height so 1532 the whole panel (incl. footer) fits the viewport, whatever sits above it. */ 1433 1533 height: calc(100vh - 280px); 1434 1534 align-self: start; 1535 /* Sit at the right of the flexible track, at a sensible reading width. The track 1536 bounds it, so it can't be clipped; margin-left:auto pins it to the right. */ 1537 width: 100%; 1538 max-width: 520px; 1539 margin-left: auto; 1435 1540 } 1436 1541 .ext-hs-log-head { 1437 1542 display: flex; align-items: center; gap: 12px; 1438 padding: 15px 18px; border-bottom: 1px solid #f0f0f4;1543 padding: 15px 18px; border-bottom: 1px solid var(--extnify-bg-soft); 1439 1544 background: var(--extnify-accent-dark); 1440 1545 } … … 1462 1567 .ext-hs-log-tools { 1463 1568 display: flex; align-items: center; gap: 12px; 1464 padding: 11px 16px; border-bottom: 1px solid #f4f4f7;1569 padding: 11px 16px; border-bottom: 1px solid var(--extnify-bg-soft); 1465 1570 } 1466 1571 .ext-hs-filters { display: flex; gap: 3px; flex: 1; flex-wrap: wrap; } … … 1469 1574 font-size: 13px; color: #6b6f76; padding: 5px 12px; border-radius: 20px; 1470 1575 } 1471 .ext-hs-filter:hover { background: #f4f4f7; }1576 .ext-hs-filter:hover { background: var(--extnify-bg-soft); } 1472 1577 .ext-hs-filter.active { background: var(--extnify-text); color: var(--extnify-surface); } 1473 1578 .ext-hs-tools-right { display: flex; align-items: center; gap: 12px; } … … 1535 1640 1536 1641 .ext-hs-lvl-info .ext-hs-bubble { background: #f3f8fd; border-color: #dcebf8; } 1537 .ext-hs-lvl-debug .ext-hs-bubble { background: #f7f4fc; border-color: #e6dcf4; }1642 .ext-hs-lvl-debug .ext-hs-bubble { background: var(--extnify-accent-tint); border-color: var(--extnify-accent-tint-2); } 1538 1643 .ext-hs-lvl-warn .ext-hs-bubble { background: #fdf8ec; border-color: #f2e4c3; } 1539 1644 .ext-hs-lvl-error .ext-hs-bubble { background: #fdf1f1; border-color: #f4d4d4; } … … 1542 1647 .ext-hs-log-foot { 1543 1648 display: flex; align-items: center; justify-content: space-between; 1544 padding: 12px 16px; border-top: 1px solid #f0f0f4;1649 padding: 12px 16px; border-top: 1px solid var(--extnify-bg-soft); 1545 1650 } 1546 1651 .ext-hs-conn { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: #82868b; } 1547 .ext- hs .ext-hs-history.button {1652 .ext-wrap .ext-hs .ext-hs-history.button { 1548 1653 background: var(--extnify-text); border-color: var(--extnify-text); color: var(--extnify-surface); 1549 border-radius: 8px; box-shadow: none; 1550 display: inline-flex; align-items: center; gap: 5px; padding: 5px 13px; height: auto; 1551 } 1552 .ext-hs .ext-hs-history.button:hover { background: #000; border-color: #000; } 1553 .ext-hs .ext-hs-history .dashicons { font-size: 15px; width: 15px; height: 27px; } 1654 } 1655 .ext-wrap .ext-hs .ext-hs-history.button:hover, 1656 .ext-wrap .ext-hs .ext-hs-history.button:focus { background: #000; border-color: #000; color: var(--extnify-surface); } 1554 1657 1555 1658 @media (max-width: 1100px) { 1556 1659 .ext-hs, .ext-hs[data-log-open="1"] { grid-template-columns: 1fr; } 1660 /* Stacked: full-width instead of a right-pinned 520px panel. */ 1661 .ext-hs-log { max-width: none; margin-left: 0; } 1557 1662 } 1558 1663 … … 1564 1669 background: var(--extnify-surface); 1565 1670 border: 1px solid var(--extnify-border); 1566 border-radius: 4px;1671 border-radius: var(--extnify-radius-sm); 1567 1672 } 1568 1673 … … 1605 1710 gap: 12px; 1606 1711 background: var(--extnify-surface); 1607 border: 1px solid #e0d8ef;1712 border: 1px solid var(--extnify-border-light); 1608 1713 border-radius: 6px; 1609 1714 padding: 18px 20px; … … 1615 1720 gap: 8px; 1616 1721 padding-bottom: 10px; 1617 border-bottom: 1px solid #f0ebfa;1722 border-bottom: 1px solid var(--extnify-accent-tint-2); 1618 1723 } 1619 1724 … … 1649 1754 border: 1px solid #f0c040; 1650 1755 border-left: 3px solid #dba617; 1651 border-radius: 3px;1756 border-radius: 4px; 1652 1757 padding: 7px 10px; 1653 1758 font-size: 12px; … … 1683 1788 1684 1789 .ext-wrap .ext-file-label { 1685 display: inline-flex;1686 align-items: center;1687 gap: 5px;1688 font-size: 12px;1689 cursor: pointer;1690 1790 flex-shrink: 0; 1691 padding: 4px 10px; 1692 height: auto; 1693 line-height: 1; 1694 } 1695 1696 .ext-file-label:focus-within { 1791 } 1792 1793 .ext-wrap .ext-file-label:focus-within { 1697 1794 border-color: var(--extnify-accent); 1698 box-shadow: 0 0 0 1px var(--extnify-accent);1795 box-shadow: 0 0 0 3px var(--extnify-accent-ring); 1699 1796 } 1700 1797 … … 1725 1822 .ext-wrap a.ext-io-btn:link, 1726 1823 .ext-wrap a.ext-io-btn:visited { 1727 display: inline-flex; 1728 align-items: center; 1729 gap: 6px; 1824 color: #fff; 1730 1825 background: var(--extnify-accent); 1731 border-color: var(--extnify-accent-dark); 1732 color: var(--extnify-surface); 1733 font-weight: 600; 1734 font-size: 13px; 1735 padding: 6px 14px; 1736 height: auto; 1737 box-shadow: none; 1738 text-decoration: none; 1739 transition: background .15s, border-color .15s; 1826 border-color: var(--extnify-accent); 1827 box-shadow: 0 1px 2px color-mix(in srgb, var(--extnify-accent) 35%, transparent); 1740 1828 } 1741 1829 … … 1743 1831 .ext-wrap .ext-io-btn:focus { 1744 1832 background: var(--extnify-accent-dark); 1745 border-color: #5c3185; 1746 color: var(--extnify-surface); 1747 box-shadow: none; 1833 border-color: var(--extnify-accent-dark); 1834 color: #fff; 1748 1835 } 1749 1836 1750 1837 .ext-wrap .ext-io-btn .dashicons, 1751 1838 .ext-wrap .ext-file-label .dashicons { 1752 font-size: 15px; 1753 width: 15px; 1754 height: 15px; 1755 line-height: 1; 1756 flex-shrink: 0; 1757 vertical-align: middle; 1839 font-size: 16px; 1840 width: 16px; 1841 height: 16px; 1758 1842 } 1759 1843 … … 1761 1845 .ext-wrap a.ext-io-btn-export:link, 1762 1846 .ext-wrap a.ext-io-btn-export:visited { 1763 background: var(--extnify-link); 1764 border-color: #135e96; 1765 color: var(--extnify-surface); 1847 color: #fff; 1766 1848 } 1767 1849 1768 1850 .ext-wrap .ext-io-btn-export:hover, 1769 1851 .ext-wrap .ext-io-btn-export:focus { 1770 background: #135e96; 1771 border-color: #0a4b78; 1772 color: var(--extnify-surface); 1852 color: #fff; 1773 1853 } 1774 1854 … … 1804 1884 border-left: none; 1805 1885 border: 1px solid var(--extnify-border); 1806 border-radius: 3px;1886 border-radius: 4px; 1807 1887 padding: 6px 10px; 1808 1888 } … … 2007 2087 group rows and align its label + dropdown with the columns above. */ 2008 2088 .ext-group-table tfoot .ext-group-foot-row td { 2009 border-top: 2px solid #d9cded;2089 border-top: 2px solid var(--extnify-accent-border); 2010 2090 background: var(--extnify-accent-tint); 2011 2091 } … … 2121 2201 font-style: normal; 2122 2202 text-decoration: none; 2123 border: 1px solid #b7d3ea;2203 border: 1px solid var(--extnify-accent-border); 2124 2204 border-radius: 20px; 2125 background: #f0f6fc;2205 background: var(--extnify-accent-tint); 2126 2206 } 2127 2207 … … 2137 2217 padding: 12px 14px; 2138 2218 background: var(--extnify-bg); 2139 border: 1px solid #e0e0e0;2140 border-radius: 4px;2219 border: 1px solid var(--extnify-border-light); 2220 border-radius: var(--extnify-radius-sm); 2141 2221 font-size: 13px; 2142 2222 line-height: 1.5; … … 2153 2233 background: #e5f4fb; 2154 2234 border: 1px solid #b6def0; 2155 border-radius: 4px;2235 border-radius: var(--extnify-radius-sm); 2156 2236 font-size: 13px; 2157 2237 line-height: 1.5; … … 2288 2368 .ext-ph-table td { 2289 2369 padding: 5px 10px; 2290 border: 1px solid #e0e0e0;2370 border: 1px solid var(--extnify-border-light); 2291 2371 vertical-align: top; 2292 2372 background: var(--extnify-surface); … … 2304 2384 background: #eef2f5; 2305 2385 padding: 1px 5px; 2306 border-radius: 3px;2386 border-radius: 4px; 2307 2387 font-size: 12px; 2308 2388 } … … 2321 2401 background: #909090; 2322 2402 border-color: #909090; 2323 border-radius: 4px;2403 border-radius: var(--extnify-radius-sm); 2324 2404 /* Fixed metrics so both (default .button and .button-small) render identically. */ 2325 2405 padding: 3px 11px; … … 2356 2436 padding: 6px; 2357 2437 background: var(--extnify-surface); 2358 border: 1px solid #b7d3ea;2359 border-radius: 4px;2438 border: 1px solid var(--extnify-accent-border); 2439 border-radius: var(--extnify-radius-sm); 2360 2440 box-shadow: 0 6px 18px rgba(0,0,0,.14); 2361 2441 column-count: 1; /* one option per line (base uses 2 columns) */ … … 2412 2492 background: var(--extnify-accent); 2413 2493 color: var(--extnify-surface); 2414 border-radius: 4px;2494 border-radius: var(--extnify-radius-sm); 2415 2495 font-size: 12px; 2416 2496 line-height: 1.6; -
extnify-fee/trunk/assets/js/admin.js
r3751128 r3833938 144 144 // Load a blank method form into a new pane keyed by a temporary id. The 145 145 // method is NOT persisted until the user clicks Save / Save All. 146 function loadNewMethodPane( tempId, label ) {146 function loadNewMethodPane( tempId, label, seq ) { 147 147 var $loading = $( '#ext-method-loading' ); 148 148 var $content = $( '#ext-method-content' ); … … 164 164 // Seed the admin name with the default label so the sidebar 165 165 // and the persisted record agree ("Untitled Method N"). 166 $pane.find( '[name="xfeepro[display]"]' ).val( label ); 166 $pane.find( '[name="extnify_fee[display]"]' ).val( label ); 167 // Give the customer-facing Method Title a matching number too. 168 if ( seq ) { 169 $pane.find( '[name="extnify_fee[name]"]' ).val( 'Fee Title ' + seq ); 170 } 167 171 } else { 168 172 $content.append( '<div class="ext-method-pane"><p class="ext-error">' + ( i18n.loadError || 'Error loading method.' ) + '</p></div>' ); … … 184 188 var $item = addMethodSidebarItem( tempId, label, true ); 185 189 sidebarItemActive( $item ); 186 loadNewMethodPane( tempId, label );190 loadNewMethodPane( tempId, label, newMethodSeq ); 187 191 }); 188 192 … … 250 254 // real DB id. Falls back to creating an item if none is found. 251 255 function updateSidebarItem( $form, oldId, newId, display ) { 252 var status = $form.find( '[name=" xfeepro[status]"]' ).val();256 var status = $form.find( '[name="extnify_fee[status]"]' ).val(); 253 257 var isActive = status === '1'; 254 258 var statusClass = isActive ? 'ext-method-active' : 'ext-method-inactive'; … … 267 271 268 272 // ── Live sidebar label: reflect the Admin Name as you type ───────────────── 269 $( document ).on( 'input', '.ext-method-form [name=" xfeepro[display]"]', function () {273 $( document ).on( 'input', '.ext-method-form [name="extnify_fee[display]"]', function () { 270 274 var val = $( this ).val(); 271 275 if ( ! val.trim() ) return; // don't blank the sidebar item … … 275 279 276 280 // ── Live sidebar status: reflect the Status select as you change it ──────── 277 $( document ).on( 'change', '.ext-method-form [name=" xfeepro[status]"]', function () {281 $( document ).on( 'change', '.ext-method-form [name="extnify_fee[status]"]', function () { 278 282 var isActive = $( this ).val() === '1'; 279 283 var id = $( this ).closest( '.ext-method-pane' ).attr( 'data-method-id' ); … … 329 333 .done( function ( resp ) { 330 334 if ( resp.success ) { 331 var enabled = $form.find( '[name=" xfeepro[status]"]' ).val() === '1';335 var enabled = $form.find( '[name="extnify_fee[status]"]' ).val() === '1'; 332 336 var $item = addMethodSidebarItem( resp.data.id, resp.data.display, enabled ); 333 337 sidebarItemActive( $item ); … … 401 405 // ── Rate-type dependency logic ──────────────────────────────────────────── 402 406 403 $( document ).on( 'change', '[name^=" xfeepro"][name$="[rate_type]"]', function () {407 $( document ).on( 'change', '[name^="extnify_fee"][name$="[rate_type]"]', function () { 404 408 updateRateDeps( $( this ).closest( '.ext-method-form' ) ); 405 409 }); … … 710 714 $form.find( 'tr.ext-zone-row .ocm-checkgroup-checkbox' ).append( 711 715 '<label class="ext-cz-label">' 712 + '<input type="checkbox" name=" xfeepro[zone][]" value="' + escAttr( val ) + '" checked /> '716 + '<input type="checkbox" name="extnify_fee[zone][]" value="' + escAttr( val ) + '" checked /> ' 713 717 + escHtml( cLabel + ' — ' + label ) 714 718 + '</label>' … … 928 932 // chosen product (hidden id + name); otherwise it stays empty. 929 933 function rangeRowHtml( idx ) { 930 var n = ' xfeepro[ranges][' + idx + ']';934 var n = 'extnify_fee[ranges][' + idx + ']'; 931 935 // Free plugin: Start / End / Cost / Remove only (blocks, partial, per-product 932 936 // are Pro). Keep this in sync with get_ranges_html() in the controller. … … 966 970 var $list = $( this ).closest( 'div' ).siblings( '.ext-sub-options-list' ); 967 971 subOptIndex = $list.find( '.ext-sub-opt-row' ).length; 968 var n = ' xfeepro[sub_options][' + subOptIndex + ']';972 var n = 'extnify_fee[sub_options][' + subOptIndex + ']'; 969 973 $list.append( 970 974 '<div class="ext-sub-opt-row" data-index="' + subOptIndex + '">' … … 1079 1083 $list.empty(); 1080 1084 $.each( rows, function ( i, row ) { 1081 var n = ' xfeepro[sub_options][' + i + ']';1085 var n = 'extnify_fee[sub_options][' + i + ']'; 1082 1086 $list.append( 1083 1087 '<div class="ext-sub-opt-row" data-index="' + i + '">' -
extnify-fee/trunk/bootstrap.php
r3751128 r3833938 2 2 defined( 'ABSPATH' ) || exit; 3 3 4 class XFee_Plugin {4 class Extnify_Fee_Plugin { 5 5 6 6 private static $instance = null; … … 20 20 private function includes(): void { 21 21 // Model + fee engine: needed on both frontend and admin. 22 require_once XFEE_PLUGIN_PATH . 'admin/model.php'; 23 require_once XFEE_PLUGIN_PATH . 'front/class-fee.php'; 22 require_once EXTNIFY_FEE_PLUGIN_PATH . 'admin/model.php'; 23 Extnify_Fee_Model::maybe_upgrade(); // sync DB schema (handles updates, not just activation) 24 require_once EXTNIFY_FEE_PLUGIN_PATH . 'front/class-fee.php'; 24 25 25 26 if ( is_admin() ) { 26 require_once XFEE_PLUGIN_PATH . 'system/library/ocm/autoloader.php'; 27 require_once XFEE_PLUGIN_PATH . 'admin/controller.php'; 28 new XFee_Back( new XFee_Model() ); 27 require_once EXTNIFY_FEE_PLUGIN_PATH . 'system/extnify-core/ui/autoloader.php'; 28 require_once EXTNIFY_FEE_PLUGIN_PATH . 'system/framework/traits/woo-helpers.php'; 29 require_once EXTNIFY_FEE_PLUGIN_PATH . 'admin/controller.php'; 30 new Extnify_Fee_Back( new Extnify_Fee_Model() ); 29 31 } 30 32 } … … 50 52 return; 51 53 } 52 ( new XFee_Fee() )->apply( $cart );54 ( new Extnify_Fee_Fee() )->apply( $cart ); 53 55 } 54 56 -
extnify-fee/trunk/extnify-fee.php
r3772791 r3833938 4 4 * Plugin URI: https://extnify.com/platforms/woocommerce 5 5 * Description: Conditional cart fees for WooCommerce — flat or percentage fees, gated by shipping zone, payment method or shipping method. 6 * Version: 1. 0.16 * Version: 1.1.0 7 7 * Author: Extnify Labs LLC 8 8 * Author URI: https://extnify.com … … 22 22 defined( 'ABSPATH' ) || exit; 23 23 24 // Build identity: FALSE = free build → no license verification, no phone-home.25 // Free and Pro ship under the SAME slug + main file, so they can never be active26 // together (installing one replaces the other in place) — this free build always27 // defines the flag.28 defined( 'EXTNIFY_DISTRIBUTION' ) || define( 'EXTNIFY_DISTRIBUTION', false );29 30 24 register_activation_hook( __FILE__, function() { 31 25 require_once plugin_dir_path( __FILE__ ) . 'admin/model.php'; 32 XFee_Model::create_table();26 Extnify_Fee_Model::maybe_upgrade(); 33 27 } ); 34 28 35 29 // Metadata single-source-of-truth (keep the PHP header above in sync — WordPress 36 // reads that directly). Constants are uniquely prefixed ( XFEE_*) so this free30 // reads that directly). Constants are uniquely prefixed (EXTNIFY_FEE_*) so this free 37 31 // plugin can never collide with the paid Extnify Fee Rules Pro (which uses EXTNIFY_*). 38 32 // Closure-wrapped so $meta stays function-scoped (no global variable). … … 40 34 $meta = json_decode( file_get_contents( plugin_dir_path( __FILE__ ) . 'extnify.json' ), true ); 41 35 42 define( ' XFEE_PLUGIN_VERSION', $meta['version'] );43 define( ' XFEE_PLUGIN_NAME', $meta['name'] );44 define( ' XFEE_PLUGIN_TEXT_DOMAIN', $meta['text_domain'] );45 define( ' XFEE_PLUGIN_REQUIRES_WC', $meta['requires_wc'] );46 define( ' XFEE_PLUGIN_TESTED_WC', $meta['tested_wc'] );47 define( ' XFEE_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );48 define( ' XFEE_PLUGIN_URL', plugin_dir_url( __FILE__ ) );49 define( ' XFEE_PLUGIN_FILE', __FILE__ );36 define( 'EXTNIFY_FEE_PLUGIN_VERSION', $meta['version'] ); 37 define( 'EXTNIFY_FEE_PLUGIN_NAME', $meta['name'] ); 38 define( 'EXTNIFY_FEE_PLUGIN_TEXT_DOMAIN', $meta['text_domain'] ); 39 define( 'EXTNIFY_FEE_PLUGIN_REQUIRES_WC', $meta['requires_wc'] ); 40 define( 'EXTNIFY_FEE_PLUGIN_TESTED_WC', $meta['tested_wc'] ); 41 define( 'EXTNIFY_FEE_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); 42 define( 'EXTNIFY_FEE_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 43 define( 'EXTNIFY_FEE_PLUGIN_FILE', __FILE__ ); 50 44 51 45 // Build-set "Upgrade to Pro" target. The WordPress.org build ships a URL (shows 52 46 // the card); the WooCommerce build ships "" (hides it, WooCommerce owns the upsell). 53 define( ' XFEE_UPGRADE_URL', isset( $meta['upgrade_url'] ) ? (string) $meta['upgrade_url'] : '' );47 define( 'EXTNIFY_FEE_UPGRADE_URL', isset( $meta['upgrade_url'] ) ? (string) $meta['upgrade_url'] : '' ); 54 48 } )(); 55 49 … … 69 63 add_action( 'admin_notices', function() { 70 64 echo '<div class="error"><p>' 71 . esc_html( XFEE_PLUGIN_NAME . ' requires WooCommerce to be installed and active.' )65 . esc_html( EXTNIFY_FEE_PLUGIN_NAME . ' requires WooCommerce to be installed and active.' ) 72 66 . '</p></div>'; 73 67 } ); … … 75 69 } 76 70 77 require_once XFEE_PLUGIN_PATH . 'bootstrap.php';78 XFee_Plugin::instance();71 require_once EXTNIFY_FEE_PLUGIN_PATH . 'bootstrap.php'; 72 Extnify_Fee_Plugin::instance(); 79 73 80 74 } ); -
extnify-fee/trunk/extnify.json
r3772791 r3833938 2 2 "name": "Extnify Fee Rules", 3 3 "title": "Extnify Fee Rules for WooCommerce", 4 "version": "1. 0.1",4 "version": "1.1.0", 5 5 "description": "Conditional cart fees for WooCommerce — flat or percentage fees, gated by shipping zone, payment method or shipping method.", 6 6 "author": "Extnify Labs LLC", -
extnify-fee/trunk/front/class-fee.php
r3751128 r3833938 17 17 defined( 'ABSPATH' ) || exit; 18 18 19 class XFee_Fee { 19 require_once __DIR__ . '/../system/extnify-core/traits/debug-log.php'; 20 21 class Extnify_Fee_Fee { 22 23 use Extnify_Debug_Log; 20 24 21 25 /** Free understands only the flat rate type. */ … … 23 27 24 28 /** Whether the global Debugging setting is on (computed per calculation). */ 25 private $debug = false;29 private $debug = null; 26 30 27 31 /** … … 34 38 // When it is disabled, NO fees are applied — matching OpenCart. Absent = 35 39 // enabled (so a fresh install with configured fees works out of the box). 36 $global = (array) get_option( ' x_feepro', array() );40 $global = (array) get_option( 'extnify_fee', array() ); 37 41 $status = isset( $global['status'] ) ? (string) $global['status'] : '1'; 38 42 if ( '1' !== $status ) { … … 41 45 } 42 46 43 $model = new XFee_Model();47 $model = new Extnify_Fee_Model(); 44 48 $rows = $model->getData(); 45 49 if ( empty( $rows ) ) { … … 194 198 // ── Debug log (gated by the global Debugging setting) ───────────────────── 195 199 196 private function debug_enabled(): bool { 197 $s = (array) get_option( 'x_feepro', array() ); 198 return isset( $s['debug'] ) && '1' === (string) $s['debug']; 199 } 200 201 /** 202 * Append one entry to the debug log — only when Debugging is enabled. 203 * Stored in the database (a capped transient), never written to a file. 204 */ 205 private function log( string $level, string $message ): void { 206 if ( ! $this->debug ) { 207 return; 208 } 209 $entries = get_transient( 'x_feepro_debug_log' ); 210 if ( ! is_array( $entries ) ) { 211 $entries = array(); 212 } 213 $entries[] = array( 214 'time' => current_time( 'H:i:s' ), 215 'level' => strtolower( $level ), 216 'message' => $message, 217 ); 218 if ( count( $entries ) > 300 ) { 219 $entries = array_slice( $entries, -300 ); 220 } 221 set_transient( 'x_feepro_debug_log', $entries, WEEK_IN_SECONDS ); 222 } 200 protected function debug_option_key(): string { return 'extnify_fee'; } 201 protected function debug_log_key(): string { return 'extnify_fee_debug_log'; } 223 202 224 203 /** The free subset of a method's fields. */ -
extnify-fee/trunk/readme.txt
r3772791 r3833938 5 5 Tested up to: 7.1 6 6 Requires PHP: 7.4 7 Stable tag: 1. 0.17 Stable tag: 1.1.0 8 8 Requires Plugins: woocommerce 9 9 WC requires at least: 7.1.0 … … 20 20 Create as many fees as you need, set each one as a flat amount or a percentage of the subtotal, and limit when it applies by shipping zone, payment method and shipping method. A positive amount adds a fee; a negative amount shows as a discount. Everything is managed from one simple screen, and a built-in live log shows you exactly why a fee did or didn't apply. 21 21 22 [Read the documentation »](https://extnify.com/docs/woocommerce/extnify-fee-rules-woocommerce) | [Try the live demo »](https://wc-dev.extnify.com/?auto_login=extnify-fee)22 [Read the documentation »](https://extnify.com/docs/woocommerce/extnify-fee-rules-woocommerce) | [Try backend »](https://extnify-fee.extnify.com/wp-admin/) | [Try frontend »](https://extnify-fee.extnify.com/shop/) 23 23 24 24 **See it in action:** … … 88 88 = More plugins by Extnify = 89 89 90 * **Extnify Shipping Rules** — build your own conditional WooCommerce shipping methods and rates. 91 * **Extnify Offer Rules** — let customers pick selectable discounts or add-ons at checkout. 90 * **Extnify Discount Rules** — rule-based product discounts shown as a sale across your store. [Free](https://wordpress.org/plugins/extnify-discount/) · [Pro](https://extnify.com/products/extnify-discount-rules-pro) 91 * **Extnify Offer Rules** — selectable discounts and optional add-ons for the cart and checkout. [Free](https://wordpress.org/plugins/extnify-offer/) · [Pro](https://extnify.com/products/extnify-offer-rules-pro-for-woocommerce) 92 * **Extnify Shipping Rules** — build your own conditional WooCommerce shipping methods and rates. [Free](https://wordpress.org/plugins/extnify-shipping/) · [Pro](https://extnify.com/products/extnify-shipping-pro-woocommerce) 92 93 93 94 Extnify Fee Rules is built by Extnify, the team behind the X-FeePro extension for OpenCart. … … 141 142 == Changelog == 142 143 144 = 1.1.0 = 145 * Rebuilt on the shared Extnify core, consistent with the other Extnify plugins. 146 * Your existing fees and settings are moved to the new storage automatically on update — nothing to re-enter. 147 * The database table now updates itself automatically after plugin updates. 148 * New fees get a numbered default title (Fee Title 2, Fee Title 3, …). 149 * Readme: new backend and frontend demo links. 150 143 151 = 1.0.1 = 144 152 * Expanded the plugin listing (features, demo, FAQ). … … 150 158 == Upgrade Notice == 151 159 160 = 1.1.0 = 161 Your fees and settings are moved to the new storage automatically. As always, back up your site before updating. 162 152 163 = 1.0.1 = 153 164 Refreshed the plugin listing and corrected the in-admin Documentation link. -
extnify-fee/trunk/system/framework/traits/woo-helpers.php
r3751128 r3833938 1 1 <?php 2 2 /** 3 * XFee_Woo_Helpers — WooCommerce-specific admin helpers shared across plugins:3 * Extnify_Fee_Woo_Helpers — WooCommerce-specific admin helpers shared across plugins: 4 4 * shipping-rate cache busting, zone (country→state) lookup, and brand 5 5 * taxonomy detection. Composed into an admin controller. … … 7 7 defined( 'ABSPATH' ) || exit; 8 8 9 trait XFee_Woo_Helpers {9 trait Extnify_Fee_Woo_Helpers { 10 10 11 11 public function ajax_get_zones() { … … 27 27 $zones[] = array( 28 28 'value' => $code . ':' . $state_code, 29 'name' => \Extnify\ XFee\Ocm\Misc::decode( $country_name . ' — ' . $state_name ),29 'name' => \Extnify\Fee\Ui\Misc::decode( $country_name . ' — ' . $state_name ), 30 30 ); 31 31 } -
extnify-fee/trunk/uninstall.php
r3751128 r3833938 12 12 13 13 // The debug log is transient (ephemeral) data — always clear it. 14 delete_transient( ' x_feepro_debug_log' );14 delete_transient( 'extnify_fee_debug_log' ); 15 15 16 delete_option( 'x_feepro' ); 16 delete_option( 'extnify_fee' ); 17 // Drop the stored schema version so a later reinstall recreates the table. 18 delete_option( 'extnify_fee_db_version' ); 17 19 require_once plugin_dir_path( __FILE__ ) . 'admin/model.php'; 18 XFee_Model::drop_table();20 Extnify_Fee_Model::drop_table();
Note:
See TracChangeset
for help on using the changeset viewer.