Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PFWA-2 : Deactivation Feedback #1291

Merged
merged 11 commits into from Feb 28, 2019

add new option to prevent double request, PFWA-2

  • Loading branch information...
kcppdevelopers committed Feb 21, 2019
commit 82df8e705dcee32c891d97e79fb193ed23eb3e05
@@ -399,6 +399,7 @@ function activate_paypal_for_woocommerce() {
if(!in_array( 'woocommerce/woocommerce.php',apply_filters('active_plugins',get_option('active_plugins'))) && !is_plugin_active_for_network( 'woocommerce/woocommerce.php' )) {
deactivate_plugins(plugin_basename(__FILE__));
}
delete_option('angelleye_paypal_woocommerce_submited_feedback');
$opt_in_log = get_option('angelleye_send_opt_in_logging_details', 'no');
if($opt_in_log == 'yes') {
$log_url = $_SERVER['HTTP_HOST'];
@@ -414,11 +415,14 @@ function activate_paypal_for_woocommerce() {
function deactivate_paypal_for_woocommerce() {
// Log activation in Angell EYE database via web service.
$opt_in_log = get_option('angelleye_send_opt_in_logging_details', 'no');
$is_submited_feedback = get_option('angelleye_paypal_woocommerce_submited_feedback', 'no');
if($opt_in_log == 'yes') {
$log_url = $_SERVER['HTTP_HOST'];
$log_plugin_id = 1;
$log_activation_status = 0;
wp_remote_request('http://www.angelleye.com/web-services/wordpress/update-plugin-status.php?url='.$log_url.'&plugin_id='.$log_plugin_id.'&activation_status='.$log_activation_status);
if($is_submited_feedback == 'no') {
$log_url = $_SERVER['HTTP_HOST'];
$log_plugin_id = 1;
$log_activation_status = 0;
wp_remote_request('http://www.angelleye.com/web-services/wordpress/update-plugin-status.php?url='.$log_url.'&plugin_id='.$log_plugin_id.'&activation_status='.$log_activation_status);
}
}
}
@@ -1244,7 +1248,8 @@ public function angelleye_handle_plugin_deactivation_request() {
'reason_details' => wc_clean($_POST['reason_details']),
), $web_services_url );
$response = wp_remote_request($request_url);
if (is_wp_error($response)) {
update_option('angelleye_paypal_woocommerce_submited_feedback', 'yes');
if (is_wp_error($response)) {
wp_send_json(wp_remote_retrieve_body($response));
} else {
wp_send_json(wp_remote_retrieve_body($response));
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.