Completed
Push — develop ( d12795...cf0659 )
by David
01:37
created
src/install/class-wordlift-install-3-45-0.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,23 +10,23 @@
 block discarded – undo
10 10
  */
11 11
 class Wordlift_Install_3_45_0 extends Wordlift_Install {
12 12
 
13
-	/**
14
-	 * {@inheritdoc}
15
-	 */
16
-	protected static $version = '3.46.0-0';
13
+    /**
14
+     * {@inheritdoc}
15
+     */
16
+    protected static $version = '3.46.0-0';
17 17
 
18
-	public function install() {
18
+    public function install() {
19 19
 
20
-		global $wpdb;
20
+        global $wpdb;
21 21
 
22
-		$wpdb->query(
23
-			"
22
+        $wpdb->query(
23
+            "
24 24
 			UPDATE {$wpdb->prefix}wl_entities
25 25
 			SET about_jsonld = NULL
26 26
 			WHERE about_jsonld = '' OR about_jsonld = 'null'
27 27
 		"
28
-		);
28
+        );
29 29
 
30
-		Ttl_Cache::flush_all();
31
-	}
30
+        Ttl_Cache::flush_all();
31
+    }
32 32
 }
Please login to merge, or discard this patch.
src/install/class-wordlift-install-3-44-1.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@
 block discarded – undo
9 9
  */
10 10
 class Wordlift_Install_3_44_1 extends Wordlift_Install {
11 11
 
12
-	/**
13
-	 * {@inheritdoc}
14
-	 */
15
-	protected static $version = '3.44.1';
12
+    /**
13
+     * {@inheritdoc}
14
+     */
15
+    protected static $version = '3.44.1';
16 16
 
17
-	public function install() {
18
-		Ttl_Cache::flush_all();
19
-	}
17
+    public function install() {
18
+        Ttl_Cache::flush_all();
19
+    }
20 20
 }
Please login to merge, or discard this patch.
src/wordlift.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -31,24 +31,24 @@  discard block
 block discarded – undo
31 31
 use Wordlift\Features\Features_Registry;
32 32
 use Wordlift\Post\Post_Adapter;
33 33
 
34
-define( 'WORDLIFT_PLUGIN_FILE', __FILE__ );
35
-define( 'WORDLIFT_VERSION', '3.46.0-0' );
34
+define('WORDLIFT_PLUGIN_FILE', __FILE__);
35
+define('WORDLIFT_VERSION', '3.46.0-0');
36 36
 
37
-require_once plugin_dir_path( __FILE__ ) . '/libraries/action-scheduler/action-scheduler.php';
38
-require_once __DIR__ . '/modules/common/load.php';
39
-require_once __DIR__ . '/modules/app/load.php';
40
-require_once __DIR__ . '/modules/include-exclude/load.php';
37
+require_once plugin_dir_path(__FILE__).'/libraries/action-scheduler/action-scheduler.php';
38
+require_once __DIR__.'/modules/common/load.php';
39
+require_once __DIR__.'/modules/app/load.php';
40
+require_once __DIR__.'/modules/include-exclude/load.php';
41 41
 
42 42
 /**
43 43
  * Filter to disable WLP on any request, defaults to true.
44 44
  *
45 45
  * @since 3.33.6
46 46
  */
