Completed
Push — develop ( 14767b...cffcc3 )
by Marco
01:20
created

Black_Studio_TinyMCE_Compatibility_Plugins   A

Complexity

Total Complexity 22

Size/Duplication

Total Lines 267
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 267
rs 10
c 0
b 0
f 0
wmc 22
cbo 0

21 Methods

Rating   Name   Duplication   Size   Complexity  
A instance() 0 7 2
A __construct() 0 3 1
A __clone() 0 4 1
A wpml() 0 3 1
A wpml_widget_update() 0 4 1
A wpml_widget_text() 0 4 1
A wp_page_widget() 0 3 1
A wp_page_widget_admin_init() 0 3 1
A wp_page_widget_enable_pages() 0 4 1
A wp_page_widget_enqueue_script() 0 3 1
A siteorigin_panels() 0 3 1
A siteorigin_panels_admin_init() 0 3 1
A siteorigin_panels_widget_object() 0 4 1
A siteorigin_panels_container_selectors() 0 4 1
A siteorigin_panels_activate_events() 0 4 1
A siteorigin_panels_deactivate_events() 0 4 1
A siteorigin_panels_enable_pages() 0 4 1
A siteorigin_panels_additional_fields() 0 4 1
A siteorigin_panels_disable_compat() 0 3 1
A jetpack_after_the_deadline() 0 3 1
A jetpack_after_the_deadline_load() 0 3 1
1
<?php
2
/**
3
 * Black Studio TinyMCE Widget - Compatibility code with other plugins
4
 *
5
 * @package Black_Studio_TinyMCE_Widget
6
 */
