Version Description
- 2020-07-01 add - added layouts library.
Download this release
Release Info
Developer | pickplugins |
Plugin | Woocommerce Products Slider |
Version | 1.13.13 |
Comparing to | |
See all releases |
Code changes from version 1.13.12 to 1.13.13
- assets/admin/js/scripts-layouts.js +42 -0
- includes/class-metabox-wcps-layout-hook.php +2 -1
- includes/class-settings.php +0 -5
- includes/functions-layout-api.php +110 -0
- includes/menu/import-layouts.php +425 -39
- readme.txt +4 -1
- woocommerce-products-slider.php +15 -3
assets/admin/js/scripts-layouts.js
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($){
|
2 |
+
|
3 |
+
$(document).on('click','.import-layout',function(){
|
4 |
+
_this = this;
|
5 |
+
post_id = $(this).attr('post_id');
|
6 |
+
|
7 |
+
$(_this).addClass('updating-message');
|
8 |
+
|
9 |
+
$.ajax({
|
10 |
+
type: 'POST',
|
11 |
+
context: _this,
|
12 |
+
url:wcps_ajax.wcps_ajaxurl,
|
13 |
+
data: {
|
14 |
+
"action" : "wcps_ajax_fetch_block_hub_by_id",
|
15 |
+
"wcps_ajax_nonce" : wcps_ajax.ajax_nonce,
|
16 |
+
"post_id" : post_id,
|
17 |
+
},
|
18 |
+
success: function( response ) {
|
19 |
+
var data = JSON.parse( response );
|
20 |
+
post_data = data['post_data'];
|
21 |
+
download_count = data['download_count'];
|
22 |
+
is_saved = data['is_saved'];
|
23 |
+
|
24 |
+
console.log(is_saved);
|
25 |
+
|
26 |
+
if(is_saved == 'yes'){
|
27 |
+
$(this).addClass('saved');
|
28 |
+
$(this).text('Saved');
|
29 |
+
}else{
|
30 |
+
$(this).addClass('saved');
|
31 |
+
$(this).text('Not Saved');
|
32 |
+
}
|
33 |
+
|
34 |
+
|
35 |
+
|
36 |
+
$(_this).removeClass('updating-message');
|
37 |
+
}
|
38 |
+
});
|
39 |
+
|
40 |
+
})
|
41 |
+
|
42 |
+
});
|
includes/class-metabox-wcps-layout-hook.php
CHANGED
@@ -20,6 +20,7 @@ if(!function_exists('wcps_layout_metabox_content_custom_scripts')){
|
|
20 |
|
21 |
|
22 |
|
|
|
23 |
?>
|
24 |
<div class="section">
|
25 |
<div class="section-title"><?php echo __('Custom scripts', 'woocommerce-products-slider'); ?></div>
|
@@ -98,7 +99,7 @@ if(!function_exists('wcps_layout_metabox_content_layout_builder')){
|
|
98 |
|
99 |
$layout_elements_data = get_post_meta($post_id,'layout_elements_data', true);
|
100 |
|
101 |
-
|
102 |
|
103 |
?>
|
104 |
<div class="section">
|
20 |
|
21 |
|
22 |
|
23 |
+
|
24 |
?>
|
25 |
<div class="section">
|
26 |
<div class="section-title"><?php echo __('Custom scripts', 'woocommerce-products-slider'); ?></div>
|
99 |
|
100 |
$layout_elements_data = get_post_meta($post_id,'layout_elements_data', true);
|
101 |
|
102 |
+
//echo '<pre>'.var_export($layout_elements_data, true).'</pre>';
|
103 |
|
104 |
?>
|
105 |
<div class="section">
|
includes/class-settings.php
CHANGED
@@ -16,15 +16,10 @@ class wcps_class_settings{
|
|
16 |
|
17 |
$wcps_plugin_info = get_option('wcps_plugin_info');
|
18 |
$wcps_upgrade = isset($wcps_plugin_info['wcps_upgrade']) ? $wcps_plugin_info['wcps_upgrade'] : '';
|
19 |
-
$import_layouts = isset($wcps_plugin_info['import_layouts']) ? $wcps_plugin_info['import_layouts'] : '';
|
20 |
|
21 |
add_submenu_page( 'edit.php?post_type=wcps', __( 'Settings', 'woocommerce-products-slider' ), __( 'Settings', 'woocommerce-products-slider' ), 'manage_options', 'settings', array( $this, 'settings' ) );
|
22 |
-
|
23 |
-
if($import_layouts != 'done')
|
24 |
add_submenu_page( 'edit.php?post_type=wcps', __( 'Import layouts', 'woocommerce-products-slider' ), __( 'Import layouts', 'woocommerce-products-slider' ), 'manage_options', 'import_layouts', array( $this, 'import_layouts' ) );
|
25 |
|
26 |
-
|
27 |
-
|
28 |
if($wcps_upgrade != 'done')
|
29 |
add_submenu_page( 'edit.php?post_type=wcps', __( 'Upgrade status', 'woocommerce-products-slider' ), __( 'Upgrade status', 'woocommerce-products-slider' ), 'manage_options', 'upgrade_status', array( $this, 'upgrade_status' ) );
|
30 |
|
16 |
|
17 |
$wcps_plugin_info = get_option('wcps_plugin_info');
|
18 |
$wcps_upgrade = isset($wcps_plugin_info['wcps_upgrade']) ? $wcps_plugin_info['wcps_upgrade'] : '';
|
|
|
19 |
|
20 |
add_submenu_page( 'edit.php?post_type=wcps', __( 'Settings', 'woocommerce-products-slider' ), __( 'Settings', 'woocommerce-products-slider' ), 'manage_options', 'settings', array( $this, 'settings' ) );
|
|
|
|
|
21 |
add_submenu_page( 'edit.php?post_type=wcps', __( 'Import layouts', 'woocommerce-products-slider' ), __( 'Import layouts', 'woocommerce-products-slider' ), 'manage_options', 'import_layouts', array( $this, 'import_layouts' ) );
|
22 |
|
|
|
|
|
23 |
if($wcps_upgrade != 'done')
|
24 |
add_submenu_page( 'edit.php?post_type=wcps', __( 'Upgrade status', 'woocommerce-products-slider' ), __( 'Upgrade status', 'woocommerce-products-slider' ), 'manage_options', 'upgrade_status', array( $this, 'upgrade_status' ) );
|
25 |
|
includes/functions-layout-api.php
ADDED
@@ -0,0 +1,110 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
|
5 |
+
|
6 |
+
|
7 |
+
/*
|
8 |
+
* Ajax Function to fetch block from http://wcps.com/ server
|
9 |
+
*
|
10 |
+
* */
|
11 |
+
function wcps_ajax_fetch_block_hub_by_id(){
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
+
check_ajax_referer( 'wcps_ajax_nonce', 'wcps_ajax_nonce' );
|
16 |
+
|
17 |
+
if(!current_user_can('manage_options')) return;
|
18 |
+
|
19 |
+
|
20 |
+
$responses = array();
|
21 |
+
|
22 |
+
$post_id = isset($_POST['post_id']) ? sanitize_text_field($_POST['post_id']) : 0;
|
23 |
+
|
24 |
+
$wcps_settings = get_option('wcps_settings');
|
25 |
+
|
26 |
+
$license_key = isset($wcps_settings['license_key']) ? $wcps_settings['license_key'] : '';
|
27 |
+
|
28 |
+
$html = '';
|
29 |
+
$api_params = array(
|
30 |
+
'block_hub_remote_action' => 'blockSearchByID',
|
31 |
+
'post_id' => $post_id,
|
32 |
+
'license_key' => $license_key,
|
33 |
+
|
34 |
+
);
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
|
39 |
+
// Send query to the license manager server
|
40 |
+
$server_response = wp_remote_get(add_query_arg($api_params, wcps_server_url), array('timeout' => 20, 'sslverify' => false));
|
41 |
+
|
42 |
+
|
43 |
+
/*
|
44 |
+
* Check is there any server error occurred
|
45 |
+
*
|
46 |
+
* */
|
47 |
+
if (is_wp_error($server_response)){
|
48 |
+
$responses['error'] = __('There is a server error', 'wp-block-hub');
|
49 |
+
}
|
50 |
+
else{
|
51 |
+
|
52 |
+
$response_data = unserialize(wp_remote_retrieve_body($server_response));
|
53 |
+
|
54 |
+
//$response_data = json_decode($response_data);
|
55 |
+
|
56 |
+
$post_title = isset($response_data['post_title']) ? ($response_data['post_title']) : '';
|
57 |
+
$post_id = isset($response_data['post_id']) ? ($response_data['post_id']) : '';
|
58 |
+
|
59 |
+
|
60 |
+
$layout_elements_data = isset($response_data['layout_elements_data']) ? ($response_data['layout_elements_data']) : array();
|
61 |
+
$custom_scripts = isset($response_data['custom_scripts']) ? ($response_data['custom_scripts']) : array();
|
62 |
+
$layout_options = isset($response_data['layout_options']) ? ($response_data['layout_options']) : array();
|
63 |
+
$post_found = isset($response_data['post_found']) ? ($response_data['post_found']) : 'no';
|
64 |
+
|
65 |
+
|
66 |
+
//error_log(serialize($layout_elements_data));
|
67 |
+
|
68 |
+
|
69 |
+
// $post_found = isset($response_data->post_found) ? sanitize_text_field($response_data->post_found) : 'no';
|
70 |
+
|
71 |
+
if($post_found == 'yes'){
|
72 |
+
// Create post object
|
73 |
+
$my_post = array(
|
74 |
+
'post_title' => $post_title,
|
75 |
+
'post_status' => 'publish',
|
76 |
+
'post_author' => 1,
|
77 |
+
'post_type' => 'wcps_layout',
|
78 |
+
);
|
79 |
+
//
|
80 |
+
// // Insert the post into the database
|
81 |
+
$new_post_id = wp_insert_post( $my_post );
|
82 |
+
//
|
83 |
+
update_post_meta($new_post_id, 'layout_options', $layout_options);
|
84 |
+
update_post_meta($new_post_id, 'layout_elements_data', $layout_elements_data);
|
85 |
+
update_post_meta($new_post_id, 'custom_scripts', $custom_scripts);
|
86 |
+
|
87 |
+
|
88 |
+
$responses['is_saved'] = 'yes';
|
89 |
+
//$responses['post_title'] = $post_title;
|
90 |
+
$responses['post_id'] = $post_id;
|
91 |
+
$responses['response_data'] = $response_data;
|
92 |
+
}else{
|
93 |
+
$responses['is_saved'] = 'no';
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
+
|
99 |
+
|
100 |
+
|
101 |
+
}
|
102 |
+
|
103 |
+
|
104 |
+
echo json_encode( $responses );
|
105 |
+
die();
|
106 |
+
}
|
107 |
+
|
108 |
+
|
109 |
+
add_action('wp_ajax_wcps_ajax_fetch_block_hub_by_id', 'wcps_ajax_fetch_block_hub_by_id');
|
110 |
+
//add_action('wp_ajax_nopriv_wcps_ajax_fetch_block_hub_by_id', 'wcps_ajax_fetch_block_hub_by_id');
|
includes/menu/import-layouts.php
CHANGED
@@ -1,88 +1,474 @@
|
|
1 |
-
<?php
|
2 |
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
|
4 |
-
|
5 |
|
6 |
-
|
|
|
|
|
7 |
|
8 |
-
$
|
|
|
9 |
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
?>
|
14 |
<div class="wrap">
|
15 |
-
|
|
|
|
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
-
<form method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
|
19 |
-
<input type="hidden" name="wcps_hidden" value="Y">
|
20 |
<?php
|
21 |
-
if(!empty($_POST['wcps_hidden'])){
|
22 |
-
$nonce = sanitize_text_field($_POST['_wpnonce']);
|
23 |
-
if(wp_verify_nonce( $nonce, 'wcps_nonce' ) && $_POST['wcps_hidden'] == 'Y') {
|
24 |
-
//do_action('wcps_settings_save');
|
25 |
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
28 |
|
29 |
-
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
|
37 |
|
38 |
-
if (is_plugin_active('woocommerce-products-slider-pro/woocommerce-products-slider-pro.php')){
|
39 |
-
$layouts_plugin_url = wcps_pro_plugin_url;
|
40 |
-
}else{
|
41 |
-
$layouts_plugin_url = wcps_plugin_url;
|
42 |
}
|
|
|
43 |
|
|
|
|
|
|
|
|
|
44 |
|
|
|
|
|
|
|
45 |
|
46 |
?>
|
47 |
|
48 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
-
|
51 |
-
<li>Step - 1: Go to <a href="<?php echo admin_url(); ?>import.php">import</a> menu and install & activate <b>WordPress</b> Importer plugin. click to "Install Now" button to install.</li>
|
52 |
-
<li>Step - 2: Download following xml file <a href="<?php echo $layouts_plugin_url; ?>sample-data/wcps-layouts.xml">wcps-layouts.xml</a>, save the file on your local machine.</li>
|
53 |
-
<li>Step - 3: Go to importer page <a href="<?php echo admin_url(); ?>import.php?import=wordpress">Import WordPress</a> and chose the downloaded file and then click to <b>Upload file and import</b>.</li>
|
54 |
-
<li>Step - 4: Go to <a href="<?php echo admin_url(); ?>edit.php?post_type=wcps_layout">WCPS layouts</a> page to see imported layouts.</li>
|
55 |
|
56 |
-
|
|
|
|
|
|
|
57 |
|
|
|
|
|
58 |
|
59 |
-
<p><label><input type="checkbox" name="import_layouts" value="1"> Mark as done</label></p>
|
60 |
|
|
|
61 |
|
62 |
-
<div class="clear clearfix"></div>
|
63 |
-
<p class="submit">
|
64 |
-
<?php wp_nonce_field( 'wcps_nonce' ); ?>
|
65 |
-
<input class="button button-primary" type="submit" name="Submit" value="<?php _e('Save Changes','woocommerce-products-slider' ); ?>" />
|
66 |
-
</p>
|
67 |
|
|
|
68 |
|
69 |
-
|
|
|
70 |
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
|
|
|
|
|
73 |
|
|
|
|
|
74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
75 |
|
|
|
76 |
|
|
|
|
|
77 |
|
|
|
78 |
|
79 |
|
80 |
|
|
|
81 |
|
|
|
|
|
82 |
|
83 |
|
|
|
|
|
84 |
|
85 |
|
|
|
86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
|
4 |
+
if(!current_user_can('manage_options')) return;
|
5 |
|
6 |
+
$keyword = isset($_GET['keyword']) ? sanitize_text_field($_GET['keyword']) : '';
|
7 |
+
$paged = isset($_GET['paged']) ? sanitize_text_field($_GET['paged']) : '';
|
8 |
+
$tabs = isset($_GET['tabs']) ? sanitize_text_field($_GET['tabs']) : 'latest';
|
9 |
|
10 |
+
$active_plugins = get_option('active_plugins');
|
11 |
+
$wpblockhub_block_hub_ids = get_option('wpblockhub_block_hub_ids', array());
|
12 |
|
13 |
+
//$domain = (is_multisite()) ? site_url() : get_bloginfo('url');
|
14 |
+
|
15 |
+
$max_num_pages = 0;
|
16 |
+
|
17 |
+
wp_enqueue_script('wcps_js');
|
18 |
+
|
19 |
+
|
20 |
+
//var_dump($_SERVER);
|
21 |
|
22 |
?>
|
23 |
<div class="wrap">
|
24 |
+
<h2><?php _e('Import Layouts', 'wp-block-hub'); ?></h2>
|
25 |
+
|
26 |
+
<div class="wpblockhub-search">
|
27 |
|
28 |
+
<div class="wp-filter">
|
29 |
+
<ul class="filter-links">
|
30 |
+
<li class=""><a href="<?php echo $_SERVER['REQUEST_URI']; ?>&tabs=latest" class="<?php if($tabs == 'latest') echo 'current'; ?>" aria-current="page"><?php _e('Latest', 'wp-block-hub'); ?></a> </li>
|
31 |
+
<!-- <li class=""><a href="--><?php //echo $_SERVER['REQUEST_URI']; ?><!--&tabs=popular" class="--><?php //if($tabs == 'popular') echo 'current'; ?><!--" aria-current="page">--><?php //_e('Popular', 'wp-block-hub'); ?><!--</a> </li>-->
|
32 |
+
<!-- <li class=""><a href="--><?php //echo $_SERVER['REQUEST_URI']; ?><!--&tabs=top_rate" class="--><?php //if($tabs == 'top_rate') echo 'current'; ?><!--" aria-current="page">--><?php //_e('Top Rated', 'wp-block-hub'); ?><!--</a> </li>-->
|
33 |
+
</ul>
|
34 |
+
|
35 |
+
<form class="block-search-form">
|
36 |
+
<span class="loading"></span>
|
37 |
+
<input id="block-keyword" type="search" placeholder="<?php _e('Start typing...', 'wp-block-hub'); ?>"
|
38 |
+
value="<?php echo $keyword; ?>">
|
39 |
+
</form>
|
40 |
+
</div>
|
41 |
|
|
|
|
|
42 |
<?php
|
|
|
|
|
|
|
|
|
43 |
|
44 |
+
$api_params = array(
|
45 |
+
'block_hub_remote_action' => 'blockSearch',
|
46 |
+
'keyword' => $keyword,
|
47 |
+
'paged' => $paged,
|
48 |
+
'tabs' => $tabs,
|
49 |
|
50 |
+
);
|
51 |
|
52 |
+
// Send query to the license manager server
|
53 |
+
$response = wp_remote_get(add_query_arg($api_params, wcps_server_url), array('timeout' => 20, 'sslverify' => false));
|
54 |
+
|
55 |
+
|
56 |
+
//echo '<pre>'.var_export($response, true).'</pre>';
|
57 |
+
|
58 |
+
/*
|
59 |
+
* Check is there any server error occurred
|
60 |
+
*
|
61 |
+
* */
|
62 |
+
if (is_wp_error($response)){
|
63 |
+
|
64 |
+
?>
|
65 |
+
<div class="return-empty">
|
66 |
+
<ul>
|
67 |
+
<li><?php echo __("Unexpected Error! The query returned with an error.", 'wp-block-hub'); ?></li>
|
68 |
+
<li><?php echo __("Make sure your internet connection is up.", 'wp-block-hub'); ?></li>
|
69 |
+
</ul>
|
70 |
+
</div>
|
71 |
+
<?php
|
72 |
|
73 |
|
|
|
|
|
|
|
|
|
74 |
}
|
75 |
+
else{
|
76 |
|
77 |
+
$response_data = json_decode(wp_remote_retrieve_body($response));
|
78 |
+
$post_data = isset($response_data->posts) ? $response_data->posts : array();
|
79 |
+
$post_found = isset($response_data->post_found) ? sanitize_text_field($response_data->post_found) : array();
|
80 |
+
$max_num_pages = isset($response_data->max_num_pages) ? sanitize_text_field($response_data->max_num_pages) : 0;
|
81 |
|
82 |
+
//echo '<pre>'.var_export($response_data, true).'</pre>';
|
83 |
+
//var_dump($response_data->ajax_nonce);
|
84 |
+
}
|
85 |
|
86 |
?>
|
87 |
|
88 |
+
<div class="block-list-items">
|
89 |
+
<?php
|
90 |
+
|
91 |
+
if(!empty($post_data)):
|
92 |
+
|
93 |
+
foreach ($post_data as $item_index=>$item):
|
94 |
+
|
95 |
|
96 |
+
//var_dump($item);
|
|
|
|
|
|
|
|
|
97 |
|
98 |
+
$post_id = isset($item->post_id) ? $item->post_id : '';
|
99 |
+
$block_title = isset($item->title) ? $item->title : __('No title', 'wp-block-hub');
|
100 |
+
$post_url = isset($item->post_url) ? $item->post_url : '';
|
101 |
+
$layout_options = isset($item->layout_options) ? unserialize($item->layout_options) : '';
|
102 |
|
103 |
+
$is_pro = isset($layout_options['is_pro']) ? $layout_options['is_pro'] : 'yes';
|
104 |
+
$layout_preview_img = isset($layout_options['layout_preview_img']) ? $layout_options['layout_preview_img'] : '';
|
105 |
|
|
|
106 |
|
107 |
+
//echo '<pre>'.var_export($is_pro, true).'</pre>';
|
108 |
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
+
?>
|
111 |
|
112 |
+
<div class="item">
|
113 |
+
<div class="item-top-area">
|
114 |
|
115 |
+
<?php if(!empty($layout_preview_img)):?>
|
116 |
+
<div class="block-thumb">
|
117 |
+
<img src="<?php echo $layout_preview_img; ?>">
|
118 |
+
</div>
|
119 |
+
<?php endif; ?>
|
120 |
|
121 |
|
122 |
+
<div class="block-content">
|
123 |
+
<div class="block-name"><?php echo $block_title; ?></div>
|
124 |
|
125 |
+
</div>
|
126 |
+
<div class="actions">
|
127 |
|
128 |
+
<span class="button import-layout" title="Enter license key to import" post_id="<?php echo $post_id; ?>"><i class="fas fa-download"></i> Import</span>
|
129 |
+
|
130 |
+
<?php if($is_pro == 'yes'): ?>
|
131 |
+
<span class="is_pro button"><i class="fas fa-crown"></i> Pro</span>
|
132 |
+
<?php else: ?>
|
133 |
+
<span class="is_free button"><i class="far fa-lightbulb"></i> Free</span>
|
134 |
+
<?php endif; ?>
|
135 |
+
|
136 |
+
|
137 |
+
</div>
|
138 |
+
</div>
|
139 |
+
<div class="clear"></div>
|
140 |
+
</div>
|
141 |
+
<?php
|
142 |
+
endforeach;
|
143 |
|
144 |
+
else:
|
145 |
|
146 |
+
echo 'Server return empty. please try again later.';
|
147 |
+
endif;
|
148 |
|
149 |
+
?>
|
150 |
|
151 |
|
152 |
|
153 |
+
</div>
|
154 |
|
155 |
+
<div class="paginate">
|
156 |
+
<?php
|
157 |
|
158 |
|
159 |
+
$big = 999999999; // need an unlikely integer
|
160 |
+
//$max_num_pages = 4;
|
161 |
|
162 |
|
163 |
+
//var_dump(get_pagenum_link( $big ));
|
164 |
|
165 |
+
echo paginate_links(
|
166 |
+
array(
|
167 |
+
'base' => preg_replace('/\?.*/', '', get_pagenum_link()) . '%_%',
|
168 |
+
//'base' => str_replace( $big, '%#%', esc_url( get_pagenum_link( $big ) ) ),
|
169 |
+
'format' => '?paged=%#%',
|
170 |
+
'current' => max( 1, $paged ),
|
171 |
+
'total' => $max_num_pages ,
|
172 |
+
'prev_text' => '« Previous',
|
173 |
+
'next_text' => 'Next »',
|
174 |
+
|
175 |
+
|
176 |
+
|
177 |
+
));
|
178 |
+
?>
|
179 |
+
</div>
|
180 |
+
|
181 |
+
|
182 |
+
|
183 |
+
</div>
|
184 |
|
185 |
</div>
|
186 |
+
|
187 |
+
|
188 |
+
<style type="text/css">
|
189 |
+
|
190 |
+
.wpblockhub-search{}
|
191 |
+
.block-search-form{
|
192 |
+
float: right;
|
193 |
+
padding: 10px;
|
194 |
+
}
|
195 |
+
.block-search-form input[type="search"]{
|
196 |
+
width: 225px;
|
197 |
+
padding: 5px;
|
198 |
+
}
|
199 |
+
.block-list-items{}
|
200 |
+
.block-list-items a{ text-decoration: none}
|
201 |
+
.block-list-items .item{
|
202 |
+
display: inline-block;
|
203 |
+
vertical-align: top;
|
204 |
+
width: 18%;
|
205 |
+
background: #fff;
|
206 |
+
margin: 10px;
|
207 |
+
}
|
208 |
+
|
209 |
+
@media (max-width: 1199.98px) {
|
210 |
+
|
211 |
+
.block-list-items .item{
|
212 |
+
width: 46%;
|
213 |
+
|
214 |
+
}
|
215 |
+
}
|
216 |
+
|
217 |
+
@media (max-width: 767.98px) {
|
218 |
+
|
219 |
+
.block-list-items .item{
|
220 |
+
width: 46%;
|
221 |
+
|
222 |
+
}
|
223 |
+
|
224 |
+
}
|
225 |
+
|
226 |
+
@media (max-width: 575.98px) {
|
227 |
+
.block-list-items .item{
|
228 |
+
width: 95%;
|
229 |
+
|
230 |
+
}
|
231 |
+
}
|
232 |
+
|
233 |
+
|
234 |
+
|
235 |
+
|
236 |
+
|
237 |
+
.block-list-items .item-top-area{}
|
238 |
+
.block-list-items .block-thumb{
|
239 |
+
/* float: left; */
|
240 |
+
overflow: hidden;
|
241 |
+
/* margin-right: 15px; */
|
242 |
+
height: 280px;
|
243 |
+
border-bottom: 1px solid #ddd;
|
244 |
+
}
|
245 |
+
.block-list-items .block-thumb img{
|
246 |
+
width: 100%;
|
247 |
+
}
|
248 |
+
|
249 |
+
.block-list-items .block-name{
|
250 |
+
font-weight: 600;
|
251 |
+
font-size: 18px;
|
252 |
+
}
|
253 |
+
.block-list-items .block-content{
|
254 |
+
padding: 15px;
|
255 |
+
}
|
256 |
+
.item .actions{
|
257 |
+
margin: 10px;
|
258 |
+
}
|
259 |
+
|
260 |
+
.item .is_pro{
|
261 |
+
background: #3f51b5;
|
262 |
+
color: #fff;
|
263 |
+
}
|
264 |
+
.item .is_free{
|
265 |
+
background: #449862;
|
266 |
+
color: #fff;
|
267 |
+
}
|
268 |
+
|
269 |
+
.block-save{}
|
270 |
+
.block-save.saved{
|
271 |
+
color: #00a04f;
|
272 |
+
}
|
273 |
+
|
274 |
+
.block-save span{
|
275 |
+
line-height: normal;
|
276 |
+
display: inline-block;
|
277 |
+
}
|
278 |
+
|
279 |
+
.block-list-items .demo-wrap{}
|
280 |
+
.block-list-items .block-action{
|
281 |
+
float: right;
|
282 |
+
display: inline-block;
|
283 |
+
padding: 15px;
|
284 |
+
text-align: right;
|
285 |
+
}
|
286 |
+
.plugin-required{}
|
287 |
+
.plugin-required a{
|
288 |
+
text-decoration: none;
|
289 |
+
}
|
290 |
+
|
291 |
+
|
292 |
+
.plugin-required .installed {
|
293 |
+
color: #00a04f;
|
294 |
+
}
|
295 |
+
|
296 |
+
.plugin-required .not-installed {
|
297 |
+
color: #e02102;
|
298 |
+
}
|
299 |
+
|
300 |
+
|
301 |
+
|
302 |
+
.block-list-items .item-bottom-area{
|
303 |
+
padding: 10px;
|
304 |
+
background: #f7f7f7;
|
305 |
+
border-top: 1px solid #ddd;
|
306 |
+
}
|
307 |
+
.item-bottom-area .col-left{
|
308 |
+
width: 49%;
|
309 |
+
display: inline-block;
|
310 |
+
vertical-align: top;
|
311 |
+
}
|
312 |
+
.item-bottom-area .col-right{
|
313 |
+
width: 49%;
|
314 |
+
display: inline-block;
|
315 |
+
text-align: right;
|
316 |
+
}
|
317 |
+
.item-bottom-area .col-left .star-rate{
|
318 |
+
margin-bottom: 10px;
|
319 |
+
}
|
320 |
+
.item-bottom-area .col-left .star-rate .dashicons{
|
321 |
+
color: #ffb900;
|
322 |
+
}
|
323 |
+
.item-bottom-area .col-left .download-count{}
|
324 |
+
|
325 |
+
.item-bottom-area .col-right .author-link{
|
326 |
+
margin-bottom: 10px;
|
327 |
+
}
|
328 |
+
|
329 |
+
|
330 |
+
|
331 |
+
.paginate{
|
332 |
+
text-align: center;
|
333 |
+
margin: 40px;
|
334 |
+
}
|
335 |
+
|
336 |
+
.paginate .page-numbers{
|
337 |
+
background: #f7f7f7;
|
338 |
+
padding: 10px 15px;
|
339 |
+
margin: 5px;
|
340 |
+
text-decoration: none;
|
341 |
+
}
|
342 |
+
.paginate .page-numbers.current{
|
343 |
+
background: #e4e4e4;
|
344 |
+
}
|
345 |
+
|
346 |
+
|
347 |
+
|
348 |
+
|
349 |
+
|
350 |
+
|
351 |
+
|
352 |
+
|
353 |
+
|
354 |
+
|
355 |
+
|
356 |
+
/*wpblockhub-import-container*/
|
357 |
+
|
358 |
+
.wpblockhub-import-container{
|
359 |
+
position: relative;
|
360 |
+
}
|
361 |
+
.wpblockhub-import-btn{}
|
362 |
+
.wpblockhub-import-container button {
|
363 |
+
background: #3f51b5;
|
364 |
+
color: #fff;
|
365 |
+
}
|
366 |
+
.wpblockhub-import-container .item-list-wrap.active{
|
367 |
+
display: block;
|
368 |
+
}
|
369 |
+
|
370 |
+
.item-list-wrap{
|
371 |
+
position: absolute;
|
372 |
+
width: 300px;
|
373 |
+
background: #fff;
|
374 |
+
border: 1px solid #ddd;
|
375 |
+
padding: 10px;
|
376 |
+
box-shadow: 0px 4px 6px 0px rgba(210, 210, 210, 0.4);
|
377 |
+
left: -188px;
|
378 |
+
max-height: 400px;
|
379 |
+
overflow: hidden;
|
380 |
+
overflow-y: scroll;
|
381 |
+
margin-top: 9px;
|
382 |
+
display: none;
|
383 |
+
}
|
384 |
+
|
385 |
+
|
386 |
+
|
387 |
+
|
388 |
+
|
389 |
+
.item-list-wrap .item {
|
390 |
+
position: relative;
|
391 |
+
transition: ease all 1s;
|
392 |
+
}
|
393 |
+
|
394 |
+
.item-list-wrap .item img{}
|
395 |
+
.item-list-wrap .item:hover img{}
|
396 |
+
|
397 |
+
/*.item-list-wrap .item img:before {*/
|
398 |
+
/* transition: ease all 1s;*/
|
399 |
+
/* content: "";*/
|
400 |
+
/* width: 100%;*/
|
401 |
+
/* height: 100%;*/
|
402 |
+
/* background: #1d1d1d78;*/
|
403 |
+
/* position: absolute;*/
|
404 |
+
/* top: 0;*/
|
405 |
+
/* left: 0;*/
|
406 |
+
/* display: none;*/
|
407 |
+
/* transform: scale(.5);*/
|
408 |
+
/*}*/
|
409 |
+
|
410 |
+
/*.item-list-wrap .item:hover img:before {*/
|
411 |
+
|
412 |
+
/* display: block;*/
|
413 |
+
/* transform: scale(1);*/
|
414 |
+
/*}*/
|
415 |
+
|
416 |
+
.item-list-wrap .item .item-import {
|
417 |
+
position: absolute;
|
418 |
+
top: 50%;
|
419 |
+
left: 50%;
|
420 |
+
transform: translate(-50%, -50%);
|
421 |
+
display: none;
|
422 |
+
z-index: 99999;
|
423 |
+
}
|
424 |
+
|
425 |
+
.item-list-wrap .item:hover .item-import{
|
426 |
+
|
427 |
+
display: block;
|
428 |
+
}
|
429 |
+
|
430 |
+
.item-list-wrap .item img{
|
431 |
+
transition: ease all 1s;
|
432 |
+
}
|
433 |
+
.item-list-wrap .item:hover img{
|
434 |
+
opacity: 0.3;
|
435 |
+
}
|
436 |
+
|
437 |
+
.item-list-wrap .item.loading{}
|
438 |
+
.item-list-wrap .item.loading:before {
|
439 |
+
content: "Loading...";
|
440 |
+
}
|
441 |
+
.item-list-wrap .categories{
|
442 |
+
width: 100%;
|
443 |
+
margin-bottom: 10px;
|
444 |
+
}
|
445 |
+
.item-list-wrap .keyword, .item-list-wrap .loading{
|
446 |
+
width: 100%;
|
447 |
+
}
|
448 |
+
|
449 |
+
|
450 |
+
|
451 |
+
.item-list-wrap .load-more{
|
452 |
+
width: 100%;
|
453 |
+
text-align: center;
|
454 |
+
}
|
455 |
+
|
456 |
+
|
457 |
+
.item-list-wrap .plugins-required{}
|
458 |
+
.item-list-wrap .plugins-required a{
|
459 |
+
text-decoration: none;
|
460 |
+
}
|
461 |
+
|
462 |
+
|
463 |
+
|
464 |
+
/*Sidebar .wpblockhub-import-wrap*/
|
465 |
+
|
466 |
+
.wpblockhub-import-wrap{}
|
467 |
+
.wpblockhub-import-header-wrap{
|
468 |
+
padding: 15px;
|
469 |
+
}
|
470 |
+
|
471 |
+
.wpblockhub-import-header{
|
472 |
+
|
473 |
+
}
|
474 |
+
</style>
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Tags: product slider, woocommerce slider, carousel slider, product category slider, woo slider, carousel slider, woocommerce product slider
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 5.4
|
7 |
-
Stable tag: 1.13.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -142,6 +142,9 @@ then paste this shortcode anywhere in your page to display slider<br />
|
|
142 |
== Changelog ==
|
143 |
|
144 |
|
|
|
|
|
|
|
145 |
= 1.13.12 =
|
146 |
* 2020-05-17 update - Minor css update
|
147 |
* 2020-05-17 update - Variable sanitization issue fixed
|
4 |
Tags: product slider, woocommerce slider, carousel slider, product category slider, woo slider, carousel slider, woocommerce product slider
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 5.4
|
7 |
+
Stable tag: 1.13.13
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
142 |
== Changelog ==
|
143 |
|
144 |
|
145 |
+
= 1.13.13 =
|
146 |
+
* 2020-07-01 add - added layouts library.
|
147 |
+
|
148 |
= 1.13.12 =
|
149 |
* 2020-05-17 update - Minor css update
|
150 |
* 2020-05-17 update - Variable sanitization issue fixed
|
woocommerce-products-slider.php
CHANGED
@@ -3,9 +3,9 @@
|
|
3 |
Plugin Name: PickPlugins Product Slider for WooCommerce
|
4 |
Plugin URI: http://pickplugins.com/items/woocommerce-product-slider-for-wordpress/
|
5 |
Description: Fully responsive and mobile ready Carousel Slider for your WooCommerce product. unlimited slider anywhere via short-codes and easy admin setting.
|
6 |
-
Version: 1.13.
|
7 |
WC requires at least: 3.0.0
|
8 |
-
WC tested up to: 4.
|
9 |
Author: PickPlugins
|
10 |
Text Domain: woocommerce-products-slider
|
11 |
Author URI: http://pickplugins.com
|
@@ -23,11 +23,13 @@ class WoocommerceProductsSlider{
|
|
23 |
define('wcps_plugin_url', plugins_url('/', __FILE__) );
|
24 |
define('wcps_plugin_dir', plugin_dir_path( __FILE__ ) );
|
25 |
define('wcps_plugin_name', 'PickPlugins Product Slider' );
|
26 |
-
define('wcps_plugin_version', '1.13.
|
|
|
27 |
|
28 |
require_once( wcps_plugin_dir . 'includes/class-post-types.php');
|
29 |
require_once( wcps_plugin_dir . 'includes/class-metabox-wcps.php');
|
30 |
require_once( wcps_plugin_dir . 'includes/class-metabox-wcps-hook.php');
|
|
|
31 |
|
32 |
require_once( wcps_plugin_dir . 'includes/class-metabox-wcps-layout.php');
|
33 |
require_once( wcps_plugin_dir . 'includes/class-metabox-wcps-layout-hook.php');
|
@@ -137,12 +139,22 @@ class WoocommerceProductsSlider{
|
|
137 |
|
138 |
public function _admin_scripts(){
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
|
141 |
wp_register_style('font-awesome-4', wcps_plugin_url.'assets/global/css/font-awesome-4.css');
|
142 |
wp_register_style('font-awesome-5', wcps_plugin_url.'assets/global/css/font-awesome-5.css');
|
143 |
|
144 |
wp_register_style('settings-tabs', wcps_plugin_url.'assets/settings-tabs/settings-tabs.css');
|
145 |
wp_register_script('settings-tabs', wcps_plugin_url.'assets/settings-tabs/settings-tabs.js' , array( 'jquery' ));
|
|
|
|
|
|
|
|
|
146 |
|
147 |
$settings_tabs_field = new settings_tabs_field();
|
148 |
$settings_tabs_field->admin_scripts();
|
3 |
Plugin Name: PickPlugins Product Slider for WooCommerce
|
4 |
Plugin URI: http://pickplugins.com/items/woocommerce-product-slider-for-wordpress/
|
5 |
Description: Fully responsive and mobile ready Carousel Slider for your WooCommerce product. unlimited slider anywhere via short-codes and easy admin setting.
|
6 |
+
Version: 1.13.13
|
7 |
WC requires at least: 3.0.0
|
8 |
+
WC tested up to: 4.2
|
9 |
Author: PickPlugins
|
10 |
Text Domain: woocommerce-products-slider
|
11 |
Author URI: http://pickplugins.com
|
23 |
define('wcps_plugin_url', plugins_url('/', __FILE__) );
|
24 |
define('wcps_plugin_dir', plugin_dir_path( __FILE__ ) );
|
25 |
define('wcps_plugin_name', 'PickPlugins Product Slider' );
|
26 |
+
define('wcps_plugin_version', '1.13.13' );
|
27 |
+
define('wcps_server_url', 'https://www.pickplugins.com/demo/woocommerce-products-slider/');
|
28 |
|
29 |
require_once( wcps_plugin_dir . 'includes/class-post-types.php');
|
30 |
require_once( wcps_plugin_dir . 'includes/class-metabox-wcps.php');
|
31 |
require_once( wcps_plugin_dir . 'includes/class-metabox-wcps-hook.php');
|
32 |
+
require_once( wcps_plugin_dir . 'includes/functions-layout-api.php');
|
33 |
|
34 |
require_once( wcps_plugin_dir . 'includes/class-metabox-wcps-layout.php');
|
35 |
require_once( wcps_plugin_dir . 'includes/class-metabox-wcps-layout-hook.php');
|
139 |
|
140 |
public function _admin_scripts(){
|
141 |
|
142 |
+
wp_enqueue_script('wcps_js', plugins_url('assets/admin/js/scripts-layouts.js', __FILE__), array('jquery'));
|
143 |
+
wp_localize_script('wcps_js', 'wcps_ajax', array(
|
144 |
+
'wcps_ajaxurl' => admin_url('admin-ajax.php'),
|
145 |
+
'ajax_nonce' => wp_create_nonce('wcps_ajax_nonce'),
|
146 |
+
)
|
147 |
+
);
|
148 |
|
149 |
wp_register_style('font-awesome-4', wcps_plugin_url.'assets/global/css/font-awesome-4.css');
|
150 |
wp_register_style('font-awesome-5', wcps_plugin_url.'assets/global/css/font-awesome-5.css');
|
151 |
|
152 |
wp_register_style('settings-tabs', wcps_plugin_url.'assets/settings-tabs/settings-tabs.css');
|
153 |
wp_register_script('settings-tabs', wcps_plugin_url.'assets/settings-tabs/settings-tabs.js' , array( 'jquery' ));
|
154 |
+
//wp_register_script('wcps-layouts-api', wcps_plugin_url.'assets/admin/js/scripts-layouts.js' , array( 'jquery' ));
|
155 |
+
|
156 |
+
|
157 |
+
|
158 |
|
159 |
$settings_tabs_field = new settings_tabs_field();
|
160 |
$settings_tabs_field->admin_scripts();
|