Changeset 3426465
- Timestamp:
- 12/23/2025 07:22:03 PM (3 months ago)
- Location:
- cod24-shipping
- Files:
-
- 33 added
- 4 deleted
- 3 edited
-
tags/5.0.1/readme.txt (deleted)
-
tags/5.0.2/readme.txt (deleted)
-
tags/5.0.3/readme.txt (deleted)
-
tags/5.0.4 (added)
-
tags/5.0.4/assets (added)
-
tags/5.0.4/assets/css (added)
-
tags/5.0.4/assets/css/cod24-dokan-frontend.css (added)
-
tags/5.0.4/assets/css/cod24-dokan-vendor.css (added)
-
tags/5.0.4/assets/css/cod24-woo-admin.css (added)
-
tags/5.0.4/assets/css/sweetalert2.css (added)
-
tags/5.0.4/assets/index.php (added)
-
tags/5.0.4/assets/js (added)
-
tags/5.0.4/assets/js/city-select.js (added)
-
tags/5.0.4/assets/js/cod24-dokan-settings.js (added)
-
tags/5.0.4/assets/js/cod24-dokan-vendor-order.js (added)
-
tags/5.0.4/assets/js/cod24-shcod-fee.js (added)
-
tags/5.0.4/assets/js/cod24-woo-admin.js (added)
-
tags/5.0.4/assets/js/sweetalert2.js (added)
-
tags/5.0.4/cod24-shipping.php (added)
-
tags/5.0.4/inc (added)
-
tags/5.0.4/inc/api (added)
-
tags/5.0.4/inc/api/class-cod24-api.php (added)
-
tags/5.0.4/inc/api/class-cod24-tipax-api.php (added)
-
tags/5.0.4/inc/class-cod24-dokan.php (added)
-
tags/5.0.4/inc/class-cod24-settings.php (added)
-
tags/5.0.4/inc/class-cod24-shcod.php (added)
-
tags/5.0.4/inc/class-cod24-woo.php (added)
-
tags/5.0.4/inc/index.php (added)
-
tags/5.0.4/inc/shipping (added)
-
tags/5.0.4/inc/shipping/class-cod24-pishtaz.php (added)
-
tags/5.0.4/inc/shipping/class-cod24-special.php (added)
-
tags/5.0.4/inc/shipping/class-cod24-tipax.php (added)
-
tags/5.0.4/index.php (added)
-
tags/5.0.4/readme.txt (added)
-
tags/5.0.4/templates (added)
-
tags/5.0.4/templates/vendor-order-metabox.php (added)
-
tags/5.0/readme.txt (deleted)
-
trunk/cod24-shipping.php (modified) (2 diffs)
-
trunk/inc/class-cod24-dokan.php (modified) (5 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cod24-shipping/trunk/cod24-shipping.php
r3426042 r3426465 3 3 Plugin Name: COD24 Shipping For Woocommerce 4 4 Description: This plugin is adding COD24 shipping methods to woocommerce. 5 Version: 5.0. 35 Version: 5.0.4 6 6 Author: COD24 7 7 Author URI: https://cod24.ir 8 8 License: GPL-2.0+ 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html 10 Domain Path: /languages11 10 Text Domain: cod24-shipping 12 11 */ … … 27 26 public function __construct() 28 27 { 29 define('COD24_PLUGIN_VERSION', '5.0.3'); 30 define('COD24_PLUGIN_DIR', plugin_dir_path(__FILE__)); 31 define('COD24_PLUGIN_URL', plugin_dir_url(__FILE__)); 32 33 // Include required files 34 require_once('inc/api/class-cod24-api.php'); 35 require_once('inc/api/class-cod24-tipax-api.php'); 36 require_once('inc/shipping/class-cod24-pishtaz.php'); 37 require_once('inc/shipping/class-cod24-special.php'); 38 require_once('inc/shipping/class-cod24-tipax.php'); 39 require_once('inc/class-cod24-settings.php'); 40 require_once('inc/class-cod24-shcod.php'); 41 require_once('inc/class-cod24-woo.php'); 42 require_once('inc/class-cod24-dokan.php'); 43 44 // Include Dokan integration if Dokan is active 45 if (!class_exists('\WeDevs_Dokan')) { 46 47 } 48 49 // Schedule the cron job to run once (e.g., 2 minutes from now) 50 if (!get_option('cod24_meta_data_migrated')) { 51 if (!wp_next_scheduled('migrate_cod24_meta_data_cron')) { 52 wp_schedule_single_event(time() + 120, 'migrate_cod24_meta_data_cron'); 53 } 54 add_action('migrate_cod24_meta_data_cron', array(__CLASS__, 'migrate_cod24_meta_data')); 55 } 28 define('COD24_PLUGIN_VERSION', '5.0.4'); 29 define('COD24_PLUGIN_DIR', plugin_dir_path(__FILE__)); 30 define('COD24_PLUGIN_URL', plugin_dir_url(__FILE__)); 31 32 // Include required files 33 require_once('inc/api/class-cod24-api.php'); 34 require_once('inc/api/class-cod24-tipax-api.php'); 35 require_once('inc/shipping/class-cod24-pishtaz.php'); 36 require_once('inc/shipping/class-cod24-special.php'); 37 require_once('inc/shipping/class-cod24-tipax.php'); 38 require_once('inc/class-cod24-settings.php'); 39 require_once('inc/class-cod24-shcod.php'); 40 require_once('inc/class-cod24-woo.php'); 41 require_once('inc/class-cod24-dokan.php'); 42 43 // Schedule the cron job to run once (e.g., 2 minutes from now) 44 if (!get_option('cod24_meta_data_migrated')) { 45 if (!wp_next_scheduled('migrate_cod24_meta_data_cron')) { 46 wp_schedule_single_event(time() + 120, 'migrate_cod24_meta_data_cron'); 47 } 48 add_action('migrate_cod24_meta_data_cron', array(__CLASS__, 'migrate_cod24_meta_data')); 49 50 } 56 51 } 57 52 -
cod24-shipping/trunk/inc/class-cod24-dokan.php
r3426042 r3426465 278 278 <div class="dokan-form-group"> 279 279 <label class="dokan-w3 dokan-control-label" for="vendor_cod24_pishtaz_fallback_price"> 280 <?php echo esc_attr__('Fallback Price', 'cod24-shipping'). ' ('. get_woocommerce_currency_symbol().')'; ?>280 <?php echo esc_attr__('Fallback Price', 'cod24-shipping'). ' ('. esc_attr( get_woocommerce_currency_symbol() ).')'; ?> 281 281 </label> 282 282 <div class="dokan-w5"> … … 301 301 <div class="dokan-form-group"> 302 302 <label class="dokan-w3 dokan-control-label" for="vendor_cod24_special_fallback_price"> 303 <?php echo esc_attr__('Fallback Price', 'cod24-shipping'). ' ('. get_woocommerce_currency_symbol().')'; ?>303 <?php echo esc_attr__('Fallback Price', 'cod24-shipping'). ' ('. esc_attr( get_woocommerce_currency_symbol() ).')'; ?> 304 304 </label> 305 305 <div class="dokan-w5"> … … 331 331 <div class="dokan-form-group"> 332 332 <label class="dokan-w3 dokan-control-label" for="vendor_cod24_tipax_price"> 333 <?php echo esc_attr__('Shipping Price', 'cod24-shipping'). ' ('. get_woocommerce_currency_symbol().')'; ?>333 <?php echo esc_attr__('Shipping Price', 'cod24-shipping'). ' ('. esc_attr( get_woocommerce_currency_symbol() ).')'; ?> 334 334 </label> 335 335 <div class="dokan-w5"> … … 352 352 </div> 353 353 </div> 354 354 355 355 </form> 356 357 356 358 357 </div> … … 367 366 public static function save_vendor_cod24_settings() 368 367 { 369 if (isset($_POST['dokan_cod24_settings_nonce_field']) && !wp_verify_nonce(sanitize_text_field( wp_unslash ($_POST['dokan_cod24_settings_nonce_field'])), 'dokan_cod24_settings_nonce')) { 368 // Check nonce - fail early if missing or invalid 369 if (!isset($_POST['dokan_cod24_settings_nonce_field']) || 370 !wp_verify_nonce(sanitize_text_field(wp_unslash($_POST['dokan_cod24_settings_nonce_field'])), 'dokan_cod24_settings_nonce')) { 370 371 wp_send_json_error(array('message' => __('Security check failed', 'cod24-shipping'))); 371 } 372 372 exit; 373 } 374 375 // Check user permissions - ensure user is logged in and is a vendor 373 376 $vendor_id = dokan_get_current_user_id(); 374 377 378 if (!$vendor_id || !dokan_is_user_seller($vendor_id)) { 379 wp_send_json_error(array('message' => __('You do not have permission to perform this action', 'cod24-shipping'))); 380 exit; 381 } 382 375 383 // General Settings 376 384 $enabled = isset($_POST['vendor_cod24_enabled']) ? 'yes' : 'no'; 377 385 update_user_meta($vendor_id, '_vendor_cod24_enabled', $enabled); 378 386 379 387 if (!empty($_POST['vendor_cod24_username'])) { 380 update_user_meta($vendor_id, '_vendor_cod24_username', sanitize_text_field( $_POST['vendor_cod24_username']));381 } 382 388 update_user_meta($vendor_id, '_vendor_cod24_username', sanitize_text_field(wp_unslash($_POST['vendor_cod24_username']))); 389 } 390 383 391 if (!empty($_POST['vendor_cod24_password'])) { 384 update_user_meta($vendor_id, '_vendor_cod24_password', sanitize_text_field( $_POST['vendor_cod24_password']));385 } 386 392 update_user_meta($vendor_id, '_vendor_cod24_password', sanitize_text_field(wp_unslash($_POST['vendor_cod24_password']))); 393 } 394 387 395 // Enabled Methods 388 $enabled_methods = isset($_POST['vendor_cod24_enabled_methods']) ? array_map('sanitize_text_field', (array) $_POST['vendor_cod24_enabled_methods']) : array();396 $enabled_methods = isset($_POST['vendor_cod24_enabled_methods']) ? array_map('sanitize_text_field', wp_unslash((array) $_POST['vendor_cod24_enabled_methods'])) : array(); 389 397 update_user_meta($vendor_id, '_vendor_cod24_enabled_methods', $enabled_methods); 390 398 391 399 // Pishtaz Settings 392 400 if (isset($_POST['vendor_cod24_pishtaz_title'])) { 393 update_user_meta($vendor_id, '_vendor_cod24_pishtaz_title', sanitize_text_field( $_POST['vendor_cod24_pishtaz_title']));401 update_user_meta($vendor_id, '_vendor_cod24_pishtaz_title', sanitize_text_field(wp_unslash($_POST['vendor_cod24_pishtaz_title']))); 394 402 } 395 403 if (isset($_POST['vendor_cod24_pishtaz_fallback_price'])) { 396 update_user_meta($vendor_id, '_vendor_cod24_pishtaz_fallback_price', floatval( $_POST['vendor_cod24_pishtaz_fallback_price']));397 } 398 404 update_user_meta($vendor_id, '_vendor_cod24_pishtaz_fallback_price', floatval(wp_unslash($_POST['vendor_cod24_pishtaz_fallback_price']))); 405 } 406 399 407 // Special Settings 400 408 if (isset($_POST['vendor_cod24_special_title'])) { 401 update_user_meta($vendor_id, '_vendor_cod24_special_title', sanitize_text_field( $_POST['vendor_cod24_special_title']));409 update_user_meta($vendor_id, '_vendor_cod24_special_title', sanitize_text_field(wp_unslash($_POST['vendor_cod24_special_title']))); 402 410 } 403 411 if (isset($_POST['vendor_cod24_special_fallback_price'])) { 404 update_user_meta($vendor_id, '_vendor_cod24_special_fallback_price', floatval( $_POST['vendor_cod24_special_fallback_price']));405 } 406 412 update_user_meta($vendor_id, '_vendor_cod24_special_fallback_price', floatval(wp_unslash($_POST['vendor_cod24_special_fallback_price']))); 413 } 414 407 415 // Tipax Settings 408 416 if (isset($_POST['vendor_cod24_tipax_title'])) { 409 update_user_meta($vendor_id, '_vendor_cod24_tipax_title', sanitize_text_field( $_POST['vendor_cod24_tipax_title']));417 update_user_meta($vendor_id, '_vendor_cod24_tipax_title', sanitize_text_field(wp_unslash($_POST['vendor_cod24_tipax_title']))); 410 418 } 411 419 if (isset($_POST['vendor_cod24_tipax_price'])) { 412 update_user_meta($vendor_id, '_vendor_cod24_tipax_price', sanitize_text_field( $_POST['vendor_cod24_tipax_price']));413 } 414 420 update_user_meta($vendor_id, '_vendor_cod24_tipax_price', sanitize_text_field(wp_unslash($_POST['vendor_cod24_tipax_price']))); 421 } 422 415 423 wp_send_json_success(array('message' => __('Settings saved successfully!', 'cod24-shipping'))); 424 exit; 416 425 } 417 426 -
cod24-shipping/trunk/readme.txt
r3426042 r3426465 4 4 Requires at least: 5.0 5 5 Tested up to: 6.9 6 Stable tag: 5.0. 36 Stable tag: 5.0.4 7 7 License: GPL-2.0+ 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 44 44 45 45 == Changelog == 46 47 = 5.0.4 = 48 * Bugs fixes and improvements 46 49 47 50 = 5.0.3 =
Note: See TracChangeset
for help on using the changeset viewer.