Duplicate Post - Version 1.2.4

Version Description

  • Added deactivation module
Download this release

Release Info

Developer iclyde
Plugin Icon wp plugin Duplicate Post
Version 1.2.4
Comparing to
See all releases

Code changes from version 1.2.3 to 1.2.4

analyst/src/Mutator.php CHANGED
@@ -60,10 +60,10 @@ class Mutator
60
 
61
  analyst_require_template('optin.php');
62
 
63
- analyst_require_template('forms/deactivate.php', [
64
- 'pencilImage' => analyst_assets_url('img/pencil.png'),
65
- 'smileImage' => analyst_assets_url('img/smile.png'),
66
- ]);
67
 
68
  analyst_require_template('forms/install.php', [
69
  'pluginToInstall' => $this->cache->get('plugin_to_install'),
60
 
61
  analyst_require_template('optin.php');
62
 
63
+ // analyst_require_template('forms/deactivate.php', [
64
+ // 'pencilImage' => analyst_assets_url('img/pencil.png'),
65
+ // 'smileImage' => analyst_assets_url('img/smile.png'),
66
+ // ]);
67
 
68
  analyst_require_template('forms/install.php', [
69
  'pluginToInstall' => $this->cache->get('plugin_to_install'),
copy-delete-posts.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin Name: Copy & Delete Posts
5
  * Plugin URI: https://copy-delete-posts.com
6
  * Description: The best solution to easily make duplicates of your posts & pages, and delete them in one go.
7
- * Version: 1.2.3
8
  * Author: Copy Delete Posts
9
  * Author URI: https://copy-delete-posts.com/
10
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -30,11 +30,13 @@ analyst_init(array(
30
  * @since 1.0.0
31
  */
32
  // Plugin constants
33
- define('CDP_VERSION', '1.2.3');
34
  define('CDP_WP_VERSION', get_bloginfo('version'));
35
  define('CDP_SCRIPT_DEBUG', false);
36
  define('CDP_ROOT_DIR', __DIR__);
37
  define('CDP_ROOT_FILE', __FILE__);
 
 
38
  $cdp_plug_url = plugins_url('', __FILE__);
39
 
40
  load_plugin_textdomain('copy-delete-posts', null, dirname(plugin_basename(__FILE__)) . '/languages');
@@ -142,6 +144,17 @@ add_action('upgrader_process_complete', function () {
142
  $review_banner = new \Inisev\Subs\Inisev_Review(CDP_ROOT_FILE, CDP_ROOT_DIR, 'copy-delete-posts', 'Copy & Delete Posts', 'https://bit.ly/2VeAf2E', 'copy-delete-posts');
143
  }
144
 
 
 
 
 
 
 
 
 
 
 
 
145
  });
146
  /** –– **/
147
 
4
  * Plugin Name: Copy & Delete Posts
5
  * Plugin URI: https://copy-delete-posts.com
6
  * Description: The best solution to easily make duplicates of your posts & pages, and delete them in one go.
7
+ * Version: 1.2.4
8
  * Author: Copy Delete Posts
9
  * Author URI: https://copy-delete-posts.com/
10
  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
30
  * @since 1.0.0
31
  */
32
  // Plugin constants
33
+ define('CDP_VERSION', '1.2.4');
34
  define('CDP_WP_VERSION', get_bloginfo('version'));
35
  define('CDP_SCRIPT_DEBUG', false);
36
  define('CDP_ROOT_DIR', __DIR__);
37
  define('CDP_ROOT_FILE', __FILE__);
38
+ define('CDP_MODULES_DIR', CDP_ROOT_DIR . DIRECTORY_SEPARATOR . 'modules' . DIRECTORY_SEPARATOR);
39
+
40
  $cdp_plug_url = plugins_url('', __FILE__);
41
 
42
  load_plugin_textdomain('copy-delete-posts', null, dirname(plugin_basename(__FILE__)) . '/languages');
144
  $review_banner = new \Inisev\Subs\Inisev_Review(CDP_ROOT_FILE, CDP_ROOT_DIR, 'copy-delete-posts', 'Copy & Delete Posts', 'https://bit.ly/2VeAf2E', 'copy-delete-posts');
145
  }
146
 
147
+ // Deactivation module
148
+ $cdp_plugin_path = trailingslashit(basename(CDP_ROOT_DIR)) . basename(CDP_ROOT_FILE);
149
+ if (isset($GLOBALS['IIEV_PLUGINS_DEACTIVATION'])) {
150
+ if (is_array($GLOBALS['IIEV_PLUGINS_DEACTIVATION'])) $GLOBALS['IIEV_PLUGINS_DEACTIVATION'][] = $cdp_plugin_path;
151
+ } else {
152
+ if (!(class_exists('\Inisev\Subs\Inisev_Deactivation') || class_exists('Inisev\Subs\Inisev_Deactivation') || class_exists('Inisev_Deactivation'))) {
153
+ require_once CDP_MODULES_DIR . 'deactivation' . DIRECTORY_SEPARATOR . 'deactivation.php';
154
+ }
155
+ $deactivation_module = new \Inisev\Subs\Inisev_Deactivation($cdp_plugin_path, CDP_ROOT_DIR, CDP_ROOT_FILE);
156
+ }
157
+
158
  });
159
  /** –– **/
160
 
modules/deactivation/assets/script.js ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Always close the code, cause you can make conflicts (same for css use prefixes)
2
+ (function ($) {
3
+
4
+ let deactivation_urls = {};
5
+
6
+ function getUrl(plugin_dir) {
7
+
8
+ let plugin_slug = plugin_dir.split('/')[0];
9
+ return 'https://wordpress.org/support/plugin/' + plugin_slug + '/#wporg-footer';
10
+
11
+ }
12
+
13
+ function closeModal() {
14
+
15
+ setTimeout(function () {
16
+ $('#iiev-modal-leave').animate({'opacity': 0}, 400);
17
+ }, 200);
18
+
19
+ $('.iiev-modal-leave__body').animate({'opacity': 0, 'top': '-50px'}, 300, function () {
20
+ setTimeout(function () {
21
+ $('#iiev-modal-leave').hide();
22
+ }, 100);
23
+ });
24
+
25
+ }
26
+
27
+ function openModal(e) {
28
+
29
+ e.preventDefault();
30
+
31
+ let plugin_dist = $(e.target).attr('data-plugin-dist');
32
+
33
+ $('.iiev-modal-leave__away-link').attr('href', getUrl(plugin_dist));
34
+ $('.iiev-modal-leave__deactivated-link').attr('href', deactivation_urls[plugin_dist]);
35
+
36
+ $('#iiev-modal-leave').show();
37
+ $('#iiev-modal-leave').animate({'opacity': 1}, 300);
38
+ $('.iiev-modal-leave__body').animate({'opacity': 1, 'top': '0px'}, 300);
39
+
40
+ }
41
+
42
+ function addHook($tr) {
43
+
44
+ $tr.find('.deactivate').find('a').on('click', openModal);
45
+
46
+ }
47
+
48
+ function tryToFindItAndAddEvent(plugin) {
49
+
50
+ let $tr = $('#the-list').find('tr[data-plugin="' + plugin + '"]');
51
+ let deactivate_btn = $tr.find('.deactivate')
52
+ if (typeof deactivate_btn != 'undefined' && deactivate_btn.length > 0) {
53
+ deactivate_url = deactivate_btn.find('a')[0].getAttribute('href');
54
+ if (typeof deactivate_url != 'undefined' && deactivate_url.length > 0) {
55
+ deactivation_urls[plugin] = deactivate_url;
56
+ deactivate_btn.find('a').attr('href', '#');
57
+ deactivate_btn.find('a').attr('data-plugin-dist', plugin);
58
+ addHook($tr);
59
+ }
60
+ }
61
+
62
+ }
63
+
64
+ $('.iiev-modal-leave__btn-close').on('click', closeModal);
65
+
66
+ for (let i = 0; i < IIEV_DEACTIV_PLUG_LIST.length; ++i) {
67
+
68
+ let plugin = IIEV_DEACTIV_PLUG_LIST[i];
69
+ tryToFindItAndAddEvent(plugin);
70
+
71
+ }
72
+
73
+
74
+ })(jQuery);
modules/deactivation/assets/style.css ADDED
@@ -0,0 +1,322 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ :root {
2
+ --icon-browser-color: #590bbe;
3
+ --icon-youtube-color: #e0301a;
4
+ --icon-focus-color: #f78422;
5
+ --icon-write-color: #c344bd;
6
+ --icon-bell-color: #e2c300;
7
+ --icon-robot-color: #3b5998;
8
+ --icon-mic-color: #55acee; }
9
+
10
+ .iiev-modal-leave {
11
+ font-family: "Montserrat", "Arial", sans-serif;
12
+ color: #393939; }
13
+
14
+ .iiev-modal-leave__body {
15
+ opacity: 0;
16
+ top: -50px;
17
+ max-width: 600px;
18
+ position: relative;
19
+ background: #f0fbfe;
20
+ border-radius: 20px;
21
+ display: grid;
22
+ grid-template-columns: 1fr;
23
+ -webkit-box-align: start;
24
+ -ms-flex-align: start;
25
+ align-items: start;
26
+ justify-items: center;
27
+ -webkit-transform: translateY(50px);
28
+ transform: translateY(50px);
29
+ -webkit-transition: 0.5s all;
30
+ transition: 0.5s all;
31
+ margin: 115px auto 0; }
32
+
33
+ .iiev-modal-leave__btn-close {
34
+ display: -webkit-box;
35
+ display: -ms-flexbox;
36
+ display: flex;
37
+ -webkit-box-align: center;
38
+ -ms-flex-align: center;
39
+ align-items: center;
40
+ -webkit-box-pack: center;
41
+ -ms-flex-pack: center;
42
+ justify-content: center;
43
+ width: 26px;
44
+ height: 26px;
45
+ border: 0;
46
+ padding: 0;
47
+ background: transparent;
48
+ position: absolute;
49
+ z-index: 10;
50
+ right: 15px;
51
+ top: 15px;
52
+ cursor: pointer;
53
+ fill: #adadad;
54
+ -webkit-transition: fill 0.3s ease 0s;
55
+ transition: fill 0.3s ease 0s; }
56
+ @media (hover: hover), screen and (min-width: 0\0) {
57
+ .iiev-modal-leave__btn-close:hover {
58
+ fill: #000; } }
59
+
60
+ .iiev-modal-leave__content {
61
+ padding: 0 27px;
62
+ display: grid;
63
+ padding-bottom: 12px; }
64
+ @media (min-width: 600px) {
65
+ .iiev-modal-leave__content {
66
+ grid-template-columns: 247px 1fr;
67
+ gap: 42px 22px; } }
68
+
69
+ .iiev-modal-leave__title-wrap {
70
+ position: relative;
71
+ z-index: 3;
72
+ margin-top: -21px;
73
+ margin-bottom: 40px;
74
+ grid-column: 1/-1; }
75
+ @media (min-width: 600px) {
76
+ .iiev-modal-leave__title-wrap {
77
+ margin-bottom: 0; } }
78
+
79
+ .iiev-modal-leave__title {
80
+ font-weight: 500;
81
+ font-size: 28px;
82
+ line-height: 34px;
83
+ max-width: 255px;
84
+ text-align: center;
85
+ margin: 0 auto;
86
+ position: relative; }
87
+ .iiev-modal-leave__title::after {
88
+ pointer-events: none;
89
+ content: "";
90
+ position: absolute;
91
+ top: 50%;
92
+ left: 50%;
93
+ -webkit-transform: translate(-50%, -50%);
94
+ transform: translate(-50%, -50%);
95
+ width: 230px;
96
+ height: 221px;
97
+ z-index: -1;
98
+ background: url("../img/message.svg") no-repeat;
99
+ background-size: cover; }
100
+ @media (min-width: 600px) {
101
+ .iiev-modal-leave__title::after {
102
+ width: 273px;
103
+ height: 268px; } }
104
+
105
+ .iiev-modal-leave-text-primary {
106
+ color: #2885c0; }
107
+
108
+ .iiev-modal-leave__img-wrap {
109
+ position: relative;
110
+ z-index: 1; }
111
+
112
+ @media (min-width: 600px) {
113
+ .iiev-modal-leave__text-content {
114
+ padding-top: 47px;
115
+ padding-right: 20px; } }
116
+
117
+ .iiev-modal-leave__text-content-title {
118
+ font-weight: normal;
119
+ font-size: 18px;
120
+ line-height: 27px;
121
+ margin: 0 0 19px; }
122
+
123
+ .iiev-modal-leave__away-link {
124
+ padding: 15px 26px 13px 27px;
125
+ text-decoration: none;
126
+ background: #2885c0;
127
+ border-radius: 10px;
128
+ display: -webkit-inline-box;
129
+ display: -ms-inline-flexbox;
130
+ display: inline-flex;
131
+ -webkit-box-align: center;
132
+ -ms-flex-align: center;
133
+ align-items: center;
134
+ -webkit-box-pack: center;
135
+ -ms-flex-pack: center;
136
+ justify-content: center;
137
+ font-weight: 600;
138
+ font-size: 18px;
139
+ line-height: 22px;
140
+ color: #ffffff;
141
+ opacity: 1;
142
+ transition: .3s all;
143
+ margin: 0 auto 15px; }
144
+ .iiev-modal-leave__away-link svg {
145
+ -webkit-transition: -webkit-transform 0.3s ease 0s;
146
+ transition: -webkit-transform 0.3s ease 0s;
147
+ transition: transform 0.3s ease 0s;
148
+ transition: transform 0.3s ease 0s, -webkit-transform 0.3s ease 0s; }
149
+ @media (hover: hover), screen and (min-width: 0\0) {
150
+ .iiev-modal-leave__away-link:hover svg {
151
+ -webkit-transform: translateX(5px);
152
+ transform: translateX(5px); } }
153
+
154
+ .iiev-modal-leave__away-link-text {
155
+ margin-right: 10px; }
156
+
157
+ .iiev-modal-leave__away-link:hover {
158
+ color: white !important;
159
+ opacity: 0.9;
160
+ }
161
+
162
+ .iiev-modal-leave__loggin-trouble {
163
+ display: -webkit-inline-box;
164
+ display: -ms-inline-flexbox;
165
+ display: inline-flex;
166
+ -webkit-box-align: center;
167
+ -ms-flex-align: center;
168
+ align-items: center;
169
+ margin: 0 0 8px 38px; }
170
+ .iiev-modal-leave__loggin-trouble span {
171
+ font-weight: normal;
172
+ font-size: 15px;
173
+ line-height: 18px;
174
+ color: #808080; }
175
+
176
+ .iiev-modal-leave__info {
177
+ display: -webkit-box;
178
+ display: -ms-flexbox;
179
+ display: flex;
180
+ -webkit-box-align: center;
181
+ -ms-flex-align: center;
182
+ align-items: center;
183
+ position: relative;
184
+ margin-left: 5px;
185
+ cursor: pointer; }
186
+ .iiev-modal-leave__info::after {
187
+ display: none;
188
+ content: "";
189
+ position: absolute;
190
+ z-index: 6;
191
+ bottom: calc(100% + 4px);
192
+ left: 50%;
193
+ -webkit-transform: translateX(-50%);
194
+ transform: translateX(-50%);
195
+ width: 0;
196
+ height: 0;
197
+ border-width: 21px 17.5px 0 17.5px;
198
+ border-color: #2885c0 transparent transparent transparent;
199
+ border-style: solid; }
200
+ .iiev-modal-leave__info::before {
201
+ content: "";
202
+ position: absolute;
203
+ width: 100px;
204
+ height: 40px;
205
+ background: transparent;
206
+ top: -30px;
207
+ left: 50%;
208
+ -webkit-transform: translateX(-50%);
209
+ transform: translateX(-50%);
210
+ pointer-events: none; }
211
+ @media (hover: hover), screen and (min-width: 0\0) {
212
+ .iiev-modal-leave__info:hover::before {
213
+ pointer-events: all; }
214
+ .iiev-modal-leave__info:hover::after {
215
+ -webkit-animation: 0.45s ease 0s normal forwards 1 iiev_fadein;
216
+ animation: 0.45s ease 0s normal forwards 1 iiev_fadein;
217
+ display: block }
218
+ .iiev-modal-leave__info:hover .iiev-modal-leave__info-popup {
219
+ -webkit-animation: 0.45s ease 0s normal forwards 1 iiev_fadein;
220
+ animation: 0.45s ease 0s normal forwards 1 iiev_fadein;
221
+ display: block;
222
+ z-index: 6; } }
223
+
224
+ @keyframes iiev_fadein {
225
+ 0% { opacity:0; }
226
+ 66% { opacity:0; }
227
+ 100% { opacity:1; }
228
+ }
229
+
230
+ @-webkit-keyframes iiev_fadein {
231
+ 0% { opacity:0; }
232
+ 66% { opacity:0; }
233
+ 100% { opacity:1; }
234
+ }
235
+
236
+ @keyframes iiev_fadeout {
237
+ 0% { opacity:0; }
238
+ 66% { opacity:0; }
239
+ 100% { opacity:1; display: none; }
240
+ }
241
+
242
+ @-webkit-keyframes iiev_fadeout {
243
+ 0% { opacity:0; }
244
+ 66% { opacity:0; }
245
+ 100% { opacity:1; display: none; }
246
+ }
247
+
248
+ .iiev-modal-leave__info-icon {
249
+ position: relative; }
250
+
251
+ .iiev-modal-leave__info-popup {
252
+ display: none;
253
+ position: absolute;
254
+ bottom: calc(100% + 4px);
255
+ left: -200px;
256
+ width: 200px;
257
+ padding: 20px 28px 19px;
258
+ background: #2885c0;
259
+ -webkit-box-shadow: 0px 0px 17px rgba(0, 0, 0, 0.3);
260
+ box-shadow: 0px 0px 17px rgba(0, 0, 0, 0.3);
261
+ border-radius: 5px;
262
+ font-weight: 500;
263
+ font-size: 15px;
264
+ line-height: 18px;
265
+ text-align: center;
266
+ color: #ffffff;
267
+ opacity: 0;
268
+ transition: .3s all;
269
+ margin-bottom: 11px; }
270
+ @media (min-width: 600px) {
271
+ .iiev-modal-leave__info-popup {
272
+ left: -377px;
273
+ width: 400px; } }
274
+
275
+ .iiev-modal-leave__text-hint {
276
+ font-weight: normal;
277
+ font-size: 13px;
278
+ line-height: 19px;
279
+ color: #2885c0;
280
+ position: relative;
281
+ padding-left: 12px; }
282
+ .iiev-modal-leave__text-hint::before {
283
+ content: "";
284
+ position: absolute;
285
+ left: 0;
286
+ top: 0;
287
+ width: 2px;
288
+ height: 100%;
289
+ border-radius: 2px;
290
+ background: currentColor; }
291
+
292
+ .iiev-modal-leave__footer {
293
+ width: 100%;
294
+ background: #d7f0f7;
295
+ text-align: center;
296
+ border-radius: 0px 0px 20px 20px; }
297
+
298
+ .iiev-modal-leave__deactivated-link {
299
+ text-decoration: none;
300
+ display: -webkit-inline-box;
301
+ display: -ms-inline-flexbox;
302
+ display: inline-flex;
303
+ font-weight: 500;
304
+ font-size: 14px;
305
+ line-height: 17px;
306
+ color: #9fb9bf;
307
+ padding: 16px 5px 17px; }
308
+ @media (hover: hover), screen and (min-width: 0\0) {
309
+ .iiev-modal-leave__deactivated-link:hover {
310
+ color: #3b7887; } }
311
+
312
+ #iiev-modal-leave {
313
+ position: fixed;
314
+ top: 0;
315
+ left: 0;
316
+ width: 100%;
317
+ height: 100%;
318
+ z-index: 99999;
319
+ background: rgba(2, 113, 245, 0.21);
320
+ display: none;
321
+ opacity: 0;
322
+ }
modules/deactivation/deactivation.php ADDED
@@ -0,0 +1,132 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Deactivation free help offer module
5
+ *
6
+ * @category Child Plugin
7
+ * @version v0.1.0
8
+ * @since v0.1.0
9
+ * @author iClyde <kontakt@iclyde.pl>
10
+ * @author Artem K
11
+ */
12
+
13
+ // Namespace
14
+ namespace Inisev\Subs;
15
+
16
+ // Disallow direct access
17
+ if (!defined('ABSPATH')) exit;
18
+
19
+ /**
20
+ * Main class for handling the Deactivation
21
+ */
22
+ if (!class_exists('Inisev\Subs\Inisev_Deactivation')) {
23
+ class Inisev_Deactivation {
24
+
25
+ // Variables
26
+ private $assets_url;
27
+ private $plugin_dir;
28
+
29
+ /**
30
+ * __construct - Initialization of the module
31
+ * @param string $plugin Name with path to the plugin source file e.g. "backup-backup/backup-backup.php"
32
+ *
33
+ * @return void
34
+ */
35
+ function __construct($plugin, $plugin_dir, $plugin_file) {
36
+
37
+ global $pagenow;
38
+ if ($pagenow != 'plugins.php') return;
39
+
40
+ $this->plugin_file = $plugin_file;
41
+ $this->plugin_dir = $plugin_dir;
42
+ $this->assets_url = plugin_dir_url($this->plugin_dir) . basename($plugin_dir);
43
+
44
+ if (file_exists(trailingslashit(WP_PLUGIN_DIR) . $plugin)) {
45
+ if (!isset($GLOBALS['IIEV_PLUGINS_DEACTIVATION'])) {
46
+ $GLOBALS['IIEV_PLUGINS_DEACTIVATION'] = [];
47
+ }
48
+ if (!in_array($plugin, $GLOBALS['IIEV_PLUGINS_DEACTIVATION'])) {
49
+ $GLOBALS['IIEV_PLUGINS_DEACTIVATION'][] = $plugin;
50
+ }
51
+ }
52
+
53
+ $this->enableDeactivation();
54
+
55
+ }
56
+
57
+ /**
58
+ * add_assets - Will add assets for that module
59
+ *
60
+ * @return void
61
+ */
62
+ public function add_assets() {
63
+
64
+ wp_enqueue_script('inisev-deactivation-script', $this->__asset('assets/script.js'), [], filemtime($this->__asset('assets/script.js', true)), true);
65
+ wp_enqueue_style('inisev-deactivation-style', $this->__asset('assets/style.css'), [], filemtime($this->__asset('assets/style.css', true)));
66
+
67
+ add_action('wp_after_admin_bar_render', [&$this, 'render_content']);
68
+
69
+ }
70
+
71
+ /**
72
+ * render_content - Will render content of our deactivation modal
73
+ *
74
+ * @return void
75
+ */
76
+ public function render_content() {
77
+
78
+ require_once trailingslashit(__DIR__) . 'modal.php';
79
+
80
+ }
81
+
82
+ /**
83
+ * __asset - Asset handler will return path
84
+ *
85
+ * @param string $name Relative path to the file
86
+ * @return string Absolute path to that file
87
+ */
88
+ private function __asset($name, $dir = false) {
89
+
90
+ if ($dir == false) {
91
+ return trailingslashit($this->assets_url) . 'modules' . DIRECTORY_SEPARATOR . 'deactivation' . DIRECTORY_SEPARATOR . $name;
92
+ } else {
93
+ return trailingslashit(__DIR__) . $name;
94
+ }
95
+
96
+ }
97
+
98
+ /**
99
+ * add_plugin_list - Will print out script with plugin array
100
+ *
101
+ * @return void
102
+ */
103
+ public function add_plugin_list() {
104
+
105
+ $plugin_list = $GLOBALS['IIEV_PLUGINS_DEACTIVATION'];
106
+ if (is_array($plugin_list) && sizeof($plugin_list) >= 1) {
107
+ echo '<script type="text/javascript"> const IIEV_DEACTIV_PLUG_LIST = ' . json_encode($plugin_list) . ';</script>';
108
+ }
109
+
110
+ }
111
+
112
+ /**
113
+ * enableDeactivation - It will enable deactivation script & style
114
+ *
115
+ * @return void
116
+ */
117
+ private function enableDeactivation() {
118
+
119
+ if (!defined('IIEV_ASSETS_LOADED_DEACTIV')) {
120
+ define('IIEV_ASSETS_LOADED_DEACTIV', true);
121
+ add_action('admin_enqueue_scripts', [&$this, 'add_assets']);
122
+ }
123
+
124
+ if (!defined('IIEV_LIST_MODULE_DEACTIV')) {
125
+ define('IIEV_LIST_MODULE_DEACTIV', true);
126
+ add_action('wp_print_scripts', [&$this, 'add_plugin_list']);
127
+ }
128
+
129
+ }
130
+
131
+ }
132
+ }
modules/deactivation/img/dog.webp ADDED
Binary file
modules/deactivation/img/message.svg ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ <svg width="275" height="260" viewBox="0 0 275 260" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M152.549 17.9273C85.7088 12.3375 27.6767 54.5999 22.8443 112.385C19.2289 155.615 46.4303 195.126 88.2189 214.688C80.8529 241.755 65.0762 243.476 65.0762 243.476C93.7247 250.105 109.631 235.151 117.046 224.373C122.912 225.623 128.914 226.559 135.059 227.073C201.899 232.663 259.931 190.401 264.764 132.616C269.596 74.8313 219.282 23.5081 152.549 17.9273Z" fill="#DBF6FE"/>
3
+ <path d="M142.552 10.2519C121.314 8.4758 99.6793 11.4432 79.795 19.4422C61.8156 26.7321 45.3353 38.1641 33.0046 53.1999C20.9166 67.9304 13.1221 85.8425 11.2119 104.789C9.1845 125.138 14.0838 145.74 24.5632 163.226C35.4106 181.503 51.6406 196.431 70.3337 206.57C72.7231 207.856 75.1215 209.033 77.6277 210.22C77.3584 209.546 76.9813 208.863 76.7119 208.189C74.4547 215.708 71.6584 223.182 66.1764 229.02C64.6216 230.736 62.6356 232.415 60.8025 233.565C60.0028 234.041 59.2031 234.517 58.4124 234.885C58.0709 235.073 57.7385 235.154 57.397 235.343C57.1724 235.433 56.2739 235.792 56.7231 235.612C56.0583 235.774 55.3844 236.043 54.7285 236.097C53.1922 236.294 52.868 238.872 54.4671 239.223C63.9447 241.427 73.908 241.717 83.2794 238.701C90.3056 236.466 96.6137 232.434 101.826 227.225C104.199 224.818 106.364 222.285 108.225 219.51C107.776 219.689 107.21 219.968 106.76 220.147C121.269 223.206 136.173 224.127 150.953 222.649C163.657 221.323 176.181 218.245 188.087 213.487C199.22 208.881 209.823 202.82 219.15 195.132C228.119 187.849 236.018 179.065 242.157 169.265C248.297 159.465 252.567 148.64 254.817 137.321C257.084 125.786 257.213 113.855 255.132 102.39C253.033 91.1417 248.949 80.2697 243.157 70.3405C237.167 60.1777 229.569 51.0745 220.785 43.1748C211.597 34.9157 201.195 28.1835 190.011 23.0144C178.1 17.4587 165.496 13.6906 152.524 11.7372C149.119 10.9097 145.786 10.5224 142.552 10.2519C140.504 10.0806 140.233 13.3148 142.282 13.4861C167.401 15.5868 191.844 24.4703 211.838 39.8211C229.793 53.5901 243.929 72.7934 250.023 94.6895C256.107 116.694 253.594 140.258 243.103 160.55C232.613 180.842 214.775 196.829 194.396 206.849C171.186 218.261 144.709 222.018 119.24 218.911C115.161 218.353 110.984 217.678 106.932 216.796C106.402 216.643 105.719 217.02 105.467 217.433C102.133 222.257 98.0798 226.586 93.2454 229.873C87.0181 234.237 79.6504 236.661 72.1035 237.333C66.5332 237.735 60.8284 237.15 55.3934 235.935C55.3032 237.013 55.2221 237.983 55.1319 239.062C57.3241 238.811 59.5795 237.805 61.4126 236.656C66.5524 233.612 70.6326 228.959 73.5539 223.884C76.2235 219.222 77.932 214.371 79.4428 209.286C79.7305 208.442 79.3624 207.651 78.527 207.256C59.7258 198.41 42.9384 184.955 31.0304 167.675C19.8051 151.321 13.4141 131.68 13.8781 111.852C14.3418 93.3266 20.627 75.2883 31.4393 60.2341C42.4853 44.9822 57.5912 33.1096 74.6454 25.1996C93.2901 16.4455 113.811 12.5165 134.178 13.0256C136.882 13.1431 139.586 13.2607 142.282 13.4861C144.33 13.6574 144.6 10.4232 142.552 10.2519Z" fill="#523823"/>
4
+ </svg>
modules/deactivation/modal.php ADDED
@@ -0,0 +1,81 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Deactivation free help offer module
5
+ *
6
+ * @category Child Plugin
7
+ * @version v0.1.0
8
+ * @since v0.1.0
9
+ * @author iClyde <kontakt@iclyde.pl>
10
+ * @author Artem K
11
+ */
12
+
13
+ // Namespace
14
+ namespace Inisev\Subs;
15
+
16
+ // Disallow direct access
17
+ if (!defined('ABSPATH')) exit;
18
+
19
+ ?>
20
+ <div id="iiev-modal-leave" class="iiev-modal-leave">
21
+
22
+ <div class="iiev-modal-leave__body">
23
+ <button type="button" class="iiev-modal-leave__btn-close" id="iiev-modal-leave__closebtn" aria-label="close modal">
24
+ <svg width="10" height="10" viewBox="0 0 11 10">
25
+ <path d="M9.70384 1.96966L6.66078 4.99993L9.70384 8.03006C10.1565 8.48093 10.1565 9.21127 9.70384 9.66213C9.47768 9.88732 9.18117 10 8.8848 10C8.58794 10 8.2914 9.88749 8.06541 9.66213L5.02168 6.63165L1.97818 9.6621C1.75204 9.88729 1.4555 9.99997 1.15887 9.99997C0.86233 9.99997 0.565989 9.88746 0.339654 9.6621C-0.112987 9.21144 -0.112987 8.48107 0.339654 8.03004L3.38264 4.9999L0.339481 1.96966C-0.11316 1.51896 -0.11316 0.788452 0.339481 0.33776C0.792036 -0.112587 1.52528 -0.112587 1.978 0.33776L5.02165 3.36804L8.06506 0.33776C8.51788 -0.112587 9.2512 -0.112587 9.70367 0.33776C10.1565 0.788452 10.1565 1.51896 9.70384 1.96966Z"></path>
26
+ </svg>
27
+ </button>
28
+ <div class="iiev-modal-leave__content">
29
+
30
+ <div class="iiev-modal-leave__title-wrap">
31
+ <h1 class="iiev-modal-leave__title">
32
+ <b><span class="iiev-modal-leave-text-primary">Please</span></b> don’t leave us!
33
+ </h1>
34
+ </div>
35
+ <div class="iiev-modal-leave__img-wrap">
36
+ <img src="<?php echo $this->__asset('img/dog.webp') ?>" width="247" height="290" alt="dog with sad eyes">
37
+ </div>
38
+
39
+ <div class="iiev-modal-leave__text-content">
40
+ <h2 class="iiev-modal-leave__text-content-title">
41
+ We’re happy to fix the issue, whatever it is! Quickly, and <b><span class="iiev-modal-leave-text-primary">100%
42
+ for free</span></b> :)
43
+ </h2>
44
+ <a href="#" target="_blank" class="iiev-modal-leave__away-link">
45
+ <span class="iiev-modal-leave__away-link-text">Ok, let me ask you</span>
46
+ <svg width="7" height="12" viewBox="0 0 7 12">
47
+ <path d="M6.53033 6.53033C6.82322 6.23744 6.82322 5.76256 6.53033 5.46967L1.75736 0.696699C1.46447 0.403806 0.989592 0.403806 0.696699 0.696699C0.403806 0.989592 0.403806 1.46447 0.696699 1.75736L4.93934 6L0.696699 10.2426C0.403806 10.5355 0.403806 11.0104 0.696699 11.3033C0.989592 11.5962 1.46447 11.5962 1.75736 11.3033L6.53033 6.53033ZM5 6.75H6V5.25H5V6.75Z" fill="white"></path>
48
+ </svg>
49
+ </a>
50
+ <div class="iiev-modal-leave__loggin-trouble">
51
+
52
+ <span>Trouble logging in?</span>
53
+ <div class="iiev-modal-leave__info">
54
+ <svg class="iiev-modal-leave__info-icon" width="16" height="16" viewBox="0 0 16 16">
55
+ <circle cx="8" cy="8" r="8" fill="#2885C0"></circle>
56
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M9.44813 5.96124C9.43327 5.95864 9.41823 5.95732 9.40314 5.95735H9.35043C9.19253 5.95266 9.03454 5.96281 8.87853 5.98761C8.70752 6.01975 8.53137 6.04738 8.361 6.07374L8.12249 6.11102L7.22241 6.25761L7.08805 6.2801L7.02376 6.29105L6.92733 6.3071L6.75503 6.84456H7.03598H7.12084C7.17623 6.84374 7.23162 6.84633 7.2867 6.85229C7.33498 6.85765 7.37929 6.88156 7.41025 6.919C7.4412 6.95643 7.45637 7.00445 7.45257 7.05288C7.43727 7.20794 7.40736 7.36118 7.36322 7.51061C7.23464 7.96064 7.10155 8.41068 6.97426 8.85299L6.79682 9.46246C6.77175 9.55054 6.74604 9.6386 6.72032 9.72732C6.63996 10.0044 6.55638 10.2905 6.47602 10.5734C6.4227 10.7466 6.39709 10.9271 6.40015 11.1083C6.40419 11.3387 6.49837 11.5585 6.66246 11.7203C6.82256 11.8768 7.03213 11.9728 7.25521 11.9916C7.3071 11.9973 7.35924 12.0001 7.41143 12C7.61553 11.9994 7.8174 11.9574 8.00483 11.8765C8.2435 11.7715 8.46128 11.6243 8.64772 11.4419C8.8778 11.2198 9.08106 10.9714 9.25335 10.702C9.30542 10.6222 9.35556 10.5399 9.40442 10.4609L9.47321 10.3503L9.56065 10.2108L9.08232 9.92921L8.99811 10.0578C8.99297 10.0649 8.9891 10.0713 8.98524 10.0777L8.96596 10.1054L8.87661 10.2339C8.80718 10.3323 8.73516 10.4339 8.66187 10.5309C8.58028 10.6427 8.4848 10.7436 8.37772 10.8312C8.35185 10.8519 8.32301 10.8686 8.2922 10.8807H8.289C8.28474 10.8775 8.28105 10.8736 8.27807 10.8691C8.27469 10.8652 8.27247 10.8604 8.27167 10.8553C8.27088 10.8502 8.27152 10.845 8.27356 10.8402L8.29477 10.7444C8.31855 10.6325 8.34171 10.5271 8.37128 10.423C8.67537 9.36346 8.9859 8.28661 9.28613 7.24511L9.57929 6.22932C9.58379 6.21389 9.58701 6.19909 9.59086 6.18494C9.59472 6.1708 9.59086 6.17275 9.59536 6.16568L9.64037 5.98824L9.45843 5.96701L9.44813 5.96124ZM9.47385 3.28162C9.34609 3.22768 9.2088 3.19994 9.07012 3.2C8.93297 3.20061 8.79733 3.22879 8.67131 3.28291C8.54528 3.33703 8.43144 3.41598 8.33656 3.51501C8.23998 3.61221 8.16371 3.72764 8.11217 3.85459C8.06062 3.98154 8.03486 4.11747 8.03635 4.25448C8.03785 4.39149 8.06658 4.52684 8.12088 4.65264C8.17518 4.77844 8.25397 4.89217 8.35264 4.98724C8.44609 5.08127 8.55715 5.15598 8.67949 5.20706C8.80183 5.25813 8.93303 5.28458 9.06561 5.28491H9.07526C9.31563 5.28393 9.54827 5.1999 9.73377 5.04704C9.91928 4.89418 10.0462 4.68187 10.0931 4.44612C10.1401 4.21038 10.104 3.96566 9.99117 3.75343C9.8783 3.5412 9.69554 3.37452 9.47385 3.28162Z" fill="white"></path>
57
+ <div class="iiev-modal-leave__info-popup">
58
+ Your account on Wordpress.org (where you open a new support thread) is different to the one you
59
+ login to your WordPress
60
+ dashboard (where you are now). If you don't have a WordPress.org account yet, please sign up at the
61
+ top right on the
62
+ Support Forum page, and then scroll down on that page . It only takes a minute:)
63
+ Thank you!
64
+ </div>
65
+ </svg></div>
66
+
67
+ </div>
68
+ <p class="iiev-modal-leave__text-hint">
69
+ Just open a new ticket, you don't have to browse through existing ones
70
+ </p>
71
+ </div>
72
+
73
+ </div>
74
+ <footer class="iiev-modal-leave__footer">
75
+ <a href="#" class="iiev-modal-leave__deactivated-link">
76
+ I already asked – de-activate it for now
77
+ </a>
78
+ </footer>
79
+ </div>
80
+
81
+ </div>
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: CopyDeletePosts, copydelete
3
  Tags: Duplicate post, Copy posts, Copy pages, Duplicate posts, Duplicate pages, Clone posts, Clone pages, Delete posts, Delete pages, Duplicator, copy post, copy page
4
  Requires at least: 4.6
5
  Tested up to: 5.8.2
6
- Stable tag: 1.2.3
7
  License: GPLv3
8
  Requires PHP: 5.6
9
 
@@ -151,6 +151,9 @@ Copy Delete Posts WordPress plugin doesn’t store any site visitor information
151
 
152
  == Changelog ==
153
 
 
 
 
154
  = 1.2.3 =
155
  * Applied improvements that depends on user performance data
156
 
@@ -269,5 +272,5 @@ Copy Delete Posts WordPress plugin doesn’t store any site visitor information
269
  * Initial release
270
 
271
  == Upgrade Notice ==
272
- = 1.2.3 =
273
- * Applied improvements that depends on user performance data
3
  Tags: Duplicate post, Copy posts, Copy pages, Duplicate posts, Duplicate pages, Clone posts, Clone pages, Delete posts, Delete pages, Duplicator, copy post, copy page
4
  Requires at least: 4.6
5
  Tested up to: 5.8.2
6
+ Stable tag: 1.2.4
7
  License: GPLv3
8
  Requires PHP: 5.6
9
 
151
 
152
  == Changelog ==
153
 
154
+ = 1.2.4 =
155
+ * Added deactivation module
156
+
157
  = 1.2.3 =
158
  * Applied improvements that depends on user performance data
159
 
272
  * Initial release
273
 
274
  == Upgrade Notice ==
275
+ = 1.2.4 =
276
+ * Added deactivation module