Skip to content

Commit

Permalink
4.0.8 version
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivamddeveloper committed Nov 22, 2022
1 parent 647b014 commit 708aaee
Show file tree
Hide file tree
Showing 14 changed files with 1,384 additions and 1,369 deletions.
2 changes: 1 addition & 1 deletion admin/class-woo-refund-and-exchange-lite-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function wrael_admin_enqueue_scripts( $hook ) {
'wps_rma_nonce' => wp_create_nonce( 'wps_rma_ajax_seurity' ),
'wrael_admin_param_location' => admin_url( 'admin.php?page=woo_refund_and_exchange_lite_menu&wrael_tab=woo-refund-and-exchange-lite-general' ),
'check_pro_active' => esc_html( $pro_active ),
'wps_policy_already_exist' => esc_html__( 'Policy already exist', 'woo-refund-and-exchange-lite' ),
'wps_policy_already_exist' => esc_html__( 'Policy already exists', 'woo-refund-and-exchange-lite' ),
)
);
wp_enqueue_script( $this->plugin_name . 'admin-js' );
Expand Down
5 changes: 0 additions & 5 deletions assets/src/common/js/woo-refund-and-exchange-lite-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,8 @@ jQuery( document ).on( 'ready', function(){
}
}

} else {
alerthtml = '<p class="wps_order_msg_sent_notice">'+ wrael_common_param.no_file_attached +'</p><a href="" class="wps_remove_notice_msg">X</a>';
}
}
if ( order_msg_type == 'admin') {
alerthtml = '';
}
if ( msg == '' ) {
alerthtml = '<p class="wps_order_msg_sent_notice">'+ wrael_common_param.message_empty +'</p><a href="" class="wps_remove_notice_msg">X</a>';
}
Expand Down
22 changes: 14 additions & 8 deletions common/class-woo-refund-and-exchange-lite-common.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function wrael_common_enqueue_styles() {
* @since 1.0.0
*/
public function wrael_common_enqueue_scripts() {
if ( function_exists( 'wps_rma_css_and_js_load_page' ) && wps_rma_css_and_js_load_page() ) {
if ( ( function_exists( 'wps_rma_css_and_js_load_page' ) && wps_rma_css_and_js_load_page() ) || ( function_exists( 'get_current_screen' ) && 'shop_order' === get_current_screen()->id ) ) {
$pro_active = wps_rma_pro_active();
if ( get_current_user_id() > 0 ) {
$myaccount_page = get_option( 'woocommerce_myaccount_page_id' );
Expand Down Expand Up @@ -132,16 +132,22 @@ public function wps_rma_order_return_attach_files() {
$count = count( $_FILES['wps_rma_return_request_files']['tmp_name'] );
for ( $i = 0; $i < $count; $i++ ) {
if ( isset( $_FILES['wps_rma_return_request_files']['tmp_name'][ $i ] ) ) {
$directory = ABSPATH . 'wp-content/attachment';
$directory = realpath( ABSPATH . 'wp-content/attachment' );
if ( ! file_exists( $directory ) ) {
mkdir( $directory, 0755, true );
}
$file_name = isset( $_FILES['wps_rma_return_request_files']['name'][ $i ] ) ? sanitize_text_field( wp_unslash( $_FILES['wps_rma_return_request_files']['name'][ $i ] ) ) : '';
$source_path = sanitize_text_field( wp_unslash( $_FILES['wps_rma_return_request_files']['tmp_name'][ $i ] ) );
$target_path = $directory . '/' . $order_id . '-' . $file_name;

$filename[] = $order_id . '-' . $file_name;
move_uploaded_file( $source_path, $target_path );
$file_name = isset( $_FILES['wps_rma_return_request_files']['name'][ $i ] ) ? sanitize_text_field( wp_unslash( $_FILES['wps_rma_return_request_files']['name'][ $i ] ) ) : '';
$file_type = isset( $_FILES['wps_rma_return_request_files']['type'][ $i ] ) ? sanitize_text_field( wp_unslash( $_FILES['wps_rma_return_request_files']['type'][ $i ] ) ) : '';
if ( 'image/png' === $file_type || 'image/jpeg' === $file_type || 'image/jpg' === $file_type ) {
$source_path = sanitize_text_field( wp_unslash( $_FILES['wps_rma_return_request_files']['tmp_name'][ $i ] ) );
$target_path = $directory . '/' . $order_id . '-' . $file_name;
if ( false === $directory || false === realpath( $source_path ) ) {
// Traversal attempt.
return;
}
$filename[] = $order_id . '-' . $file_name;
move_uploaded_file( $source_path, $target_path );
}
}
}

Expand Down
5 changes: 1 addition & 4 deletions common/css/woo-refund-and-exchange-lite-common.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
min-width: unset;
}

.wps-rma-product__table thead th:nth-of-type(1) {
width: 80px;
}

table.wps-rma-product__table thead th:nth-of-type(2) {
min-width: 315px;
Expand Down Expand Up @@ -155,7 +152,7 @@ table.wps-rma-product__table td.product-name img {
@media screen and (max-width: 580px) {

#wps_wrma_exchange_request_form_wrapper.wps-rma-form__wrapper.wps-rma-form__wrapper,
div.wps-rma-form__wrapper.wps-rma-form__wrapper,
div.wps-rma-form__wrapper.wps-rma-form__wrapper
{
border: none;
}
Expand Down
5 changes: 0 additions & 5 deletions common/js/woo-refund-and-exchange-lite-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,8 @@ jQuery( document ).on( 'ready', function(){
}
}

} else {
alerthtml = '<p class="wps_order_msg_sent_notice">'+ wrael_common_param.no_file_attached +'</p><a href="" class="wps_remove_notice_msg">X</a>';
}
}
if ( order_msg_type == 'admin') {
alerthtml = '';
}
if ( msg == '' ) {
alerthtml = '<p class="wps_order_msg_sent_notice">'+ wrael_common_param.message_empty +'</p><a href="" class="wps_remove_notice_msg">X</a>';
}
Expand Down
2 changes: 1 addition & 1 deletion common/js/woo-refund-and-exchange-lite-common.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified languages/woo-refund-and-exchange-lite-en_US.mo
Binary file not shown.
Loading

0 comments on commit 708aaee

Please sign in to comment.