Skip to content

Commit

Permalink
text doamin added and security updated
Browse files Browse the repository at this point in the history
  • Loading branch information
hmbashar committed Apr 5, 2024
1 parent 5299c5d commit ae0f1b3
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 38 deletions.
Binary file added .DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions cbwct.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php
/*
Plugin Name: Order Tracker for WooCommerce
Plugin URI: https://wordpress.org/plugins/alishop-wc-order-tracker
Plugin URI: https://wordpress.org/plugins/wc-order-tracker/
Description: Your customer can track his/her order on your WooCommerce website easily, woocommerce order tracking system with ajax
Author: Md Abul Bashar
Version: 1.2.1
Version: 1.2.2
Author URI: https://facebook.com/hmbashar
Text Domain: cbwct
Expand Down
21 changes: 10 additions & 11 deletions inc/custom.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,15 @@ public static function cbwct_wcps($data, $status, $value){
}
// Progress bar text for invalid order
public static function order_text($status){

if('cancelled' === $status) {
printf('The order has been %s, Please contact support', ucwords($status));
}
elseif('refunded' === $status) {
printf('The order has been %s, Please contact support', ucwords($status));
}
elseif('failed' === $status) {
printf('The order has been %s, Please contact support', ucwords($status));

if ('cancelled' === $status) {
printf(esc_html__('The order has been %s, Please contact support', 'cbwct'), esc_html(ucwords($status)));
} elseif ('refunded' === $status) {
printf(esc_html__('The order has been %s, Please contact support', 'cbwct'), esc_html(ucwords($status)));
} elseif ('failed' === $status) {
printf(esc_html__('The order has been %s, Please contact support', 'cbwct'), esc_html(ucwords($status)));
}


}

Expand Down Expand Up @@ -97,7 +96,7 @@ public static function selected_gateway_name($selected) {
echo $payment_method_title;
}else {

echo 'No exists';
echo esc_html__('No exists', 'cbwct');
}

}
Expand Down Expand Up @@ -126,7 +125,7 @@ function cbwct_wc_order_tracking_result() {

require_once(CBWCT_TRACKER_PATH . '/inc/process.php');
}else {
echo 'Invalid User';
echo esc_html__('Invalid User', 'cbwct');
}

exit;
Expand Down
10 changes: 5 additions & 5 deletions inc/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,27 @@

// Tracking Heading
function cbwct_order_tracking_heading(){
echo __('Order Tracker', 'cbwet');
echo esc_html__('Order Tracker', 'cbwet');
}
add_filter( 'cbwct_order_tracking_heading', 'cbwct_order_tracking_heading');

// Order Number
function cbwct_field_text_order_number(){
echo __('Order Number', 'cbwet');
echo esc_html__('Order Number', 'cbwet');
}
add_filter( 'cbwct_field_text_order_number', 'cbwct_field_text_order_number');


// Phone Number
function cbwct_field_text_phone_number(){
echo __('Phone Number', 'cbwet');
echo esc_html__('Phone Number', 'cbwet');
}
add_filter( 'cbwct_field_text_phone_number', 'cbwct_field_text_phone_number');


// Submit Button text
function cbwct_submit_button_text(){
echo __('Track Order', 'cbwet');
echo esc_html__('Track Order', 'cbwet');
}
add_filter( 'cbwct_submit_button_text', 'cbwct_submit_button_text');

Expand All @@ -55,7 +55,7 @@ function cbwct_shipped_prograss_percent() {

function cbwct_order_is_not_found($value, $order_number) {

$order_not_found = sprintf('%s Oops! Sorry! %s order is not found! please check order or phone number %s', '<h5 class="cbwct_notice">', $order_number, '</h5>');
$order_not_found = sprintf('%s Oops! Sorry! %s order is not found! please check order or phone number %s', '<h5 class="cbwct_notice">', esc_attr($order_number), '</h5>');

return $order_not_found;
}
Expand Down
6 changes: 3 additions & 3 deletions inc/process.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@


if(empty($get_order_number) || empty($get_phone_number)) { // search field empty check
apply_filters( 'cbwct_order_number_phone_number_required', 'Order Number & Phone field is required' );
apply_filters( 'cbwct_order_number_phone_number_required', esc_html__('Order Number & Phone field is required', 'cbwct' ));
}else {

if(!isset($get_order_number)) { //order number empty
$order = NULL;

}else {
if(CBWCT_ORDER_TRACKER::order_number_exists($get_order_number) == false) {
echo apply_filters( 'cbwct_order_is_not_found', 'order is not found!', $get_order_number );
echo apply_filters( 'cbwct_order_is_not_found', esc_html__('order is not found!', 'cbwct') , $get_order_number );
}else {
$order = wc_get_order( $get_order_number ); // set order number

Expand Down Expand Up @@ -49,7 +49,7 @@
require_once( CBWCT_TRACKER_PATH . '/inc/templates/result.php');
}
}else {
echo apply_filters( 'cbwct_order_is_not_found', 'order is not found!', $get_order_number );
echo apply_filters( 'cbwct_order_is_not_found', esc_html__('order is not found!', 'cbwct'), $get_order_number );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion inc/shortcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function cbwct_wc_shortcode($attrs, $content = NULL) {
ob_start();
extract(shortcode_atts(array(

'post_type' =>'post'
'post_type' =>'shop_order'

), $attrs));

Expand Down
8 changes: 4 additions & 4 deletions inc/template-markup.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,24 @@
<div class="cbwct-tracking-container">
<div class="cbwct-tracking">
<div class="cbwct-tracking-title">
<h2><?php apply_filters( 'cbwct_order_tracking_heading', __('Order Tracker', 'cbwet') );?></h2>
<h2><?php apply_filters( 'cbwct_order_tracking_heading', esc_html__('Order Tracker', 'cbwet') );?></h2>
</div>

<!--Tracking Form -->
<div class="cbwct-tracking-from">
<form method="POST">
<div class="cbwct-tracking-form-area">
<div class="cbwct-tracking-form-field">
<label for="order_number"><?php apply_filters('cbwct_field_text_order_number', __('Order Number', 'cbwet'));?></label>
<label for="order_number"><?php apply_filters('cbwct_field_text_order_number', esc_html__('Order Number', 'cbwet'));?></label>
<input type="text" id="order_number" name="order_number" placeholder="Order Number...">
</div>
<div class="cbwct-tracking-form-field">
<label for="phone"><?php apply_filters('cbwct_field_text_phone_number', __('Phone Number', 'cbwet'));?></label>
<label for="phone"><?php apply_filters('cbwct_field_text_phone_number', esc_html__('Phone Number', 'cbwet'));?></label>
<input type="text" id="phone" name="phone_number" placeholder="Phone Number...">
</div>
<div class="cbwct-tracking-form-field cbwct-traking-form-submit">
<?php wp_nonce_field('cbwct_nonce_data'); ?>
<input type="submit" value="<?php apply_filters('cbwct_submit_button_text', __('Track Order', 'cbwet'));?>">
<input type="submit" value="<?php apply_filters('cbwct_submit_button_text', esc_html__('Track Order', 'cbwet'));?>">
</div>
</div>
</form>
Expand Down
24 changes: 12 additions & 12 deletions inc/templates/result.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
<div class="cbwct-tracking-list">
<table>
<tr>
<td>Order Number:</td>
<td><?php echo esc_html__('Order Number', 'cbwct'); ?></td>
<td><?php echo esc_html($order->get_id()); ?></td>
</tr>
<tr>
<td>Order Date</td>
<td><?php echo esc_html__('Order Date', 'cbwct'); ?></td>
<td><?php echo esc_html($order_data['date_created']->date('d-M-y @ h:i:s A')); ?></td>
</tr>
<tr>
<td>Order Status</td>
<td><?php echo esc_html__('Order Status', 'cbwct'); ?></td>
<td><?php echo esc_html(ucwords($order->get_status())); ?></td>
</tr>
<tr>
<td>Last Update</td>
<td><?php echo esc_html__('Last Update', 'cbwct'); ?></td>
<td><?php echo esc_html($order_data['date_modified']->date('d-M-y @ h:i:s A')); ?></td>
</tr>

<tr>
<td>Product:</td>
<td><?php echo esc_html__('Products', 'cbwct'); ?></td>
<td>
<ul>
<?php
Expand All @@ -42,39 +42,39 @@
</tr>

<tr>
<td>Customer Name:</td>
<td><?php echo esc_html__('Customer Name: ', 'cbwct'); ?>
<?php if(!empty($order_data['shipping']['first_name'])) : ?>
<td><?php echo esc_html($order_data['shipping']['first_name']); ?> <?php echo esc_html($order_data['shipping']['last_name']); ?></td>
<?php else : ?>
<td><?php echo esc_html($order_data['billing']['first_name']); ?> <?php echo esc_html($order_data['billing']['last_name']); ?></td>
<?php endif; ?>
</tr>
<tr>
<td>Phone:</td>
<td><?Php echo esc_html__('Customer Phone:', 'cbwct'); ?></td>
<?php if(!empty($order_data['shipping']['phone'])) : ?>
<td><?php echo esc_html($order_data['shipping']['phone']); ?></td>
<?php else : ?>
<td><?php echo esc_html($order_data['billing']['phone']); ?></td>
<?php endif; ?>
</tr>
<tr>
<td>Customer Number:</td>
<td><?php echo esc_html__('Customer Number:', 'cbwct'); ?></td>
<td><?php echo esc_html($order_data['customer_id']); ?></td>
</tr>
<tr>
<td>Customer Note:</td>
<td><?php echo esc_html__('Customer Note:', 'cbwct'); ?></td>
<td><?php echo esc_html($order->get_customer_note()); ?></td>
</tr>
<tr>
<td>Delivery Method</td>
<td><?php echo esc_html__('Delivery Method', 'cbwct'); ?></td>
<td><?php echo esc_html($order->get_shipping_method()); ?></td>
</tr>
<tr>
<td>Payment Method</td>
<td><?php echo esc_html__('Payment Method', 'cbwct'); ?></td>
<td><?php echo esc_html(CBWCT_ORDER_TRACKER::selected_gateway_name($order->get_payment_method())); ?></td>
</tr>
<tr>
<td>Total Amount</td>
<td><?php echo esc_html__('Total Amount', 'cbwct'); ?></td>
<td><?php echo esc_html(wc_format_decimal($order->get_total(), 2)); ?></td>
</tr>
</table>
Expand Down

0 comments on commit ae0f1b3

Please sign in to comment.