PluginProbe
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages / 2.0.0
Kit (formerly ConvertKit) – Email Newsletter, Email Marketing, Membership, Subscribers and Landing Pages v2.0.0
3.4.4 3.4.3 3.4.2 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 All 197 releases
← All changes | includes/class-wp-convertkit.php +27 -39 2.3.02.0.0 View file →
@@ -20,9 +20,9 @@
20 20 * @since 1.9.6
21 21 *
22 22 * @var object
23 23 */
24 - private static $instance;
24 + public static $instance;
25 25
26 26 /**
27 27 * Holds singleton initialized classes that include
28 28 * action and filter hooks.
@@ -63,21 +63,17 @@
63 63 if ( ! is_admin() ) {
64 64 return;
65 65 }
66 66
67 - $this->classes['admin_bulk_edit'] = new ConvertKit_Admin_Bulk_Edit();
68 - $this->classes['admin_cache_plugins'] = new ConvertKit_Admin_Cache_Plugins();
69 - $this->classes['admin_category'] = new ConvertKit_Admin_Category();
70 - $this->classes['admin_notices'] = new ConvertKit_Admin_Notices();
71 - $this->classes['admin_post'] = new ConvertKit_Admin_Post();
72 - $this->classes['admin_quick_edit'] = new ConvertKit_Admin_Quick_Edit();
73 - $this->classes['admin_refresh_resources'] = new ConvertKit_Admin_Refresh_Resources();
74 - $this->classes['admin_restrict_content'] = new ConvertKit_Admin_Restrict_Content();
75 - $this->classes['admin_settings'] = new ConvertKit_Admin_Settings();
76 - $this->classes['admin_setup_wizard_plugin'] = new ConvertKit_Admin_Setup_Wizard_Plugin();
77 - $this->classes['admin_setup_wizard_restrict_content'] = new ConvertKit_Admin_Setup_Wizard_Restrict_Content();
78 - $this->classes['admin_tinymce'] = new ConvertKit_Admin_TinyMCE();
79 - $this->classes['admin_user'] = new ConvertKit_Admin_User();
67 + $this->classes['admin_bulk_edit'] = new ConvertKit_Admin_Bulk_Edit();
68 + $this->classes['admin_category'] = new ConvertKit_Admin_Category();
69 + $this->classes['admin_post'] = new ConvertKit_Admin_Post();
70 + $this->classes['admin_quick_edit'] = new ConvertKit_Admin_Quick_Edit();
71 + $this->classes['admin_refresh_resources'] = new ConvertKit_Admin_Refresh_Resources();
72 + $this->classes['admin_settings'] = new ConvertKit_Admin_Settings();
73 + $this->classes['admin_setup_wizard_plugin'] = new ConvertKit_Admin_Setup_Wizard_Plugin();
74 + $this->classes['admin_tinymce'] = new ConvertKit_Admin_TinyMCE();
75 + $this->classes['admin_user'] = new ConvertKit_Admin_User();
80 76
81 77 /**
82 78 * Initialize integration classes for the WordPress Administration interface.
83 79 *
@@ -140,10 +136,9 @@
140 136 if ( is_admin() ) {
141 137 return;
142 138 }
143 139
144 - $this->classes['output'] = new ConvertKit_Output();
145 - $this->classes['output_restrict_content'] = new ConvertKit_Output_Restrict_Content();
140 + $this->classes['output'] = new ConvertKit_Output();
146 141
147 142 /**
148 143 * Initialize integration classes for the frontend web site.
149 144 *
@@ -160,25 +155,21 @@
160 155 * @since 1.9.6
161 156 */
162 157 private function initialize_global() {
163 158
164 - $this->classes['ajax'] = new ConvertKit_AJAX();
165 - $this->classes['blocks_convertkit_broadcasts'] = new ConvertKit_Block_Broadcasts();
166 - $this->classes['blocks_convertkit_content'] = new ConvertKit_Block_Content();
167 - $this->classes['blocks_convertkit_formtrigger'] = new ConvertKit_Block_Form_Trigger();
168 - $this->classes['blocks_convertkit_form'] = new ConvertKit_Block_Form();
169 - $this->classes['blocks_convertkit_product'] = new ConvertKit_Block_Product();
170 - $this->classes['block_formatter_form_link'] = new ConvertKit_Block_Formatter_Form_Link();
171 - $this->classes['block_formatter_product_link'] = new ConvertKit_Block_Formatter_Product_Link();
172 - $this->classes['broadcasts_importer'] = new ConvertKit_Broadcasts_Importer();
173 - $this->classes['elementor'] = new ConvertKit_Elementor();
174 - $this->classes['gutenberg'] = new ConvertKit_Gutenberg();
175 - $this->classes['media_library'] = new ConvertKit_Media_Library();
176 - $this->classes['review_request'] = new ConvertKit_Review_Request( 'ConvertKit', 'convertkit', CONVERTKIT_PLUGIN_PATH );
177 - $this->classes['preview_output'] = new ConvertKit_Preview_Output();
178 - $this->classes['setup'] = new ConvertKit_Setup();
179 - $this->classes['shortcodes'] = new ConvertKit_Shortcodes();
180 - $this->classes['widgets'] = new ConvertKit_Widgets();
159 + $this->classes['ajax'] = new ConvertKit_AJAX();
160 + $this->classes['blocks_convertkit_broadcasts'] = new ConvertKit_Block_Broadcasts();
161 + $this->classes['blocks_convertkit_content'] = new ConvertKit_Block_Content();
162 + $this->classes['blocks_convertkit_product'] = new ConvertKit_Block_Product();
163 + $this->classes['blocks_convertkit_form'] = new ConvertKit_Block_Form();
164 + $this->classes['elementor'] = new ConvertKit_Elementor();
165 + $this->classes['gutenberg'] = new ConvertKit_Gutenberg();
166 + $this->classes['post_type_product'] = new ConvertKit_Post_Type_Product();
167 + $this->classes['review_request'] = new ConvertKit_Review_Request( 'ConvertKit', 'convertkit', CONVERTKIT_PLUGIN_PATH );
168 + $this->classes['preview_output'] = new ConvertKit_Preview_Output();
169 + $this->classes['setup'] = new ConvertKit_Setup();
170 + $this->classes['shortcodes'] = new ConvertKit_Shortcodes();
171 + $this->classes['widgets'] = new ConvertKit_Widgets();
181 172
182 173 // Run the setup's update process on WordPress' init hook.
183 174 // Doing this sooner may result in errors with WordPress functions that are not yet
184 175 // available to the update routine.
@@ -358,18 +349,15 @@
358 349
359 350 }
360 351
361 352 /**
362 - * Loads the plugin's translated strings, if available.
353 + * Loads plugin textdomain
363 354 *
364 355 * @since 1.0.0
365 356 */
366 357 public function load_language_files() {
367 358
368 - // If the .mo file for a given language is available in WP_LANG_DIR/convertkit
369 - // i.e. it's available as a translation at https://translate.wordpress.org/projects/wp-plugins/convertkit/,
370 - // it will be used instead of the .mo file in convertkit/languages.
371 - load_plugin_textdomain( 'convertkit', false, 'convertkit/languages' );
359 + load_plugin_textdomain( 'convertkit', false, basename( dirname( CONVERTKIT_PLUGIN_FILE ) ) . '/languages/' ); // @phpstan-ignore-line.
372 360
373 361 }
374 362
375 363 /**
@@ -424,9 +412,9 @@
424 412 * @return object Class.
425 413 */
426 414 public static function get_instance() {
427 415
428 - if ( null === self::$instance ) {
416 + if ( ! isset( self::$instance ) && ! ( self::$instance instanceof self ) ) { // @phpstan-ignore-line.
429 417 self::$instance = new self();
430 418 }
431 419
432 420 return self::$instance;