Changeset 3390468
- Timestamp:
- 11/05/2025 12:49:21 PM (5 months ago)
- Location:
- woocommerce-delivery-date
- Files:
-
- 68 added
- 20 edited
-
tags/2.2.1/assets/jquery-ui (added)
-
tags/2.2.1/assets/jquery-ui/AUTHORS.txt (added)
-
tags/2.2.1/assets/jquery-ui/LICENSE.txt (added)
-
tags/2.2.1/assets/jquery-ui/images (added)
-
tags/2.2.1/assets/jquery-ui/images/ui-icons_444444_256x240.png (added)
-
tags/2.2.1/assets/jquery-ui/images/ui-icons_555555_256x240.png (added)
-
tags/2.2.1/assets/jquery-ui/images/ui-icons_777620_256x240.png (added)
-
tags/2.2.1/assets/jquery-ui/images/ui-icons_777777_256x240.png (added)
-
tags/2.2.1/assets/jquery-ui/images/ui-icons_cc0000_256x240.png (added)
-
tags/2.2.1/assets/jquery-ui/images/ui-icons_ffffff_256x240.png (added)
-
tags/2.2.1/assets/jquery-ui/jquery-ui.css (added)
-
tags/2.2.1/assets/jquery-ui/jquery-ui.min.css (added)
-
tags/2.2.1/assets/jquery-ui/jquery-ui.structure.css (added)
-
tags/2.2.1/assets/jquery-ui/jquery-ui.structure.min.css (added)
-
tags/2.2.1/assets/jquery-ui/jquery-ui.theme.css (added)
-
tags/2.2.1/assets/jquery-ui/jquery-ui.theme.min.css (added)
-
tags/2.2.1/assets/jquery-ui/themes (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/images (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/images/ui-icons_2e83ff_256x240.png (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/images/ui-icons_454545_256x240.png (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/images/ui-icons_888888_256x240.png (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/images/ui-icons_cd0a0a_256x240.png (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/jquery-ui.css (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/jquery-ui.min.css (added)
-
tags/2.2.1/assets/jquery-ui/themes/smoothness/theme.css (added)
-
tags/2.2.1/freemius/assets/img/dreamfox-deliverydate.png (added)
-
tags/2.2.1/readme.txt (modified) (1 diff)
-
tags/2.2.1/src/Admin/Backend.php (modified) (1 diff)
-
tags/2.2.1/src/Site/AssetsManager.php (modified) (1 diff)
-
tags/2.2.1/src/Site/CheckoutFieldManager.php (modified) (1 diff)
-
tags/2.2.1/src/Site/Frontend.php (modified) (2 diffs)
-
tags/2.2.1/src/Views/templates/admin_js_view.php (modified) (1 diff)
-
tags/2.2.1/src/Views/templates/admin_order_view.php (modified) (1 diff)
-
tags/2.2.1/src/Views/templates/delivery_date.php (modified) (2 diffs)
-
tags/2.2.1/src/Views/templates/email_view.php (modified) (1 diff)
-
tags/2.2.1/woocommerce-delivery-date.php (modified) (2 diffs)
-
trunk/assets/jquery-ui (added)
-
trunk/assets/jquery-ui/AUTHORS.txt (added)
-
trunk/assets/jquery-ui/LICENSE.txt (added)
-
trunk/assets/jquery-ui/images (added)
-
trunk/assets/jquery-ui/images/ui-icons_444444_256x240.png (added)
-
trunk/assets/jquery-ui/images/ui-icons_555555_256x240.png (added)
-
trunk/assets/jquery-ui/images/ui-icons_777620_256x240.png (added)
-
trunk/assets/jquery-ui/images/ui-icons_777777_256x240.png (added)
-
trunk/assets/jquery-ui/images/ui-icons_cc0000_256x240.png (added)
-
trunk/assets/jquery-ui/images/ui-icons_ffffff_256x240.png (added)
-
trunk/assets/jquery-ui/jquery-ui.css (added)
-
trunk/assets/jquery-ui/jquery-ui.min.css (added)
-
trunk/assets/jquery-ui/jquery-ui.structure.css (added)
-
trunk/assets/jquery-ui/jquery-ui.structure.min.css (added)
-
trunk/assets/jquery-ui/jquery-ui.theme.css (added)
-
trunk/assets/jquery-ui/jquery-ui.theme.min.css (added)
-
trunk/assets/jquery-ui/themes (added)
-
trunk/assets/jquery-ui/themes/smoothness (added)
-
trunk/assets/jquery-ui/themes/smoothness/images (added)
-
trunk/assets/jquery-ui/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png (added)
-
trunk/assets/jquery-ui/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png (added)
-
trunk/assets/jquery-ui/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png (added)
-
trunk/assets/jquery-ui/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png (added)
-
trunk/assets/jquery-ui/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png (added)
-
trunk/assets/jquery-ui/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png (added)
-
trunk/assets/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png (added)
-
trunk/assets/jquery-ui/themes/smoothness/images/ui-icons_2e83ff_256x240.png (added)
-
trunk/assets/jquery-ui/themes/smoothness/images/ui-icons_454545_256x240.png (added)
-
trunk/assets/jquery-ui/themes/smoothness/images/ui-icons_888888_256x240.png (added)
-
trunk/assets/jquery-ui/themes/smoothness/images/ui-icons_cd0a0a_256x240.png (added)
-
trunk/assets/jquery-ui/themes/smoothness/jquery-ui.css (added)
-
trunk/assets/jquery-ui/themes/smoothness/jquery-ui.min.css (added)
-
trunk/assets/jquery-ui/themes/smoothness/theme.css (added)
-
trunk/freemius/assets/img/dreamfox-deliverydate.png (added)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/src/Admin/Backend.php (modified) (1 diff)
-
trunk/src/Site/AssetsManager.php (modified) (1 diff)
-
trunk/src/Site/CheckoutFieldManager.php (modified) (1 diff)
-
trunk/src/Site/Frontend.php (modified) (2 diffs)
-
trunk/src/Views/templates/admin_js_view.php (modified) (1 diff)
-
trunk/src/Views/templates/admin_order_view.php (modified) (1 diff)
-
trunk/src/Views/templates/delivery_date.php (modified) (2 diffs)
-
trunk/src/Views/templates/email_view.php (modified) (1 diff)
-
trunk/woocommerce-delivery-date.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
woocommerce-delivery-date/tags/2.2.1/readme.txt
r3385776 r3390468 3 3 Contributors: Dreamfox Media, freemius 4 4 Donate link: https://www.dreamfoxmedia.com 5 Tags: woocommerce,delivery, delivery date, plugin,free5 Tags: woocommerce,delivery, delivery date,free 6 6 Requires at least: 5.0 7 7 Tested up to: 6.8 8 8 Stable tag: 2.2.1 9 9 WC requires at least: 6.0.0 10 WC tested up to: 10. 211 License: GPLv 2or later10 WC tested up to: 10.3 11 License: GPLv3 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html 13 13 -
woocommerce-delivery-date/tags/2.2.1/src/Admin/Backend.php
r3385198 r3390468 20 20 public function displayOrderDataInAdmin( $order ) { 21 21 $view = new AdminOrderView($this, $order->get_id()); 22 echo $view->render();22 echo wp_kses_post( $view->render() ); 23 23 } 24 24 -
woocommerce-delivery-date/tags/2.2.1/src/Site/AssetsManager.php
r3385198 r3390468 6 6 class AssetsManager extends AbstractAssets 7 7 { 8 /** 9 * Frontend enqueue hook 10 */ 11 protected function _getEventName() { 12 return 'wp_enqueue_scripts'; 13 } 8 14 9 protected function _getEventName() 10 { 11 return 'wp_enqueue_scripts'; 12 } 15 /** 16 * Register styles that the AbstractAssets parent can handle. 17 * Keep your existing frontend.css and add local jQuery UI theme CSS. 18 */ 19 protected function _buildStyles() { 20 return [ 21 'frontend' => [ 22 'src' => $this->getAssetUrl('frontend.css'), 23 'deps' => [], 24 'ver' => defined('WP_DEBUG') && WP_DEBUG ? time() : '1.0.0', 25 ], 26 // Local copy of the jQuery UI 1.12.1 "Smoothness" theme CSS 27 'jquery-ui-theme' => [ 28 'src' => $this->getAssetUrl('assets/jquery-ui/themes/smoothness/jquery-ui.min.css'), 29 'deps' => [], 30 'ver' => '1.12.1', 31 ], 32 ]; 33 } 13 34 14 protected function _buildStyles() 15 { 16 return [ 17 'frontend' => array( 18 'src' => $this->getAssetUrl( 'frontend.css' ), 19 ), 20 ]; 21 } 35 /** 36 * No additional script files from your plugin right now. 37 */ 38 protected function _buildScripts() { 39 return []; 40 } 22 41 23 protected function _buildScripts() 24 { 25 return []; 26 } 42 /** 43 * Enqueue WordPress-bundled jQuery UI and our local theme CSS. 44 */ 45 public function registerScripts() { 46 parent::registerScripts(); 27 47 28 public function registerScripts() 29 { 30 parent::registerScripts();48 // WordPress already bundles the JS parts of jQuery UI; just enqueue what you use. 49 wp_enqueue_script('jquery-ui-core'); 50 wp_enqueue_script('jquery-ui-datepicker'); 31 51 32 // Load the datepicker script (pre-registered in WordPress). 33 wp_enqueue_script( 'jquery-ui-datepicker' ); 52 // Enqueue our local theme CSS (registered via _buildStyles()). 53 // Use a unique handle to avoid collisions with other plugins/themes. 54 wp_enqueue_style('dreamfox-deliverydate-jquery-ui-theme'); 34 55 35 // You need styling for the datepicker. For simplicity I've linked to the jQuery UI CSS on a CDN. 36 wp_register_style( 'jquery-ui', 'https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css' ); 37 wp_enqueue_style( 'jquery-ui' ); 38 } 56 // Ensure your frontend CSS still loads. 57 wp_enqueue_style('dreamfox-deliverydate-frontend'); 58 } 39 59 40 protected function _getBuildType() 41 { 42 return 'free'; 43 } 60 /** 61 * Build type identifier unchanged. 62 */ 63 protected function _getBuildType() { 64 return 'free'; 65 } 44 66 } -
woocommerce-delivery-date/tags/2.2.1/src/Site/CheckoutFieldManager.php
r3385198 r3390468 21 21 $dateFormat = get_option('date_format'); 22 22 $minDeliveryDate = date($dateFormat, strtotime('+' . ( $datesToDeliver ) . ' day', current_time('timestamp', 0))); 23 $label = __('Select delivery date', ' dreamfox-wdd');23 $label = __('Select delivery date', 'woocommerce-delivery-date'); 24 24 $required = false; 25 25 $this->_fields[DREAMFOX_WDD_FIELD_NAME] = array( -
woocommerce-delivery-date/tags/2.2.1/src/Site/Frontend.php
r3385198 r3390468 41 41 public function outputDeliveryDate() { 42 42 $view = new DeliveryDateView($this); 43 echo $view->render();43 echo wp_kses_post( $view->render() ); 44 44 } 45 45 … … 61 61 public function renderEmailWithDeliveryDate( $order, $is_admin_email ) { 62 62 $view = new EmailView($this, $order); 63 echo $view->render();63 echo wp_kses_post( $view->render() ); 64 64 } 65 65 66 66 public function renderOrderView( $order ) { 67 67 $view = new OrderView($this, $order); 68 echo $view->render();68 echo wp_kses_post( $view->render() ); 69 69 } 70 70 -
woocommerce-delivery-date/tags/2.2.1/src/Views/templates/admin_js_view.php
r3385198 r3390468 1 1 <script type="text/javascript"> 2 var wdd_static_url = <?php echo json_encode($this->getStaticUrl()); ?>;2 var wdd_static_url = <?php echo wp_json_encode( $this->getStaticUrl() ); ?>; 3 3 </script> -
woocommerce-delivery-date/tags/2.2.1/src/Views/templates/admin_order_view.php
r3385198 r3390468 4 4 ?> 5 5 <div class="order_data_column"> 6 <h4><?php e cho __('Delivery Date'); ?></h4>6 <h4><?php esc_html_e( 'Delivery Date', 'woocommerce-delivery-date' ); ?></h4> 7 7 <p><?php echo $deliveryDate; ?></p> 8 8 </div> -
woocommerce-delivery-date/tags/2.2.1/src/Views/templates/delivery_date.php
r3385198 r3390468 9 9 ?> 10 10 <div class="dreamfox-delivery-date" id="dd__checkout_field"> 11 <h3><?php e cho __('Delivery Info', 'dreamfox-wdd'); ?></h3>11 <h3><?php esc_html_e( 'Delivery Info', 'woocommerce-delivery-date' ); ?></h3> 12 12 <?php foreach ($checkout->checkout_fields[DREAMFOX_WDD_FIELD_NAME] as $key => $field) : ?> 13 13 <?php woocommerce_form_field($key, $field, $checkout->get_value($key)); ?> … … 15 15 </div> 16 16 17 18 <script type="text/javascript"> 19 (function($){ 20 $(document).ready(function() { 21 $('#<?php echo DREAMFOX_WDD_FIELD_NAME; ?>').datepicker({ 22 dateFormat : '<?php echo DateHelper::getJsDateFormat(get_option( 'date_format' )) ?>', 23 minDate: <?php echo $this->getMinDate(); ?>, 24 }); 25 }) 26 })(jQuery); 17 <script> 18 jQuery(function($) { 19 $('#<?php echo esc_js( DREAMFOX_WDD_FIELD_NAME ); ?>').datepicker({ 20 dateFormat: <?php echo wp_json_encode( DateHelper::getJsDateFormat( get_option( 'date_format' ) ) ); ?>, 21 minDate: <?php echo (int) $this->getMinDate(); ?>, 22 }); 23 }); 27 24 </script> -
woocommerce-delivery-date/tags/2.2.1/src/Views/templates/email_view.php
r3385198 r3390468 3 3 $label = $this->getLabel(); 4 4 if (!empty($deliveryDate)) { 5 echo sprintf('<p><strong>%s:</strong>%s</p>', $label, $deliveryDate); 5 echo sprintf( 6 '<p><strong>%s:</strong> %s</p>', 7 esc_html( $label ), 8 esc_html( $deliveryDate ) 9 ); 6 10 } -
woocommerce-delivery-date/tags/2.2.1/woocommerce-delivery-date.php
r3385198 r3390468 2 2 3 3 /** 4 * Plugin Name: Woocommerce Delivery Date Premium5 * Plugin URI: https:// dreamfoxmedia.com4 * Plugin Name: Delivery Date for WooCommerce 5 * Plugin URI: https://github.com/WPPlugins/woocommerce-delivery-date 6 6 * Version: 2.2.1 7 7 * Author URI: https://dreamfoxmedia.com 8 8 * Author: Dreamfox Media 9 * Description: Extend Woo commerce plugin to add delivery date on checkout9 * Description: Extend WooCommerce plugin to add delivery date on checkout 10 10 * Requires at least: 5.0 11 11 * Tested up to: 6.8 12 12 * WC requires at least: 6.0.0 13 * WC tested up to: 10. 213 * WC tested up to: 10.3 14 14 * License: GPLv3 or later 15 15 * License URI: http://www.opensource.org/licenses/gpl-license.php 16 * Text Domain: woocommerce-delivery-date 17 * Domain Path: /lang/ 16 * Text Domain: deliverydate-for-woocommerce 18 17 * @Developer : Marco van Loghum Slaterus / Hoang Xuan Hao ( Pamysoft ) 19 18 */ … … 24 23 define( 'DREAMFOX_WDD_PLUGIN_FILE', __FILE__ ); 25 24 } 25 /** 26 * Resilient Freemius accessor: 27 * - If your project exposes a Freemius function, return it (e.g., dreamfox_delivery_date()). 28 * - Otherwise return a safe stub so calls like my_fs()->is__premium_only() won't fatally error. 29 */ 30 if ( !function_exists( 'my_fs' ) ) { 31 function my_fs() { 32 // If your Freemius accessor is a different one in other builds, check them here: 33 if ( function_exists( 'dfm_sgppfw_fs' ) ) { 34 return dfm_sgppfw_fs(); 35 } 36 if ( function_exists( 'dreamfox_delivery_date' ) ) { 37 return dreamfox_delivery_date(); 38 } 39 static $stub = null; 40 if ( !$stub ) { 41 $stub = new class { 42 public function add_filter() { 43 return null; 44 } 45 46 public function __call( $name, $args ) { 47 return null; 48 } 49 50 public function set_basename() { 51 return null; 52 } 53 54 } 55 ; 56 } 57 return $stub; 58 } 59 60 } 61 /** 62 * If Freemius is already loaded elsewhere, sync the basename on premium. 63 */ 64 if ( function_exists( 'dfm_sgppfw_fs' ) || function_exists( 'dreamfox_delivery_date' ) ) { 65 } 26 66 if ( function_exists( 'dreamfox_delivery_date' ) ) { 67 // If helper already exists (e.g., after an update), keep basename in sync. 27 68 dreamfox_delivery_date()->set_basename( false, __FILE__ ); 28 69 } else { 29 if ( !function_exists( 'dreamfox_delivery_date' ) ) { 30 // Create a helper function for easy SDK access. 31 function dreamfox_delivery_date() { 32 global $dreamfox_delivery_date; 33 if ( !isset( $dreamfox_delivery_date ) ) { 34 // Activate multisite network integration. 35 if ( !defined( 'WP_FS__PRODUCT_10651_MULTISITE' ) ) { 36 define( 'WP_FS__PRODUCT_10651_MULTISITE', true ); 37 } 38 // Include Freemius SDK. 39 require_once dirname( __FILE__ ) . '/freemius/start.php'; 40 $dreamfox_delivery_date = fs_dynamic_init( array( 41 'id' => '10651', 42 'slug' => 'dreamfox-deliverydate', 43 'premium_slug' => 'dreamfox-deliverydate-premium', 44 'type' => 'plugin', 45 'public_key' => 'pk_cbd84d7abd43d4e1d2c4b5850c495', 46 'is_premium' => false, 47 'premium_suffix' => 'Premium', 48 'has_addons' => false, 49 'has_paid_plans' => true, 50 'menu' => array( 51 'slug' => 'woocommerce-delivery-date', 52 'first-path' => 'admin.php?page=woocommerce-delivery-date', 53 'support' => false, 54 'network' => true, 55 'parent' => array( 56 'slug' => 'woocommerce', 57 ), 70 // Create a helper for easy SDK access. 71 function dreamfox_delivery_date() { 72 global $dreamfox_delivery_date; 73 if ( !isset( $dreamfox_delivery_date ) ) { 74 // Activate multisite network integration. 75 if ( !defined( 'WP_FS__PRODUCT_10651_MULTISITE' ) ) { 76 define( 'WP_FS__PRODUCT_10651_MULTISITE', true ); 77 } 78 // Include Freemius SDK. 79 require_once dirname( __FILE__ ) . '/freemius/start.php'; 80 $dreamfox_delivery_date = fs_dynamic_init( array( 81 'id' => '10651', 82 'slug' => 'dreamfox-deliverydate', 83 'premium_slug' => 'dreamfox-deliverydate-premium', 84 'type' => 'plugin', 85 'public_key' => 'pk_cbd84d7abd43d4e1d2c4b5850c495', 86 'is_premium' => false, 87 'premium_suffix' => 'Premium', 88 'has_addons' => false, 89 'has_paid_plans' => true, 90 'menu' => array( 91 'slug' => 'woocommerce-delivery-date', 92 'first-path' => 'admin.php?page=woocommerce-delivery-date', 93 'support' => false, 94 'network' => true, 95 'parent' => array( 96 'slug' => 'woocommerce', 58 97 ), 59 'is_live' => true, 60 ) ); 61 } 62 return $dreamfox_delivery_date; 98 ), 99 'is_live' => true, 100 ) ); 63 101 } 102 return $dreamfox_delivery_date; 103 } 64 104 65 // Init Freemius. 66 dreamfox_delivery_date(); 67 // Signal that SDK was initiated. 68 do_action( 'dreamfox_delivery_date_loaded' ); 69 } 70 if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { 71 include dirname( __FILE__ ) . '/bootstrap.php'; 72 } 105 // Init Freemius (available to my_fs()). 106 dreamfox_delivery_date(); 107 do_action( 'dreamfox_delivery_date_loaded' ); 73 108 } 109 /** 110 * === FREE vs PREMIUM Freemius UI filters === 111 * Free : hide account/contact/pricing menus, enable anonymous, disable branding. 112 * Premium: show menus, disable anonymous, keep branding defaults. 113 */ 114 $fs = my_fs(); 115 // FREE 116 $fs->add_filter( 'show_account', '__return_false' ); 117 $fs->add_filter( 'show_contact', '__return_false' ); 118 $fs->add_filter( 'show_pricing', '__return_false' ); 119 $fs->add_filter( 'is_submenu_visible', '__return_false' ); 120 $fs->add_filter( 'enable_anonymous', '__return_true' ); 121 $fs->add_filter( 'disable_freemius_branding', '__return_true' ); 122 /** 123 * Load core plugin code for BOTH free & premium builds. 124 * Premium-only files (e.g., /src/Premium) should be further gated INSIDE bootstrap.php 125 * using `if ( my_fs()->is__premium_only() ) { ... }`. 126 */ 127 if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { 128 include dirname( __FILE__ ) . '/bootstrap.php'; 129 } -
woocommerce-delivery-date/trunk/readme.txt
r3385776 r3390468 3 3 Contributors: Dreamfox Media, freemius 4 4 Donate link: https://www.dreamfoxmedia.com 5 Tags: woocommerce,delivery, delivery date, plugin,free5 Tags: woocommerce,delivery, delivery date,free 6 6 Requires at least: 5.0 7 7 Tested up to: 6.8 8 8 Stable tag: 2.2.1 9 9 WC requires at least: 6.0.0 10 WC tested up to: 10. 211 License: GPLv 2or later10 WC tested up to: 10.3 11 License: GPLv3 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html 13 13 -
woocommerce-delivery-date/trunk/src/Admin/Backend.php
r3111568 r3390468 20 20 public function displayOrderDataInAdmin( $order ) { 21 21 $view = new AdminOrderView($this, $order->get_id()); 22 echo $view->render();22 echo wp_kses_post( $view->render() ); 23 23 } 24 24 -
woocommerce-delivery-date/trunk/src/Site/AssetsManager.php
r2920091 r3390468 6 6 class AssetsManager extends AbstractAssets 7 7 { 8 /** 9 * Frontend enqueue hook 10 */ 11 protected function _getEventName() { 12 return 'wp_enqueue_scripts'; 13 } 8 14 9 protected function _getEventName() 10 { 11 return 'wp_enqueue_scripts'; 12 } 15 /** 16 * Register styles that the AbstractAssets parent can handle. 17 * Keep your existing frontend.css and add local jQuery UI theme CSS. 18 */ 19 protected function _buildStyles() { 20 return [ 21 'frontend' => [ 22 'src' => $this->getAssetUrl('frontend.css'), 23 'deps' => [], 24 'ver' => defined('WP_DEBUG') && WP_DEBUG ? time() : '1.0.0', 25 ], 26 // Local copy of the jQuery UI 1.12.1 "Smoothness" theme CSS 27 'jquery-ui-theme' => [ 28 'src' => $this->getAssetUrl('assets/jquery-ui/themes/smoothness/jquery-ui.min.css'), 29 'deps' => [], 30 'ver' => '1.12.1', 31 ], 32 ]; 33 } 13 34 14 protected function _buildStyles() 15 { 16 return [ 17 'frontend' => array( 18 'src' => $this->getAssetUrl( 'frontend.css' ), 19 ), 20 ]; 21 } 35 /** 36 * No additional script files from your plugin right now. 37 */ 38 protected function _buildScripts() { 39 return []; 40 } 22 41 23 protected function _buildScripts() 24 { 25 return []; 26 } 42 /** 43 * Enqueue WordPress-bundled jQuery UI and our local theme CSS. 44 */ 45 public function registerScripts() { 46 parent::registerScripts(); 27 47 28 public function registerScripts() 29 { 30 parent::registerScripts();48 // WordPress already bundles the JS parts of jQuery UI; just enqueue what you use. 49 wp_enqueue_script('jquery-ui-core'); 50 wp_enqueue_script('jquery-ui-datepicker'); 31 51 32 // Load the datepicker script (pre-registered in WordPress). 33 wp_enqueue_script( 'jquery-ui-datepicker' ); 52 // Enqueue our local theme CSS (registered via _buildStyles()). 53 // Use a unique handle to avoid collisions with other plugins/themes. 54 wp_enqueue_style('dreamfox-deliverydate-jquery-ui-theme'); 34 55 35 // You need styling for the datepicker. For simplicity I've linked to the jQuery UI CSS on a CDN. 36 wp_register_style( 'jquery-ui', 'https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css' ); 37 wp_enqueue_style( 'jquery-ui' ); 38 } 56 // Ensure your frontend CSS still loads. 57 wp_enqueue_style('dreamfox-deliverydate-frontend'); 58 } 39 59 40 protected function _getBuildType() 41 { 42 return 'free'; 43 } 60 /** 61 * Build type identifier unchanged. 62 */ 63 protected function _getBuildType() { 64 return 'free'; 65 } 44 66 } -
woocommerce-delivery-date/trunk/src/Site/CheckoutFieldManager.php
r2920091 r3390468 21 21 $dateFormat = get_option('date_format'); 22 22 $minDeliveryDate = date($dateFormat, strtotime('+' . ( $datesToDeliver ) . ' day', current_time('timestamp', 0))); 23 $label = __('Select delivery date', ' dreamfox-wdd');23 $label = __('Select delivery date', 'woocommerce-delivery-date'); 24 24 $required = false; 25 25 $this->_fields[DREAMFOX_WDD_FIELD_NAME] = array( -
woocommerce-delivery-date/trunk/src/Site/Frontend.php
r3111568 r3390468 41 41 public function outputDeliveryDate() { 42 42 $view = new DeliveryDateView($this); 43 echo $view->render();43 echo wp_kses_post( $view->render() ); 44 44 } 45 45 … … 61 61 public function renderEmailWithDeliveryDate( $order, $is_admin_email ) { 62 62 $view = new EmailView($this, $order); 63 echo $view->render();63 echo wp_kses_post( $view->render() ); 64 64 } 65 65 66 66 public function renderOrderView( $order ) { 67 67 $view = new OrderView($this, $order); 68 echo $view->render();68 echo wp_kses_post( $view->render() ); 69 69 } 70 70 -
woocommerce-delivery-date/trunk/src/Views/templates/admin_js_view.php
r2920091 r3390468 1 1 <script type="text/javascript"> 2 var wdd_static_url = <?php echo json_encode($this->getStaticUrl()); ?>;2 var wdd_static_url = <?php echo wp_json_encode( $this->getStaticUrl() ); ?>; 3 3 </script> -
woocommerce-delivery-date/trunk/src/Views/templates/admin_order_view.php
r2920091 r3390468 4 4 ?> 5 5 <div class="order_data_column"> 6 <h4><?php e cho __('Delivery Date'); ?></h4>6 <h4><?php esc_html_e( 'Delivery Date', 'woocommerce-delivery-date' ); ?></h4> 7 7 <p><?php echo $deliveryDate; ?></p> 8 8 </div> -
woocommerce-delivery-date/trunk/src/Views/templates/delivery_date.php
r2920091 r3390468 9 9 ?> 10 10 <div class="dreamfox-delivery-date" id="dd__checkout_field"> 11 <h3><?php e cho __('Delivery Info', 'dreamfox-wdd'); ?></h3>11 <h3><?php esc_html_e( 'Delivery Info', 'woocommerce-delivery-date' ); ?></h3> 12 12 <?php foreach ($checkout->checkout_fields[DREAMFOX_WDD_FIELD_NAME] as $key => $field) : ?> 13 13 <?php woocommerce_form_field($key, $field, $checkout->get_value($key)); ?> … … 15 15 </div> 16 16 17 18 <script type="text/javascript"> 19 (function($){ 20 $(document).ready(function() { 21 $('#<?php echo DREAMFOX_WDD_FIELD_NAME; ?>').datepicker({ 22 dateFormat : '<?php echo DateHelper::getJsDateFormat(get_option( 'date_format' )) ?>', 23 minDate: <?php echo $this->getMinDate(); ?>, 24 }); 25 }) 26 })(jQuery); 17 <script> 18 jQuery(function($) { 19 $('#<?php echo esc_js( DREAMFOX_WDD_FIELD_NAME ); ?>').datepicker({ 20 dateFormat: <?php echo wp_json_encode( DateHelper::getJsDateFormat( get_option( 'date_format' ) ) ); ?>, 21 minDate: <?php echo (int) $this->getMinDate(); ?>, 22 }); 23 }); 27 24 </script> -
woocommerce-delivery-date/trunk/src/Views/templates/email_view.php
r2920091 r3390468 3 3 $label = $this->getLabel(); 4 4 if (!empty($deliveryDate)) { 5 echo sprintf('<p><strong>%s:</strong>%s</p>', $label, $deliveryDate); 5 echo sprintf( 6 '<p><strong>%s:</strong> %s</p>', 7 esc_html( $label ), 8 esc_html( $deliveryDate ) 9 ); 6 10 } -
woocommerce-delivery-date/trunk/woocommerce-delivery-date.php
r3385198 r3390468 2 2 3 3 /** 4 * Plugin Name: Woocommerce Delivery Date Premium5 * Plugin URI: https:// dreamfoxmedia.com4 * Plugin Name: Delivery Date for WooCommerce 5 * Plugin URI: https://github.com/WPPlugins/woocommerce-delivery-date 6 6 * Version: 2.2.1 7 7 * Author URI: https://dreamfoxmedia.com 8 8 * Author: Dreamfox Media 9 * Description: Extend Woo commerce plugin to add delivery date on checkout9 * Description: Extend WooCommerce plugin to add delivery date on checkout 10 10 * Requires at least: 5.0 11 11 * Tested up to: 6.8 12 12 * WC requires at least: 6.0.0 13 * WC tested up to: 10. 213 * WC tested up to: 10.3 14 14 * License: GPLv3 or later 15 15 * License URI: http://www.opensource.org/licenses/gpl-license.php 16 * Text Domain: woocommerce-delivery-date 17 * Domain Path: /lang/ 16 * Text Domain: deliverydate-for-woocommerce 18 17 * @Developer : Marco van Loghum Slaterus / Hoang Xuan Hao ( Pamysoft ) 19 18 */ … … 24 23 define( 'DREAMFOX_WDD_PLUGIN_FILE', __FILE__ ); 25 24 } 25 /** 26 * Resilient Freemius accessor: 27 * - If your project exposes a Freemius function, return it (e.g., dreamfox_delivery_date()). 28 * - Otherwise return a safe stub so calls like my_fs()->is__premium_only() won't fatally error. 29 */ 30 if ( !function_exists( 'my_fs' ) ) { 31 function my_fs() { 32 // If your Freemius accessor is a different one in other builds, check them here: 33 if ( function_exists( 'dfm_sgppfw_fs' ) ) { 34 return dfm_sgppfw_fs(); 35 } 36 if ( function_exists( 'dreamfox_delivery_date' ) ) { 37 return dreamfox_delivery_date(); 38 } 39 static $stub = null; 40 if ( !$stub ) { 41 $stub = new class { 42 public function add_filter() { 43 return null; 44 } 45 46 public function __call( $name, $args ) { 47 return null; 48 } 49 50 public function set_basename() { 51 return null; 52 } 53 54 } 55 ; 56 } 57 return $stub; 58 } 59 60 } 61 /** 62 * If Freemius is already loaded elsewhere, sync the basename on premium. 63 */ 64 if ( function_exists( 'dfm_sgppfw_fs' ) || function_exists( 'dreamfox_delivery_date' ) ) { 65 } 26 66 if ( function_exists( 'dreamfox_delivery_date' ) ) { 67 // If helper already exists (e.g., after an update), keep basename in sync. 27 68 dreamfox_delivery_date()->set_basename( false, __FILE__ ); 28 69 } else { 29 if ( !function_exists( 'dreamfox_delivery_date' ) ) { 30 // Create a helper function for easy SDK access. 31 function dreamfox_delivery_date() { 32 global $dreamfox_delivery_date; 33 if ( !isset( $dreamfox_delivery_date ) ) { 34 // Activate multisite network integration. 35 if ( !defined( 'WP_FS__PRODUCT_10651_MULTISITE' ) ) { 36 define( 'WP_FS__PRODUCT_10651_MULTISITE', true ); 37 } 38 // Include Freemius SDK. 39 require_once dirname( __FILE__ ) . '/freemius/start.php'; 40 $dreamfox_delivery_date = fs_dynamic_init( array( 41 'id' => '10651', 42 'slug' => 'dreamfox-deliverydate', 43 'premium_slug' => 'dreamfox-deliverydate-premium', 44 'type' => 'plugin', 45 'public_key' => 'pk_cbd84d7abd43d4e1d2c4b5850c495', 46 'is_premium' => false, 47 'premium_suffix' => 'Premium', 48 'has_addons' => false, 49 'has_paid_plans' => true, 50 'menu' => array( 51 'slug' => 'woocommerce-delivery-date', 52 'first-path' => 'admin.php?page=woocommerce-delivery-date', 53 'support' => false, 54 'network' => true, 55 'parent' => array( 56 'slug' => 'woocommerce', 57 ), 70 // Create a helper for easy SDK access. 71 function dreamfox_delivery_date() { 72 global $dreamfox_delivery_date; 73 if ( !isset( $dreamfox_delivery_date ) ) { 74 // Activate multisite network integration. 75 if ( !defined( 'WP_FS__PRODUCT_10651_MULTISITE' ) ) { 76 define( 'WP_FS__PRODUCT_10651_MULTISITE', true ); 77 } 78 // Include Freemius SDK. 79 require_once dirname( __FILE__ ) . '/freemius/start.php'; 80 $dreamfox_delivery_date = fs_dynamic_init( array( 81 'id' => '10651', 82 'slug' => 'dreamfox-deliverydate', 83 'premium_slug' => 'dreamfox-deliverydate-premium', 84 'type' => 'plugin', 85 'public_key' => 'pk_cbd84d7abd43d4e1d2c4b5850c495', 86 'is_premium' => false, 87 'premium_suffix' => 'Premium', 88 'has_addons' => false, 89 'has_paid_plans' => true, 90 'menu' => array( 91 'slug' => 'woocommerce-delivery-date', 92 'first-path' => 'admin.php?page=woocommerce-delivery-date', 93 'support' => false, 94 'network' => true, 95 'parent' => array( 96 'slug' => 'woocommerce', 58 97 ), 59 'is_live' => true, 60 ) ); 61 } 62 return $dreamfox_delivery_date; 98 ), 99 'is_live' => true, 100 ) ); 63 101 } 102 return $dreamfox_delivery_date; 103 } 64 104 65 // Init Freemius. 66 dreamfox_delivery_date(); 67 // Signal that SDK was initiated. 68 do_action( 'dreamfox_delivery_date_loaded' ); 69 } 70 if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { 71 include dirname( __FILE__ ) . '/bootstrap.php'; 72 } 105 // Init Freemius (available to my_fs()). 106 dreamfox_delivery_date(); 107 do_action( 'dreamfox_delivery_date_loaded' ); 73 108 } 109 /** 110 * === FREE vs PREMIUM Freemius UI filters === 111 * Free : hide account/contact/pricing menus, enable anonymous, disable branding. 112 * Premium: show menus, disable anonymous, keep branding defaults. 113 */ 114 $fs = my_fs(); 115 // FREE 116 $fs->add_filter( 'show_account', '__return_false' ); 117 $fs->add_filter( 'show_contact', '__return_false' ); 118 $fs->add_filter( 'show_pricing', '__return_false' ); 119 $fs->add_filter( 'is_submenu_visible', '__return_false' ); 120 $fs->add_filter( 'enable_anonymous', '__return_true' ); 121 $fs->add_filter( 'disable_freemius_branding', '__return_true' ); 122 /** 123 * Load core plugin code for BOTH free & premium builds. 124 * Premium-only files (e.g., /src/Premium) should be further gated INSIDE bootstrap.php 125 * using `if ( my_fs()->is__premium_only() ) { ... }`. 126 */ 127 if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { 128 include dirname( __FILE__ ) . '/bootstrap.php'; 129 }
Note: See TracChangeset
for help on using the changeset viewer.