Changeset 3452297
- Timestamp:
- 02/02/2026 05:40:48 PM (2 months ago)
- Location:
- steadfast-api
- Files:
-
- 24 added
- 4 edited
-
tags/1.0.5 (added)
-
tags/1.0.5/assets (added)
-
tags/1.0.5/assets/admin (added)
-
tags/1.0.5/assets/admin/css (added)
-
tags/1.0.5/assets/admin/css/dashboard.css (added)
-
tags/1.0.5/assets/admin/css/style.css (added)
-
tags/1.0.5/assets/admin/img (added)
-
tags/1.0.5/assets/admin/img/logo.png (added)
-
tags/1.0.5/assets/admin/img/steadfast-bg.png (added)
-
tags/1.0.5/assets/admin/js (added)
-
tags/1.0.5/assets/admin/js/dashboard.js (added)
-
tags/1.0.5/assets/admin/js/scripts.js (added)
-
tags/1.0.5/assets/invoice (added)
-
tags/1.0.5/assets/invoice/css (added)
-
tags/1.0.5/assets/invoice/css/style.css (added)
-
tags/1.0.5/includes (added)
-
tags/1.0.5/includes/ajax.php (added)
-
tags/1.0.5/includes/class-admin-menu.php (added)
-
tags/1.0.5/includes/class-hooks.php (added)
-
tags/1.0.5/includes/functions.php (added)
-
tags/1.0.5/readme.txt (added)
-
tags/1.0.5/steadfast-api.php (added)
-
tags/1.0.5/templates (added)
-
tags/1.0.5/templates/invoice.php (added)
-
trunk/assets/admin/js/scripts.js (modified) (1 diff)
-
trunk/includes/functions.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/steadfast-api.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
steadfast-api/trunk/assets/admin/js/scripts.js
r3445113 r3452297 289 289 }, type: 'post', 290 290 291 success: function (response) { 292 console.log(response) 293 if (response.success) { 294 let success_ratio = response.data.success_ratio; 295 let errorMessage = response.data.error; 296 let current = response.data.current; 297 let limit = response.data.limit; 298 299 if (errorMessage) { 300 content = ` 301 <h2>Sorry!</h2> 302 <p>${errorMessage}</p> 303 <p><strong>Already Checked:</strong> ${current}</p> 304 <p><strong>Your Limit :</strong> ${limit}</p> 305 `; 306 } else { 307 var content = ` 308 <h2>📊 SteadFast Success Rate</h2> 309 <p><strong>📦Total Orders :</strong> ${response.data.total_parcels || 0}</p> 310 <p><strong>✅Total Delivered :</strong> ${response.data.total_delivered || 0}</p> 311 <p><strong>❌Total Cancelled:</strong> ${response.data.total_cancelled || 0}</p> 312 `; 313 } 314 315 $('#stdf-customer-info-content').html(content); 316 317 thisButton.find('span').text(success_ratio); 318 thisButton.addClass("stdf-success-ratio"); 319 $modal.show(); 320 $overlay.show(); 321 } else { 322 alert('Error: ' + response.data); 323 } 324 }, 291 success: function(response) { 292 293 294 let content = ''; 295 let success_ratio = response.data.success_ratio || '0.00%'; 296 297 if (response.data.message && response.data.message.trim().length > 0) { 298 content = ` 299 <h2>${response.data.message}</h2> 300 <p><strong>Attempts Left:</strong> ${response.data.attempts_left || 0}</p> 301 `; 302 } 303 else if (response.data.error) { 304 content = ` 305 <h2>Sorry!</h2> 306 <p>${response.data.error}</p> 307 <p><strong>Already Checked:</strong> ${response.data.current || 0}</p> 308 <p><strong>Your Limit:</strong> ${response.data.limit || 0}</p> 309 `; 310 } 311 else { 312 content = ` 313 <h2>📊 SteadFast Success Rate</h2> 314 <p><strong>📦 Total Orders:</strong> ${response.data.total_parcels || 0}</p> 315 <p><strong>✅ Total Delivered:</strong> ${response.data.total_delivered || 0}</p> 316 <p><strong>❌ Total Cancelled:</strong> ${response.data.total_cancelled || 0}</p> 317 <p><strong>📈 Success Ratio:</strong> ${success_ratio}</p> 318 `; 319 } 320 321 $('#stdf-customer-info-content').html(content); 322 thisButton.find('span').text(success_ratio); 323 thisButton.addClass("stdf-success-ratio"); 324 325 $modal.show(); 326 $overlay.show(); 327 }, 325 328 error: function () { 326 329 thisButton.html('Failed'); -
steadfast-api/trunk/includes/functions.php
r3407125 r3452297 450 450 $body = wp_remote_retrieve_body($response); 451 451 $order_info = json_decode($body, true); 452 $success_ratio = stdf_calculate_success_rate($order_info['total_parcels'],$order_info['total_delivered']); 453 update_post_meta( $order_id, 'stdf_success_ratio', $success_ratio ); 452 453 454 if (isset($order_info['status']) && (string) $order_info['status'] === '401') { 455 456 $order_info['authorization'] = $order_info['status']; 457 return $order_info; 458 } 459 460 461 $total_parcels = isset($order_info['total_parcels']) ? (int) $order_info['total_parcels'] : 0; 462 $total_delivered = isset($order_info['total_delivered']) ? (int) $order_info['total_delivered'] : 0; 463 464 $success_ratio = stdf_calculate_success_rate($total_parcels, $total_delivered); 465 466 update_post_meta($order_id, 'stdf_success_ratio', $success_ratio); 454 467 455 468 $order_info['success_ratio'] = $success_ratio; 456 457 469 458 470 return $order_info; -
steadfast-api/trunk/readme.txt
r3445113 r3452297 3 3 Donate link: https://steadfast.com.bd/ 4 4 Plugin URI: https://wordpress.org/plugins/steadfast-api/ 5 Tags: steadfast, steadfast courier, send to steadfast, steadfast api5 Tags: steadfast, steadfast courier, packly, steadfast api 6 6 Requires at least: 6.5.5 7 7 Tested up to: 6.9 8 8 Requires PHP: 8.0 9 Stable tag: 1.0. 49 Stable tag: 1.0.5 10 10 Tested up to WooCommerce: 10.3.5 11 11 Text Domain: steadfast-api … … 94 94 == Changelog == 95 95 96 = 1.0.5 = 97 * Fix css loading issue. 98 96 99 = 1.0.4 = 97 100 * Show Courier Score Check Limit Message. -
steadfast-api/trunk/steadfast-api.php
r3445113 r3452297 14 14 15 15 defined( 'ABSPATH' ) || exit; 16 defined( 'STDF_PLUGIN_URL' ) || define( 'STDF_PLUGIN_URL', WP_PLUGIN_URL . '/' . plugin_basename( dirname( __FILE__ ) ) . '/');16 defined( 'STDF_PLUGIN_URL' ) || define( 'STDF_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); 17 17 defined( 'STDF_PLUGIN_DIR' ) || define( 'STDF_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 18 18 defined( 'STDF_PLUGIN_FILE' ) || define( 'STDF_PLUGIN_FILE', plugin_basename( __FILE__ ) ); 19 defined( 'STDF_PLUGIN_VERSION' ) || define( 'STDF_PLUGIN_VERSION', '1.0.0' ); 19 defined( 'STDF_PLUGIN_VERSION' ) || define( 'STDF_PLUGIN_VERSION', '1.0.4' ); 20 20 21 21 22
Note: See TracChangeset
for help on using the changeset viewer.