Version Description
(2020-01-16) = * Fix Post Box issue * Update Service Library * fix text-domain
Download this release
Release Info
Developer | wahid0003 |
Plugin | CTX Feed – WooCommerce Product Feed Manager Plugin |
Version | 3.2.13 |
Comparing to | |
See all releases |
Code changes from version 3.2.12 to 3.2.13
- README.txt +6 -1
- admin/class-woo-feed-admin.php +51 -53
- admin/partials/woo-feed-admin-display.php +1 -0
- admin/partials/woo-feed-edit-template.php +1 -0
- includes/class-woo-feed-docs.php +1 -0
- includes/classes/class-woo-feed-webappick-api.php +43 -47
- libs/WebAppick/AppServices/Insights.php +59 -80
- libs/WebAppick/AppServices/License.php +52 -29
- woo-feed.php +2 -2
README.txt
CHANGED
@@ -5,7 +5,7 @@ Tags:woocommerce,google product feed,facebook product feed,woocommerce product f
|
|
5 |
Requires at least: 3.6
|
6 |
Tested Up To: 5.4-alpha-46743
|
7 |
Requires PHP: 5.6
|
8 |
-
Stable tag: 3.2.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -305,6 +305,11 @@ Using pro version:
|
|
305 |
|
306 |
== Changelog ==
|
307 |
|
|
|
|
|
|
|
|
|
|
|
308 |
= 3.2.12 (2020-01-14) =
|
309 |
* Service library update
|
310 |
* Add Support Form Added
|
5 |
Requires at least: 3.6
|
6 |
Tested Up To: 5.4-alpha-46743
|
7 |
Requires PHP: 5.6
|
8 |
+
Stable tag: 3.2.13
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
305 |
|
306 |
== Changelog ==
|
307 |
|
308 |
+
= 3.2.13 (2020-01-16) =
|
309 |
+
* Fix Post Box issue
|
310 |
+
* Update Service Library
|
311 |
+
* fix text-domain
|
312 |
+
|
313 |
= 3.2.12 (2020-01-14) =
|
314 |
* Service library update
|
315 |
* Add Support Form Added
|
admin/class-woo-feed-admin.php
CHANGED
@@ -64,18 +64,17 @@ class Woo_Feed_Admin
|
|
64 |
* between the defined hooks and the functions defined in this
|
65 |
* class.
|
66 |
*/
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
|
|
|
|
|
|
74 |
}
|
75 |
-
wp_register_style( $this->woo_feed, plugin_dir_url(__FILE__) . 'css/woo-feed-admin.css', $mainDeps, $this->version, 'all' );
|
76 |
-
|
77 |
-
wp_enqueue_style( $this->woo_feed );
|
78 |
-
|
79 |
}
|
80 |
|
81 |
/**
|
@@ -96,49 +95,48 @@ class Woo_Feed_Admin
|
|
96 |
* between the defined hooks and the functions defined in this
|
97 |
* class.
|
98 |
*/
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
}
|
126 |
-
|
127 |
-
wp_register_script($this->woo_feed, plugin_dir_url(__FILE__) . 'js/woo-feed-admin.js', $feedScriptDependency, $this->version, false);
|
128 |
-
|
129 |
-
wp_localize_script($this->woo_feed, 'wpf_ajax_obj', array(
|
130 |
-
'wpf_ajax_url' => admin_url( 'admin-ajax.php' ),
|
131 |
-
'nonce' => wp_create_nonce( 'wpf_feed_nonce' ),
|
132 |
-
'na' => esc_html__( 'N/A', 'woo-feed' ),
|
133 |
-
'regenerate' => esc_html__( 'Generating...', 'woo-feed' ),
|
134 |
-
'form' => [
|
135 |
-
'loading_tmpl' => esc_html__( 'Loading Template...', 'woo-feed' ),
|
136 |
-
'generate' => esc_html__( 'Delivering Configuration...', 'woo-feed' ),
|
137 |
-
'save' => esc_html__( 'Saving Configuration...', 'woo-feed' ),
|
138 |
-
],
|
139 |
-
));
|
140 |
-
|
141 |
-
wp_enqueue_script($this->woo_feed);
|
142 |
}
|
143 |
|
144 |
/**
|
64 |
* between the defined hooks and the functions defined in this
|
65 |
* class.
|
66 |
*/
|
67 |
+
if( false !== strpos( $hook, 'webappick' ) && false !== strpos( $hook, 'feed' ) ) {
|
68 |
+
wp_register_style( 'selectize', plugin_dir_url(__FILE__) . 'css/selectize.css', array(),$this->version );
|
69 |
+
wp_register_style( 'slick', plugin_dir_url(__FILE__) . 'css/slick.css', array(),$this->version );
|
70 |
+
wp_register_style( 'slick-theme', plugin_dir_url(__FILE__) . 'css/slick-theme.css', array(),$this->version );
|
71 |
+
$mainDeps = array( 'selectize' );
|
72 |
+
if( $hook == 'woo-feed_page_webappick-feed-pro-vs-free' ) {
|
73 |
+
$mainDeps = array_merge( $mainDeps, array('slick', 'slick-theme') );
|
74 |
+
}
|
75 |
+
wp_register_style( $this->woo_feed, plugin_dir_url(__FILE__) . 'css/woo-feed-admin.css', $mainDeps, $this->version, 'all' );
|
76 |
+
wp_enqueue_style( $this->woo_feed );
|
77 |
}
|
|
|
|
|
|
|
|
|
78 |
}
|
79 |
|
80 |
/**
|
95 |
* between the defined hooks and the functions defined in this
|
96 |
* class.
|
97 |
*/
|
98 |
+
if( false !== strpos( $hook, 'webappick' ) && false !== strpos( $hook, 'feed' ) ) {
|
99 |
+
wp_register_script( "jquery-selectize", plugin_dir_url(__FILE__) . 'js/selectize.min.js', array( 'jquery' ), $this->version, false );
|
100 |
+
wp_register_script( "jquery-validate", plugin_dir_url(__FILE__) . 'js/jquery.validate.min.js', array( 'jquery' ), $this->version, false );
|
101 |
+
wp_register_script( "jquery-validate-additional-methods", plugin_dir_url(__FILE__) . 'js/additional-methods.min.js', array( 'jquery', 'jquery-validate' ), $this->version, false );
|
102 |
+
wp_register_script( "jquery-sortable", plugin_dir_url(__FILE__) . 'js/jquery-sortable.js', array( 'jquery' ), $this->version, false );
|
103 |
+
|
104 |
+
wp_register_script( "jquery-slick", plugin_dir_url(__FILE__) . 'js/slick.js', array( 'jquery' ), $this->version, false );
|
105 |
+
|
106 |
+
if( ! wp_script_is( 'clipboard', 'registered' ) ) {
|
107 |
+
wp_register_script( 'clipboard', plugin_dir_url(__FILE__) . 'js/clipboard.min.js', [], '2.0.4', false);
|
108 |
+
}
|
109 |
+
|
110 |
+
$feedScriptDependency = [
|
111 |
+
'jquery', 'clipboard',
|
112 |
+
'jquery-selectize', 'jquery-sortable',
|
113 |
+
'jquery-validate', 'jquery-validate-additional-methods',
|
114 |
+
'wp-util',
|
115 |
+
'utils',
|
116 |
+
'wp-lists',
|
117 |
+
'postbox',
|
118 |
+
'tags-box',
|
119 |
+
// 'underscore', 'word-count', 'jquery-ui-autocomplete',
|
120 |
+
'jquery-touch-punch'
|
121 |
+
];
|
122 |
+
if( $hook == 'woo-feed_page_webappick-feed-pro-vs-free' ) {
|
123 |
+
$feedScriptDependency[] = 'jquery-slick';
|
124 |
+
}
|
125 |
+
|
126 |
+
wp_register_script($this->woo_feed, plugin_dir_url(__FILE__) . 'js/woo-feed-admin.js', $feedScriptDependency, $this->version, false);
|
127 |
+
wp_localize_script($this->woo_feed, 'wpf_ajax_obj', array(
|
128 |
+
'wpf_ajax_url' => admin_url( 'admin-ajax.php' ),
|
129 |
+
'nonce' => wp_create_nonce( 'wpf_feed_nonce' ),
|
130 |
+
'na' => esc_html__( 'N/A', 'woo-feed' ),
|
131 |
+
'regenerate' => esc_html__( 'Generating...', 'woo-feed' ),
|
132 |
+
'form' => [
|
133 |
+
'loading_tmpl' => esc_html__( 'Loading Template...', 'woo-feed' ),
|
134 |
+
'generate' => esc_html__( 'Delivering Configuration...', 'woo-feed' ),
|
135 |
+
'save' => esc_html__( 'Saving Configuration...', 'woo-feed' ),
|
136 |
+
],
|
137 |
+
));
|
138 |
+
wp_enqueue_script($this->woo_feed);
|
139 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
}
|
141 |
|
142 |
/**
|
admin/partials/woo-feed-admin-display.php
CHANGED
@@ -50,6 +50,7 @@ register_and_do_woo_feed_meta_boxes( $current_screen, $feedRules );
|
|
50 |
<?php
|
51 |
wp_nonce_field('woo_feed_form_nonce');
|
52 |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
|
|
53 |
?>
|
54 |
<div id="poststuff">
|
55 |
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
|
50 |
<?php
|
51 |
wp_nonce_field('woo_feed_form_nonce');
|
52 |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
53 |
+
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
54 |
?>
|
55 |
<div id="poststuff">
|
56 |
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
|
admin/partials/woo-feed-edit-template.php
CHANGED
@@ -38,6 +38,7 @@ register_and_do_woo_feed_meta_boxes( $current_screen, $feedRules );
|
|
38 |
<?php
|
39 |
wp_nonce_field('wf_edit_feed');
|
40 |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
|
|
41 |
?>
|
42 |
<div id="poststuff">
|
43 |
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
|
38 |
<?php
|
39 |
wp_nonce_field('wf_edit_feed');
|
40 |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
41 |
+
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
42 |
?>
|
43 |
<div id="poststuff">
|
44 |
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
|
includes/class-woo-feed-docs.php
CHANGED
@@ -36,6 +36,7 @@ if( ! class_exists( 'WooFeedDocs' ) ) {
|
|
36 |
function woo_feed_docs() {
|
37 |
$faqs = $this->__get_feed_help();
|
38 |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
|
|
39 |
$current_screen = get_current_screen();
|
40 |
?>
|
41 |
<div class="wrap wapk-admin wapk-feed-docs">
|
36 |
function woo_feed_docs() {
|
37 |
$faqs = $this->__get_feed_help();
|
38 |
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
|
39 |
+
wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
|
40 |
$current_screen = get_current_screen();
|
41 |
?>
|
42 |
<div class="wrap wapk-admin wapk-feed-docs">
|
includes/classes/class-woo-feed-webappick-api.php
CHANGED
@@ -64,18 +64,6 @@ if( ! class_exists( 'WooFeedWebAppickAPI' ) ) {
|
|
64 |
*
|
65 |
*/
|
66 |
private function __construct() {
|
67 |
-
add_action( 'init', [ $this, '__init' ] );
|
68 |
-
}
|
69 |
-
|
70 |
-
/**
|
71 |
-
* Cloning is forbidden.
|
72 |
-
* @since 1.0.2
|
73 |
-
*/
|
74 |
-
public function __clone() {
|
75 |
-
_doing_it_wrong( __FUNCTION__, __( 'Cloning is forbidden.', 'woo-feed' ), '1.0.2' );
|
76 |
-
}
|
77 |
-
|
78 |
-
public function __init() {
|
79 |
if ( ! class_exists( 'WebAppick\AppServices\Client' ) ) {
|
80 |
/** @noinspection PhpIncludeInspection */
|
81 |
require_once WOO_FEED_LIBS_PATH . 'WebAppick/AppServices/Client.php';
|
@@ -94,6 +82,14 @@ if( ! class_exists( 'WooFeedWebAppickAPI' ) ) {
|
|
94 |
$this->promotion->init();
|
95 |
}
|
96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
/**
|
98 |
* Initialize Insights
|
99 |
* @return void
|
@@ -109,36 +105,36 @@ if( ! class_exists( 'WooFeedWebAppickAPI' ) ) {
|
|
109 |
* @see wc_get_product_types();
|
110 |
*/
|
111 |
$this->insights->add_extra( [
|
112 |
-
'products'
|
113 |
-
'variations'
|
114 |
-
'batch_limit'
|
115 |
-
'feed_configs'
|
116 |
|
117 |
-
'product_cat_num'
|
118 |
] );
|
119 |
-
|
120 |
-
$this
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
|
|
|
|
|
|
|
|
127 |
}
|
128 |
|
129 |
/**
|
130 |
* Generate Support Ticket Email Template
|
131 |
* @return string
|
132 |
*/
|
133 |
-
|
134 |
// dynamic variable format __INPUT_NAME__
|
135 |
-
$licenseData = '';
|
136 |
-
if ( $license = get_option( 'woocommerce_product_feed_pro_data', false ) ) {
|
137 |
-
$licenseData = sprintf( '<br>API Key : %s<br>API Email : %s', $license['api_key'], $license['activation_email'] );
|
138 |
-
}
|
139 |
/** @noinspection HtmlUnknownTarget */
|
140 |
-
$template = '<div style="margin: 10px auto;"><p>Website : <a href="__WEBSITE__">__WEBSITE__</a><br>Plugin : %s (v.%s)
|
141 |
-
$template = sprintf( $template, $this->client->getName(), $this->client->getProjectVersion()
|
142 |
$template .= '<div style="margin: 10px auto;"><hr></div>';
|
143 |
$template .= '<div style="margin: 10px auto;"><h3>__SUBJECT__</h3></div>';
|
144 |
$template .= '<div style="margin: 10px auto;">__MESSAGE__</div>';
|
@@ -154,21 +150,21 @@ if( ! class_exists( 'WooFeedWebAppickAPI' ) ) {
|
|
154 |
* Generate Support Ticket Ajax Response
|
155 |
* @return string
|
156 |
*/
|
157 |
-
|
158 |
$response = '';
|
159 |
-
$response .= sprintf( '<h3>%s</h3>', esc_html__( 'Thank you -- Support Ticket Submitted.', '
|
160 |
-
$ticketSubmitted = esc_html__( 'Your ticket has been successfully submitted.', '
|
161 |
-
$twenty4Hours = sprintf( '<strong>%s</strong>', esc_html__( '24 hours', '
|
162 |
-
$notification = sprintf( esc_html__( 'You will receive an email notification from "support@webappick.com" in your inbox within %s.', '
|
163 |
-
$followUp = esc_html__( 'Please Follow the email and WebAppick Support Team will get back with you shortly.', '
|
164 |
$response .= sprintf( '<p>%s %s %s</p>', $ticketSubmitted, $notification, $followUp );
|
165 |
-
$docLink = sprintf( '<a class="button button-primary" href="https://webappick.helpscoutdocs.com/" target="_blank"><span class="dashicons dashicons-media-document" aria-hidden="true"></span> %s</a>', esc_html__( 'Documentation', '
|
166 |
-
$vidLink = sprintf( '<a class="button button-primary" href="http://bit.ly/2u6giNz" target="_blank"><span class="dashicons dashicons-video-alt3" aria-hidden="true"></span> %s</a>', esc_html__( 'Video Tutorials', '
|
167 |
$response .= sprintf( '<p>%s %s</p>', $docLink, $vidLink );
|
168 |
$response .= '<br><br><br>';
|
169 |
-
$toc = sprintf( '<a href="https://webappick.com/terms-and-conditions/" target="_blank">%s</a>', esc_html__( 'Terms & Conditions', '
|
170 |
-
$pp = sprintf( '<a href="https://webappick.com/privacy-policy/" target="_blank">%s</a>', esc_html__( 'Privacy Policy', '
|
171 |
-
$policy = sprintf( esc_html__( 'Please read our %s and %s', '
|
172 |
$response .= sprintf( '<p style="font-size: 12px;">%s</p>', $policy );
|
173 |
return $response;
|
174 |
}
|
@@ -177,12 +173,12 @@ if( ! class_exists( 'WooFeedWebAppickAPI' ) ) {
|
|
177 |
* Set Error Response Message For Support Ticket Request
|
178 |
* @return string
|
179 |
*/
|
180 |
-
|
181 |
return sprintf(
|
182 |
'<div class="mui-error"><p>%s</p><p>%s</p><br><br><p style="font-size: 12px;">%s</p></div>',
|
183 |
-
esc_html__( 'Something Went Wrong. Please Try The Support Ticket Form On Our Website.', '
|
184 |
-
sprintf( '<a class="button button-primary" href="https://webappick.com/support/" target="_blank">%s</a>', esc_html__( 'Get Support', '
|
185 |
-
esc_html__( 'Support Ticket form will open in new tab in 5 seconds.', '
|
186 |
);
|
187 |
}
|
188 |
|
64 |
*
|
65 |
*/
|
66 |
private function __construct() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
67 |
if ( ! class_exists( 'WebAppick\AppServices\Client' ) ) {
|
68 |
/** @noinspection PhpIncludeInspection */
|
69 |
require_once WOO_FEED_LIBS_PATH . 'WebAppick/AppServices/Client.php';
|
82 |
$this->promotion->init();
|
83 |
}
|
84 |
|
85 |
+
/**
|
86 |
+
* Cloning is forbidden.
|
87 |
+
* @since 1.0.2
|
88 |
+
*/
|
89 |
+
public function __clone() {
|
90 |
+
_doing_it_wrong( __FUNCTION__, __( 'Cloning is forbidden.', 'woo-feed' ), '1.0.2' );
|
91 |
+
}
|
92 |
+
|
93 |
/**
|
94 |
* Initialize Insights
|
95 |
* @return void
|
105 |
* @see wc_get_product_types();
|
106 |
*/
|
107 |
$this->insights->add_extra( [
|
108 |
+
'products' => $this->insights->get_post_count( 'product' ),
|
109 |
+
'variations' => $this->insights->get_post_count( 'product_variation' ),
|
110 |
+
'batch_limit' => get_option( 'woo_feed_per_batch' ),
|
111 |
+
'feed_configs' => json_encode( $result ),
|
112 |
|
113 |
+
'product_cat_num' => $catCount,
|
114 |
] );
|
115 |
+
$projectSlug = $this->client->getSlug();
|
116 |
+
add_filter( $projectSlug . '_what_tracked', [ $this, 'data_we_collect' ], 10, 1 );
|
117 |
+
add_filter( "WebAppick_{$projectSlug}_Support_Ticket_Recipient_Email", function(){
|
118 |
+
return 'support@webappick.com';
|
119 |
+
}, 10 );
|
120 |
+
add_filter( "WebAppick_{$projectSlug}_Support_Ticket_Email_Template", [ $this, 'supportTicketTemplate' ], 10 );
|
121 |
+
add_filter( "WebAppick_{$projectSlug}_Support_Request_Ajax_Success_Response", [ $this, 'supportResponse' ], 10 );
|
122 |
+
add_filter( "WebAppick_{$projectSlug}_Support_Request_Ajax_Error_Response", [ $this, 'supportErrorResponse' ], 10 );
|
123 |
+
add_filter( "WebAppick_{$projectSlug}_Support_Page_URL", function(){
|
124 |
+
return 'https://webappick.com/support/';
|
125 |
+
}, 10 );
|
126 |
+
$this->insights->init();
|
127 |
}
|
128 |
|
129 |
/**
|
130 |
* Generate Support Ticket Email Template
|
131 |
* @return string
|
132 |
*/
|
133 |
+
public function supportTicketTemplate() {
|
134 |
// dynamic variable format __INPUT_NAME__
|
|
|
|
|
|
|
|
|
135 |
/** @noinspection HtmlUnknownTarget */
|
136 |
+
$template = '<div style="margin: 10px auto;"><p>Website : <a href="__WEBSITE__">__WEBSITE__</a><br>Plugin : %s (v.%s)</p></div>';
|
137 |
+
$template = sprintf( $template, $this->client->getName(), $this->client->getProjectVersion() );
|
138 |
$template .= '<div style="margin: 10px auto;"><hr></div>';
|
139 |
$template .= '<div style="margin: 10px auto;"><h3>__SUBJECT__</h3></div>';
|
140 |
$template .= '<div style="margin: 10px auto;">__MESSAGE__</div>';
|
150 |
* Generate Support Ticket Ajax Response
|
151 |
* @return string
|
152 |
*/
|
153 |
+
public function supportResponse() {
|
154 |
$response = '';
|
155 |
+
$response .= sprintf( '<h3>%s</h3>', esc_html__( 'Thank you -- Support Ticket Submitted.', 'woo-feed' ) );
|
156 |
+
$ticketSubmitted = esc_html__( 'Your ticket has been successfully submitted.', 'woo-feed' );
|
157 |
+
$twenty4Hours = sprintf( '<strong>%s</strong>', esc_html__( '24 hours', 'woo-feed' ) );
|
158 |
+
$notification = sprintf( esc_html__( 'You will receive an email notification from "support@webappick.com" in your inbox within %s.', 'woo-feed' ), $twenty4Hours );
|
159 |
+
$followUp = esc_html__( 'Please Follow the email and WebAppick Support Team will get back with you shortly.', 'woo-feed' );
|
160 |
$response .= sprintf( '<p>%s %s %s</p>', $ticketSubmitted, $notification, $followUp );
|
161 |
+
$docLink = sprintf( '<a class="button button-primary" href="https://webappick.helpscoutdocs.com/" target="_blank"><span class="dashicons dashicons-media-document" aria-hidden="true"></span> %s</a>', esc_html__( 'Documentation', 'woo-feed' ) );
|
162 |
+
$vidLink = sprintf( '<a class="button button-primary" href="http://bit.ly/2u6giNz" target="_blank"><span class="dashicons dashicons-video-alt3" aria-hidden="true"></span> %s</a>', esc_html__( 'Video Tutorials', 'woo-feed' ) );
|
163 |
$response .= sprintf( '<p>%s %s</p>', $docLink, $vidLink );
|
164 |
$response .= '<br><br><br>';
|
165 |
+
$toc = sprintf( '<a href="https://webappick.com/terms-and-conditions/" target="_blank">%s</a>', esc_html__( 'Terms & Conditions', 'woo-feed' ) );
|
166 |
+
$pp = sprintf( '<a href="https://webappick.com/privacy-policy/" target="_blank">%s</a>', esc_html__( 'Privacy Policy', 'woo-feed' ) );
|
167 |
+
$policy = sprintf( esc_html__( 'Please read our %s and %s', 'woo-feed' ), $toc, $pp );
|
168 |
$response .= sprintf( '<p style="font-size: 12px;">%s</p>', $policy );
|
169 |
return $response;
|
170 |
}
|
173 |
* Set Error Response Message For Support Ticket Request
|
174 |
* @return string
|
175 |
*/
|
176 |
+
public function supportErrorResponse() {
|
177 |
return sprintf(
|
178 |
'<div class="mui-error"><p>%s</p><p>%s</p><br><br><p style="font-size: 12px;">%s</p></div>',
|
179 |
+
esc_html__( 'Something Went Wrong. Please Try The Support Ticket Form On Our Website.', 'woo-feed' ),
|
180 |
+
sprintf( '<a class="button button-primary" href="https://webappick.com/support/" target="_blank">%s</a>', esc_html__( 'Get Support', 'woo-feed' ) ),
|
181 |
+
esc_html__( 'Support Ticket form will open in new tab in 5 seconds.', 'woo-feed' )
|
182 |
);
|
183 |
}
|
184 |
|
libs/WebAppick/AppServices/Insights.php
CHANGED
@@ -129,6 +129,33 @@ class Insights {
|
|
129 |
* @return void
|
130 |
*/
|
131 |
public function init() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
if ( $this->client->getType() == 'plugin' ) {
|
133 |
$this->init_plugin();
|
134 |
} elseif ( $this->client->getType() == 'theme' ) {
|
@@ -728,80 +755,6 @@ class Insights {
|
|
728 |
return $reasons;
|
729 |
}
|
730 |
|
731 |
-
/**
|
732 |
-
* Set Support Ticket Template For sending the email query.
|
733 |
-
* @param string $ticketTemplate
|
734 |
-
*
|
735 |
-
* @return Insights
|
736 |
-
*/
|
737 |
-
public function setTicketTemplate( $ticketTemplate ) {
|
738 |
-
if( $this->didInit ) {
|
739 |
-
_doing_it_wrong( __METHOD__, sprintf( '<code>%s</code> Should be called before Insights::init()', __METHOD__ ), '1.0.1' );
|
740 |
-
return $this;
|
741 |
-
}
|
742 |
-
$this->ticketTemplate = $ticketTemplate;
|
743 |
-
return $this;
|
744 |
-
}
|
745 |
-
|
746 |
-
/**
|
747 |
-
* Set Ajax Success Response for Support Ticket Submission
|
748 |
-
* @param string $supportResponse
|
749 |
-
*
|
750 |
-
* @return Insights
|
751 |
-
*/
|
752 |
-
public function setSupportResponse( $supportResponse ) {
|
753 |
-
if( $this->didInit ) {
|
754 |
-
_doing_it_wrong( __METHOD__, sprintf( '<code>%s</code> Should be called before Insights::init()', __METHOD__ ), '1.0.1' );
|
755 |
-
return $this;
|
756 |
-
}
|
757 |
-
$this->supportResponse = $supportResponse;
|
758 |
-
return $this;
|
759 |
-
}
|
760 |
-
|
761 |
-
/**
|
762 |
-
* @param string $supportErrorResponse
|
763 |
-
* @return Insights
|
764 |
-
*/
|
765 |
-
public function setSupportErrorResponse( $supportErrorResponse ) {
|
766 |
-
if( $this->didInit ) {
|
767 |
-
_doing_it_wrong( __METHOD__, sprintf( '<code>%s</code> Should be called before Insights::init()', __METHOD__ ), '1.0.1' );
|
768 |
-
return $this;
|
769 |
-
}
|
770 |
-
$this->supportErrorResponse = $supportErrorResponse;
|
771 |
-
return $this;
|
772 |
-
}
|
773 |
-
|
774 |
-
/**
|
775 |
-
* @param string $supportURL
|
776 |
-
* @return Insights
|
777 |
-
*/
|
778 |
-
public function setSupportURL( $supportURL ) {
|
779 |
-
if( $this->didInit ) {
|
780 |
-
_doing_it_wrong( __METHOD__, sprintf( '<code>%s</code> Should be called before Insights::init()', __METHOD__ ), '1.0.1' );
|
781 |
-
return $this;
|
782 |
-
}
|
783 |
-
$this->supportURL = esc_url_raw( $supportURL, [ 'http', 'https' ] );
|
784 |
-
return $this;
|
785 |
-
}
|
786 |
-
|
787 |
-
/**
|
788 |
-
* Set Ticket Recipient Email
|
789 |
-
* @param string $ticketRecipient
|
790 |
-
* @return Insights
|
791 |
-
*/
|
792 |
-
public function setTicketRecipient( $ticketRecipient ) {
|
793 |
-
if( $this->didInit ) {
|
794 |
-
_doing_it_wrong( __METHOD__, sprintf( '<code>%s</code> Should be called before Insights::init()', __METHOD__ ), '1.0.1' );
|
795 |
-
return $this;
|
796 |
-
}
|
797 |
-
if( ! is_email( $ticketRecipient ) ) {
|
798 |
-
_doing_it_wrong( __METHOD__, sprintf( '<code>%s</code> Should be called before Insights::init()', __METHOD__ ), '1.0.1' );
|
799 |
-
return $this;
|
800 |
-
}
|
801 |
-
$this->ticketRecipient = sanitize_email( $ticketRecipient );
|
802 |
-
return $this;
|
803 |
-
}
|
804 |
-
|
805 |
/**
|
806 |
* Plugin deactivation uninstall reason submission
|
807 |
*
|
@@ -855,7 +808,7 @@ class Insights {
|
|
855 |
}
|
856 |
|
857 |
public function support_ticket_submission() {
|
858 |
-
if( empty( $this->
|
859 |
wp_send_json_error( sprintf( '<p class="mui-error">%s<br>%s</p>', esc_html__( 'Something Went Wrong.', 'webappick' ), esc_html__( 'Please try again after sometime.', 'webappick' ) ) );
|
860 |
wp_die(-1 );
|
861 |
}
|
@@ -883,15 +836,41 @@ class Insights {
|
|
883 |
$sanitizer = 'sanitize_text_field';
|
884 |
if( $k == 'email' ) $sanitizer = 'sanitize_email';
|
885 |
if( $k == 'website' ) $sanitizer = 'esc_url';
|
|
|
|
|
886 |
$k = '__' . strtoupper( $k ) . '__';
|
887 |
-
$this->ticketTemplate = str_replace( [ $k ], [
|
888 |
-
$this->supportResponse = str_replace( [ $k ], [ call_user_func_array( $sanitizer, [$v] ) ], $this->supportResponse );
|
889 |
-
$this->supportErrorResponse = str_replace( [ $k ], [ call_user_func_array( $sanitizer, [$v] ) ], $this->supportErrorResponse );
|
890 |
}
|
891 |
-
|
892 |
if ( wp_mail( $this->ticketRecipient, sanitize_text_field( $_REQUEST['subject'] ), sprintf( '<div>%s</div>', $this->ticketTemplate ), $headers ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
893 |
wp_send_json_success( $this->supportResponse );
|
894 |
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
895 |
wp_send_json_error( $this->supportErrorResponse );
|
896 |
}
|
897 |
} else {
|
@@ -913,7 +892,7 @@ class Insights {
|
|
913 |
$reasons = $this->__get_uninstall_reasons();
|
914 |
$admin_user = $this->__get_admin();
|
915 |
$displayName = ( ! empty( $admin_user->first_name ) && ! empty( $admin_user->last_name ) ) ? $admin_user->first_name . ' ' . $admin_user->last_name : $admin_user->display_name;
|
916 |
-
$showSupportTicket = ( ! empty( $this->ticketTemplate ) && ! empty( $this->
|
917 |
?>
|
918 |
<div class="wapk-dr-modal" id="<?php echo $this->client->getSlug(); ?>-wapk-dr-modal" aria-label="<?php printf( esc_attr__( '“%s” Uninstall Confirmation', 'webappick' ), $this->client->getName() ); ?>" role="dialog" aria-modal="true">
|
919 |
<?php if( $showSupportTicket ) { ?>
|
129 |
* @return void
|
130 |
*/
|
131 |
public function init() {
|
132 |
+
// Env Setup
|
133 |
+
$projectSlug = $this->client->getSlug();
|
134 |
+
/**
|
135 |
+
* Support Page URL
|
136 |
+
* @param string $supportURL
|
137 |
+
*/
|
138 |
+
if( false !== ( $supportURL = apply_filters( "WebAppick_{$projectSlug}_Support_Page_URL" , false ) ) ) {
|
139 |
+
$supportURL = esc_url_raw( $supportURL, [ 'http', 'https' ] );
|
140 |
+
if( ! empty( $supportURL ) ) $this->supportURL = $supportURL;
|
141 |
+
}
|
142 |
+
/**
|
143 |
+
* Set Ticket Recipient Email
|
144 |
+
* @param string $ticketRecipient
|
145 |
+
*/
|
146 |
+
$ticketRecipient = apply_filters( "WebAppick_{$projectSlug}_Support_Ticket_Recipient_Email" , false );
|
147 |
+
if( FALSE !== $ticketRecipient && is_email( $ticketRecipient ) ) {
|
148 |
+
$this->ticketRecipient = sanitize_email( $ticketRecipient );
|
149 |
+
}
|
150 |
+
/**
|
151 |
+
* Set Support Ticket Template For sending the email query.
|
152 |
+
* @param string $ticketTemplate
|
153 |
+
*/
|
154 |
+
if( false !== ( $ticketTemplate = apply_filters( "WebAppick_{$projectSlug}_Support_Ticket_Email_Template" , false ) ) ) {
|
155 |
+
$this->ticketTemplate = $ticketTemplate;
|
156 |
+
}
|
157 |
+
|
158 |
+
// initialize
|
159 |
if ( $this->client->getType() == 'plugin' ) {
|
160 |
$this->init_plugin();
|
161 |
} elseif ( $this->client->getType() == 'theme' ) {
|
755 |
return $reasons;
|
756 |
}
|
757 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
758 |
/**
|
759 |
* Plugin deactivation uninstall reason submission
|
760 |
*
|
808 |
}
|
809 |
|
810 |
public function support_ticket_submission() {
|
811 |
+
if( empty( $this->ticketTemplate ) || empty( $this->ticketRecipient ) || empty( $this->supportURL ) ) {
|
812 |
wp_send_json_error( sprintf( '<p class="mui-error">%s<br>%s</p>', esc_html__( 'Something Went Wrong.', 'webappick' ), esc_html__( 'Please try again after sometime.', 'webappick' ) ) );
|
813 |
wp_die(-1 );
|
814 |
}
|
836 |
$sanitizer = 'sanitize_text_field';
|
837 |
if( $k == 'email' ) $sanitizer = 'sanitize_email';
|
838 |
if( $k == 'website' ) $sanitizer = 'esc_url';
|
839 |
+
$v = call_user_func_array( $sanitizer, [$v] );
|
840 |
+
$_REQUEST[$k] = $v; // sanitized.
|
841 |
$k = '__' . strtoupper( $k ) . '__';
|
842 |
+
$this->ticketTemplate = str_replace( [ $k ], [ $v ], $this->ticketTemplate );
|
|
|
|
|
843 |
}
|
844 |
+
$projectSlug = $this->client->getSlug();
|
845 |
if ( wp_mail( $this->ticketRecipient, sanitize_text_field( $_REQUEST['subject'] ), sprintf( '<div>%s</div>', $this->ticketTemplate ), $headers ) ) {
|
846 |
+
/**
|
847 |
+
* Set Ajax Success Response for Support Ticket Submission
|
848 |
+
* @param string $supportResponse
|
849 |
+
* @param array $_REQUEST
|
850 |
+
*/
|
851 |
+
if( false !== ( $supportResponse = apply_filters( "WebAppick_{$projectSlug}_Support_Request_Ajax_Success_Response" , false, $_REQUEST ) ) ) {
|
852 |
+
$this->supportResponse = $supportResponse;
|
853 |
+
} else {
|
854 |
+
$this->supportResponse = sprintf(
|
855 |
+
'<h3>%s</h3>',
|
856 |
+
esc_html__( 'Thank you -- Support Ticket Submitted.', 'webappick' )
|
857 |
+
);
|
858 |
+
}
|
859 |
wp_send_json_success( $this->supportResponse );
|
860 |
} else {
|
861 |
+
/**
|
862 |
+
* Set Support Ticket Ajax Error Response.
|
863 |
+
* @param string $supportErrorResponse
|
864 |
+
* @param array $_REQUEST
|
865 |
+
*/
|
866 |
+
if( false !== ( $supportErrorResponse = apply_filters( "WebAppick_{$projectSlug}_Support_Request_Ajax_Error_Response" , false, $_REQUEST ) ) ) {
|
867 |
+
$this->supportErrorResponse = $supportErrorResponse;
|
868 |
+
} else {
|
869 |
+
$this->supportErrorResponse = sprintf(
|
870 |
+
'<div class="mui-error"><p>%s</p></div>',
|
871 |
+
esc_html__( 'Something Went Wrong. Please Try Again After Sometime.', 'webappick' )
|
872 |
+
);
|
873 |
+
}
|
874 |
wp_send_json_error( $this->supportErrorResponse );
|
875 |
}
|
876 |
} else {
|
892 |
$reasons = $this->__get_uninstall_reasons();
|
893 |
$admin_user = $this->__get_admin();
|
894 |
$displayName = ( ! empty( $admin_user->first_name ) && ! empty( $admin_user->last_name ) ) ? $admin_user->first_name . ' ' . $admin_user->last_name : $admin_user->display_name;
|
895 |
+
$showSupportTicket = ( ! empty( $this->ticketTemplate ) && ! empty( $this->ticketRecipient ) && ! empty( $this->supportURL) );
|
896 |
?>
|
897 |
<div class="wapk-dr-modal" id="<?php echo $this->client->getSlug(); ?>-wapk-dr-modal" aria-label="<?php printf( esc_attr__( '“%s” Uninstall Confirmation', 'webappick' ), $this->client->getName() ); ?>" role="dialog" aria-modal="true">
|
898 |
<?php if( $showSupportTicket ) { ?>
|
libs/WebAppick/AppServices/License.php
CHANGED
@@ -87,10 +87,12 @@ class License {
|
|
87 |
*/
|
88 |
public function __construct( Client $client ) {
|
89 |
$this->client = $client;
|
90 |
-
|
91 |
$this->option_key = 'WebAppick_' . md5( $this->client->getSlug() ) . '_manage_license';
|
92 |
-
|
93 |
$this->schedule_hook = $this->client->getSlug() . '_license_check_event';
|
|
|
|
|
|
|
94 |
}
|
95 |
|
96 |
/**
|
@@ -99,17 +101,11 @@ class License {
|
|
99 |
* @return void
|
100 |
*/
|
101 |
public function init() {
|
102 |
-
// load the license
|
103 |
-
$this->getLicense();
|
104 |
-
// handle license page form before anything
|
105 |
-
if ( isset( $_POST['submit'], $_POST['_action'] ) ) {
|
106 |
-
$this->handle_license_page_form( $_POST );
|
107 |
-
}
|
108 |
// check the validity and save the state
|
109 |
$this->is_valid();
|
110 |
// Run hook to check license status daily
|
111 |
add_action( $this->schedule_hook, array( $this, 'check_license_status' ) );
|
112 |
-
$this->currentUserCanManage =
|
113 |
$this->isLicensePage = isset( $_GET['page'] ) && $_GET['page'] === $this->menu_args['menu_slug'];
|
114 |
add_action( 'plugin_action_links_' . $this->client->getBasename(), [ $this, 'plugin_action_links' ] );
|
115 |
add_action( 'admin_notices', array( $this, '__admin_notices' ), 10 );
|
@@ -118,8 +114,17 @@ class License {
|
|
118 |
$this->didInit = true;
|
119 |
}
|
120 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
public function __admin_notices() {
|
122 |
-
if ( ! $this->currentUserCanManage ) return;
|
123 |
if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL === true ) {
|
124 |
$host = parse_url( $this->__getLicenceAPI(), PHP_URL_HOST );
|
125 |
if ( ! defined( 'WP_ACCESSIBLE_HOSTS' ) || ( defined( 'WP_ACCESSIBLE_HOSTS' ) && false === stristr( WP_ACCESSIBLE_HOSTS, $host ) ) ) {
|
@@ -328,6 +333,12 @@ class License {
|
|
328 |
'parent_slug' => '',
|
329 |
];
|
330 |
$this->menu_args = wp_parse_args( $args, $defaults );
|
|
|
|
|
|
|
|
|
|
|
|
|
331 |
add_action( 'admin_menu', array( $this, 'admin_menu' ), 999 );
|
332 |
}
|
333 |
|
@@ -371,7 +382,8 @@ class License {
|
|
371 |
?></p>
|
372 |
<?php } ?>
|
373 |
<form method="post" action="<?php $this->formActionUrl(); ?>" novalidate="novalidate" spellcheck="false" autocomplete="off">
|
374 |
-
|
|
|
375 |
<div class="license-input-fields">
|
376 |
<div class="license-input-key">
|
377 |
<svg enable-background="new 0 0 512 512" version="1.1" viewBox="0 0 512 512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
@@ -381,9 +393,9 @@ class License {
|
|
381 |
<input class="regular-text" id="license_key" type="text"
|
382 |
value="<?php echo $this->get_input_license_value( $action, $this->license ); ?>"
|
383 |
placeholder="<?php esc_attr_e( 'Enter your license key to activate', 'webappick' ); ?>"
|
384 |
-
name="license_key"<?php readonly( ( 'deactivate' == $action ), true, true ) ?> autocomplete="off">
|
385 |
</div>
|
386 |
-
<button type="submit" name="submit" class="<?php printf( esc_attr( '%s-button' ), $action );?>"><?php
|
387 |
$action == 'activate' ? esc_html_e( 'Activate License', 'webappick' ) : esc_html_e( 'Deactivate License', 'webappick' ) ;
|
388 |
?></button>
|
389 |
<a href="http://webappick.com/my-account/api-keys/" class="button button-primary button-hero" style="margin-left: 20px;font-size: 17px;line-height: 2.5;" target="_blank"><?php esc_html_e( 'Manage License', 'webappick' ); ?></a>
|
@@ -399,18 +411,21 @@ class License {
|
|
399 |
|
400 |
/**
|
401 |
* License form submit
|
402 |
-
* @
|
403 |
*/
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
|
|
|
|
|
|
414 |
}
|
415 |
}
|
416 |
|
@@ -721,19 +736,27 @@ class License {
|
|
721 |
private function activation_deactivation() {
|
722 |
switch ( $this->client->getType() ) {
|
723 |
case 'plugin':
|
724 |
-
register_activation_hook( $this->client->
|
725 |
-
register_deactivation_hook( $this->client->
|
726 |
-
add_action( 'activated_plugin', array( $this, '
|
727 |
break;
|
728 |
-
|
729 |
case 'theme':
|
730 |
-
add_action( 'switch_theme', array( $this, '
|
731 |
add_action( 'after_switch_theme', array( $this, 'schedule_cron_event' ), 10 );
|
732 |
add_action( 'after_switch_theme', array( $this, 'redirect_to_license_page' ), 999, 2 );
|
733 |
break;
|
734 |
}
|
735 |
}
|
736 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
737 |
/**
|
738 |
* Redirect to the license activation page after plugin/theme is activated.
|
739 |
* @TODO make option for the plugin/theme (which is using this lib) can alter this method with their custom function.
|
87 |
*/
|
88 |
public function __construct( Client $client ) {
|
89 |
$this->client = $client;
|
|
|
90 |
$this->option_key = 'WebAppick_' . md5( $this->client->getSlug() ) . '_manage_license';
|
91 |
+
$this->data_key = $this->client->getSlug() . '-license';
|
92 |
$this->schedule_hook = $this->client->getSlug() . '_license_check_event';
|
93 |
+
// load the license
|
94 |
+
$this->getLicense();
|
95 |
+
add_action( 'init', [ $this, 'handle_license_page_form' ], 10 );
|
96 |
}
|
97 |
|
98 |
/**
|
101 |
* @return void
|
102 |
*/
|
103 |
public function init() {
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
// check the validity and save the state
|
105 |
$this->is_valid();
|
106 |
// Run hook to check license status daily
|
107 |
add_action( $this->schedule_hook, array( $this, 'check_license_status' ) );
|
108 |
+
$this->currentUserCanManage = $this->menu_args['capability'];
|
109 |
$this->isLicensePage = isset( $_GET['page'] ) && $_GET['page'] === $this->menu_args['menu_slug'];
|
110 |
add_action( 'plugin_action_links_' . $this->client->getBasename(), [ $this, 'plugin_action_links' ] );
|
111 |
add_action( 'admin_notices', array( $this, '__admin_notices' ), 10 );
|
114 |
$this->didInit = true;
|
115 |
}
|
116 |
|
117 |
+
/**
|
118 |
+
* Expose the License Key
|
119 |
+
* @return void|string
|
120 |
+
*/
|
121 |
+
public function get_key() {
|
122 |
+
$this->getLicense();
|
123 |
+
return $this->license['key'];
|
124 |
+
}
|
125 |
+
|
126 |
public function __admin_notices() {
|
127 |
+
if ( ! current_user_can( $this->currentUserCanManage ) ) return;
|
128 |
if ( defined( 'WP_HTTP_BLOCK_EXTERNAL' ) && WP_HTTP_BLOCK_EXTERNAL === true ) {
|
129 |
$host = parse_url( $this->__getLicenceAPI(), PHP_URL_HOST );
|
130 |
if ( ! defined( 'WP_ACCESSIBLE_HOSTS' ) || ( defined( 'WP_ACCESSIBLE_HOSTS' ) && false === stristr( WP_ACCESSIBLE_HOSTS, $host ) ) ) {
|
333 |
'parent_slug' => '',
|
334 |
];
|
335 |
$this->menu_args = wp_parse_args( $args, $defaults );
|
336 |
+
if( ! in_array( $this->menu_args['type'], [ 'menu', 'options', 'submenu' ] ) ) {
|
337 |
+
if( empty( $this->menu_args['parent_slug'] ) ) $this->menu_args['type'] = 'menu';
|
338 |
+
}
|
339 |
+
if( $this->menu_args['type'] == 'submenu' && empty( $this->menu_args['parent_slug'] ) ) {
|
340 |
+
$this->menu_args['type'] = 'options';
|
341 |
+
}
|
342 |
add_action( 'admin_menu', array( $this, 'admin_menu' ), 999 );
|
343 |
}
|
344 |
|
382 |
?></p>
|
383 |
<?php } ?>
|
384 |
<form method="post" action="<?php $this->formActionUrl(); ?>" novalidate="novalidate" spellcheck="false" autocomplete="off">
|
385 |
+
<?php wp_nonce_field( $this->data_key ); ?>
|
386 |
+
<input type="hidden" name="<?php echo esc_attr( $this->data_key); ?>[_action]" value="<?php echo esc_attr( $action ); ?>">
|
387 |
<div class="license-input-fields">
|
388 |
<div class="license-input-key">
|
389 |
<svg enable-background="new 0 0 512 512" version="1.1" viewBox="0 0 512 512" xml:space="preserve" xmlns="http://www.w3.org/2000/svg">
|
393 |
<input class="regular-text" id="license_key" type="text"
|
394 |
value="<?php echo $this->get_input_license_value( $action, $this->license ); ?>"
|
395 |
placeholder="<?php esc_attr_e( 'Enter your license key to activate', 'webappick' ); ?>"
|
396 |
+
name="<?php echo esc_attr( $this->data_key); ?>[license_key]"<?php readonly( ( 'deactivate' == $action ), true, true ) ?> autocomplete="off">
|
397 |
</div>
|
398 |
+
<button type="submit" name="<?php echo esc_attr( $this->data_key); ?>[submit]" class="<?php printf( esc_attr( '%s-button' ), $action );?>"><?php
|
399 |
$action == 'activate' ? esc_html_e( 'Activate License', 'webappick' ) : esc_html_e( 'Deactivate License', 'webappick' ) ;
|
400 |
?></button>
|
401 |
<a href="http://webappick.com/my-account/api-keys/" class="button button-primary button-hero" style="margin-left: 20px;font-size: 17px;line-height: 2.5;" target="_blank"><?php esc_html_e( 'Manage License', 'webappick' ); ?></a>
|
411 |
|
412 |
/**
|
413 |
* License form submit
|
414 |
+
* @return void
|
415 |
*/
|
416 |
+
public function handle_license_page_form() {
|
417 |
+
if( isset( $_POST[$this->data_key] ) ) {
|
418 |
+
check_admin_referer( $this->data_key );
|
419 |
+
switch ( $_POST[$this->data_key]['_action'] ) {
|
420 |
+
case 'activate':
|
421 |
+
$this->activate_client_license( $_POST[$this->data_key] );
|
422 |
+
break;
|
423 |
+
case 'deactivate':
|
424 |
+
$this->deactivate_client_license();
|
425 |
+
break;
|
426 |
+
default:
|
427 |
+
break;
|
428 |
+
}
|
429 |
}
|
430 |
}
|
431 |
|
736 |
private function activation_deactivation() {
|
737 |
switch ( $this->client->getType() ) {
|
738 |
case 'plugin':
|
739 |
+
register_activation_hook( $this->client->getBasename(), array( $this, 'schedule_cron_event' ) );
|
740 |
+
register_deactivation_hook( $this->client->getBasename(), array( $this, 'project_deactivation' ) );
|
741 |
+
add_action( 'activated_plugin', array( $this, 'redirect_to_license_page' ), 999, 2 );
|
742 |
break;
|
|
|
743 |
case 'theme':
|
744 |
+
add_action( 'switch_theme', array( $this, 'project_deactivation' ), 10 );
|
745 |
add_action( 'after_switch_theme', array( $this, 'schedule_cron_event' ), 10 );
|
746 |
add_action( 'after_switch_theme', array( $this, 'redirect_to_license_page' ), 999, 2 );
|
747 |
break;
|
748 |
}
|
749 |
}
|
750 |
|
751 |
+
/**
|
752 |
+
* Project Deactivation Callback.
|
753 |
+
*/
|
754 |
+
public function project_deactivation() {
|
755 |
+
$this->clear_scheduler();
|
756 |
+
$this->getLicense();
|
757 |
+
$this->deactivate_client_license();
|
758 |
+
}
|
759 |
+
|
760 |
/**
|
761 |
* Redirect to the license activation page after plugin/theme is activated.
|
762 |
* @TODO make option for the plugin/theme (which is using this lib) can alter this method with their custom function.
|
woo-feed.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Plugin Name: WooCommerce Product Feed
|
16 |
* Plugin URI: https://webappick.com/
|
17 |
* Description: This plugin generate WooCommerce product feed for Shopping Engines like Google Shopping,Facebook Product Feed,eBay,Amazon,Idealo and many more..
|
18 |
-
* Version: 3.2.
|
19 |
* Author: WebAppick
|
20 |
* Author URI: https://webappick.com/
|
21 |
* License: GPL v2
|
@@ -41,7 +41,7 @@ if ( ! defined( 'WOO_FEED_FREE_VERSION' ) ) {
|
|
41 |
* Plugin Version
|
42 |
* @var string
|
43 |
*/
|
44 |
-
define( 'WOO_FEED_FREE_VERSION', '3.2.
|
45 |
}
|
46 |
if ( ! defined( 'WOO_FEED_FREE_FILE') ) {
|
47 |
/**
|
15 |
* Plugin Name: WooCommerce Product Feed
|
16 |
* Plugin URI: https://webappick.com/
|
17 |
* Description: This plugin generate WooCommerce product feed for Shopping Engines like Google Shopping,Facebook Product Feed,eBay,Amazon,Idealo and many more..
|
18 |
+
* Version: 3.2.13
|
19 |
* Author: WebAppick
|
20 |
* Author URI: https://webappick.com/
|
21 |
* License: GPL v2
|
41 |
* Plugin Version
|
42 |
* @var string
|
43 |
*/
|
44 |
+
define( 'WOO_FEED_FREE_VERSION', '3.2.13' );
|
45 |
}
|
46 |
if ( ! defined( 'WOO_FEED_FREE_FILE') ) {
|
47 |
/**
|