Skip to content

Commit

Permalink
Merge pull request #100 from codersaiful/2.9.0.4
Browse files Browse the repository at this point in the history
2.9.0.4
  • Loading branch information
codersaiful authored May 30, 2021
2 parents db97ddd + c51f046 commit 98c8bcd
Show file tree
Hide file tree
Showing 38 changed files with 221 additions and 299 deletions.
72 changes: 36 additions & 36 deletions admin/action-hook.php

Large diffs are not rendered by default.

27 changes: 0 additions & 27 deletions admin/ajax_table_preview.php

This file was deleted.

11 changes: 10 additions & 1 deletion admin/configuration_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,16 @@ function wpt_configuration_page(){

}else if( isset( $_POST['data'] ) && isset( $_POST['configure_submit'] ) ){
//configure_submit
$value = ( is_array( $_POST['data'] ) ? $_POST['data'] : false );
$value = false;
if( is_array( $_POST['data'] ) ){
$value = array_map(
function ($field){
//All post value is santized here using array_map
return sanitize_text_field( $field );
},$_POST['data']
);
}
// $value 's all key_value is sanitized before update on database
update_option( 'wpt_configure_options', $value );
}
$current_config_value = get_option( 'wpt_configure_options' );
Expand Down
2 changes: 1 addition & 1 deletion admin/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ function wpt_get_base64_post_meta( $post_id ){
*/
function wpt_ajax_get_post_meta_base64(){
if( isset( $_POST['post_id'] ) && ! empty( $_POST['post_id'] ) && isset( $_POST['action'] ) == 'wpt_set_post_meta' ){
$post_id = $_POST['post_id'];
$post_id = sanitize_text_field( $_POST['post_id'] );
if( ! $post_id || ! is_numeric( $post_id ) ) echo '';

echo wpt_get_base64_post_meta( $post_id );
Expand Down
38 changes: 36 additions & 2 deletions admin/tabs/basics.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,44 @@
//Helping from https://wordpress.stackexchange.com/questions/216070/wp-dropdown-categories-with-multiple-select/253403
wpt_wp_dropdown_categories( $defaults );
//***************************************/
//***************************************/
?>
<select name="basics[data][terms][<?php echo esc_attr( $term_key ); ?>][]" class="wpt_select2 wpt_query_terms ua_query_terms_<?php echo esc_attr( $term_key ); ?> ua_select" id="wpt_term_<?php echo esc_attr( $term_key ); ?>" multiple="multiple">
<?php echo $options_item; ?>
<?php
$allowed_atts = array(
'selected' => array(),
'value' => array(),

// 'align' => array(),
// 'class' => array(),
// 'type' => array(),
// 'id' => array(),
// 'dir' => array(),
// 'lang' => array(),
// 'style' => array(),
// 'xml:lang' => array(),
// 'src' => array(),
// 'alt' => array(),
// 'href' => array(),
// 'rel' => array(),
// 'rev' => array(),
// 'target' => array(),
// 'novalidate' => array(),
// 'type' => array(),
// 'value' => array(),
// 'name' => array(),
// 'tabindex' => array(),
// 'action' => array(),
// 'method' => array(),
// 'for' => array(),
// 'width' => array(),
// 'height' => array(),
// 'data' => array(),
// 'title' => array(),
);

$allowed_tags['option'] = $allowed_atts;
echo wp_kses( $options_item, $allowed_tags ); ?>
</select>

<?php
Expand Down
16 changes: 8 additions & 8 deletions admin/tabs/inc-column/column-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@
<li class="wpt_sortable_peritem <?php echo esc_attr( $enabled_class ); ?> column_keyword_<?php echo esc_attr( $keyword ); ?>">
<span title="<?php esc_attr_e( 'Move Handle', 'wpt_pro' );?>" class="handle"></span>
<div class="wpt_shortable_data">
<input placeholder="<?php echo $keyword; ?>"
name="column_array<?php echo $_device_name; ?>[<?php echo $keyword; ?>]"
<input placeholder="<?php echo esc_attr( $keyword ); ?>"
name="column_array<?php echo esc_attr( $_device_name ); ?>[<?php echo esc_attr( $keyword ); ?>]"
data-column_title="<?php echo esc_attr__( $updated_title,'wpt_pro' ); ?>"
data-keyword="<?php echo esc_attr( $keyword ); ?>"
class="colum_data_input <?php echo esc_attr( $keyword ); ?>"
type="text"
title="<?php echo esc_attr__( 'Click for Expand/Collapse. Edit your Column Title here.', 'wpt_pro' ); ?>"
value="<?php echo htmlentities( $updated_title ); ?>" <?php echo $readOnly; ?>>
value="<?php echo htmlentities( $updated_title ); ?>" <?php echo esc_attr( $readOnly ); ?>>

<?php
//Type Maintenance
$type = isset( $column_settings[$keyword]['type'] ) && !empty( $column_settings[$keyword]['type'] ) ? $column_settings[$keyword]['type'] : 'default';
$type_name = isset( $column_settings[$keyword]['type_name'] ) && !empty( $column_settings[$keyword]['type_name'] ) ? $column_settings[$keyword]['type_name'] : __( 'Default', 'wpt_pro' );
?>
<input type="hidden" name="column_settings<?php echo $_device_name; ?>[<?php echo esc_attr( $keyword ); ?>][type]" value="<?php echo esc_attr( $type ); ?>">
<input type="hidden" name="column_settings<?php echo $_device_name; ?>[<?php echo esc_attr( $keyword ); ?>][type_name]" value="<?php echo esc_attr( $type_name ); ?>">
<input type="hidden" name="column_settings<?php echo esc_attr( $_device_name ); ?>[<?php echo esc_attr( $keyword ); ?>][type]" value="<?php echo esc_attr( $type ); ?>">
<input type="hidden" name="column_settings<?php echo esc_attr( $_device_name ); ?>[<?php echo esc_attr( $keyword ); ?>][type_name]" value="<?php echo esc_attr( $type_name ); ?>">

<span class="wpt_colunm_type">
<?php if( !empty( $type ) && $type !== 'default'){ ?>
Expand Down Expand Up @@ -97,12 +97,12 @@ class="colum_data_input <?php echo esc_attr( $keyword ); ?>"
<span class="wpt_column_arrow wpt_arrow_top" data-target="prev" data-keyword="<?php echo esc_attr( $keyword ); ?>">&uArr;</span>
<span class="wpt_column_arrow wpt_arrow_down" data-target="next" data-keyword="<?php echo esc_attr( $keyword ); ?>">&dArr;</span>
<span title="<?php esc_attr_e( 'Move Handle', 'wpt_pro' );?>" class="handle checkbox_handle">
<input name="enabled_column_array<?php echo $_device_name; ?>[<?php echo $keyword; ?>]"
value="<?php echo $keyword; ?>"
<input name="enabled_column_array<?php echo esc_attr( $_device_name ); ?>[<?php echo esc_attr( $keyword ); ?>]"
value="<?php echo esc_attr( $keyword ); ?>"
title="<?php echo esc_html__( 'Active Inactive Column', 'wpt_pro' );?>"
class="checkbox_handle_input <?php echo esc_attr( $enabled_class ); ?>"
type="checkbox"
data-column_keyword="<?php echo esc_attr( $keyword ); ?>" <?php echo $checked_attribute; ?>>
data-column_keyword="<?php echo esc_attr( $keyword ); ?>" <?php echo esc_attr( $checked_attribute ); ?>>
</span>
</li>
<?php
Expand Down
6 changes: 3 additions & 3 deletions admin/tabs/mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@
$enabled_class = $checked_attribute = '';
}
?>
<li class="hide_on_mobile_permits <?php echo $enabled_class; ?> column_keyword_<?php echo esc_attr( $keyword ); ?>">
<li class="hide_on_mobile_permits <?php echo esc_attr( $enabled_class ); ?> column_keyword_<?php echo esc_attr( $keyword ); ?>">

<div class="wpt_mobile_hide_keyword">
<b data-column_title="<?php echo esc_attr( $title ); ?>" data-keyword="<?php echo esc_attr( $keyword ); ?>" class="mobile_issue_field <?php echo esc_attr( $keyword ); ?>" type="text" ><?php echo $title; ?></b>
<b data-column_title="<?php echo esc_attr( $title ); ?>" data-keyword="<?php echo esc_attr( $keyword ); ?>" class="mobile_issue_field <?php echo esc_attr( $keyword ); ?>" type="text" ><?php echo esc_html( $title ); ?></b>
</div>
<span title="<?php echo esc_attr( $keyword ); ?>" title="<?php esc_attr_e( 'Move Handle', 'wpt_pro' ); ?>" class="handle checkbox_handle">
<input name="mobile[disable][]" value="<?php echo esc_attr( $keyword ); ?>" title="<?php esc_attr_e( 'Active Inactive Column', 'wpt_pro' ); ?>" class="checkbox_handle_input <?php echo $enabled_class; ?>" type="checkbox" data-column_keyword="<?php echo esc_attr( $keyword ); ?>" <?php echo $checked_attribute; ?>>
<input name="mobile[disable][]" value="<?php echo esc_attr( $keyword ); ?>" title="<?php esc_attr_e( 'Active Inactive Column', 'wpt_pro' ); ?>" class="checkbox_handle_input <?php echo esc_attr( $enabled_class ); ?>" type="checkbox" data-column_keyword="<?php echo esc_attr( $keyword ); ?>" <?php echo esc_attr( $checked_attribute ); ?>>
</span>
</li>
<?php
Expand Down
12 changes: 6 additions & 6 deletions admin/tabs/responsive.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@
$enabled_class = $checked_attribute = '';
}
?>
<li class="hide_on_mobile_permits <?php echo $enabled_class; ?> column_keyword_<?php echo esc_attr( $keyword ); ?>">
<li class="hide_on_mobile_permits <?php echo esc_attr( $enabled_class ); ?> column_keyword_<?php echo esc_attr( $keyword ); ?>">

<div class="wpt_mobile_hide_keyword">
<b data-column_title="<?php echo esc_attr( $title ); ?>" data-keyword="<?php echo esc_attr( $keyword ); ?>" class="mobile_issue_field <?php echo esc_attr( $keyword ); ?>" type="text" ><?php echo $title; ?></b>
<b data-column_title="<?php echo esc_attr( $title ); ?>" data-keyword="<?php echo esc_attr( $keyword ); ?>" class="mobile_issue_field <?php echo esc_attr( $keyword ); ?>" type="text" ><?php echo esc_html( $title ); ?></b>
</div>
<span title="<?php echo esc_attr( $keyword ); ?>" title="<?php esc_attr_e( 'Move Handle', 'wpt_pro' ); ?>" class="handle checkbox_handle">
<input name="mobile[disable][]" value="<?php echo esc_attr( $keyword ); ?>" title="<?php esc_attr_e( 'Active Inactive Column', 'wpt_pro' ); ?>" class="checkbox_handle_input <?php echo $enabled_class; ?>" type="checkbox" data-column_keyword="<?php echo esc_attr( $keyword ); ?>" <?php echo $checked_attribute; ?>>
<input name="mobile[disable][]" value="<?php echo esc_attr( $keyword ); ?>" title="<?php esc_attr_e( 'Active Inactive Column', 'wpt_pro' ); ?>" class="checkbox_handle_input <?php echo esc_attr( $enabled_class ); ?>" type="checkbox" data-column_keyword="<?php echo esc_attr( $keyword ); ?>" <?php echo esc_attr( $checked_attribute ); ?>>
</span>
</li>
<?php
Expand Down Expand Up @@ -136,7 +136,7 @@
<td class="responsive td_<?php echo esc_attr( $devc_key ); ?>">
<div class="wpt_responsive_wraper">
<div class="wpt_res_wrapper_inside ultraaddons-panel">
<h1 class="with-background dark-background"><?php echo $devc_name; ?></h1>
<h1 class="with-background dark-background"><?php echo esc_html( $devc_name ); ?></h1>
<div class="wpt_responsive_each_wraper responsive_wrapper_<?php echo esc_attr( $devc_key ); ?>">
<?php
$r_selected_column = isset( $meta_responsive[$devc_key] ) && is_array( $meta_responsive[$devc_key] ) ? $meta_responsive[$devc_key] : false;
Expand Down Expand Up @@ -170,8 +170,8 @@
id="<?php echo esc_attr( $id ); ?>"
name="responsive[<?php echo esc_attr( $devc_key ); ?>][<?php echo esc_attr( $key ); ?>]"
value="<?php echo esc_attr( $key ); ?>"
<?php echo $selected; ?>>
<label for="<?php echo esc_attr( $id ); ?>"><?php echo $value; ?> - <small>(<?php echo $key; ?>)</small></label>
<?php echo esc_attr( $selected ); ?>>
<label for="<?php echo esc_attr( $id ); ?>"><?php echo esc_html( $value ); ?> - <small>(<?php echo esc_html( $key ); ?>)</small></label>
</div>
<?php
}
Expand Down
4 changes: 2 additions & 2 deletions admin/tabs/search_n_filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@
<table class="ultraaddons-table wpt_snf_on_off ">
<tr>
<th>
<label class="wpt_label" for="filter_for_<?php echo $per_keyword; ?>"><?php echo sprintf( esc_html__('Choose [%s] %s (For Advanced Searchbox Filter) %s','wpt_pro'),$per_keyword,'<small>','</small>');?></label>
<label class="wpt_label" for="filter_for_<?php echo esc_attr( $per_keyword ); ?>"><?php echo sprintf( esc_html__('Choose [%s] %s (For Advanced Searchbox Filter) %s','wpt_pro'),$per_keyword,'<small>','</small>');?></label>
</th>
<td>
<select name="search_n_filter[<?php echo $per_keyword; ?>][]" data-name="<?php echo $per_keyword; ?>" id="filter_for_<?php echo $per_keyword; ?>" class="wpt_fullwidth wpt_data_filed_atts wpt_select2 ua_input" multiple>
<select name="search_n_filter[<?php echo esc_attr( $per_keyword ); ?>][]" data-name="<?php echo esc_attr( $per_keyword ); ?>" id="filter_for_<?php echo esc_attr( $per_keyword ); ?>" class="wpt_fullwidth wpt_data_filed_atts wpt_select2 ua_input" multiple>
<?php
foreach ( $tax_object as $tax_item ) {
$tax_array_key = $per_keyword;
Expand Down
8 changes: 7 additions & 1 deletion assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -1065,10 +1065,16 @@ body.wpt_admin_body .select2-container--default .select2-selection--multiple .se
border: 1px solid white;
border-radius: 4px;
margin: 5px 5px 3px 2px;
padding: 4px 5px;
padding: 1px 5px 4px 22px;
color: black;
box-shadow: 1px 1px 3px 0px #0000003b;
}

body.wpt_admin_body .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
margin-top: 3px;
}


