PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.9
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.9
4.0.8 4.0.7 4.0.6 4.0.5 4.0.4 4.0.3 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.10.0 3.10.1 3.10.10 3.10.11 3.10.12 3.10.13 3.10.14 3.10.15 3.10.2 3.10.3 All 149 releases
← All changes | vendor/codeinwp/themeisle-sdk/src/Modules/Uninstall_feedback.php +118 -98 3.10.133.4.9 View file →
@@ -11,9 +11,8 @@
11 11
12 12 namespace ThemeisleSDK\Modules;
13 13
14 14 use ThemeisleSDK\Common\Abstract_Module;
15 -use ThemeisleSDK\Loader;
16 15 use ThemeisleSDK\Product;
17 16
18 17 // Exit if accessed directly.
19 18 if ( ! defined( 'ABSPATH' ) ) {
@@ -48,24 +47,27 @@
48 47 *
49 48 * @var array $options_plugin The main options list for plugins.
50 49 */
51 50 private $options_plugin = array(
52 - 'id3' => array(
53 - 'id' => 3,
54 - 'type' => 'text',
55 -
51 + 'I found a better plugin' => array(
52 + 'id' => 3,
53 + 'type' => 'text',
54 + 'placeholder' => 'What\'s the plugin\'s name?',
56 55 ),
57 - 'id4' => array(
58 - 'type' => 'textarea',
59 - 'id' => 4,
56 + 'I could not get the plugin to work' => array(
57 + 'type' => 'textarea',
58 + 'placeholder' => 'What problem are you experiencing?',
59 + 'id' => 4,
60 60 ),
61 - 'id5' => array(
62 - 'id' => 5,
63 - 'type' => 'textarea',
61 + 'I no longer need the plugin' => array(
62 + 'id' => 5,
63 + 'type' => 'textarea',
64 + 'placeholder' => 'If you could improve one thing about our product, what would it be?',
64 65 ),
65 - 'id6' => array(
66 - 'type' => 'textarea',
67 - 'id' => 6,
66 + 'It\'s a temporary deactivation. I\'m just debugging an issue.' => array(
67 + 'type' => 'textarea',
68 + 'placeholder' => 'What problem are you experiencing?',
69 + 'id' => 6,
68 70 ),
69 71 );
70 72 /**
71 73 * Default options for theme.
@@ -72,23 +74,23 @@
72 74 *
73 75 * @var array $options_theme The main options list for themes.
74 76 */
75 77 private $options_theme = array(
76 - 'id7' => array(
78 + 'I don\'t know how to make it look like demo' => array(
77 79 'id' => 7,
78 80 ),
79 - 'id8' => array(
80 - 'type' => 'text',
81 - 'id' => 8,
81 + 'It lacks options' => array(
82 + 'placeholder' => 'What option is missing?',
83 + 'type' => 'text',
84 + 'id' => 8,
82 85 ),
83 - 'id9' => array(
84 - 'id' => 9,
85 - 'type' => 'text',
86 + 'Is not working with a plugin that I need' => array(
87 + 'id' => 9,
88 + 'type' => 'text',
89 + 'placeholder' => 'What is the name of the plugin',
86 90 ),
87 - 'id10' => array(
88 -
89 - 'title' => '',
90 - 'id' => 10,
91 + 'I want to try a new design, I don\'t like {theme} style' => array(
92 + 'id' => 10,
91 93 ),
92 94 );
93 95 /**
94 96 * Default other option.
@@ -95,18 +97,43 @@
95 97 *
96 98 * @var array $other The other option
97 99 */
98 100 private $other = array(
99 - 'id999' => array(
100 - 'id' => 999,
101 - 'type' => 'textarea',
101 + 'Other' => array(
102 + 'id' => 999,
103 + 'type' => 'textarea',
104 + 'placeholder' => 'What can we do better?',
102 105 ),
103 106 );
107 + /**
108 + * Default heading for plugin.
109 + *
110 + * @var string $heading_plugin The heading of the modal
111 + */
112 + private $heading_plugin = 'What\'s wrong?';
113 + /**
114 + * Default heading for theme.
115 + *
116 + * @var string $heading_theme The heading of the modal
117 + */
118 + private $heading_theme = 'What does not work for you in {theme}?';
119 + /**
120 + * Default submit button action text.
121 + *
122 + * @var string $button_submit The text of the deactivate button
123 + */
124 + private $button_submit = 'Submit & Deactivate';
125 + /**
126 + * Default cancel button.
127 + *
128 + * @var string $button_cancel The text of the cancel button
129 + */
130 + private $button_cancel = 'Skip & Deactivate';
104 131
105 132 /**
106 133 * Loads the additional resources
107 134 */
108 - public function load_resources() {
135 + function load_resources() {
109 136 $screen = get_current_screen();
110 137
111 138 if ( ! $screen || ! in_array( $screen->id, array( 'theme-install', 'plugins' ) ) ) {
112 139 return;
@@ -127,13 +154,13 @@
127 154 /**
128 155 * Render theme feedback drawer.
129 156 */
130 157 private function render_theme_feedback_popup() {
131 - $heading = str_replace( '{theme}', $this->product->get_name(), Loader::$labels['uninstall']['heading_theme'] );
132 - $button_submit = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit', Loader::$labels['uninstall']['submit'] );
158 + $heading = str_replace( '{theme}', $this->product->get_name(), $this->heading_theme );
159 + $button_submit = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit', 'Submit' );
133 160 $options = $this->options_theme;
134 161 $options = $this->randomize_options( apply_filters( $this->product->get_key() . '_feedback_deactivate_options', $options ) );
135 - $info_disclosure_link = '<a href="#" class="info-disclosure-link">' . apply_filters( $this->product->get_slug() . '_themeisle_sdk_info_collect_cta', Loader::$labels['uninstall']['cta_info'] ) . '</a>';
162 + $info_disclosure_link = '<a href="#" class="info-disclosure-link">' . apply_filters( $this->product->get_slug() . '_themeisle_sdk_info_collect_cta', 'What info do we collect?' ) . '</a>';
136 163
137 164 $options += $this->other;
138 165
139 166 ?>
@@ -150,9 +177,9 @@
150 177 <?php
151 178 echo wp_kses_post( $info_disclosure_link );
152 179 echo wp_kses_post( $this->get_disclosure_labels() );
153 180 echo '<div class="buttons">';
154 - echo get_submit_button( //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, Function has an internal sanitization.
181 + echo get_submit_button(
155 182 $button_submit,
156 183 'secondary',
157 184 $this->product->get_key() . 'ti-deactivate-yes',
158 185 false,
@@ -208,9 +235,9 @@
208 235 font-size: 13px;
209 236 }
210 237
211 238 .ti-feedback .popup--form input[type="radio"] {
212 - <?php echo is_rtl() ? 'margin: 0 0 0 10px;' : 'margin: 0 10px 0 0;'; ?>
239 + <?php echo is_rtl() ? 'margin: 0 0 0 10px;' : 'margin: 0 10px 0 0;'; ?>
213 240 }
214 241
215 242 .ti-feedback .popup--form input[type="radio"]:checked ~ textarea {
216 243 display: block;
@@ -286,9 +313,9 @@
286 313 width: 100%;
287 314 }
288 315
289 316 .ti-feedback .buttons input:last-child {
290 - <?php echo is_rtl() ? 'margin-right: auto;' : 'margin-left: auto;'; ?>
317 + <?php echo is_rtl() ? 'margin-right: auto;' : 'margin-left: auto;'; ?>
291 318 }
292 319
293 320 .ti-theme-uninstall-feedback-drawer {
294 321 border-top-left-radius: 5px;
@@ -340,19 +367,19 @@
340 367 display: block;
341 368 position: absolute;
342 369 top: 50%;
343 370 transform: translateY(-50%);
344 - <?php
345 - echo is_rtl() ?
346 - 'right: -10px;
347 - border-top: 20px solid transparent;
348 - border-left: 20px solid #23A1CE;
349 - border-bottom: 20px solid transparent;' :
350 - 'left: -10px;
351 - border-top: 20px solid transparent;
352 - border-right: 20px solid #23A1CE;
353 - border-bottom: 20px solid transparent;';
354 - ?>
371 + <?php
372 + echo is_rtl() ?
373 + 'right: -10px;
374 + border-top: 20px solid transparent;
375 + border-left: 20px solid #23A1CE;
376 + border-bottom: 20px solid transparent;' :
377 + 'left: -10px;
378 + border-top: 20px solid transparent;
379 + border-right: 20px solid #23A1CE;
380 + border-bottom: 20px solid transparent;';
381 + ?>
355 382 }
356 383
357 384 .ti-plugin-uninstall-feedback-popup {
358 385 display: none;
@@ -358,9 +385,10 @@
358 385 display: none;
359 386 position: absolute;
360 387 white-space: normal;
361 388 width: 400px;
362 - <?php echo is_rtl() ? 'right: calc( 100% + 15px );' : 'left: calc( 100% + 15px );'; ?> top: -15px;
389 + <?php echo is_rtl() ? 'right: calc( 100% + 15px );' : 'left: calc( 100% + 15px );'; ?>
390 + top: -15px;
363 391 }
364 392
365 393 .ti-plugin-uninstall-feedback-popup.sending-feedback .popup--body i {
366 394 animation: rotation 2s infinite linear;
@@ -385,9 +413,9 @@
385 413 .ti-plugin-uninstall-feedback-popup.active {
386 414 display: block;
387 415 }
388 416
389 - tr[data-plugin^="<?php echo esc_attr( $this->product->get_slug() ); ?>"] .deactivate {
417 + tr[data-plugin^="<?php echo $this->product->get_slug(); ?>"] .deactivate {
390 418 position: relative;
391 419 }
392 420
393 421 body.ti-feedback-open .ti-feedback-overlay {
@@ -446,22 +474,22 @@
446 474 $('.ti-theme-uninstall-feedback-drawer input[type="radio"]').on('change', function () {
447 475 var radio = $(this);
448 476 if (radio.parent().find('textarea').length > 0 &&
449 477 radio.parent().find('textarea').val().length === 0) {
450 - $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').attr('disabled', 'disabled');
478 + $('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
451 479 radio.parent().find('textarea').on('keyup', function (e) {
452 480 if ($(this).val().length === 0) {
453 - $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').attr('disabled', 'disabled');
481 + $('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
454 482 } else {
455 - $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').removeAttr('disabled');
483 + $('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
456 484 }
457 485 });
458 486 } else {
459 - $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').removeAttr('disabled');
487 + $('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
460 488 }
461 489 });
462 490
463 - $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').on('click', function (e) {
491 + $('#<?php echo $key; ?>ti-deactivate-yes').on('click', function (e) {
464 492 e.preventDefault();
465 493 e.stopPropagation();
466 494
467 495 var selectedOption = $(
@@ -467,9 +495,9 @@
467 495 var selectedOption = $(
468 496 '.ti-theme-uninstall-feedback-drawer input[name="ti-deactivate-option"]:checked');
469 497 $.post(ajaxurl, {
470 498 'action': '<?php echo esc_attr( $key ) . '_uninstall_feedback'; ?>',
471 - 'nonce': '<?php echo esc_attr( wp_create_nonce( (string) __CLASS__ ) ); ?>',
499 + 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
472 500 'id': selectedOption.parent().attr('ti-option-id'),
473 501 'msg': selectedOption.parent().find('textarea').val(),
474 502 'type': 'theme',
475 503 'key': '<?php echo esc_attr( $key ); ?>'
@@ -496,23 +524,18 @@
496 524 'textarea' => 2,
497 525 ];
498 526 ?>
499 527 <ul class="popup--form">
500 - <?php
501 - foreach ( $options as $idx => $attributes ) {
502 - $title = Loader::$labels['uninstall']['options'][ $idx ]['title'];
503 - $placeholder = array_key_exists( 'placeholder', Loader::$labels['uninstall']['options'][ $idx ] ) ? Loader::$labels['uninstall']['options'][ $idx ]['placeholder'] : '';
504 - ?>
528 + <?php foreach ( $options as $title => $attributes ) { ?>
505 529 <li ti-option-id="<?php echo esc_attr( $attributes['id'] ); ?>">
506 - <input type="radio" name="ti-deactivate-option"
507 - id="<?php echo esc_attr( $key . $attributes['id'] ); ?>">
530 + <input type="radio" name="ti-deactivate-option" id="<?php echo esc_attr( $key . $attributes['id'] ); ?>">
508 531 <label for="<?php echo esc_attr( $key . $attributes['id'] ); ?>">
509 - <?php echo esc_attr( str_replace( '{theme}', $this->product->get_name(), $title ) ); ?>
532 + <?php echo str_replace( '{theme}', $this->product->get_name(), $title ); ?>
510 533 </label>
511 534 <?php
512 535 if ( array_key_exists( 'type', $attributes ) ) {
513 -
514 - echo '<textarea width="100%" rows="' . esc_attr( $inputs_row_map[ $attributes['type'] ] ) . '" name="comments" placeholder="' . esc_attr( $placeholder ) . '"></textarea>';
536 + $placeholder = array_key_exists( 'placeholder', $attributes ) ? $attributes['placeholder'] : '';
537 + echo '<textarea width="100%" rows="' . $inputs_row_map[ $attributes['type'] ] . '" name="comments" placeholder="' . esc_attr( $placeholder ) . '"></textarea>';
515 538 }
516 539 ?>
517 540 </li>
518 541 <?php } ?>
@@ -523,19 +546,18 @@
523 546 /**
524 547 * Render plugin feedback popup.
525 548 */
526 549 private function render_plugin_feedback_popup() {
527 - $button_cancel = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_cancel', Loader::$labels['uninstall']['button_cancel'] );
528 - $button_submit = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit', Loader::$labels['uninstall']['button_submit'] );
550 + $button_cancel = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_cancel', $this->button_cancel );
551 + $button_submit = apply_filters( $this->product->get_key() . '_feedback_deactivate_button_submit', $this->button_submit );
529 552 $options = $this->randomize_options( apply_filters( $this->product->get_key() . '_feedback_deactivate_options', $this->options_plugin ) );
530 - $info_disclosure_link = '<a href="#" class="info-disclosure-link">' . apply_filters( $this->product->get_slug() . '_themeisle_sdk_info_collect_cta', Loader::$labels['uninstall']['cta_info'] ) . '</a>';
553 + $info_disclosure_link = '<a href="#" class="info-disclosure-link">' . apply_filters( $this->product->get_slug() . '_themeisle_sdk_info_collect_cta', 'What info do we collect?' ) . '</a>';
531 554
532 555 $options += $this->other;
533 556 ?>
534 - <div class="ti-plugin-uninstall-feedback-popup ti-feedback"
535 - id="<?php echo esc_attr( $this->product->get_slug() . '_uninstall_feedback_popup' ); ?>">
557 + <div class="ti-plugin-uninstall-feedback-popup ti-feedback" id="<?php echo esc_attr( $this->product->get_slug() . '_uninstall_feedback_popup' ); ?>">
536 558 <div class="popup--header">
537 - <h5><?php echo wp_kses( Loader::$labels['uninstall']['heading_plugin'], array( 'span' => true ) ); ?> </h5>
559 + <h5><?php echo wp_kses( $this->heading_plugin, array( 'span' => true ) ); ?> </h5>
538 560 </div><!--/.popup--header-->
539 561 <div class="popup--body">
540 562 <?php $this->render_options_list( $options ); ?>
541 563 </div><!--/.popup--body-->
@@ -544,15 +566,15 @@
544 566 <?php
545 567 echo wp_kses_post( $info_disclosure_link );
546 568 echo wp_kses_post( $this->get_disclosure_labels() );
547 569 echo '<div class="buttons">';
548 - echo get_submit_button( //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, Function internals are escaped.
570 + echo get_submit_button(
549 571 $button_cancel,
550 572 'secondary',
551 573 $this->product->get_key() . 'ti-deactivate-no',
552 574 false
553 575 );
554 - echo get_submit_button( //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, Function internals are escaped.
576 + echo get_submit_button(
555 577 $button_submit,
556 578 'primary',
557 579 $this->product->get_key() . 'ti-deactivate-yes',
558 580 false,
@@ -579,9 +601,9 @@
579 601 ?>
580 602 <script type="text/javascript" id="ti-deactivate-js">
581 603 (function ($) {
582 604 $(document).ready(function () {
583 - var targetElement = 'tr[data-plugin^="<?php echo esc_attr( $this->product->get_slug() ); ?>/"] span.deactivate a';
605 + var targetElement = 'tr[data-plugin^="<?php echo $this->product->get_slug(); ?>/"] span.deactivate a';
584 606 var redirectUrl = $(targetElement).attr('href');
585 607 if ($('.ti-feedback-overlay').length === 0) {
586 608 $('body').prepend('<div class="ti-feedback-overlay"></div>');
587 609 }
@@ -605,22 +627,22 @@
605 627 $('<?php echo esc_attr( $popup_id ); ?> input[type="radio"]').on('change', function () {
606 628 var radio = $(this);
607 629 if (radio.parent().find('textarea').length > 0 &&
608 630 radio.parent().find('textarea').val().length === 0) {
609 - $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').attr('disabled', 'disabled');
631 + $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
610 632 radio.parent().find('textarea').on('keyup', function (e) {
611 633 if ($(this).val().length === 0) {
612 - $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').attr('disabled', 'disabled');
634 + $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
613 635 } else {
614 - $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').removeAttr('disabled');
636 + $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
615 637 }
616 638 });
617 639 } else {
618 - $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').removeAttr('disabled');
640 + $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
619 641 }
620 642 });
621 643
622 - $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-no').on('click', function (e) {
644 + $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-no').on('click', function (e) {
623 645 e.preventDefault();
624 646 e.stopPropagation();
625 647 $(targetElement).unbind('click');
626 648 $('body').removeClass('ti-feedback-open');
@@ -629,9 +651,9 @@
629 651 location.href = redirectUrl;
630 652 }
631 653 });
632 654
633 - $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').on('click', function (e) {
655 + $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').on('click', function (e) {
634 656 e.preventDefault();
635 657 e.stopPropagation();
636 658 $(targetElement).unbind('click');
637 659 var selectedOption = $(
@@ -637,9 +659,9 @@
637 659 var selectedOption = $(
638 660 '<?php echo esc_attr( $popup_id ); ?> input[name="ti-deactivate-option"]:checked');
639 661 var data = {
640 662 'action': '<?php echo esc_attr( $key ) . '_uninstall_feedback'; ?>',
641 - 'nonce': '<?php echo esc_attr( wp_create_nonce( (string) __CLASS__ ) ); ?>',
663 + 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
642 664 'id': selectedOption.parent().attr('ti-option-id'),
643 665 'msg': selectedOption.parent().find('textarea').val(),
644 666 'type': 'plugin',
645 667 'key': '<?php echo esc_attr( $key ); ?>'
@@ -678,14 +700,13 @@
678 700 private function get_disclosure_labels() {
679 701 $disclosure_new_labels = apply_filters( $this->product->get_slug() . '_themeisle_sdk_disclosure_content_labels', [], $this->product );
680 702 $disclosure_labels = array_merge(
681 703 [
682 - 'title' => Loader::$labels['uninstall']['disclosure']['title'],
704 + 'title' => 'Below is a detailed view of all data that ThemeIsle will receive if you fill in this survey. No domain name, email address or IP addresses are transmited after you submit the survey.',
683 705 'items' => [
684 - sprintf( Loader::$labels['uninstall']['disclosure']['version'], '<strong>', ucwords( $this->product->get_type() ), '</strong>', '<code>', $this->product->get_version(), '</code>' ),
685 - sprintf( Loader::$labels['uninstall']['disclosure']['website'], '<strong>', '</strong>', '<code>', get_site_url(), '</code>' ),
686 - sprintf( Loader::$labels['uninstall']['disclosure']['usage'], '<strong>', '</strong>', '<code>', ( time() - $this->product->get_install_time() ), 's</code>' ),
687 - sprintf( Loader::$labels['uninstall']['disclosure']['reason'], '<strong>', '</strong>', '<i>', '</i>' ),
706 + sprintf( '%s %s version %s %s %s %s', '<strong>', ucwords( $this->product->get_type() ), '</strong>', '<code>', $this->product->get_version(), '</code>' ),
707 + sprintf( '%sCurrent website:%s %s %s %s', '<strong>', '</strong>', '<code>', get_site_url(), '</code>' ),
708 + sprintf( '%s Uninstall reason %s %s Selected reason from the above survey %s ', '<strong>', '</strong>', '<i>', '</i>' ),
688 709 ],
689 710 ],
690 711 $disclosure_new_labels
691 712 );
@@ -703,9 +724,9 @@
703 724 * Randomizes the options array.
704 725 *
705 726 * @param array $options The options array.
706 727 */
707 - public function randomize_options( $options ) {
728 + function randomize_options( $options ) {
708 729 $new = array();
709 730 $keys = array_keys( $options );
710 731 shuffle( $keys );
711 732
@@ -718,9 +739,9 @@
718 739
719 740 /**
720 741 * Called when the deactivate button is clicked.
721 742 */
722 - public function post_deactivate() {
743 + function post_deactivate() {
723 744 check_ajax_referer( (string) __CLASS__, 'nonce' );
724 745
725 746 $this->post_deactivate_or_cancel();
726 747
@@ -732,10 +753,10 @@
732 753 }
733 754 $this->call_api(
734 755 array(
735 756 'type' => 'deactivate',
736 - 'id' => sanitize_key( $_POST['id'] ),
737 - 'comment' => isset( $_POST['msg'] ) ? sanitize_textarea_field( $_POST['msg'] ) : '',
757 + 'id' => $_POST['id'],
758 + 'comment' => isset( $_POST['msg'] ) ? $_POST['msg'] : '',
738 759 )
739 760 );
740 761 wp_send_json( [] );
741 762
@@ -744,16 +765,16 @@
744 765 /**
745 766 * Called when the deactivate/cancel button is clicked.
746 767 */
747 768 private function post_deactivate_or_cancel() {
748 - if ( ! isset( $_POST['type'] ) || ! isset( $_POST['key'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing, Nonce already present in caller function.
769 + if ( ! isset( $_POST['type'] ) || ! isset( $_POST['key'] ) ) {
749 770 return;
750 771 }
751 - if ( 'theme' !== $_POST['type'] ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing, Nonce already present in caller function.
772 + if ( 'theme' !== $_POST['type'] ) {
752 773 return;
753 774 }
754 775
755 - set_transient( 'ti_sdk_pause_' . sanitize_text_field( $_POST['key'] ), true, self::PAUSE_DEACTIVATE_WINDOW_DAYS * DAY_IN_SECONDS );//phpcs:ignore WordPress.Security.NonceVerification.Missing, Nonce already present in caller function.
776 + set_transient( 'ti_sdk_pause_' . $_POST['key'], true, self::PAUSE_DEACTIVATE_WINDOW_DAYS * DAY_IN_SECONDS );
756 777
757 778 }
758 779
759 780 /**
@@ -763,14 +784,13 @@
763 784 *
764 785 * @return bool Is the request succesfull?
765 786 */
766 787 protected function call_api( $attributes ) {
767 - $slug = $this->product->get_slug();
768 - $version = $this->product->get_version();
769 - $attributes['slug'] = $slug;
770 - $attributes['version'] = $version;
771 - $attributes['url'] = get_site_url();
772 - $attributes['active_time'] = ( time() - $this->product->get_install_time() );
788 + $slug = $this->product->get_slug();
789 + $version = $this->product->get_version();
790 + $attributes['slug'] = $slug;
791 + $attributes['version'] = $version;
792 + $attributes['url'] = get_site_url();
773 793
774 794 $response = wp_remote_post(
775 795 self::FEEDBACK_ENDPOINT,
776 796 array(