PluginProbe
HubSpot All-In-One Marketing – Forms, Popups, Live Chat / 11.0.7
HubSpot All-In-One Marketing – Forms, Popups, Live Chat v11.0.7
11.3.75 11.3.73 11.3.71 11.3.70 11.3.69 11.3.64 11.3.65 11.3.62 11.3.61 11.3.56 11.3.58 11.0.31 11.0.52 11.0.54 11.0.56 11.0.58 11.0.7 11.1.10 11.1.11 11.1.13 11.1.14 11.1.15 11.1.2 11.1.20 11.1.21 All 73 releases
leadin / public / admin / class-deactivationform.php

class-deactivationform.php in HubSpot All-In-One Marketing – Forms, Popups, Live Chat 11.0.7, at public/admin/class-deactivationform.php

100 lines 3.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Leadin\admin;
4
5 use Leadin\data\Portal_Options;
6 use \Leadin\includes\utils as utils;
7
8 /**
9 * Class responsible for rendering the deactivation feedback form.
10 */
11 class DeactivationForm {
12 /**
13 * Class constructor, adds necessary hooks.
14 */
15 public function __construct() {
16 add_action( 'admin_footer', array( $this, 'add_feedback_form' ) );
17 }
18
19 /**
20 * Render deactivation feedback form on plugin page.
21 */
22 public function add_feedback_form() {
23 if ( get_current_screen()->id === 'plugins' ) {
24 // handlers and logic are added via jQuery in the frontend.
25 ?>
26 <div id="leadin-feedback-container" style="display: none;">
27 <div class="leadin-feedback-header">
28 <h2><?php echo esc_html( __( "We're sorry to see you go", 'leadin' ) ); ?></h2>
29 <div class="leadin-modal-close">
30 <svg class="leadin-close-svg" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg">
31 <path class="leadin-close-path" d="M14.5,1.5l-13,13m0-13,13,13" transform="translate(-1 -1)"></path>
32 </svg>
33 </div>
34 </div>
35 <div class="leadin-feedback-body">
36 <div>
37 <strong>
38 <?php echo esc_html( __( "If you have a moment, please let us know why you're deactivating the plugin.", 'leadin' ) ); ?>
39 </strong>
40 </div>
41 <form id='leadin-deactivate-form' class="leadin-deactivate-form">
42 <?php
43 $radio_buttons = array(
44 "I can't sign up or log in",
45 'The plugin is impacting website performance',
46 "The plugin isn't working",
47 "The plugin isn't useful",
48 'Temporarily disabling or troubleshooting',
49 'Other',
50 );
51
52 $radio_button_translations = array(
53 __( "I can't sign up or log in", 'leadin' ),
54 __( 'The plugin is impacting website performance', 'leadin' ),
55 __( "The plugin isn't working", 'leadin' ),
56 __( "The plugin isn't useful", 'leadin' ),
57 __( 'Temporarily disabling or troubleshooting', 'leadin' ),
58 __( 'Other', 'leadin' ),
59 );
60
61 $buttons_count = count( $radio_buttons );
62 for ( $i = 0; $i < $buttons_count; $i++ ) {
63 ?>
64 <div class="leadin-radio-input-container">
65 <input
66 type="radio"
67 id="leadinFeedback<?php echo esc_attr( $i ); ?>"
68 name="feedback"
69 value="<?php echo esc_attr( $radio_buttons[ $i ] ); ?>"
70 class="leadin-feedback-radio"
71 required
72 >
73 <label for="leadinFeedback<?php echo esc_attr( $i ); ?>">
74 <?php echo esc_html( $radio_button_translations[ $i ] ); ?>
75 </label>
76 </div>
77 <?php
78 }
79 ?>
80 <textarea name="details" class="leadin-feedback-text-area leadin-feedback-text-control" placeholder="<?php echo esc_html( __( 'Feedback...', 'leadin' ) ); ?>"></textarea>
81 <input type="hidden" name="portal_id" value="<?php echo esc_html( Portal_Options::get_portal_id() ); ?>">
82 <div class="leadin-button-container">
83 <button type="submit" id="leadin-feedback-submit" class="leadin-button leadin-primary-button leadin-loader-button">
84 <div class="leadin-loader-button-content">
85 <?php echo esc_html( __( 'Submit & deactivate', 'leadin' ) ); ?>
86 </div>
87 <div class="leadin-loader"></div>
88 </button>
89 <button type="button" id="leadin-feedback-skip" class="leadin-button leadin-secondary-button">
90 <?php echo esc_html( __( 'Skip & deactivate', 'leadin' ) ); ?>
91 </button>
92 </div>
93 </form>
94 </div>
95 </div>
96 <?php
97 }
98 }
99 }
100