7
8
// Exit if accessed directly.
9
if ( ! defined( 'ABSPATH' ) ) {
10
	exit;
11
}
12
13
if ( ! class_exists( 'Black_Studio_TinyMCE_Compatibility_Plugins' ) ) {
14
15
	/**
16
	 * Class that provides compatibility code with other plugins
17
	 * Starting from version 3.0.0 this class is no longer used, and it will be removed in future version
18
	 *
19
	 * @package Black_Studio_TinyMCE_Widget
20
	 * @since 2.0.0
21
	 * @deprecated 3.0.0
22
	 */
23
	final class Black_Studio_TinyMCE_Compatibility_Plugins {
24
25
		/**
26
		 * The single instance of the class
27
		 *
28
		 * @var object
29
		 * @since 2.0.0
30
		 * @deprecated 3.0.0
31
		 */
32
		protected static $_instance = null;
33
34
		/**
35
		 * Return the single class instance
36
		 *
37
		 * @return object
38
		 * @since 2.0.0
39
		 * @deprecated 3.0.0
40
		 */
41
		public static function instance() {
42
			_deprecated_function( __FUNCTION__, '3.0.0' );
43
			if ( is_null( self::$_instance ) ) {
44
				self::$_instance = new self();
45
			}
46
			return self::$_instance;
47
		}
48
49
		/**
50
		 * Class constructor
51
		 *
52
		 * @since 2.0.0
53
		 * @deprecated 3.0.0
54
		 */
55
		protected function __construct() {
56
			_deprecated_function( __FUNCTION__, '3.0.0' );
57
		}
58
59
		/**
60
		 * Prevent the class from being cloned
61
		 *
62
		 * @return void
63
		 * @since 2.0.0
64
		 * @deprecated 3.0.0
65
		 */
66
		protected function __clone() {
67
			_deprecated_function( __FUNCTION__, '3.0.0' );
68
			_doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin&#8217; uh?' ), '3.0' );
69
		}
70
71
		/**
72
		 * Compatibility with WPML
73
		 *
74
		 * @return void
75
		 * @since 2.0.0
76
		 * @deprecated 3.0.0
77
		 */
78
		public function wpml() {
79
			_deprecated_function( __FUNCTION__, '3.0.0' );
80
		}
81
82
		/**
83
		 * Add widget text to WPML String translation
84
		 *
85
		 * @param mixed[] $instance Widget instance.
86
		 * @return mixed[]
87
		 * @since 2.0.0
88
		 * @deprecated 3.0.0
89
		 */
90
		public function wpml_widget_update( $instance ) {
91
			_deprecated_function( __FUNCTION__, '3.0.0' );
92
			return $instance;
93
		}
94
95
		/**
96
		 * Translate widget text
97
		 *
98
		 * @param string       $text     Widget text.
99
		 * @param mixed[]|null $instance Widget instance.
100
		 * @param object|null  $widget   Widget object.
101
		 * @return string
102
		 * @since 2.0.0
103
		 * @deprecated 3.0.0
104
		 */
105
		public function wpml_widget_text( $text, $instance = null, $widget = null ) {
106
			_deprecated_function( __FUNCTION__, '3.0.0', 'bstw()->compatibility()->module( \'wpml\' )->widget_text( $text, $instance, $widget )' );
107
			return bstw()->compatibility()->module( 'wpml' )->widget_text( $text, $instance, $widget );
108
		}
109
110
		/**
111
		 * Compatibility for WP Page Widget plugin
112
		 *
113
		 * @return void
114
		 * @since 2.0.0
115
		 * @deprecated 3.0.0
116
		 */
117
		public function wp_page_widget() {
118
			_deprecated_function( __FUNCTION__, '3.0.0' );
119
		}
120
121
		/**
122
		 * Initialize compatibility for WP Page Widget plugin (only for WordPress 3.3+)
123
		 *
124
		 * @return void
125
		 * @since 2.0.0
126
		 * @deprecated 3.0.0
127
		 */
128
		public function wp_page_widget_admin_init() {
129
			_deprecated_function( __FUNCTION__, '3.0.0' );
130
		}
131
132
		/**
133
		 * Enable filter for WP Page Widget plugin
134
		 *
135
		 * @param string[] $pages Array of pages.
136
		 * @return string[]
137
		 * @since 2.0.0
138
		 * @deprecated 3.0.0
139
		 */
140
		public function wp_page_widget_enable_pages( $pages ) {
141
			_deprecated_function( __FUNCTION__, '3.0.0' );
142
			return $pages;
143
		}
144
145
		/**
146
		 * Enqueue script for WP Page Widget plugin
147
		 *
148
		 * @return void
149
		 * @since 2.0.0
150
		 * @deprecated 3.0.0
151
		 */
152
		public function wp_page_widget_enqueue_script() {
153
			_deprecated_function( __FUNCTION__, '3.0.0' );
154
		}
155
156
		/**
157
		 * Compatibility with Page Builder (SiteOrigin Panels)
158
		 *
159
		 * @return void
160
		 * @since 2.0.0
161
		 * @deprecated 3.0.0
162
		 */
163
		public function siteorigin_panels() {
164
			_deprecated_function( __FUNCTION__, '3.0.0' );
165
		}
166
167
		/**
168
		 * Initialize compatibility for Page Builder (SiteOrigin Panels)
169
		 *
170
		 * @return void
171
		 * @since 2.0.0
172
		 * @deprecated 3.0.0
173
		 */
174
		public function siteorigin_panels_admin_init() {
175
			_deprecated_function( __FUNCTION__, '3.0.0' );
176
		}
177
178
		/**
179
		 * Remove widget number to prevent translation when using Page Builder (SiteOrigin Panels) + WPML String Translation
180
		 *
181
		 * @param object $widget Widget object.
182
		 * @return object
183
		 * @since 2.0.0
184
		 * @deprecated 3.0.0
185
		 */
186
		public function siteorigin_panels_widget_object( $widget ) {
187
			_deprecated_function( __FUNCTION__, '3.0.0' );
188
			return $widget;
189
		}
190
191
		/**
192
		 * Add selector for widget detection for Page Builder (SiteOrigin Panels)
193
		 *
194
		 * @param string[] $selectors Array of selectors.
195
		 * @return string[]
196
		 * @since 2.0.0
197
		 * @deprecated 3.0.0
198
		 */
199
		public function siteorigin_panels_container_selectors( $selectors ) {
200
			_deprecated_function( __FUNCTION__, '3.0.0' );
201
			return $selectors;
202
		}
203
204
		/**
205
		 * Add activate events for Page Builder (SiteOrigin Panels)
206
		 *
207
		 * @param string[] $events Array of events.
208
		 * @return string[]
209
		 * @since 2.0.0
210
		 * @deprecated 3.0.0
211
		 */
212
		public function siteorigin_panels_activate_events( $events ) {
213
			_deprecated_function( __FUNCTION__, '3.0.0' );
214
			return $events;
215
		}
216
217
		/**
218
		 * Add deactivate events for Page Builder (SiteOrigin Panels)
219
		 *
220
		 * @param string[] $events Array of events.
221
		 * @return string[]
222
		 * @since 2.0.0
223
		 * @deprecated 3.0.0
224
		 */
225
		public function siteorigin_panels_deactivate_events( $events ) {
226
			_deprecated_function( __FUNCTION__, '3.0.0' );
227
			return $events;
228
		}
229
230
		/**
231
		 * Add pages filter to enable editor for Page Builder (SiteOrigin Panels)
232
		 *
233
		 * @param string[] $pages Array of pages.
234
		 * @return string[]
235
		 * @since 2.0.0
236
		 * @deprecated 3.0.0
237
		 */
238
		public function siteorigin_panels_enable_pages( $pages ) {
239
			_deprecated_function( __FUNCTION__, '3.0.0' );
240
			return $pages;
241
		}
242
243
		/**
244
		 * Add widget field for Page Builder (SiteOrigin Panels)
245
		 *
246
		 * @param string[] $fields Array of fields.
247
		 * @return string[]
248
		 * @since 2.6.0
249
		 * @deprecated 3.0.0
250
		 */
251
		public function siteorigin_panels_additional_fields( $fields ) {
252
			_deprecated_function( __FUNCTION__, '3.0.0' );
253
			return $fields;
254
		}
255
256
		/**
257
		 * Disable old compatibility code provided by Page Builder (SiteOrigin Panels)
258
		 *
259
		 * @return void
260
		 * @since 2.0.0
261
		 * @deprecated 3.0.0
262
		 */
263
		public function siteorigin_panels_disable_compat() {
264
			_deprecated_function( __FUNCTION__, '3.0.0' );
265
		}
266
267
		/**
268
		 * Compatibility with Jetpack After the deadline
269
		 *
270
		 * @return void
271
		 * @since 2.0.0
272
		 * @deprecated 3.0.0
273
		 */
274
		public function jetpack_after_the_deadline() {
275
			_deprecated_function( __FUNCTION__, '3.0.0' );
276
		}
277
278
		/**
279
		 * Load Jetpack After the deadline scripts
280
		 *
281
		 * @return void
282
		 * @since 2.0.0
283
		 * @deprecated 3.0.0
284
		 */
285
		public function jetpack_after_the_deadline_load() {
286
			_deprecated_function( __FUNCTION__, '3.0.0' );
287
		}
288
289
	} // END class Black_Studio_TinyMCE_Compatibility_Plugins
290
291
} // END class_exists check
292