PluginProbe
Visualizer – Tables & Charts Manager with Built-in AI Generator / 3.4.4
Visualizer – Tables & Charts Manager with Built-in AI Generator v3.4.4
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 +42 -50 3.10.43.4.4 View file →
@@ -131,9 +131,9 @@
131 131
132 132 /**
133 133 * Loads the additional resources
134 134 */
135 - public function load_resources() {
135 + function load_resources() {
136 136 $screen = get_current_screen();
137 137
138 138 if ( ! $screen || ! in_array( $screen->id, array( 'theme-install', 'plugins' ) ) ) {
139 139 return;
@@ -177,9 +177,9 @@
177 177 <?php
178 178 echo wp_kses_post( $info_disclosure_link );
179 179 echo wp_kses_post( $this->get_disclosure_labels() );
180 180 echo '<div class="buttons">';
181 - echo get_submit_button( //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, Function has an internal sanitization.
181 + echo get_submit_button(
182 182 $button_submit,
183 183 'secondary',
184 184 $this->product->get_key() . 'ti-deactivate-yes',
185 185 false,
@@ -235,9 +235,9 @@
235 235 font-size: 13px;
236 236 }
237 237
238 238 .ti-feedback .popup--form input[type="radio"] {
239 - <?php echo is_rtl() ? 'margin: 0 0 0 10px;' : 'margin: 0 10px 0 0;'; ?>
239 + margin: 0 10px 0 0;
240 240 }
241 241
242 242 .ti-feedback .popup--form input[type="radio"]:checked ~ textarea {
243 243 display: block;
@@ -313,9 +313,9 @@
313 313 width: 100%;
314 314 }
315 315
316 316 .ti-feedback .buttons input:last-child {
317 - <?php echo is_rtl() ? 'margin-right: auto;' : 'margin-left: auto;'; ?>
317 + margin-left: auto;
318 318 }
319 319
320 320 .ti-theme-uninstall-feedback-drawer {
321 321 border-top-left-radius: 5px;
@@ -365,21 +365,15 @@
365 365 .ti-plugin-uninstall-feedback-popup .popup--header:before {
366 366 content: "";
367 367 display: block;
368 368 position: absolute;
369 + border: 20px solid #23A1CE;
370 + left: -10px;
369 371 top: 50%;
372 + border-top: 20px solid transparent;
373 + border-bottom: 20px solid transparent;
374 + border-left: 0;
370 375 transform: translateY(-50%);
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 - ?>
382 376 }
383 377
384 378 .ti-plugin-uninstall-feedback-popup {
385 379 display: none;
@@ -385,9 +379,9 @@
385 379 display: none;
386 380 position: absolute;
387 381 white-space: normal;
388 382 width: 400px;
389 - <?php echo is_rtl() ? 'right: calc( 100% + 15px );' : 'left: calc( 100% + 15px );'; ?>
383 + left: 100%;
390 384 top: -15px;
391 385 }
392 386
393 387 .ti-plugin-uninstall-feedback-popup.sending-feedback .popup--body i {
@@ -413,9 +407,9 @@
413 407 .ti-plugin-uninstall-feedback-popup.active {
414 408 display: block;
415 409 }
416 410
417 - tr[data-plugin^="<?php echo esc_attr( $this->product->get_slug() ); ?>"] .deactivate {
411 + tr[data-plugin^="<?php echo $this->product->get_slug(); ?>"] .deactivate {
418 412 position: relative;
419 413 }
420 414
421 415 body.ti-feedback-open .ti-feedback-overlay {
@@ -474,22 +468,22 @@
474 468 $('.ti-theme-uninstall-feedback-drawer input[type="radio"]').on('change', function () {
475 469 var radio = $(this);
476 470 if (radio.parent().find('textarea').length > 0 &&
477 471 radio.parent().find('textarea').val().length === 0) {
478 - $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').attr('disabled', 'disabled');
472 + $('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
479 473 radio.parent().find('textarea').on('keyup', function (e) {
480 474 if ($(this).val().length === 0) {
481 - $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').attr('disabled', 'disabled');
475 + $('#<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
482 476 } else {
483 - $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').removeAttr('disabled');
477 + $('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
484 478 }
485 479 });
486 480 } else {
487 - $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').removeAttr('disabled');
481 + $('#<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
488 482 }
489 483 });
490 484
491 - $('#<?php echo esc_attr( $key ); ?>ti-deactivate-yes').on('click', function (e) {
485 + $('#<?php echo $key; ?>ti-deactivate-yes').on('click', function (e) {
492 486 e.preventDefault();
493 487 e.stopPropagation();
494 488
495 489 var selectedOption = $(
@@ -495,9 +489,9 @@
495 489 var selectedOption = $(
496 490 '.ti-theme-uninstall-feedback-drawer input[name="ti-deactivate-option"]:checked');
497 491 $.post(ajaxurl, {
498 492 'action': '<?php echo esc_attr( $key ) . '_uninstall_feedback'; ?>',
499 - 'nonce': '<?php echo esc_attr( wp_create_nonce( (string) __CLASS__ ) ); ?>',
493 + 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
500 494 'id': selectedOption.parent().attr('ti-option-id'),
501 495 'msg': selectedOption.parent().find('textarea').val(),
502 496 'type': 'theme',
503 497 'key': '<?php echo esc_attr( $key ); ?>'
@@ -528,14 +522,14 @@
528 522 <?php foreach ( $options as $title => $attributes ) { ?>
529 523 <li ti-option-id="<?php echo esc_attr( $attributes['id'] ); ?>">
530 524 <input type="radio" name="ti-deactivate-option" id="<?php echo esc_attr( $key . $attributes['id'] ); ?>">
531 525 <label for="<?php echo esc_attr( $key . $attributes['id'] ); ?>">
532 - <?php echo esc_attr( str_replace( '{theme}', $this->product->get_name(), $title ) ); ?>
526 + <?php echo str_replace( '{theme}', $this->product->get_name(), $title ); ?>
533 527 </label>
534 528 <?php
535 529 if ( array_key_exists( 'type', $attributes ) ) {
536 530 $placeholder = array_key_exists( 'placeholder', $attributes ) ? $attributes['placeholder'] : '';
537 - echo '<textarea width="100%" rows="' . esc_attr( $inputs_row_map[ $attributes['type'] ] ) . '" name="comments" placeholder="' . esc_attr( $placeholder ) . '"></textarea>';
531 + echo '<textarea width="100%" rows="' . $inputs_row_map[ $attributes['type'] ] . '" name="comments" placeholder="' . esc_attr( $placeholder ) . '"></textarea>';
538 532 }
539 533 ?>
540 534 </li>
541 535 <?php } ?>
@@ -566,15 +560,15 @@
566 560 <?php
567 561 echo wp_kses_post( $info_disclosure_link );
568 562 echo wp_kses_post( $this->get_disclosure_labels() );
569 563 echo '<div class="buttons">';
570 - echo get_submit_button( //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, Function internals are escaped.
564 + echo get_submit_button(
571 565 $button_cancel,
572 566 'secondary',
573 567 $this->product->get_key() . 'ti-deactivate-no',
574 568 false
575 569 );
576 - echo get_submit_button( //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped, Function internals are escaped.
570 + echo get_submit_button(
577 571 $button_submit,
578 572 'primary',
579 573 $this->product->get_key() . 'ti-deactivate-yes',
580 574 false,
@@ -601,9 +595,9 @@
601 595 ?>
602 596 <script type="text/javascript" id="ti-deactivate-js">
603 597 (function ($) {
604 598 $(document).ready(function () {
605 - var targetElement = 'tr[data-plugin^="<?php echo esc_attr( $this->product->get_slug() ); ?>/"] span.deactivate a';
599 + var targetElement = 'tr[data-plugin^="<?php echo $this->product->get_slug(); ?>/"] span.deactivate a';
606 600 var redirectUrl = $(targetElement).attr('href');
607 601 if ($('.ti-feedback-overlay').length === 0) {
608 602 $('body').prepend('<div class="ti-feedback-overlay"></div>');
609 603 }
@@ -627,22 +621,22 @@
627 621 $('<?php echo esc_attr( $popup_id ); ?> input[type="radio"]').on('change', function () {
628 622 var radio = $(this);
629 623 if (radio.parent().find('textarea').length > 0 &&
630 624 radio.parent().find('textarea').val().length === 0) {
631 - $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').attr('disabled', 'disabled');
625 + $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
632 626 radio.parent().find('textarea').on('keyup', function (e) {
633 627 if ($(this).val().length === 0) {
634 - $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').attr('disabled', 'disabled');
628 + $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').attr('disabled', 'disabled');
635 629 } else {
636 - $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').removeAttr('disabled');
630 + $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
637 631 }
638 632 });
639 633 } else {
640 - $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').removeAttr('disabled');
634 + $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').removeAttr('disabled');
641 635 }
642 636 });
643 637
644 - $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-no').on('click', function (e) {
638 + $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-no').on('click', function (e) {
645 639 e.preventDefault();
646 640 e.stopPropagation();
647 641 $(targetElement).unbind('click');
648 642 $('body').removeClass('ti-feedback-open');
@@ -651,9 +645,9 @@
651 645 location.href = redirectUrl;
652 646 }
653 647 });
654 648
655 - $('<?php echo esc_attr( $popup_id ); ?> #<?php echo esc_attr( $key ); ?>ti-deactivate-yes').on('click', function (e) {
649 + $('<?php echo esc_attr( $popup_id ); ?> #<?php echo $key; ?>ti-deactivate-yes').on('click', function (e) {
656 650 e.preventDefault();
657 651 e.stopPropagation();
658 652 $(targetElement).unbind('click');
659 653 var selectedOption = $(
@@ -659,9 +653,9 @@
659 653 var selectedOption = $(
660 654 '<?php echo esc_attr( $popup_id ); ?> input[name="ti-deactivate-option"]:checked');
661 655 var data = {
662 656 'action': '<?php echo esc_attr( $key ) . '_uninstall_feedback'; ?>',
663 - 'nonce': '<?php echo esc_attr( wp_create_nonce( (string) __CLASS__ ) ); ?>',
657 + 'nonce': '<?php echo wp_create_nonce( (string) __CLASS__ ); ?>',
664 658 'id': selectedOption.parent().attr('ti-option-id'),
665 659 'msg': selectedOption.parent().find('textarea').val(),
666 660 'type': 'plugin',
667 661 'key': '<?php echo esc_attr( $key ); ?>'
@@ -700,13 +694,12 @@
700 694 private function get_disclosure_labels() {
701 695 $disclosure_new_labels = apply_filters( $this->product->get_slug() . '_themeisle_sdk_disclosure_content_labels', [], $this->product );
702 696 $disclosure_labels = array_merge(
703 697 [
704 - 'title' => 'Below is a detailed view of all data that ThemeIsle will receive if you fill in this survey. No email address or IP addresses are transmitted after you submit the survey.',
698 + '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.',
705 699 'items' => [
706 700 sprintf( '%s %s version %s %s %s %s', '<strong>', ucwords( $this->product->get_type() ), '</strong>', '<code>', $this->product->get_version(), '</code>' ),
707 701 sprintf( '%sCurrent website:%s %s %s %s', '<strong>', '</strong>', '<code>', get_site_url(), '</code>' ),
708 - sprintf( '%sUsage time:%s %s %s%s', '<strong>', '</strong>', '<code>', ( time() - $this->product->get_install_time() ), 's</code>' ),
709 702 sprintf( '%s Uninstall reason %s %s Selected reason from the above survey %s ', '<strong>', '</strong>', '<i>', '</i>' ),
710 703 ],
711 704 ],
712 705 $disclosure_new_labels
@@ -725,9 +718,9 @@
725 718 * Randomizes the options array.
726 719 *
727 720 * @param array $options The options array.
728 721 */
729 - public function randomize_options( $options ) {
722 + function randomize_options( $options ) {
730 723 $new = array();
731 724 $keys = array_keys( $options );
732 725 shuffle( $keys );
733 726
@@ -740,9 +733,9 @@
740 733
741 734 /**
742 735 * Called when the deactivate button is clicked.
743 736 */
744 - public function post_deactivate() {
737 + function post_deactivate() {
745 738 check_ajax_referer( (string) __CLASS__, 'nonce' );
746 739
747 740 $this->post_deactivate_or_cancel();
748 741
@@ -754,10 +747,10 @@
754 747 }
755 748 $this->call_api(
756 749 array(
757 750 'type' => 'deactivate',
758 - 'id' => sanitize_key( $_POST['id'] ),
759 - 'comment' => isset( $_POST['msg'] ) ? sanitize_textarea_field( $_POST['msg'] ) : '',
751 + 'id' => $_POST['id'],
752 + 'comment' => isset( $_POST['msg'] ) ? $_POST['msg'] : '',
760 753 )
761 754 );
762 755 wp_send_json( [] );
763 756
@@ -766,16 +759,16 @@
766 759 /**
767 760 * Called when the deactivate/cancel button is clicked.
768 761 */
769 762 private function post_deactivate_or_cancel() {
770 - if ( ! isset( $_POST['type'] ) || ! isset( $_POST['key'] ) ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing, Nonce already present in caller function.
763 + if ( ! isset( $_POST['type'] ) || ! isset( $_POST['key'] ) ) {
771 764 return;
772 765 }
773 - if ( 'theme' !== $_POST['type'] ) { //phpcs:ignore WordPress.Security.NonceVerification.Missing, Nonce already present in caller function.
766 + if ( 'theme' !== $_POST['type'] ) {
774 767 return;
775 768 }
776 769
777 - 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.
770 + set_transient( 'ti_sdk_pause_' . $_POST['key'], true, self::PAUSE_DEACTIVATE_WINDOW_DAYS * DAY_IN_SECONDS );
778 771
779 772 }
780 773
781 774 /**
@@ -785,14 +778,13 @@
785 778 *
786 779 * @return bool Is the request succesfull?
787 780 */
788 781 protected function call_api( $attributes ) {
789 - $slug = $this->product->get_slug();
790 - $version = $this->product->get_version();
791 - $attributes['slug'] = $slug;
792 - $attributes['version'] = $version;
793 - $attributes['url'] = get_site_url();
794 - $attributes['active_time'] = ( time() - $this->product->get_install_time() );
782 + $slug = $this->product->get_slug();
783 + $version = $this->product->get_version();
784 + $attributes['slug'] = $slug;
785 + $attributes['version'] = $version;
786 + $attributes['url'] = get_site_url();
795 787
796 788 $response = wp_remote_post(
797 789 self::FEEDBACK_ENDPOINT,
798 790 array(