PluginProbe ʕ •ᴥ•ʔ
GiveWP – Donation Plugin and Fundraising Platform / 4.14.5
GiveWP – Donation Plugin and Fundraising Platform v4.14.5
4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 2.31.0 2.31.1 2.32.0 2.33.0 2.33.1 2.33.2 2.33.3 2.33.4 2.33.5 2.4.0 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.10.0 3.11.0 3.12.0 3.12.1 3.12.2 3.12.3 3.13.0 3.14.0 3.14.1 3.14.2 3.15.0 3.15.1 3.16.0 3.16.1 3.16.2 3.16.3 3.16.4 3.16.5 3.17.0 3.17.1 3.17.2 3.18.0 3.19.0 3.19.1 3.19.2 3.19.3 3.19.4 3.2.0 3.2.1 3.2.2 3.20.0 3.21.0 3.21.1 3.22.0 3.22.1 3.22.2 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.7.0 3.8.0 3.9.0 4.0.0 4.1.0 4.1.1 4.10.0 4.10.1 4.11.0 4.12.0 4.13.0 4.13.1 4.13.2 4.14.0 4.14.1 4.14.2 4.14.3 4.14.4 4.14.5 4.14.6 4.2.0 4.2.1 4.3.0 4.3.1 4.3.2 4.4.0 4.5.0 4.6.1 4.7.0 4.7.1 4.8.0 4.8.1 4.9.0 trunk 1.9.0 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.2 2.11.3 2.12.0 2.12.1 2.12.2 2.12.3 2.13.0 2.13.1 2.13.2 2.13.3 2.13.4 2.14.0 2.15.0 2.16.0 2.16.1 2.17.0 2.17.1 2.17.3 2.18.0 2.18.1 2.19.1 2.19.2 2.19.3 2.19.4 2.19.5 2.19.6 2.19.7 2.19.8 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.20.0 2.20.1 2.20.2 2.21.0 2.21.1 2.21.2 2.21.3 2.21.4 2.22.0 2.22.1 2.22.2 2.22.3 2.23.0 2.23.1 2.23.2 2.24.0 2.24.1 2.24.2 2.25.0 2.25.1 2.25.2 2.25.3 2.26.0 2.27.0 2.27.1 2.27.2 2.27.3 2.28.0 2.29.0 2.29.1 2.29.2
give / includes / admin / plugins.php
give / includes / admin Last commit date
add-ons 4 years ago donors 7 months ago emails 5 months ago forms 1 year ago payments 1 year ago reports 1 year ago settings 5 months ago shortcodes 1 year ago tools 4 months ago upgrades 5 months ago views 1 year ago abstract-admin-settings-page.php 2 years ago admin-actions.php 5 months ago admin-filters.php 9 months ago admin-footer.php 2 years ago admin-pages.php 5 months ago class-addon-activation-banner.php 9 months ago class-admin-settings.php 1 year ago class-api-keys-table.php 4 years ago class-blank-slate.php 1 year ago class-give-admin.php 5 years ago class-give-html-elements.php 1 year ago class-i18n-module.php 4 years ago dashboard-widgets.php 3 years ago give-metabox-functions.php 3 years ago import-functions.php 11 months ago misc-functions.php 2 years ago plugins.php 9 months ago setting-page-functions.php 6 years ago
plugins.php
634 lines
1 <?php
2 /**
3 * Admin Plugins
4 *
5 * @package Give
6 * @subpackage Admin/Plugins
7 * @copyright Copyright (c) 2016, GiveWP
8 * @license https://opensource.org/licenses/gpl-license GNU Public License
9 * @since 1.4
10 */
11
12 // Exit if accessed directly.
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit;
15 }
16
17 /**
18 * Plugins row action links
19 *
20 * @since 1.4
21 *
22 * @param array $actions An array of plugin action links.
23 *
24 * @return array An array of updated action links.
25 */
26 function give_plugin_action_links( $actions ) {
27 $new_actions = [
28 'settings' => sprintf(
29 '<a href="%1$s">%2$s</a>',
30 admin_url( 'edit.php?post_type=give_forms&page=give-settings' ),
31 __( 'Settings', 'give' )
32 ),
33 ];
34
35 return array_merge( $new_actions, $actions );
36 }
37
38 add_filter( 'plugin_action_links_' . GIVE_PLUGIN_BASENAME, 'give_plugin_action_links' );
39
40
41 /**
42 * Plugin row meta links
43 *
44 * @since 1.4
45 *
46 * @param array $plugin_meta An array of the plugin's metadata.
47 * @param string $plugin_file Path to the plugin file, relative to the plugins directory.
48 *
49 * @return array
50 */
51 function give_plugin_row_meta( $plugin_meta, $plugin_file ) {
52 if ( GIVE_PLUGIN_BASENAME !== $plugin_file ) {
53 return $plugin_meta;
54 }
55
56 $new_meta_links = [
57 sprintf(
58 '<a href="%1$s" target="_blank">%2$s</a>',
59 esc_url(
60 add_query_arg(
61 [
62 'utm_source' => 'plugins-page',
63 'utm_medium' => 'plugin-row',
64 'utm_campaign' => 'admin',
65 ],
66 'https://givewp.com/documentation/'
67 )
68 ),
69 __( 'Documentation', 'give' )
70 ),
71 sprintf(
72 '<a href="%1$s" target="_blank">%2$s</a>',
73 esc_url(
74 add_query_arg(
75 [
76 'utm_source' => 'plugins-page',
77 'utm_medium' => 'plugin-row',
78 'utm_campaign' => 'admin',
79 ],
80 'https://givewp.com/addons/'
81 )
82 ),
83 __( 'Add-ons', 'give' )
84 ),
85 ];
86
87 return array_merge( $plugin_meta, $new_meta_links );
88 }
89
90 add_filter( 'plugin_row_meta', 'give_plugin_row_meta', 10, 2 );
91
92
93 /**
94 * Get the Parent Page Menu Title in admin section.
95 * Based on get_admin_page_title WordPress Function.
96 *
97 * @since 1.8.17
98 *
99 * @global array $submenu
100 * @global string $plugin_page
101 *
102 * @return string $title Page title
103 */
104 function give_get_admin_page_menu_title() {
105 $title = '';
106 global $submenu, $plugin_page;
107
108 foreach ( array_keys( $submenu ) as $parent ) {
109 if ( 'edit.php?post_type=give_forms' !== $parent ) {
110 continue;
111 }
112
113 foreach ( $submenu[ $parent ] as $submenu_array ) {
114 if ( $plugin_page !== $submenu_array[2] ) {
115 continue;
116 }
117
118 $title = isset( $submenu_array[0] ) ?
119 $submenu_array[0] :
120 $submenu_array[3];
121 }
122 }
123
124 return $title;
125 }
126
127 /**
128 * Store recently activated Give's addons to wp options.
129 *
130 * @since 2.1.0
131 */
132 function give_recently_activated_addons() {
133 // Check if action is set.
134 if ( isset( $_REQUEST['action'] ) ) {
135 $plugin_action = ( '-1' !== $_REQUEST['action'] ) ? $_REQUEST['action'] : ( isset( $_REQUEST['action2'] ) ? $_REQUEST['action2'] : '' );
136 $plugins = [];
137
138 switch ( $plugin_action ) {
139 case 'activate': // Single add-on activation.
140 $plugins[] = $_REQUEST['plugin'];
141 break;
142 case 'activate-selected': // If multiple add-ons activated.
143 $plugins = $_REQUEST['checked'];
144 break;
145 }
146
147 if ( ! empty( $plugins ) ) {
148
149 $give_addons = give_get_recently_activated_addons();
150
151 foreach ( $plugins as $plugin ) {
152 // Get plugins which has 'Give-' as prefix.
153 if ( stripos( $plugin, 'Give-' ) !== false ) {
154 $give_addons[] = $plugin;
155 }
156 }
157
158 if ( ! empty( $give_addons ) ) {
159 // Update the Give's activated add-ons.
160 update_option( 'give_recently_activated_addons', $give_addons, false );
161 }
162 }
163 }
164 }
165
166 // Add add-on plugins to wp option table.
167 add_action( 'activated_plugin', 'give_recently_activated_addons', 10 );
168
169 /**
170 * Create new menu in plugin section that include all the add-on
171 *
172 * @since 2.1.0
173 *
174 * @param $plugin_menu
175 *
176 * @return mixed
177 */
178 function give_filter_addons_do_filter_addons( $plugin_menu ) {
179 global $plugins;
180
181 $give_addons = wp_list_pluck( give_get_plugins( [ 'only_add_on' => true ] ), 'Name' );
182
183 if ( ! empty( $give_addons ) ) {
184 foreach ( $plugins['all'] as $file => $plugin_data ) {
185
186 if ( in_array( $plugin_data['Name'], $give_addons ) ) {
187 $plugins['give'][ $file ] = $plugins['all'][ $file ];
188 $plugins['give'][ $file ]['plugin'] = $file;
189
190 // Replicate the next step.
191 if ( current_user_can( 'update_plugins' ) ) {
192 $current = get_site_transient( 'update_plugins' );
193
194 if ( isset( $current->response[ $file ] ) ) {
195 $plugins['give'][ $file ]['update'] = true;
196 $plugins['give'][ $file ] = array_merge( (array) $current->response[ $file ], $plugins['give'][ $file ] );
197 } elseif ( isset( $current->no_update[ $file ] ) ) {
198 $plugins['give'][ $file ] = array_merge( (array) $current->no_update[ $file ], $plugins['give'][ $file ] );
199 }
200 }
201 }
202 }
203 }
204
205 return $plugin_menu;
206
207 }
208
209 add_filter( 'show_advanced_plugins', 'give_filter_addons_do_filter_addons' );
210 add_filter( 'show_network_active_plugins', 'give_filter_addons_do_filter_addons' );
211
212 /**
213 * Keep activating the same add-on when admin activate or deactivate from Give Menu
214 *
215 * @since 2.2.0
216 *
217 * @param $action
218 * @param $result
219 */
220 function give_prepare_filter_addons_referer( $action, $result ) {
221 if ( ! function_exists( 'get_current_screen' ) ) {
222 return;
223 }
224 $screen = get_current_screen();
225 if ( is_object( $screen ) && $screen->base === 'plugins' && ! empty( $_REQUEST['plugin_status'] ) && $_REQUEST['plugin_status'] === 'give' ) {
226 global $status;
227 $status = 'give';
228 }
229 }
230
231 add_action( 'check_admin_referer', 'give_prepare_filter_addons_referer', 10, 2 );
232
233 /**
234 * Make the Give Menu as an default menu and update the Menu Name
235 *
236 * @since 2.1.0
237 *
238 * @param $views
239 *
240 * @return mixed
241 */
242 function give_filter_addons_filter_addons( $views ) {
243
244 global $status, $plugins;
245
246 if ( ! empty( $plugins['give'] ) ) {
247 $class = '';
248
249 if ( 'give' === $status ) {
250 $class = 'current';
251 }
252
253 $views['give'] = sprintf(
254 '<a class="%s" href="plugins.php?plugin_status=give"> %s <span class="count">(%s) </span></a>',
255 $class,
256 __( 'Give', 'give' ),
257 count( $plugins['give'] )
258 );
259 }
260
261 return $views;
262 }
263
264 add_filter( 'views_plugins', 'give_filter_addons_filter_addons' );
265 add_filter( 'views_plugins-network', 'give_filter_addons_filter_addons' );
266
267 /**
268 * Set the Give as the Main menu when admin click on the Give Menu in Plugin section.
269 *
270 * @since 2.1.0
271 *
272 * @param $plugins
273 *
274 * @return mixed
275 */
276 function give_prepare_filter_addons( $plugins ) {
277 global $status;
278
279 if ( isset( $_REQUEST['plugin_status'] ) && 'give' === $_REQUEST['plugin_status'] ) {
280 $status = 'give';
281 }
282
283 return $plugins;
284 }
285
286 add_filter( 'all_plugins', 'give_prepare_filter_addons' );
287
288
289 /**
290 * Display the upgrade notice message.
291 *
292 * @param array $data Array of plugin metadata.
293 * @param array $response An array of metadata about the available plugin update.
294 *
295 * @since 2.1
296 */
297 function give_in_plugin_update_message( $data, $response ) {
298 $new_version = $data['new_version'];
299 $current_version_parts = explode( '.', GIVE_VERSION );
300 $new_version_parts = explode( '.', $new_version );
301
302 // If it is a minor upgrade then return.
303 if ( version_compare( $current_version_parts[0] . '.' . $current_version_parts[1], $new_version_parts[0] . '.' . $new_version_parts[1], '=' ) ) {
304
305 return;
306 }
307
308 // Get the upgrade notice from the trunk.
309 $upgrade_notice = give_get_plugin_upgrade_notice( $new_version );
310
311 // Display upgrade notice.
312 echo apply_filters( 'give_in_plugin_update_message', $upgrade_notice ? '</p>' . wp_kses_post( $upgrade_notice ) . '<p class="dummy">' : '' );
313 }
314
315 // Display upgrade notice.
316 add_action( 'in_plugin_update_message-' . GIVE_PLUGIN_BASENAME, 'give_in_plugin_update_message', 10, 2 );
317
318
319 /**
320 * Get the upgrade notice from WordPress.org.
321 *
322 * Note: internal purpose use only
323 *
324 * @since 2.1
325 *
326 * @param string $new_version New verison of the plugin.
327 *
328 * @return string
329 */
330 function give_get_plugin_upgrade_notice( $new_version ) {
331
332 // Cache the upgrade notice.
333 $transient_name = "give_upgrade_notice_{$new_version}";
334 $upgrade_notice = get_transient( $transient_name );
335
336 if ( false === $upgrade_notice ) {
337 $response = wp_safe_remote_get( 'https://plugins.svn.wordpress.org/give/trunk/readme.txt' );
338
339 if ( ! is_wp_error( $response ) && ! empty( $response['body'] ) ) {
340 $upgrade_notice = give_parse_plugin_update_notice( $response['body'], $new_version );
341 set_transient( $transient_name, $upgrade_notice, DAY_IN_SECONDS );
342 }
343 }
344
345 return $upgrade_notice;
346 }
347
348
349 /**
350 * Parse update notice from readme file.
351 *
352 * Note: internal purpose use only
353 *
354 * @since 2.1
355 *
356 * @param string $content Content of the readme.txt file.
357 * @param string $new_version The version with current version is compared.
358 *
359 * @return string
360 */
361 function give_parse_plugin_update_notice( $content, $new_version ) {
362 $version_parts = explode( '.', $new_version );
363 $check_for_notices = [
364 $version_parts[0] . '.0',
365 $version_parts[0] . '.0.0',
366 $version_parts[0] . '.' . $version_parts[1] . '.' . '0',
367 ];
368
369 // Regex to extract Upgrade notice from the readme.txt file.
370 $notice_regexp = '~==\s*Upgrade Notice\s*==\s*=\s*(.*)\s*=(.*)(=\s*' . preg_quote( $new_version ) . '\s*=|$)~Uis';
371
372 $upgrade_notice = '';
373
374 foreach ( $check_for_notices as $check_version ) {
375 if ( version_compare( GIVE_VERSION, $check_version, '>' ) ) {
376 continue;
377 }
378
379 $matches = null;
380
381 if ( preg_match( $notice_regexp, $content, $matches ) ) {
382 $notices = (array) preg_split( '~[\r\n]+~', trim( $matches[2] ) );
383
384 if ( version_compare( trim( $matches[1] ), $check_version, '=' ) ) {
385 $upgrade_notice .= '<p class="give-plugin-upgrade-notice">';
386
387 foreach ( $notices as $index => $line ) {
388 $upgrade_notice .= preg_replace( '~\[([^\]]*)\]\(([^\)]*)\)~', '<a href="${2}">${1}</a>', $line );
389 }
390
391 $upgrade_notice .= '</p>';
392 }
393
394 if ( ! empty( $upgrade_notice ) ) {
395 break;
396 }
397 }
398 }
399
400 return wp_kses_post( $upgrade_notice );
401 }
402
403
404 /**
405 * Add styling to the plugin upgrade notice.
406 *
407 * @since 2.1
408 */
409 function give_plugin_notice_css() {
410 ?>
411 <style type="text/css">
412 #give-update .give-plugin-upgrade-notice {
413 font-weight: 400;
414 background: #fff8e5 !important;
415 border-left: 4px solid #ffb900;
416 border-top: 1px solid #ffb900;
417 padding: 9px 0 9px 12px !important;
418 margin: 0 -12px 0 -16px !important;
419 }
420
421 #give-update .give-plugin-upgrade-notice:before {
422 content: '\f348';
423 display: inline-block;
424 font: 400 18px/1 dashicons;
425 speak: none;
426 margin: 0 8px 0 -2px;
427 vertical-align: top;
428 }
429
430 #give-update .dummy {
431 display: none;
432 }
433 </style>
434 <?php
435 }
436
437 add_action( 'admin_head', 'give_plugin_notice_css' );
438
439 /**
440 * Get list of add-on last activated.
441 *
442 * @since 2.1.3
443 *
444 * @return mixed|array list of recently activated add-on
445 */
446 function give_get_recently_activated_addons() {
447 return get_option( 'give_recently_activated_addons', [] );
448 }
449
450 /**
451 * Renders the Give Deactivation Survey Form.
452 * Note: only for internal use
453 *
454 * @since 4.10.0 Updated the icon path to the new build directory.
455 * @since 2.2
456 */
457 function give_deactivation_popup() {
458 // Bailout.
459 if ( ! current_user_can( 'delete_plugins' ) ) {
460 give_die();
461 }
462
463 $results = [];
464
465 // Start output buffering.
466 ob_start();
467 ?>
468
469 <h2 id="deactivation-survey-title">
470 <img src="<?php echo esc_url( GIVE_PLUGIN_URL ); ?>/build/assets/dist/images/give-icon-full-circle.svg">
471 <span><?php esc_html_e( 'GiveWP Deactivation', 'give' ); ?></span>
472 </h2>
473 <form class="deactivation-survey-form" method="POST">
474 <p><?php esc_html_e( 'If you have a moment, please let us know why you are deactivating Give. All submissions are anonymous and we only use this feedback to improve this plugin.', 'give' ); ?></p>
475
476 <div>
477 <label class="give-field-description">
478 <input type="radio" name="give-survey-radios" value="1">
479 <?php esc_html_e( "I'm only deactivating temporarily", 'give' ); ?>
480 </label>
481 </div>
482
483 <div>
484 <label class="give-field-description">
485 <input type="radio" name="give-survey-radios" value="2">
486 <?php esc_html_e( 'I no longer need the plugin', 'give' ); ?>
487 </label>
488 </div>
489
490 <div>
491 <label class="give-field-description">
492 <input type="radio" name="give-survey-radios" value="3" data-has-field="true">
493 <?php esc_html_e( 'I found a better plugin', 'give' ); ?>
494 </label>
495
496 <div class="give-survey-extra-field">
497 <p><?php esc_html_e( 'What is the name of the plugin?', 'give' ); ?></p>
498 <input type="text" name="user-reason" class="widefat">
499 </div>
500 </div>
501
502 <div>
503 <label class="give-field-description">
504 <input type="radio" name="give-survey-radios" value="4">
505 <?php esc_html_e( 'I only needed the plugin for a short period', 'give' ); ?>
506 </label>
507 </div>
508
509 <div>
510 <label class="give-field-description">
511 <input type="radio" name="give-survey-radios" value="5" data-has-field="true">
512 <?php esc_html_e( 'The plugin broke my site', 'give' ); ?>
513 </label>
514
515 <div class="give-survey-extra-field">
516 <p>
517 <?php
518 printf(
519 '%1$s %2$s %3$s',
520 __( "We're sorry to hear that, check", 'give' ),
521 '<a href="https://wordpress.org/support/plugin/give">GiveWP Support</a>.',
522 __( 'Can you describe the issue?', 'give' )
523 );
524 ?>
525 </p>
526 <textarea disabled name="user-reason" class="widefat" rows="6"></textarea>
527 </div>
528 </div>
529
530 <div>
531 <label class="give-field-description">
532 <input type="radio" name="give-survey-radios" value="6" data-has-field="true">
533 <?php esc_html_e( 'The plugin suddenly stopped working', 'give' ); ?>
534 </label>
535
536 <div class="give-survey-extra-field">
537 <p>
538 <?php
539 printf(
540 '%1$s %2$s %3$s',
541 __( "We're sorry to hear that, check", 'give' ),
542 '<a href="https://wordpress.org/support/plugin/give">GiveWP Support</a>.',
543 __( 'Can you describe the issue?', 'give' )
544 );
545 ?>
546 </p>
547 <textarea disabled name="user-reason" class="widefat" rows="6"></textarea>
548 </div>
549 </div>
550
551 <div>
552 <label class="give-field-description">
553 <input type="radio" name="give-survey-radios" value="7" data-has-field="true">
554 <?php esc_html_e( 'Other', 'give' ); ?>
555 </label>
556
557 <div class="give-survey-extra-field">
558 <p><?php esc_html_e( "Please describe why you're deactivating Give", 'give' ); ?></p>
559 <textarea disabled name="user-reason" class="widefat" rows="6"></textarea>
560 </div>
561 </div>
562
563 <div id="survey-and-delete-data">
564 <p>
565 <label>
566 <input type="checkbox" name="confirm_reset_store" value="1">
567 <?php esc_html_e( 'Would you like to delete all GiveWP data?', 'give' ); ?>
568 </label>
569 <section class="give-field-description">
570 <?php esc_html_e( 'By default the custom roles, GiveWP options, and database entries are not deleted when you deactivate Give. If you are deleting GiveWP completely from your website and want those items removed as well check this option. Note: This will permanently delete all GiveWP data from your database.', 'give' ); ?>
571 </section>
572 </p>
573 </div>
574 <input type="hidden" name="give-export-class" value="Give_Tools_Reset_Stats">
575 <?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
576 </form>
577
578 <?php
579
580 // Echo content (deactivation form) from the output buffer.
581 $output = ob_get_clean();
582
583 $results['html'] = $output;
584
585 wp_send_json( $results );
586 }
587
588 add_action( 'wp_ajax_give_deactivation_popup', 'give_deactivation_popup' );
589
590 /**
591 * Ajax callback after the deactivation survey form has been submitted.
592 * Note: only for internal use
593 *
594 * @since 2.2
595 */
596 function give_deactivation_form_submit() {
597
598 if ( ! check_ajax_referer( 'deactivation_survey_nonce', 'nonce', false ) ) {
599 wp_send_json_error();
600 }
601
602 $form_data = give_clean( wp_parse_args( $_POST['form-data'] ) );
603
604 // Get the selected radio value.
605 $radio_value = isset( $form_data['give-survey-radios'] ) ? $form_data['give-survey-radios'] : 0;
606
607 // Get the reason if any radio button has an optional text field.
608 $user_reason = isset( $form_data['user-reason'] ) ? $form_data['user-reason'] : '';
609
610 // Get the value of the checkbox for deleting Give's data.
611 $delete_data = isset( $form_data['confirm_reset_store'] ) ? $form_data['confirm_reset_store'] : '';
612
613 // Send data to survey server. It doesn't matter if it fails.
614 wp_remote_post(
615 'http://survey.givewp.com/wp-json/give/v2/survey/',
616 [
617 'body' => [
618 'radio_value' => $radio_value,
619 'user_reason' => $user_reason,
620 ],
621 'timeout' => 0.1
622 ]
623 );
624
625 if ( '1' === $delete_data ) {
626 give_update_option( 'uninstall_on_delete', 'enabled' );
627 wp_send_json_success( [ 'delete_data' => true ] );
628 }
629
630 wp_send_json_success( [ 'delete_data' => false ] );
631 }
632
633 add_action( 'wp_ajax_deactivation_form_submit', 'give_deactivation_form_submit' );
634