47
-if ( ! apply_filters( 'wl_is_enabled', true ) ) {
47
+if ( ! apply_filters('wl_is_enabled', true)) {
48 48
 	return;
49 49
 }
50 50
 
51
-require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
51
+require_once plugin_dir_path(__FILE__).'vendor/autoload.php';
52 52
 
53 53
 /*
54 54
  * We introduce the WordLift autoloader, since we start using classes in namespaces, i.e. Wordlift\Http.
@@ -58,15 +58,15 @@  discard block
 block discarded – undo
58 58
 wordlift_plugin_autoload_register();
59 59
 
60 60
 // Include WordLift constants.
61
-require_once plugin_dir_path( __FILE__ ) . 'wordlift-constants.php';
61
+require_once plugin_dir_path(__FILE__).'wordlift-constants.php';
62 62
 
63 63
 // Load modules.
64
-require_once plugin_dir_path( __FILE__ ) . 'modules/core/wordlift-core.php';
64
+require_once plugin_dir_path(__FILE__).'modules/core/wordlift-core.php';
65 65
 
66
-require_once plugin_dir_path( __FILE__ ) . 'deprecations.php';
66
+require_once plugin_dir_path(__FILE__).'deprecations.php';
67 67
 
68 68
 // Load early to enable/disable features.
69
-require_once plugin_dir_path( __FILE__ ) . 'wordlift/features/index.php';
69
+require_once plugin_dir_path(__FILE__).'wordlift/features/index.php';
70 70
 
71 71
 /**
72 72
  * The code that runs during plugin activation.
@@ -74,11 +74,11 @@  discard block
 block discarded – undo
74 74
  */
75 75
 function activate_wordlift() {
76 76
 
77
-	$log = Wordlift_Log_Service::get_logger( 'activate_wordlift' );
77
+	$log = Wordlift_Log_Service::get_logger('activate_wordlift');
78 78
 
79
-	$log->info( 'Activating WordLift...' );
79
+	$log->info('Activating WordLift...');
80 80
 
81
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php';
81
+	require_once plugin_dir_path(__FILE__).'includes/class-wordlift-activator.php';
82 82
 	Wordlift_Activator::activate();
83 83
 
84 84
 	/**
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
 	 */
99 99
 	Top_Entities::activate();
100 100
 
101
-	if ( ! wp_next_scheduled( 'wl_daily_cron' ) ) {
102
-		wp_schedule_event( time(), 'daily', 'wl_daily_cron' );
101
+	if ( ! wp_next_scheduled('wl_daily_cron')) {
102
+		wp_schedule_event(time(), 'daily', 'wl_daily_cron');
103 103
 	}
104 104
 
105 105
 }
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
  */
111 111
 function deactivate_wordlift() {
112 112
 
113
-	require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php';
113
+	require_once plugin_dir_path(__FILE__).'includes/class-wordlift-deactivator.php';
114 114
 	Wordlift_Deactivator::deactivate();
115 115
 	Wordlift_Http_Api::deactivate();
116 116
 	Ttl_Cache_Cleaner::deactivate();
@@ -126,18 +126,18 @@  discard block
 block discarded – undo
126 126
 	Key_Validation_Notice::remove_notification_flag();
127 127
 	flush_rewrite_rules();
128 128
 
129
-	wp_clear_scheduled_hook( 'wl_daily_cron' );
129
+	wp_clear_scheduled_hook('wl_daily_cron');
130 130
 
131 131
 }
132 132
 
133
-register_activation_hook( __FILE__, 'activate_wordlift' );
134
-register_deactivation_hook( __FILE__, 'deactivate_wordlift' );
133
+register_activation_hook(__FILE__, 'activate_wordlift');
134
+register_deactivation_hook(__FILE__, 'deactivate_wordlift');
135 135
 
136 136
 /**
137 137
  * The core plugin class that is used to define internationalization,
138 138
  * admin-specific hooks, and public-facing site hooks.
139 139
  */
140
-require plugin_dir_path( __FILE__ ) . 'includes/class-wordlift.php';
140
+require plugin_dir_path(__FILE__).'includes/class-wordlift.php';
141 141
 
142 142
 /**
143 143
  * Begins execution of the plugin.
@@ -157,12 +157,12 @@  discard block
 block discarded – undo
157 157
 	 * @return bool
158 158
 	 * @since 3.27.6
159 159
 	 */
160
-	if ( apply_filters( 'wl_feature__enable__widgets', true ) ) {
161
-		add_action( 'widgets_init', 'wl_register_chord_widget' );
162
-		add_action( 'widgets_init', 'wl_register_geo_widget' );
163
-		add_action( 'widgets_init', 'wl_register_timeline_widget' );
160
+	if (apply_filters('wl_feature__enable__widgets', true)) {
161
+		add_action('widgets_init', 'wl_register_chord_widget');
162
+		add_action('widgets_init', 'wl_register_geo_widget');
163
+		add_action('widgets_init', 'wl_register_timeline_widget');
164 164
 	}
165
-	add_filter( 'widget_text', 'do_shortcode' );
165
+	add_filter('widget_text', 'do_shortcode');
166 166
 
167 167
 	/**
168 168
 	 * Filter: wl_feature__enable__analysis
@@ -172,10 +172,10 @@  discard block
 block discarded – undo
172 172
 	 * @return bool
173 173
 	 * @since 3.27.6
174 174
 	 */
175
-	if ( apply_filters( 'wl_feature__enable__analysis', true ) ) {
176
-		add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' );
175
+	if (apply_filters('wl_feature__enable__analysis', true)) {
176
+		add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_action');
177 177
 	} else {
178
-		add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' );
178
+		add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action');
179 179
 	}
180 180
 
181 181
 	$plugin = new Wordlift();
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
 
193 193
 	add_action(
194 194
 		'plugins_loaded',
195
-		function () {
195
+		function() {
196 196
 			// All features from registry should be initialized here.
197 197
 			$features_registry = Features_Registry::get_instance();
198 198
 			$features_registry->initialize_all_features();
@@ -203,27 +203,27 @@  discard block
 block discarded – undo
203 203
 	add_action(
204 204
 		'plugins_loaded',
205 205
 		// phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
206
-		function () use ( $plugin ) {
206
+		function() use ($plugin) {
207 207
 
208 208
 			new Wordlift_Products_Navigator_Shortcode_REST();
209 209
 
210 210
 			// Register the Dataset module, requires `$api_service`.
211
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/dataset/index.php';
212
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/shipping-data/index.php';
211
+			require_once plugin_dir_path(__FILE__).'wordlift/dataset/index.php';
212
+			require_once plugin_dir_path(__FILE__).'wordlift/shipping-data/index.php';
213 213
 
214 214
 			/*
215 215
 			* Require the Entity annotation cleanup module.
216 216
 			*
217 217
 			* @since 3.34.6
218 218
 			*/
219
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/cleanup/index.php';
219
+			require_once plugin_dir_path(__FILE__).'wordlift/cleanup/index.php';
220 220
 
221 221
 			/*
222 222
 			* Import LOD entities.
223 223
 			*
224 224
 			* @since 3.35.0
225 225
 			*/
226
-			require_once plugin_dir_path( __FILE__ ) . 'wordlift/lod-import/index.php';
226
+			require_once plugin_dir_path(__FILE__).'wordlift/lod-import/index.php';
227 227
 
228 228
 		}
229 229
 	);
@@ -241,23 +241,23 @@  discard block
 block discarded – undo
241 241
 function wordlift_plugin_autoload_register() {
242 242
 
243 243
 	spl_autoload_register(
244
-		function ( $class_name ) {
244
+		function($class_name) {
245 245
 
246 246
 			// Bail out if these are not our classes.
247
-			if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) {
247
+			if (0 !== strpos($class_name, 'Wordlift\\')) {
248 248
 				return false;
249 249
 			}
250 250
 
251
-			$class_name_lc = strtolower( str_replace( '_', '-', $class_name ) );
251
+			$class_name_lc = strtolower(str_replace('_', '-', $class_name));
252 252
 
253
-			preg_match( '|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches );
253
+			preg_match('|^(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches);
254 254
 
255
-			$path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] );
256
-			$file = 'class-' . $matches[2] . '.php';
255
+			$path = str_replace('\\', DIRECTORY_SEPARATOR, $matches[1]);
256
+			$file = 'class-'.$matches[2].'.php';
257 257
 
258
-			$full_path = plugin_dir_path( __FILE__ ) . $path . DIRECTORY_SEPARATOR . $file;
258
+			$full_path = plugin_dir_path(__FILE__).$path.DIRECTORY_SEPARATOR.$file;
259 259
 
260
-			if ( ! file_exists( $full_path ) ) {
260
+			if ( ! file_exists($full_path)) {
261 261
 				return false;
262 262
 			}
263 263
 
@@ -269,13 +269,13 @@  discard block
 block discarded – undo
269 269
 
270 270
 }
271 271
 
272
-function wl_block_categories( $categories ) {
272
+function wl_block_categories($categories) {
273 273
 	return array_merge(
274 274
 		$categories,
275 275
 		array(
276 276
 			array(
277 277
 				'slug'  => 'wordlift',
278
-				'title' => __( 'WordLift', 'wordlift' ),
278
+				'title' => __('WordLift', 'wordlift'),
279 279
 			),
280 280
 		)
281 281
 	);
@@ -285,46 +285,46 @@  discard block
 block discarded – undo
285 285
  * This function is created temporarily to handle the legacy library,
286 286
  * this has to be removed when removing the legacy fields from the ui.
287 287
  */
288
-function wl_enqueue_leaflet( $in_footer = false ) {
288
+function wl_enqueue_leaflet($in_footer = false) {
289 289
 	// Leaflet.
290
-	wp_enqueue_style( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.css', array(), '1.6.0' );
291
-	wp_enqueue_script( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer );
290
+	wp_enqueue_style('wl-leaflet', plugin_dir_url(__FILE__).'js/leaflet/leaflet.css', array(), '1.6.0');
291
+	wp_enqueue_script('wl-leaflet', plugin_dir_url(__FILE__).'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer);
292 292
 }
293 293
 
294
-add_filter( 'block_categories', 'wl_block_categories', 10 );
294
+add_filter('block_categories', 'wl_block_categories', 10);
295 295
 
296 296
 // Temporary fix for a typo in WooCommerce Extension.
297 297
 add_filter(
298 298
 	'wl_feature__enable__dataset',
299
-	function ( $value ) {
300
-		return apply_filters( 'wl_features__enable__dataset', $value );
299
+	function($value) {
300
+		return apply_filters('wl_features__enable__dataset', $value);
301 301
 	}
302 302
 );
303 303
 
304
-require_once __DIR__ . '/modules/food-kg/load.php';
305
-require_once __DIR__ . '/modules/gardening-kg/load.php';
306
-require_once __DIR__ . '/modules/acf4so/load.php';
307
-require_once __DIR__ . '/modules/dashboard/load.php';
308
-require_once __DIR__ . '/modules/pods/load.php';
309
-require_once __DIR__ . '/modules/include-exclude-push-config/load.php';
310
-require_once __DIR__ . '/modules/super-resolution/load.php';
304
+require_once __DIR__.'/modules/food-kg/load.php';
305
+require_once __DIR__.'/modules/gardening-kg/load.php';
306
+require_once __DIR__.'/modules/acf4so/load.php';
307
+require_once __DIR__.'/modules/dashboard/load.php';
308
+require_once __DIR__.'/modules/pods/load.php';
309
+require_once __DIR__.'/modules/include-exclude-push-config/load.php';
310
+require_once __DIR__.'/modules/super-resolution/load.php';
311 311
 
312
-function _wl_update_plugins_raptive_domain( $update, $plugin_data, $plugin_file ) {
312
+function _wl_update_plugins_raptive_domain($update, $plugin_data, $plugin_file) {
313 313
 	// Bail out if it's not our plugin.
314 314
 	$update_uri = $plugin_data['UpdateURI'];
315
-	if ( 'wordlift/wordlift.php' !== $plugin_file || ! isset( $update_uri ) ) {
315
+	if ('wordlift/wordlift.php' !== $plugin_file || ! isset($update_uri)) {
316 316
 		return $update;
317 317
 	}
318 318
 
319
-	$response = wp_remote_get( "$update_uri?nocache=" . time() );
319
+	$response = wp_remote_get("$update_uri?nocache=".time());
320 320
 
321
-	if ( is_wp_error( $response ) ) {
321
+	if (is_wp_error($response)) {
322 322
 		return $update;
323 323
 	}
324 324
 
325 325
 	try {
326
-		return json_decode( wp_remote_retrieve_body( $response ) );
327
-	} catch ( Exception $e ) {
326
+		return json_decode(wp_remote_retrieve_body($response));
327
+	} catch (Exception $e) {
328 328
 		return $update;
329 329
 	}
330 330
 }
Please login to merge, or discard this patch.