body.wpt_admin_body .ultraaddons-panel p {

color: #888;
Expand Down
34 changes: 14 additions & 20 deletions assets/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,20 @@
return false;
}

var ajax_url,ajax_url_additional = '/wp-admin/admin-ajax.php';
var site_url = $('div.wpt_product_table_wrapper').data('site_url');
ajax_url = site_url + ajax_url_additional;

var plugin_url = WPT_DATA.plugin_url;
var include_url = WPT_DATA.include_url;
var content_url = WPT_DATA.content_url;

var ajax_url = WPT_DATA.ajax_url;
/*
if ( typeof woocommerce_params === 'undefined' ){
var site_url = $('div.wpt_product_table_wrapper').data('site_url');
ajax_url = site_url + ajax_url_additional;
//woocommerce_params //wc_add_to_cart_params
}else{
ajax_url = woocommerce_params.ajax_url;
}
*/
console.log(WPT_DATA,ajax_url);//Only for Developer
if( ajax_url === 'undefined' + ajax_url_additional ){
var site_url = WPT_DATA.site_url;

console.log(WPT_DATA);//Only for Developer
if( ajax_url === 'undefined' ){
console.log( 'WOO PRODUCT TABLE is not Available to this page \nOR:::SORRY!!!!: woocommerce_params is Undefine also ajax_url also undefined. So ajax will not work not. Contact with [email protected]' );
return false;
}

/**
* Pagination
* @type Objectt
Expand Down Expand Up @@ -169,11 +163,11 @@
$('table.wpt_product_table td select').trigger('change');
function fixAfterAjaxLoad() {
$('table.wpt_product_table td select').trigger('change');
//$.getScript(site_url + "/wp-includes/js/mediaelement/mediaelement-and-player.min.js");
//$.getScript(site_url + "/wp-practice/wp-includes/js/mediaelement/mediaelement-migrate.min.js");
$.getScript(site_url + "/wp-includes/js/mediaelement/wp-mediaelement.min.js");
$.getScript(site_url + "/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart-variation.min.js");
$.getScript(site_url + "/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart-variation.js");
//$.getScript(include_url + "/js/mediaelement/mediaelement-and-player.min.js");
//$.getScript(include_url + "/js/mediaelement/mediaelement-migrate.min.js");
$.getScript(include_url + "/js/mediaelement/wp-mediaelement.min.js");
$.getScript(plugin_url + "/woocommerce/assets/js/frontend/add-to-cart-variation.min.js");
$.getScript(plugin_url + "/woocommerce/assets/js/frontend/add-to-cart-variation.js");
}


Expand Down
2 changes: 1 addition & 1 deletion includes/ajax_add_to_cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ function wpt_variation_image_load(){
$variation_id = isset( $_POST['variation_id'] ) ? $_POST['variation_id'] : false;
if( $variation_id ){
$img_src = wp_get_attachment_image_src( get_post_thumbnail_id( $variation_id ), 'full', false );
echo $img_src[0] . ' ' . $img_src[1];
echo esc_url( $img_src[0] ) . ' ' . esc_html( $img_src[1] );
}

die();
Expand Down
31 changes: 3 additions & 28 deletions includes/enqueue.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ function wpt_enqueue(){
'ajaxurl' => $ajax_url,
'ajax_url' => $ajax_url,
'site_url' => site_url(),
'plugin_url' => plugins_url(),
'content_url' => content_url(),
'include_url' => includes_url(),
'checkout_url' => wc_get_checkout_url(),
'cart_url' => wc_get_cart_url(),
'priceFormat' => wpt_price_formatter(),
Expand All @@ -66,31 +69,3 @@ function wpt_enqueue(){
}
}
add_action( 'wp_enqueue_scripts', 'wpt_enqueue', 99 );

add_action('wp_head',function(){
return;
?>

<script>
document.cookie = 'window_widths='+window.innerWidth+'; path=/';
(function($) {
'use strict';
$(document).ready(function() {
var xhttp = new XMLHttpRequest();
console.log(screen.width,screen.height,xhttp);
xhttp.open("POST", 'http://wpp.cm/', true);
xhttp.send("screensize=",screen.width,screen.height);
});
})(jQuery);


/*
* document.cookie = 'window_width='+window.innerWidth+'; path=/';
var xhttp = new XMLHttpRequest();
console.log(screen.width,screen.height,xhttp);
xhttp.open("POST", 'http://wpp.cm/', true);
xhttp.send("screensize=",screen.width,screen.height);
*/
</script>
<?php
});
Loading

0 comments on commit 98c8bcd

Please sign in to comment.