PluginProbe ʕ •ᴥ•ʔ
Auto Post Cleaner / 3.10.2
Auto Post Cleaner v3.10.2
3.12.0 3.13.1 3.2.4 3.2.5 3.3.0 3.3.10 3.3.11 3.3.8 3.4.2 3.5.3 3.6.0 3.7.0 3.7.1 3.7.2 3.7.3 3.7.5 3.7.6 3.8.0 3.9.0 3.9.4 3.9.6 3.9.7 trunk 3.0.0 3.1.0 3.10.1 3.10.2 3.11.4
delete-old-posts-programmatically / freemius / templates / forms / optout.php
delete-old-posts-programmatically / freemius / templates / forms Last commit date
deactivation 3 years ago affiliation.php 1 year ago data-debug-mode.php 3 years ago email-address-update.php 3 years ago index.php 5 years ago license-activation.php 11 months ago optout.php 2 years ago premium-versions-upgrade-handler.php 5 years ago premium-versions-upgrade-metadata.php 5 years ago resend-key.php 3 years ago subscription-cancellation.php 2 years ago trial-start.php 3 years ago user-change.php 3 years ago
optout.php
184 lines
1 <?php
2 /**
3 * @package Freemius
4 * @copyright Copyright (c) 2015, Freemius, Inc.
5 * @license https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3
6 * @since 1.2.1.5
7 */
8
9 if ( ! defined( 'ABSPATH' ) ) {
10 exit;
11 }
12
13 /**
14 * @var array $VARS
15 * @var Freemius $fs
16 */
17 $fs = freemius( $VARS['id'] );
18 $slug = $fs->get_slug();
19
20 $reconnect_url = $fs->get_activation_url( array(
21 'nonce' => wp_create_nonce( $fs->get_unique_affix() . '_reconnect' ),
22 'fs_action' => ( $fs->get_unique_affix() . '_reconnect' ),
23 ) );
24
25 $plugin_title = "<strong>" . esc_html( $fs->get_plugin()->title ) . "</strong>";
26 $opt_out_text = fs_text_x_inline( 'Opt Out', 'verb', 'opt-out', $slug );
27
28 $permission_manager = FS_Permission_Manager::instance( $fs );
29
30 fs_enqueue_local_style( 'fs_dialog_boxes', '/admin/dialog-boxes.css' );
31 fs_enqueue_local_style( 'fs_optout', '/admin/optout.css' );
32 fs_enqueue_local_style( 'fs_common', '/admin/common.css' );
33
34 if ( ! $permission_manager->is_premium_context() ) {
35 $optional_permissions = array( $permission_manager->get_extensions_permission( false,
36 false,
37 true
38 ) );
39
40 $permission_groups = array(
41 array(
42 'id' => 'communication',
43 'type' => 'required',
44 'title' => $fs->get_text_inline( 'Communication', 'communication' ),
45 'desc' => '',
46 'permissions' => $permission_manager->get_opt_in_required_permissions( true ),
47 'is_enabled' => $fs->is_registered(),
48 'prompt' => array(
49 $fs->esc_html_inline( "Sharing your name and email allows us to keep you in the loop about new features and important updates, warn you about security issues before they become public knowledge, and send you special offers.", 'opt-out-message_user' ),
50 sprintf(
51 $fs->esc_html_inline( 'By clicking "Opt Out", %s will no longer be able to view your name and email.',
52 'opt-out-message-clicking-opt-out' ),
53 $plugin_title
54 ),
55 ),
56 'prompt_cancel_label' => $fs->get_text_inline( 'Stay Connected', 'stay-connected' )
57 ),
58 array(
59 'id' => 'diagnostic',
60 'type' => 'required',
61 'title' => $fs->get_text_inline( 'Diagnostic Info', 'diagnostic-info' ),
62 'desc' => '',
63 'permissions' => $permission_manager->get_opt_in_diagnostic_permissions( true ),
64 'is_enabled' => $fs->is_tracking_allowed(),
65 'prompt' => array(
66 sprintf(
67 $fs->esc_html_inline( 'Sharing diagnostic data helps to provide additional functionality that\'s relevant to your website, avoid WordPress or PHP version incompatibilities that can break the website, and recognize which languages & regions the %s should be translated and tailored to.',
68 'opt-out-message-clicking-opt-out' ),
69 $fs->get_module_type()
70 ),
71 sprintf(
72 $fs->esc_html_inline( 'By clicking "Opt Out", diagnostic data will no longer be sent to %s.',
73 'opt-out-message-clicking-opt-out' ),
74 $plugin_title
75 ),
76 ),
77 'prompt_cancel_label' => $fs->get_text_inline( 'Keep Sharing', 'keep-sharing' )
78 ),
79 array(
80 'id' => 'extensions',
81 'type' => 'optional',
82 'title' => $fs->get_text_inline( 'Extensions', 'extensions' ),
83 'desc' => '',
84 'permissions' => $optional_permissions,
85 ),
86 );
87 } else {
88 $optional_permissions = $permission_manager->get_license_optional_permissions( false, true );
89
90 $permission_groups = array(
91 array(
92 'id' => 'essentials',
93 'type' => 'required',
94 'title' => $fs->esc_html_inline( 'Required', 'required' ),
95 'desc' => sprintf( $fs->esc_html_inline( 'For automatic delivery of security & feature updates, and license management & protection, %s needs to:',
96 'license-sync-disclaimer' ),
97 '<b>' . esc_html( $fs->get_plugin_title() ) . '</b>' ),
98 'permissions' => $permission_manager->get_license_required_permissions( true ),
99 'is_enabled' => $permission_manager->is_essentials_tracking_allowed(),
100 'prompt' => array(
101 sprintf( $fs->esc_html_inline( 'To ensure that security & feature updates are automatically delivered directly to your WordPress Admin Dashboard while protecting your license from unauthorized abuse, %2$s needs to view the website’s homepage URL, %1$s version, SDK version, and whether the %1$s is active.', 'premium-opt-out-message-usage-tracking' ), $fs->get_module_type(), $plugin_title ),
102 sprintf( $fs->esc_html_inline( 'By opting out from sharing this information with the updates server, you’ll have to check for new %1$s releases and manually download & install them. Not just a hassle, but missing an update can put your site at risk and cause undue compatibility issues, so we highly recommend keeping these essential permissions on.', 'opt-out-message-clicking-opt-out' ), $fs->get_module_type(), $plugin_title ),
103 ),
104 'prompt_cancel_label' => $fs->get_text_inline( 'Keep automatic updates', 'premium-opt-out-cancel' )
105 ),
106 array(
107 'id' => 'optional',
108 'type' => 'optional',
109 'title' => $fs->esc_html_inline( 'Optional', 'optional' ),
110 'desc' => sprintf( $fs->esc_html_inline( 'For ongoing compatibility with your website, you can optionally allow %s to:',
111 'optional-permissions-disclaimer' ), $plugin_title ),
112 'permissions' => $optional_permissions,
113 ),
114 );
115 }
116
117 $ajax_action = 'toggle_permission_tracking';
118
119 $form_id = "fs_opt_out_{$fs->get_id()}";
120 ?>
121 <div id="<?php echo esc_attr( $form_id ) ?>"
122 class="fs-modal fs-modal-opt-out"
123 data-plugin-id="<?php echo esc_attr( $fs->get_id() ) ?>"
124 data-action="<?php echo esc_attr( $fs->get_ajax_action( $ajax_action ) ) ?>"
125 data-security="<?php echo esc_attr( $fs->get_ajax_security( $ajax_action ) ) ?>"
126 style="display: none">
127 <div class="fs-modal-dialog">
128 <div class="fs-modal-header">
129 <h4><?php echo esc_html( $opt_out_text ) ?></h4>
130 <a href="!#" class="fs-close"><i class="dashicons dashicons-no" title="Dismiss"></i></a>
131 </div>
132 <div class="fs-opt-out-permissions">
133 <div class="fs-modal-body">
134 <div class="notice notice-error inline opt-out-error-message"><p></p></div>
135 <div class="fs-permissions fs-open">
136 <?php foreach ( $permission_groups as $i => $permission_group ) : ?>
137 <?php $permission_manager->render_permissions_group( $permission_group ) ?>
138 <?php if ( $i < count( $permission_groups ) - 1 ) : ?><hr><?php endif ?>
139 <?php endforeach ?>
140 </div>
141 </div>
142 <div class="fs-modal-footer">
143 <button class="button button-primary button-close" tabindex="1"><?php echo $fs->esc_html_inline( 'Done', 'done' ) ?></button>
144 </div>
145 </div>
146 <?php foreach ( $permission_groups as $i => $permission_group ) : ?>
147 <?php if ( ! empty( $permission_group[ 'prompt' ] ) ) : ?>
148 <div class="fs-<?php echo esc_attr( $permission_group[ 'id' ] ) ?>-opt-out fs-opt-out-disclaimer" data-group-id="<?php echo esc_attr( $permission_group[ 'id' ] ) ?>" style="display: none">
149 <div class="fs-modal-body">
150 <div class="fs-modal-panel active">
151 <div class="notice notice-error inline opt-out-error-message"><p></p></div>
152 <?php foreach ( $permission_group[ 'prompt' ] as $p ) : ?>
153 <?php // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
154 <p><?php echo $p ?></p>
155 <?php endforeach ?>
156 </div>
157 </div>
158 <div class="fs-modal-footer">
159 <a class="fs-opt-out-button" tabindex="2" href="#"><?php echo esc_html( $opt_out_text ) ?></a>
160 <button class="button button-primary fs-opt-out-cancel-button" tabindex="1"><?php echo esc_html( $permission_group[ 'prompt_cancel_label' ] ) ?></button>
161 </div>
162 </div>
163 <?php endif ?>
164 <?php endforeach ?>
165 </div>
166 </div>
167
168 <?php $permission_manager->require_permissions_js( false ) ?>
169
170 <script type="text/javascript">
171 (function( $ ) {
172 $( document ).ready(function() {
173 FS.OptOut(
174 <?php echo wp_json_encode( $fs->get_id() ) ?>,
175 <?php echo wp_json_encode( $slug ) ?>,
176 <?php echo wp_json_encode( $fs->get_module_type() ) ?>,
177 <?php echo $fs->is_registered( true ) ? 'true' : 'false' ?>,
178 <?php echo $fs->is_tracking_allowed() ? 'true' : 'false' ?>,
179 <?php echo wp_json_encode( $reconnect_url ) ?>
180 );
181 });
182 })( jQuery );
183 </script>
184