PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 3.0.6
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v3.0.6
3.4.1 3.4.0 3.3.9 3.3.8 3.3.7 3.3.6 3.3.5 3.3.4 3.3.3 3.3.2 3.3.1 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3.0 2.3.1 2.3.2 2.3.3 All 194 releases
convertkit / includes / class-convertkit-setup.php

class-convertkit-setup.php in Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages 3.0.6, at includes/class-convertkit-setup.php

716 lines 20.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin activation, update and deactivation class.
4 *
5 * @package ConvertKit
6 * @author ConvertKit
7 */
8
9 /**
10 * Runs any steps required on plugin activation, update and deactivation.
11 *
12 * @package ConvertKit
13 * @author ConvertKit
14 * @version 1.9.7.4
15 */
16 class ConvertKit_Setup {
17
18 /**
19 * Runs routines when the Plugin is activated.
20 *
21 * @since 1.9.7.4
22 */
23 public function activate() {
24
25 // Call any functions to e.g. schedule WordPress Cron events now.
26 $this->schedule_cron_events();
27
28 // Install entries database table.
29 $entries = new ConvertKit_Form_Entries();
30 $entries->create_database_table();
31
32 }
33
34 /**
35 * Runs routines on every Plugin request e.g.
36 * ensuring WordPress Cron events are scheduled.
37 *
38 * @since 2.6.6
39 */
40 public function initialize() {
41
42 // Call any functions to e.g. schedule WordPress Cron events now.
43 $this->schedule_cron_events();
44
45 }
46
47 /**
48 * Runs routines if the Plugin version has been updated.
49 *
50 * @since 1.9.7.4
51 */
52 public function update() {
53
54 // Get installed Plugin version.
55 $current_version = get_option( 'convertkit_version' );
56
57 // If the version number matches the plugin version, no update routines
58 // need to run.
59 if ( $current_version === CONVERTKIT_PLUGIN_VERSION ) {
60 return;
61 }
62
63 /**
64 * 3.0.4: Add form_id to entries database table.
65 */
66 if ( version_compare( $current_version, '3.0.4', '<' ) ) {
67 $this->add_form_id_column_and_key_to_form_entries_database_table();
68 }
69
70 /**
71 * 3.0.0: Migrate reCAPTCHA settings from Restrict Content to General settings.
72 * Install entries database table.
73 */
74 if ( version_compare( $current_version, '3.0.0', '<' ) ) {
75 $this->migrate_recaptcha_settings();
76
77 // Install entries database table.
78 $entries = new ConvertKit_Form_Entries();
79 $entries->create_database_table();
80 }
81
82 /**
83 * 2.6.6: Migrate 'Default' Form value in _wp_convertkit_term_meta[form] from 0 to -1,
84 * to match Posts.
85 */
86 if ( version_compare( $current_version, '2.6.6', '<' ) ) {
87 $this->migrate_term_default_form_settings();
88 }
89
90 /**
91 * 2.5.4: Migrate WishList Member to ConvertKit Form Mappings
92 */
93 if ( ! $current_version || version_compare( $current_version, '2.5.4', '<' ) ) {
94 $this->migrate_wlm_none_setting();
95 $this->migrate_wlm_form_tag_mapping_settings();
96 }
97
98 /**
99 * 2.5.3: Migrate Third Party Form integrations' 'None' option values from `default` to blank.
100 */
101 if ( ! $current_version || version_compare( $current_version, '2.5.3', '<' ) ) {
102 $this->migrate_contact_form_7_none_setting();
103 $this->migrate_forminator_none_setting();
104 $this->migrate_wlm_none_setting();
105 }
106
107 /**
108 * 2.5.2: Migrate Forminator to ConvertKit Form Mappings
109 */
110 if ( ! $current_version || version_compare( $current_version, '2.5.2', '<' ) ) {
111 $this->migrate_forminator_form_mapping_settings();
112 }
113
114 /**
115 * 2.5.2: Migrate Contact Form 7 to ConvertKit Form Mappings
116 */
117 if ( ! $current_version || version_compare( $current_version, '2.5.2', '<' ) ) {
118 $this->migrate_contact_form_7_form_mapping_settings();
119 }
120
121 /**
122 * 2.5.0: Get Access token for API version 4.0 using a v3 API Key and Secret.
123 */
124 if ( ! $current_version || version_compare( $current_version, '2.5.0', '<' ) ) {
125 $this->maybe_get_access_token_by_api_key_and_secret();
126 }
127
128 /**
129 * 2.4.9.1+: Migrate ck_default_form to _wp_convertkit_term_meta[form], as Term settings
130 * support multiple options (form, position etc).
131 */
132 if ( version_compare( $current_version, '2.4.9.1', '<' ) ) {
133 $this->migrate_term_form_settings();
134 }
135
136 /**
137 * 1.6.1+: Refresh Forms, Landing Pages and Tags data stored in settings,
138 * to get new Forms Builder Settings.
139 */
140 if ( version_compare( $current_version, '1.6.1', '<' ) ) {
141 $this->refresh_resources();
142 }
143
144 /**
145 * 1.9.6+: Migrate _wp_convertkit_settings[default_form] to _wp_convertkit_settings[page_form] and
146 * _wp_convertkit_settings[post_form], now that each Post Type has its own Default Form setting
147 * in Settings > Kit > General.
148 */
149 if ( version_compare( $current_version, '1.9.6', '<' ) ) {
150 $this->migrate_default_form_settings();
151 }
152
153 /**
154 * 1.9.7.4+: Schedule Post Resources' Cron event to refresh Posts cache hourly,
155 * as the activate() routine won't pick this up for existing active installations.
156 */
157 if ( version_compare( $current_version, '1.9.7.4', '<' ) ) {
158 $posts = new ConvertKit_Resource_Posts( 'cron' );
159 $posts->schedule_cron_event();
160 }
161
162 // Update the installed version number in the options table.
163 update_option( 'convertkit_version', CONVERTKIT_PLUGIN_VERSION );
164
165 }
166
167 /**
168 * Adds form_id column and key to form entries database table.
169 *
170 * @since 3.0.4
171 */
172 private function add_form_id_column_and_key_to_form_entries_database_table() {
173
174 global $wpdb;
175
176 // Check if the column exists.
177 $exists = $wpdb->get_var(
178 $wpdb->prepare(
179 'SELECT COLUMN_NAME
180 FROM INFORMATION_SCHEMA.COLUMNS
181 WHERE table_name = %s
182 AND table_schema = %s
183 AND column_name = %s',
184 $wpdb->prefix . 'kit_form_entries',
185 $wpdb->dbname,
186 'form_id'
187 )
188 );
189
190 // If the column exists, don't add it again.
191 if ( $exists === 'form_id' ) {
192 return;
193 }
194
195 // Add the form_id column and key.
196 $wpdb->query(
197 $wpdb->prepare( 'ALTER TABLE %i ADD COLUMN `form_id` int(11) NOT NULL AFTER `custom_fields`', $wpdb->prefix . 'kit_form_entries' )
198 );
199 $wpdb->query(
200 $wpdb->prepare( 'ALTER TABLE %i ADD KEY `form_id` (`form_id`)', $wpdb->prefix . 'kit_form_entries' )
201 );
202
203 }
204
205 /**
206 * 3.0.0: Migrate reCAPTCHA settings from Restrict Content settings to General settings.
207 *
208 * @since 3.0.0
209 */
210 private function migrate_recaptcha_settings() {
211
212 // Read Restrict Content settings directly from options table,
213 // as Convertkit_Settings_Restrict_Content won't have helper
214 // methods to return the specific settings.
215 $settings = get_option( '_wp_convertkit_settings_restrict_content' );
216
217 // If no reCAPTCHA settings exist, bail.
218 if ( ! isset( $settings['recaptcha_site_key'] ) || ! isset( $settings['recaptcha_secret_key'] ) || ! isset( $settings['recaptcha_minimum_score'] ) ) {
219 return;
220 }
221
222 // Load settings class, saving the reCAPTCHA settings to the General settings.
223 $convertkit_settings = new ConvertKit_Settings();
224 $convertkit_settings->save(
225 array(
226 'recaptcha_site_key' => $settings['recaptcha_site_key'],
227 'recaptcha_secret_key' => $settings['recaptcha_secret_key'],
228 'recaptcha_minimum_score' => $settings['recaptcha_minimum_score'],
229 )
230 );
231
232 // Remove reCAPTCHA settings from Restrict Content settings.
233 unset( $settings['recaptcha_site_key'] );
234 unset( $settings['recaptcha_secret_key'] );
235 unset( $settings['recaptcha_minimum_score'] );
236 update_option( '_wp_convertkit_settings_restrict_content', $settings );
237
238 }
239
240 /**
241 * Change the Default value of 0 to -1 in wp_convertkit_term_meta[form], to
242 * match how the Default value is stored in Posts.
243 *
244 * @since 2.6.6
245 */
246 private function migrate_term_default_form_settings() {
247
248 // Get all Terms that have ConvertKit settings defined.
249 $query = new WP_Term_Query(
250 array(
251 'taxonomy' => 'category',
252 'hide_empty' => false,
253 'fields' => 'ids',
254 'meta_query' => array(
255 array(
256 'key' => '_wp_convertkit_term_meta',
257 'comparison' => 'EXISTS',
258 ),
259 ),
260 )
261 );
262
263 // Bail if no Terms exist.
264 if ( ! $query->terms ) {
265 return;
266 }
267
268 // Iterate through Terms, mapping settings.
269 foreach ( $query->terms as $term_id ) {
270 $term_settings = new ConvertKit_Term( $term_id );
271
272 // If the Form setting is Default i.e. it does not have a formchange it from 0 to -1.
273 if ( ! $term_settings->has_form() ) {
274 $term_settings->save(
275 array(
276 'form' => -1,
277 )
278 );
279 }
280 }
281
282 }
283
284 /**
285 * 2.5.4: Migrate WLM settings:
286 * - Prefix any WishList Member to ConvertKit Form ID mappings with `form:`,
287 * - Prefix any WishList Member to ConvertKit Tag ID mappings with `tag:`,
288 * - Standardise the settings keys to the format {wlm_level_id}_subscribe
289 * and {wlm_level_id}_unsubscribe.
290 *
291 * @since 2.5.4
292 */
293 private function migrate_wlm_form_tag_mapping_settings() {
294
295 $convertkit_wlm_settings = new ConvertKit_Wishlist_Settings();
296
297 // Bail if no settings exist.
298 if ( ! $convertkit_wlm_settings->has_settings() ) {
299 return;
300 }
301
302 // Define new array for settings.
303 $settings = array();
304
305 // Iterate through settings.
306 foreach ( $convertkit_wlm_settings->get() as $key => $convertkit_form_or_tag_id ) {
307 // Split the settings key.
308 list( $wlm_level_id, $type ) = explode( '_', $key );
309
310 switch ( $type ) {
311 case 'form':
312 // This is the action to perform when the user is added to the WLM Level.
313 // Use a new name for the setting key to reflect this.
314 // < 2.5.4, forms were the only option here, so prefix the resource ID with `form:`.
315 $settings[ $wlm_level_id . '_add' ] = ( empty( $convertkit_form_or_tag_id ) ? '' : 'form:' . $convertkit_form_or_tag_id );
316 break;
317
318 case 'unsubscribe':
319 // This is the action to perform when the user is removed from the WLM Level.
320 // Use a new name for the setting key to reflect this.
321 // < 2.5.4, tags were the only option here, so prefix the resource ID with `tag:`.
322 $settings[ $wlm_level_id . '_remove' ] = ( empty( $convertkit_form_or_tag_id ) ? '' : 'tag:' . $convertkit_form_or_tag_id );
323 break;
324 }
325 }
326
327 // Update settings.
328 update_option( $convertkit_wlm_settings::SETTINGS_NAME, $settings );
329
330 }
331
332 /**
333 * 2.5.3: Migrate Third Party Form integrations' 'None' option values from `default` to blank.
334 *
335 * 2.4.9 changed the 'None' label's value from `default` to a blank string, as the v4 API's
336 * `add_subscriber_to_form()` method introduces type declarations, which would result in
337 * an uncaught TypeError when passing a non integer value.
338 *
339 * The PR for that (https://github.com/ConvertKit/convertkit-wordpress/pull/655) didn't include
340 * any tests or upgrade/migration routines to change any existing saved settings where the 'None'
341 * label's value was stored as `default`.
342 */
343 private function migrate_contact_form_7_none_setting() {
344
345 $convertkit_contact_form_7_settings = new ConvertKit_ContactForm7_Settings();
346
347 // Bail if no settings exist.
348 if ( ! $convertkit_contact_form_7_settings->has_settings() ) {
349 return;
350 }
351
352 // Get settings.
353 $settings = $convertkit_contact_form_7_settings->get();
354
355 // Iterate through settings.
356 foreach ( $settings as $contact_form_7_form_id => $convertkit_form_id ) {
357 // Skip keys that are non-numeric e.g. `creator_network_recommendations_*`.
358 if ( ! is_numeric( $contact_form_7_form_id ) ) {
359 continue;
360 }
361
362 // Change 'default' to a blank string.
363 if ( $convertkit_form_id === 'default' ) {
364 $settings[ $contact_form_7_form_id ] = '';
365 }
366 }
367
368 // Update settings.
369 update_option( $convertkit_contact_form_7_settings::SETTINGS_NAME, $settings );
370
371 }
372
373 /**
374 * 2.5.3: Migrate Third Party Form integrations' 'None' option values from `default` to blank.
375 *
376 * 2.4.9 changed the 'None' label's value from `default` to a blank string, as the v4 API's
377 * `add_subscriber_to_form()` method introduces type declarations, which would result in
378 * an uncaught TypeError when passing a non integer value.
379 *
380 * The PR for that (https://github.com/ConvertKit/convertkit-wordpress/pull/655) didn't include
381 * any tests or upgrade/migration routines to change any existing saved settings where the 'None'
382 * label's value was stored as `default`.
383 */
384 private function migrate_forminator_none_setting() {
385
386 $convertkit_forminator_settings = new ConvertKit_Forminator_Settings();
387
388 // Bail if no settings exist.
389 if ( ! $convertkit_forminator_settings->has_settings() ) {
390 return;
391 }
392
393 // Get settings.
394 $settings = $convertkit_forminator_settings->get();
395
396 // Iterate through settings.
397 foreach ( $settings as $forminator_form_id => $convertkit_form_id ) {
398 // Skip keys that are non-numeric e.g. `creator_network_recommendations_*`.
399 if ( ! is_numeric( $forminator_form_id ) ) {
400 continue;
401 }
402
403 // Change 'default' to a blank string.
404 if ( $convertkit_form_id === 'default' ) {
405 $settings[ $forminator_form_id ] = '';
406 }
407 }
408
409 // Update settings.
410 update_option( $convertkit_forminator_settings::SETTINGS_NAME, $settings );
411
412 }
413
414 /**
415 * 2.5.3: Migrate Third Party Form integrations' 'None' option values from `default` to blank.
416 *
417 * 2.4.9 changed the 'None' label's value from `default` to a blank string, as the v4 API's
418 * `add_subscriber_to_form()` method introduces type declarations, which would result in
419 * an uncaught TypeError when passing a non integer value.
420 *
421 * The PR for that (https://github.com/ConvertKit/convertkit-wordpress/pull/655) didn't include
422 * any tests or upgrade/migration routines to change any existing saved settings where the 'None'
423 * label's value was stored as `default`.
424 */
425 private function migrate_wlm_none_setting() {
426
427 $convertkit_wlm_settings = new ConvertKit_Wishlist_Settings();
428
429 // Bail if no settings exist.
430 if ( ! $convertkit_wlm_settings->has_settings() ) {
431 return;
432 }
433
434 // Get settings.
435 $settings = $convertkit_wlm_settings->get();
436
437 // Iterate through settings.
438 foreach ( $settings as $wlm_level_id => $value ) {
439 // Change 'default' to a blank string.
440 if ( $value === 'default' ) {
441 $settings[ $wlm_level_id ] = '';
442 }
443 }
444
445 // Update settings.
446 update_option( $convertkit_wlm_settings::SETTINGS_NAME, $settings );
447
448 }
449
450 /**
451 * 2.5.2: Prefix any Forminator to ConvertKit Form ID mappings with `form:`, now that
452 * the Plugin supports adding a subscriber to a Form, Tag or Sequence.
453 *
454 * @since 2.5.2
455 */
456 private function migrate_forminator_form_mapping_settings() {
457
458 $convertkit_forminator_settings = new ConvertKit_Forminator_Settings();
459
460 // Bail if no settings exist.
461 if ( ! $convertkit_forminator_settings->has_settings() ) {
462 return;
463 }
464
465 // Get settings.
466 $settings = $convertkit_forminator_settings->get();
467
468 // Iterate through settings.
469 foreach ( $settings as $forminator_form_id => $convertkit_form_id ) {
470 // Skip keys that are non-numeric e.g. `creator_network_recommendations_*`.
471 if ( ! is_numeric( $forminator_form_id ) ) {
472 continue;
473 }
474
475 // Skip values that are blank i.e. no ConvertKit Form ID specified.
476 if ( empty( $convertkit_form_id ) ) {
477 continue;
478 }
479
480 // Skip values that are non-numeric i.e. the `form_` prefix was already added.
481 // This should never happen as this routine runs once, but this is a sanity check.
482 if ( ! is_numeric( $convertkit_form_id ) ) {
483 continue;
484 }
485
486 // Prefix the ConvertKit Form ID with `form_`.
487 $settings[ $forminator_form_id ] = 'form:' . $convertkit_form_id;
488 }
489
490 // Update settings.
491 update_option( $convertkit_forminator_settings::SETTINGS_NAME, $settings );
492
493 }
494
495 /**
496 * 2.5.2: Prefix any Contact Form 7 to ConvertKit Form ID mappings with `form:`, now that
497 * the Plugin supports adding a subscriber to a Form, Tag or Sequence.
498 *
499 * @since 2.5.2
500 */
501 private function migrate_contact_form_7_form_mapping_settings() {
502
503 $convertkit_contact_form_7_settings = new ConvertKit_ContactForm7_Settings();
504
505 // Bail if no settings exist.
506 if ( ! $convertkit_contact_form_7_settings->has_settings() ) {
507 return;
508 }
509
510 // Get settings.
511 $settings = $convertkit_contact_form_7_settings->get();
512
513 // Iterate through settings.
514 foreach ( $settings as $contact_form_7_form_id => $convertkit_form_id ) {
515 // Skip keys that are non-numeric e.g. `creator_network_recommendations_*`.
516 if ( ! is_numeric( $contact_form_7_form_id ) ) {
517 continue;
518 }
519
520 // Skip values that are blank i.e. no ConvertKit Form ID specified.
521 if ( empty( $convertkit_form_id ) ) {
522 continue;
523 }
524
525 // Skip values that are non-numeric i.e. the `form_` prefix was already added.
526 // This should never happen as this routine runs once, but this is a sanity check.
527 if ( ! is_numeric( $convertkit_form_id ) ) {
528 continue;
529 }
530
531 // Prefix the ConvertKit Form ID with `form_`.
532 $settings[ $contact_form_7_form_id ] = 'form:' . $convertkit_form_id;
533 }
534
535 // Update settings.
536 update_option( $convertkit_contact_form_7_settings::SETTINGS_NAME, $settings );
537
538 }
539
540 /**
541 * 2.5.0: Fetch an Access Token, Refresh Token and Expiry for v4 API use
542 * based on the Plugin setting's v3 API Key and Secret.
543 *
544 * @since 2.5.0
545 */
546 private function maybe_get_access_token_by_api_key_and_secret() {
547
548 $convertkit_settings = new ConvertKit_Settings();
549
550 // Bail if an Access Token exists; we don't need to fetch another one.
551 if ( $convertkit_settings->has_access_token() ) {
552 return;
553 }
554
555 // Bail if no API Key or Secret.
556 if ( empty( $convertkit_settings->get_api_key() ) ) {
557 return;
558 }
559 if ( empty( $convertkit_settings->get_api_secret() ) ) {
560 return;
561 }
562
563 // Get Access Token by API Key and Secret.
564 $api = new ConvertKit_API_V4( CONVERTKIT_OAUTH_CLIENT_ID, CONVERTKIT_OAUTH_CLIENT_REDIRECT_URI );
565 $result = $api->get_access_token_by_api_key_and_secret(
566 $convertkit_settings->get_api_key(),
567 $convertkit_settings->get_api_secret(),
568 get_site_url()
569 );
570
571 // Bail if an error occured.
572 if ( is_wp_error( $result ) ) {
573 return;
574 }
575
576 // Store the new credentials.
577 // We don't use update_credentials(), because the response
578 // includes an `expires_at`, not a `created_at` and `expires_in`.
579 $convertkit_settings->save(
580 array(
581 'access_token' => $result['oauth']['access_token'],
582 'refresh_token' => $result['oauth']['refresh_token'],
583 'token_expires' => $result['oauth']['expires_at'],
584 )
585 );
586
587 }
588
589 /**
590 * Migrate ck_default_form to _wp_convertkit_term_meta[form], as Term settings
591 * support multiple options (form, position etc).
592 *
593 * @since 2.4.9.1
594 */
595 private function migrate_term_form_settings() {
596
597 // Get all Terms that have ConvertKit settings defined.
598 $query = new WP_Term_Query(
599 array(
600 'taxonomy' => 'category',
601 'hide_empty' => false,
602 'fields' => 'ids',
603 'meta_query' => array(
604 array(
605 'key' => 'ck_default_form',
606 'comparison' => 'EXISTS',
607 ),
608 ),
609 )
610 );
611
612 // Bail if no Terms exist.
613 if ( ! $query->terms ) {
614 return;
615 }
616
617 // Iterate through Terms, mapping settings.
618 foreach ( $query->terms as $term_id ) {
619 $term_settings = new ConvertKit_Term( $term_id );
620 $term_settings->save(
621 array(
622 'form' => get_term_meta( $term_id, 'ck_default_form', true ), // Fetch form setting from old meta key.
623 'form_position' => '', // Default to no position.
624 )
625 );
626
627 // Delete old Term meta.
628 delete_term_meta( $term_id, 'ck_default_form' );
629 }
630
631 }
632
633 /**
634 * 1.9.6+: Migrate _wp_convertkit_settings[default_form] to _wp_convertkit_settings[page_form] and
635 * _wp_convertkit_settings[post_form], now that each Post Type has its own Default Form setting
636 * in Settings > Kit > General.
637 */
638 private function migrate_default_form_settings() {
639
640 $convertkit_settings = new ConvertKit_Settings();
641
642 // Bail if no default_form setting exists.
643 $settings = get_option( $convertkit_settings::SETTINGS_NAME );
644 if ( ! $settings ) {
645 return;
646 }
647 if ( ! array_key_exists( 'default_form', $settings ) ) {
648 return;
649 }
650
651 // Restructure settings.
652 $settings['page_form'] = $settings['default_form'];
653 $settings['post_form'] = $settings['default_form'];
654
655 // Remove obsolete default_form setting.
656 unset( $settings['default_form'] );
657
658 // Update.
659 update_option( $convertkit_settings::SETTINGS_NAME, $settings );
660
661 }
662
663 /**
664 * 1.6.1: Refresh Forms, Landing Pages and Tags data stored in settings,
665 * to get new Forms Builder Settings.
666 */
667 private function refresh_resources() {
668
669 $forms = new ConvertKit_Resource_Forms( 'setup' );
670 $landing_pages = new ConvertKit_Resource_Landing_Pages( 'setup' );
671 $tags = new ConvertKit_Resource_Tags( 'setup' );
672
673 $forms->refresh();
674 $landing_pages->refresh();
675 $tags->refresh();
676
677 }
678
679 /**
680 * Runs routines when the Plugin is deactivated.
681 *
682 * @since 1.9.7.4
683 */
684 public function deactivate() {
685
686 // Call any functions to e.g. unschedule WordPress Cron events now.
687 $this->unschedule_cron_events();
688
689 }
690
691 /**
692 * Schedules any Plugin specific CRON events, if they do not already exist.
693 *
694 * @since 2.6.6
695 */
696 private function schedule_cron_events() {
697
698 $posts = new ConvertKit_Resource_Posts( 'cron' );
699 $posts->schedule_cron_event();
700
701 }
702
703 /**
704 * Unschedules any Plugin specific CRON events, if they exist.
705 *
706 * @since 2.6.6
707 */
708 private function unschedule_cron_events() {
709
710 $posts = new ConvertKit_Resource_Posts( 'cron' );
711 $posts->unschedule_cron_event();
712
713 }
714
715 }
716