@@ -5,7 +5,7 @@ discard block |
||
5 | 5 | 'version' => 'dev-develop', |
6 | 6 | 'reference' => '7c2127fb77a6a7581f2f75cd0c42a001ec914102', |
7 | 7 | 'type' => 'wordpress-plugin', |
8 | - 'install_path' => __DIR__ . '/../../', |
|
8 | + 'install_path' => __DIR__.'/../../', |
|
9 | 9 | 'aliases' => array(), |
10 | 10 | 'dev' => true, |
11 | 11 | ), |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | 'version' => 'dev-develop', |
16 | 16 | 'reference' => '7c2127fb77a6a7581f2f75cd0c42a001ec914102', |
17 | 17 | 'type' => 'wordpress-plugin', |
18 | - 'install_path' => __DIR__ . '/../../', |
|
18 | + 'install_path' => __DIR__.'/../../', |
|
19 | 19 | 'aliases' => array(), |
20 | 20 | 'dev_requirement' => false, |
21 | 21 | ), |
@@ -9,7 +9,7 @@ discard block |
||
9 | 9 | public static function loadClassLoader($class) |
10 | 10 | { |
11 | 11 | if ('Composer\Autoload\ClassLoader' === $class) { |
12 | - require __DIR__ . '/ClassLoader.php'; |
|
12 | + require __DIR__.'/ClassLoader.php'; |
|
13 | 13 | } |
14 | 14 | } |
15 | 15 | |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | return self::$loader; |
23 | 23 | } |
24 | 24 | |
25 | - require __DIR__ . '/platform_check.php'; |
|
25 | + require __DIR__.'/platform_check.php'; |
|
26 | 26 | |
27 | 27 | spl_autoload_register(array('ComposerAutoloaderInitca2d76f00d9dc05bb61631fe434b572d', 'loadClassLoader'), true, true); |
28 | 28 | self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); |
29 | 29 | spl_autoload_unregister(array('ComposerAutoloaderInitca2d76f00d9dc05bb61631fe434b572d', 'loadClassLoader')); |
30 | 30 | |
31 | - require __DIR__ . '/autoload_static.php'; |
|
31 | + require __DIR__.'/autoload_static.php'; |
|
32 | 32 | call_user_func(\Composer\Autoload\ComposerStaticInitca2d76f00d9dc05bb61631fe434b572d::getInitializer($loader)); |
33 | 33 | |
34 | 34 | $loader->register(true); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function getPrefixes() |
115 | 115 | { |
116 | - if (!empty($this->prefixesPsr0)) { |
|
116 | + if ( ! empty($this->prefixesPsr0)) { |
|
117 | 117 | return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); |
118 | 118 | } |
119 | 119 | |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | */ |
184 | 184 | public function add($prefix, $paths, $prepend = false) |
185 | 185 | { |
186 | - if (!$prefix) { |
|
186 | + if ( ! $prefix) { |
|
187 | 187 | if ($prepend) { |
188 | 188 | $this->fallbackDirsPsr0 = array_merge( |
189 | 189 | (array) $paths, |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | } |
201 | 201 | |
202 | 202 | $first = $prefix[0]; |
203 | - if (!isset($this->prefixesPsr0[$first][$prefix])) { |
|
203 | + if ( ! isset($this->prefixesPsr0[$first][$prefix])) { |
|
204 | 204 | $this->prefixesPsr0[$first][$prefix] = (array) $paths; |
205 | 205 | |
206 | 206 | return; |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | */ |
233 | 233 | public function addPsr4($prefix, $paths, $prepend = false) |
234 | 234 | { |
235 | - if (!$prefix) { |
|
235 | + if ( ! $prefix) { |
|
236 | 236 | // Register directories for the root namespace. |
237 | 237 | if ($prepend) { |
238 | 238 | $this->fallbackDirsPsr4 = array_merge( |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | (array) $paths |
246 | 246 | ); |
247 | 247 | } |
248 | - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
|
248 | + } elseif ( ! isset($this->prefixDirsPsr4[$prefix])) { |
|
249 | 249 | // Register directories for a new namespace. |
250 | 250 | $length = strlen($prefix); |
251 | 251 | if ('\\' !== $prefix[$length - 1]) { |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | */ |
280 | 280 | public function set($prefix, $paths) |
281 | 281 | { |
282 | - if (!$prefix) { |
|
282 | + if ( ! $prefix) { |
|
283 | 283 | $this->fallbackDirsPsr0 = (array) $paths; |
284 | 284 | } else { |
285 | 285 | $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | */ |
300 | 300 | public function setPsr4($prefix, $paths) |
301 | 301 | { |
302 | - if (!$prefix) { |
|
302 | + if ( ! $prefix) { |
|
303 | 303 | $this->fallbackDirsPsr4 = (array) $paths; |
304 | 304 | } else { |
305 | 305 | $length = strlen($prefix); |
@@ -493,18 +493,18 @@ discard block |
||
493 | 493 | private function findFileWithExtension($class, $ext) |
494 | 494 | { |
495 | 495 | // PSR-4 lookup |
496 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
496 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext; |
|
497 | 497 | |
498 | 498 | $first = $class[0]; |
499 | 499 | if (isset($this->prefixLengthsPsr4[$first])) { |
500 | 500 | $subPath = $class; |
501 | 501 | while (false !== $lastPos = strrpos($subPath, '\\')) { |
502 | 502 | $subPath = substr($subPath, 0, $lastPos); |
503 | - $search = $subPath . '\\'; |
|
503 | + $search = $subPath.'\\'; |
|
504 | 504 | if (isset($this->prefixDirsPsr4[$search])) { |
505 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
505 | + $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos + 1); |
|
506 | 506 | foreach ($this->prefixDirsPsr4[$search] as $dir) { |
507 | - if (file_exists($file = $dir . $pathEnd)) { |
|
507 | + if (file_exists($file = $dir.$pathEnd)) { |
|
508 | 508 | return $file; |
509 | 509 | } |
510 | 510 | } |
@@ -514,7 +514,7 @@ discard block |
||
514 | 514 | |
515 | 515 | // PSR-4 fallback dirs |
516 | 516 | foreach ($this->fallbackDirsPsr4 as $dir) { |
517 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
517 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
518 | 518 | return $file; |
519 | 519 | } |
520 | 520 | } |
@@ -526,14 +526,14 @@ discard block |
||
526 | 526 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
527 | 527 | } else { |
528 | 528 | // PEAR-like class name |
529 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
529 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext; |
|
530 | 530 | } |
531 | 531 | |
532 | 532 | if (isset($this->prefixesPsr0[$first])) { |
533 | 533 | foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
534 | 534 | if (0 === strpos($class, $prefix)) { |
535 | 535 | foreach ($dirs as $dir) { |
536 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
536 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
537 | 537 | return $file; |
538 | 538 | } |
539 | 539 | } |
@@ -543,7 +543,7 @@ discard block |
||
543 | 543 | |
544 | 544 | // PSR-0 fallback dirs |
545 | 545 | foreach ($this->fallbackDirsPsr0 as $dir) { |
546 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
546 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
547 | 547 | return $file; |
548 | 548 | } |
549 | 549 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | public static function getVersionRanges($packageName) |
138 | 138 | { |
139 | 139 | foreach (self::getInstalled() as $installed) { |
140 | - if (!isset($installed['versions'][$packageName])) { |
|
140 | + if ( ! isset($installed['versions'][$packageName])) { |
|
141 | 141 | continue; |
142 | 142 | } |
143 | 143 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | return implode(' || ', $ranges); |
159 | 159 | } |
160 | 160 | |
161 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
161 | + throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed'); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
@@ -168,18 +168,18 @@ discard block |
||
168 | 168 | public static function getVersion($packageName) |
169 | 169 | { |
170 | 170 | foreach (self::getInstalled() as $installed) { |
171 | - if (!isset($installed['versions'][$packageName])) { |
|
171 | + if ( ! isset($installed['versions'][$packageName])) { |
|
172 | 172 | continue; |
173 | 173 | } |
174 | 174 | |
175 | - if (!isset($installed['versions'][$packageName]['version'])) { |
|
175 | + if ( ! isset($installed['versions'][$packageName]['version'])) { |
|
176 | 176 | return null; |
177 | 177 | } |
178 | 178 | |
179 | 179 | return $installed['versions'][$packageName]['version']; |
180 | 180 | } |
181 | 181 | |
182 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
182 | + throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed'); |
|
183 | 183 | } |
184 | 184 | |
185 | 185 | /** |
@@ -189,18 +189,18 @@ discard block |
||
189 | 189 | public static function getPrettyVersion($packageName) |
190 | 190 | { |
191 | 191 | foreach (self::getInstalled() as $installed) { |
192 | - if (!isset($installed['versions'][$packageName])) { |
|
192 | + if ( ! isset($installed['versions'][$packageName])) { |
|
193 | 193 | continue; |
194 | 194 | } |
195 | 195 | |
196 | - if (!isset($installed['versions'][$packageName]['pretty_version'])) { |
|
196 | + if ( ! isset($installed['versions'][$packageName]['pretty_version'])) { |
|
197 | 197 | return null; |
198 | 198 | } |
199 | 199 | |
200 | 200 | return $installed['versions'][$packageName]['pretty_version']; |
201 | 201 | } |
202 | 202 | |
203 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
203 | + throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed'); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -210,18 +210,18 @@ discard block |
||
210 | 210 | public static function getReference($packageName) |
211 | 211 | { |
212 | 212 | foreach (self::getInstalled() as $installed) { |
213 | - if (!isset($installed['versions'][$packageName])) { |
|
213 | + if ( ! isset($installed['versions'][$packageName])) { |
|
214 | 214 | continue; |
215 | 215 | } |
216 | 216 | |
217 | - if (!isset($installed['versions'][$packageName]['reference'])) { |
|
217 | + if ( ! isset($installed['versions'][$packageName]['reference'])) { |
|
218 | 218 | return null; |
219 | 219 | } |
220 | 220 | |
221 | 221 | return $installed['versions'][$packageName]['reference']; |
222 | 222 | } |
223 | 223 | |
224 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
224 | + throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed'); |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | /** |
@@ -231,14 +231,14 @@ discard block |
||
231 | 231 | public static function getInstallPath($packageName) |
232 | 232 | { |
233 | 233 | foreach (self::getInstalled() as $installed) { |
234 | - if (!isset($installed['versions'][$packageName])) { |
|
234 | + if ( ! isset($installed['versions'][$packageName])) { |
|
235 | 235 | continue; |
236 | 236 | } |
237 | 237 | |
238 | 238 | return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; |
239 | 239 | } |
240 | 240 | |
241 | - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); |
|
241 | + throw new \OutOfBoundsException('Package "'.$packageName.'" is not installed'); |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | /** |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | // only require the installed.php file if this file is loaded from its dumped location, |
268 | 268 | // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 |
269 | 269 | if (substr(__DIR__, -8, 1) !== 'C') { |
270 | - self::$installed = include __DIR__ . '/installed.php'; |
|
270 | + self::$installed = include __DIR__.'/installed.php'; |
|
271 | 271 | } else { |
272 | 272 | self::$installed = array(); |
273 | 273 | } |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | // only require the installed.php file if this file is loaded from its dumped location, |
341 | 341 | // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 |
342 | 342 | if (substr(__DIR__, -8, 1) !== 'C') { |
343 | - self::$installed = require __DIR__ . '/installed.php'; |
|
343 | + self::$installed = require __DIR__.'/installed.php'; |
|
344 | 344 | } else { |
345 | 345 | self::$installed = array(); |
346 | 346 | } |
@@ -6,16 +6,16 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInitca2d76f00d9dc05bb61631fe434b572d |
8 | 8 | { |
9 | - public static $classMap = array ( |
|
10 | - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', |
|
11 | - 'Wordlift\\Modules\\Events\\Options_Entity\\Events_Options_Entity_Include_Exclude' => __DIR__ . '/../..' . '/includes/Options_Entity/Events_Options_Entity_Include_Exclude.php', |
|
12 | - 'Wordlift\\Modules\\Events\\Post_Entity\\Events_Post_Entity_Jsonld' => __DIR__ . '/../..' . '/includes/Post_Entity/Events_Post_Entity_Jsonld.php', |
|
13 | - 'Wordlift\\Modules\\Events\\Term_Entity\\Events_Term_Entity_Jsonld' => __DIR__ . '/../..' . '/includes/Term_Entity/Events_Term_Entity_Jsonld.php', |
|
9 | + public static $classMap = array( |
|
10 | + 'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php', |
|
11 | + 'Wordlift\\Modules\\Events\\Options_Entity\\Events_Options_Entity_Include_Exclude' => __DIR__.'/../..'.'/includes/Options_Entity/Events_Options_Entity_Include_Exclude.php', |
|
12 | + 'Wordlift\\Modules\\Events\\Post_Entity\\Events_Post_Entity_Jsonld' => __DIR__.'/../..'.'/includes/Post_Entity/Events_Post_Entity_Jsonld.php', |
|
13 | + 'Wordlift\\Modules\\Events\\Term_Entity\\Events_Term_Entity_Jsonld' => __DIR__.'/../..'.'/includes/Term_Entity/Events_Term_Entity_Jsonld.php', |
|
14 | 14 | ); |
15 | 15 | |
16 | 16 | public static function getInitializer(ClassLoader $loader) |
17 | 17 | { |
18 | - return \Closure::bind(function () use ($loader) { |
|
18 | + return \Closure::bind(function() use ($loader) { |
|
19 | 19 | $loader->classMap = ComposerStaticInitca2d76f00d9dc05bb61631fe434b572d::$classMap; |
20 | 20 | |
21 | 21 | }, null, ClassLoader::class); |
@@ -6,8 +6,8 @@ |
||
6 | 6 | $baseDir = dirname($vendorDir); |
7 | 7 | |
8 | 8 | return array( |
9 | - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', |
|
10 | - 'Wordlift\\Modules\\Events\\Options_Entity\\Events_Options_Entity_Include_Exclude' => $baseDir . '/includes/Options_Entity/Events_Options_Entity_Include_Exclude.php', |
|
11 | - 'Wordlift\\Modules\\Events\\Post_Entity\\Events_Post_Entity_Jsonld' => $baseDir . '/includes/Post_Entity/Events_Post_Entity_Jsonld.php', |
|
12 | - 'Wordlift\\Modules\\Events\\Term_Entity\\Events_Term_Entity_Jsonld' => $baseDir . '/includes/Term_Entity/Events_Term_Entity_Jsonld.php', |
|
9 | + 'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php', |
|
10 | + 'Wordlift\\Modules\\Events\\Options_Entity\\Events_Options_Entity_Include_Exclude' => $baseDir.'/includes/Options_Entity/Events_Options_Entity_Include_Exclude.php', |
|
11 | + 'Wordlift\\Modules\\Events\\Post_Entity\\Events_Post_Entity_Jsonld' => $baseDir.'/includes/Post_Entity/Events_Post_Entity_Jsonld.php', |
|
12 | + 'Wordlift\\Modules\\Events\\Term_Entity\\Events_Term_Entity_Jsonld' => $baseDir.'/includes/Term_Entity/Events_Term_Entity_Jsonld.php', |
|
13 | 13 | ); |
@@ -6,29 +6,29 @@ |
||
6 | 6 | |
7 | 7 | class Include_Exclude_API { |
8 | 8 | |
9 | - /** |
|
10 | - * @var Api_Service |
|
11 | - */ |
|
12 | - private $api_service; |
|
9 | + /** |
|
10 | + * @var Api_Service |
|
11 | + */ |
|
12 | + private $api_service; |
|
13 | 13 | |
14 | - /** |
|
15 | - * @param Api_Service $api_service |
|
16 | - */ |
|
17 | - public function __construct( Api_Service $api_service ) { |
|
18 | - $this->api_service = $api_service; |
|
19 | - } |
|
14 | + /** |
|
15 | + * @param Api_Service $api_service |
|
16 | + */ |
|
17 | + public function __construct( Api_Service $api_service ) { |
|
18 | + $this->api_service = $api_service; |
|
19 | + } |
|
20 | 20 | |
21 | - /** |
|
22 | - * Update. |
|
23 | - * |
|
24 | - * @param $payload |
|
25 | - */ |
|
26 | - public function update( $payload ) { |
|
27 | - $this->api_service->request( |
|
28 | - 'PUT', |
|
29 | - '/accounts/me/include-excludes', |
|
30 | - array( 'content-type' => 'application/json' ), |
|
31 | - wp_json_encode( $payload ) |
|
32 | - ); |
|
33 | - } |
|
21 | + /** |
|
22 | + * Update. |
|
23 | + * |
|
24 | + * @param $payload |
|
25 | + */ |
|
26 | + public function update( $payload ) { |
|
27 | + $this->api_service->request( |
|
28 | + 'PUT', |
|
29 | + '/accounts/me/include-excludes', |
|
30 | + array( 'content-type' => 'application/json' ), |
|
31 | + wp_json_encode( $payload ) |
|
32 | + ); |
|
33 | + } |
|
34 | 34 | } |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | /** |
15 | 15 | * @param Api_Service $api_service |
16 | 16 | */ |
17 | - public function __construct( Api_Service $api_service ) { |
|
17 | + public function __construct(Api_Service $api_service) { |
|
18 | 18 | $this->api_service = $api_service; |
19 | 19 | } |
20 | 20 | |
@@ -23,12 +23,12 @@ discard block |
||
23 | 23 | * |
24 | 24 | * @param $payload |
25 | 25 | */ |
26 | - public function update( $payload ) { |
|
26 | + public function update($payload) { |
|
27 | 27 | $this->api_service->request( |
28 | 28 | 'PUT', |
29 | 29 | '/accounts/me/include-excludes', |
30 | - array( 'content-type' => 'application/json' ), |
|
31 | - wp_json_encode( $payload ) |
|
30 | + array('content-type' => 'application/json'), |
|
31 | + wp_json_encode($payload) |
|
32 | 32 | ); |
33 | 33 | } |
34 | 34 | } |
@@ -6,60 +6,60 @@ |
||
6 | 6 | use Wordlift\Modules\Include_Exclude_Push_Config\Include_Exclude_API; |
7 | 7 | |
8 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
9 | - exit; |
|
9 | + exit; |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | // Bail out if the feature isn't enabled. |
13 | 13 | if ( ! apply_filters( 'wl_feature__enable__include-exclude', false ) ) { // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores |
14 | - return; |
|
14 | + return; |
|
15 | 15 | } |
16 | 16 | |
17 | 17 | // Autoloader for dependencies. |
18 | 18 | if ( file_exists( __DIR__ . '/third-party/vendor/scoper-autoload.php' ) ) { |
19 | - require __DIR__ . '/third-party/vendor/scoper-autoload.php'; |
|
19 | + require __DIR__ . '/third-party/vendor/scoper-autoload.php'; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | // Autoloader for plugin itself. |
23 | 23 | if ( file_exists( __DIR__ . '/includes/vendor/autoload.php' ) ) { |
24 | - require __DIR__ . '/includes/vendor/autoload.php'; |
|
24 | + require __DIR__ . '/includes/vendor/autoload.php'; |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | function __wl_include_exclude_push_config() { |
28 | - // Get the configuration. |
|
29 | - $config = get_option( 'wl_exclude_include_urls_settings', array() ); |
|
28 | + // Get the configuration. |
|
29 | + $config = get_option( 'wl_exclude_include_urls_settings', array() ); |
|
30 | 30 | |
31 | - // Set the default data. |
|
32 | - if ( ! is_array( $config ) || empty( $config ) || ! isset( $config['include_exclude'] ) || ! isset( $config['urls'] ) ) { |
|
33 | - $config = get_option( |
|
34 | - 'wl_exclude_include_urls_settings', |
|
35 | - array( |
|
36 | - 'include_exclude' => 'exclude', |
|
37 | - 'urls' => '', |
|
38 | - ) |
|
39 | - ); |
|
40 | - } |
|
31 | + // Set the default data. |
|
32 | + if ( ! is_array( $config ) || empty( $config ) || ! isset( $config['include_exclude'] ) || ! isset( $config['urls'] ) ) { |
|
33 | + $config = get_option( |
|
34 | + 'wl_exclude_include_urls_settings', |
|
35 | + array( |
|
36 | + 'include_exclude' => 'exclude', |
|
37 | + 'urls' => '', |
|
38 | + ) |
|
39 | + ); |
|
40 | + } |
|
41 | 41 | |
42 | - // Map the configuration to the payload. |
|
43 | - $payload = array_map( |
|
44 | - function ( $item ) use ( $config ) { |
|
45 | - return array( |
|
46 | - 'url' => |
|
47 | - ( 1 === preg_match( '@^https?://.*$@', $item ) ? $item : get_home_url( null, $item ) ), |
|
48 | - 'flag' => strtoupper( $config['include_exclude'] ), |
|
49 | - ); |
|
50 | - }, |
|
51 | - array_filter( preg_split( '/[\r\n]+/', $config['urls'] ) ) |
|
52 | - ); |
|
42 | + // Map the configuration to the payload. |
|
43 | + $payload = array_map( |
|
44 | + function ( $item ) use ( $config ) { |
|
45 | + return array( |
|
46 | + 'url' => |
|
47 | + ( 1 === preg_match( '@^https?://.*$@', $item ) ? $item : get_home_url( null, $item ) ), |
|
48 | + 'flag' => strtoupper( $config['include_exclude'] ), |
|
49 | + ); |
|
50 | + }, |
|
51 | + array_filter( preg_split( '/[\r\n]+/', $config['urls'] ) ) |
|
52 | + ); |
|
53 | 53 | |
54 | - // Load the service. |
|
55 | - $container_builder = new ContainerBuilder(); |
|
56 | - $loader = new YamlFileLoader( $container_builder, new FileLocator( __DIR__ ) ); |
|
57 | - $loader->load( 'services.yml' ); |
|
58 | - $container_builder->compile(); |
|
54 | + // Load the service. |
|
55 | + $container_builder = new ContainerBuilder(); |
|
56 | + $loader = new YamlFileLoader( $container_builder, new FileLocator( __DIR__ ) ); |
|
57 | + $loader->load( 'services.yml' ); |
|
58 | + $container_builder->compile(); |
|
59 | 59 | |
60 | - /** @var Include_Exclude_API $api */ |
|
61 | - $api = $container_builder->get( 'Wordlift\Modules\Include_Exclude_Push_Config\Include_Exclude_API' ); |
|
62 | - $api->update( $payload ); |
|
60 | + /** @var Include_Exclude_API $api */ |
|
61 | + $api = $container_builder->get( 'Wordlift\Modules\Include_Exclude_Push_Config\Include_Exclude_API' ); |
|
62 | + $api->update( $payload ); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @since 3.33.6 |
48 | 48 | */ |
49 | 49 | if ( ! apply_filters( 'wl_is_enabled', true ) ) { |
50 | - return; |
|
50 | + return; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; |
@@ -76,33 +76,33 @@ discard block |
||
76 | 76 | */ |
77 | 77 | function activate_wordlift() { |
78 | 78 | |
79 | - $log = Wordlift_Log_Service::get_logger( 'activate_wordlift' ); |
|
79 | + $log = Wordlift_Log_Service::get_logger( 'activate_wordlift' ); |
|
80 | 80 | |
81 | - $log->info( 'Activating WordLift...' ); |
|
81 | + $log->info( 'Activating WordLift...' ); |
|
82 | 82 | |
83 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php'; |
|
84 | - Wordlift_Activator::activate(); |
|
83 | + require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php'; |
|
84 | + Wordlift_Activator::activate(); |
|
85 | 85 | |
86 | - /** |
|
87 | - * Tell the {@link Wordlift_Http_Api} class that we're activating, to let it run activation tasks. |
|
88 | - * |
|
89 | - * @see https://github.com/insideout10/wordlift-plugin/issues/820 related issue. |
|
90 | - * @since 3.19.2 |
|
91 | - */ |
|
92 | - Wordlift_Http_Api::activate(); |
|
86 | + /** |
|
87 | + * Tell the {@link Wordlift_Http_Api} class that we're activating, to let it run activation tasks. |
|
88 | + * |
|
89 | + * @see https://github.com/insideout10/wordlift-plugin/issues/820 related issue. |
|
90 | + * @since 3.19.2 |
|
91 | + */ |
|
92 | + Wordlift_Http_Api::activate(); |
|
93 | 93 | |
94 | - // Ensure the post type is registered before flushing the rewrite rules. |
|
95 | - Wordlift_Entity_Post_Type_Service::get_instance()->register(); |
|
96 | - flush_rewrite_rules(); |
|
97 | - /** |
|
98 | - * @since 3.27.7 |
|
99 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
100 | - */ |
|
101 | - Top_Entities::activate(); |
|
94 | + // Ensure the post type is registered before flushing the rewrite rules. |
|
95 | + Wordlift_Entity_Post_Type_Service::get_instance()->register(); |
|
96 | + flush_rewrite_rules(); |
|
97 | + /** |
|
98 | + * @since 3.27.7 |
|
99 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
100 | + */ |
|
101 | + Top_Entities::activate(); |
|
102 | 102 | |
103 | - if ( ! wp_next_scheduled( 'wl_daily_cron' ) ) { |
|
104 | - wp_schedule_event( time(), 'daily', 'wl_daily_cron' ); |
|
105 | - } |
|
103 | + if ( ! wp_next_scheduled( 'wl_daily_cron' ) ) { |
|
104 | + wp_schedule_event( time(), 'daily', 'wl_daily_cron' ); |
|
105 | + } |
|
106 | 106 | |
107 | 107 | } |
108 | 108 | |
@@ -112,23 +112,23 @@ discard block |
||
112 | 112 | */ |
113 | 113 | function deactivate_wordlift() { |
114 | 114 | |
115 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php'; |
|
116 | - Wordlift_Deactivator::deactivate(); |
|
117 | - Wordlift_Http_Api::deactivate(); |
|
118 | - Ttl_Cache_Cleaner::deactivate(); |
|
119 | - /** |
|
120 | - * @since 3.27.7 |
|
121 | - * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
122 | - */ |
|
123 | - Top_Entities::deactivate(); |
|
124 | - /** |
|
125 | - * @since 3.27.8 |
|
126 | - * Remove notification flag on deactivation. |
|
127 | - */ |
|
128 | - Key_Validation_Notice::remove_notification_flag(); |
|
129 | - flush_rewrite_rules(); |
|
130 | - |
|
131 | - wp_clear_scheduled_hook( 'wl_daily_cron' ); |
|
115 | + require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php'; |
|
116 | + Wordlift_Deactivator::deactivate(); |
|
117 | + Wordlift_Http_Api::deactivate(); |
|
118 | + Ttl_Cache_Cleaner::deactivate(); |
|
119 | + /** |
|
120 | + * @since 3.27.7 |
|
121 | + * @see https://github.com/insideout10/wordlift-plugin/issues/1214 |
|
122 | + */ |
|
123 | + Top_Entities::deactivate(); |
|
124 | + /** |
|
125 | + * @since 3.27.8 |
|
126 | + * Remove notification flag on deactivation. |
|
127 | + */ |
|
128 | + Key_Validation_Notice::remove_notification_flag(); |
|
129 | + flush_rewrite_rules(); |
|
130 | + |
|
131 | + wp_clear_scheduled_hook( 'wl_daily_cron' ); |
|
132 | 132 | |
133 | 133 | } |
134 | 134 | |
@@ -151,84 +151,84 @@ discard block |
||
151 | 151 | * @since 1.0.0 |
152 | 152 | */ |
153 | 153 | function run_wordlift() { |
154 | - /** |
|
155 | - * Filter: wl_feature__enable__widgets. |
|
156 | - * |
|
157 | - * @param bool whether the widgets needed to be registered, defaults to true. |
|
158 | - * |
|
159 | - * @return bool |
|
160 | - * @since 3.27.6 |
|
161 | - */ |
|
162 | - if ( apply_filters( 'wl_feature__enable__widgets', true ) ) { |
|
163 | - add_action( 'widgets_init', 'wl_register_chord_widget' ); |
|
164 | - add_action( 'widgets_init', 'wl_register_geo_widget' ); |
|
165 | - add_action( 'widgets_init', 'wl_register_timeline_widget' ); |
|
166 | - } |
|
167 | - add_filter( 'widget_text', 'do_shortcode' ); |
|
168 | - |
|
169 | - /** |
|
170 | - * Filter: wl_feature__enable__analysis |
|
171 | - * |
|
172 | - * @param bool Whether to send api request to analysis or not |
|
173 | - * |
|
174 | - * @return bool |
|
175 | - * @since 3.27.6 |
|
176 | - */ |
|
177 | - if ( apply_filters( 'wl_feature__enable__analysis', true ) ) { |
|
178 | - add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' ); |
|
179 | - } else { |
|
180 | - add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' ); |
|
181 | - } |
|
182 | - |
|
183 | - $plugin = new Wordlift(); |
|
184 | - $plugin->run(); |
|
185 | - |
|
186 | - // Initialize the TTL Cache Cleaner. |
|
187 | - new Ttl_Cache_Cleaner(); |
|
188 | - |
|
189 | - // Load the new Post Adapter. |
|
190 | - new Post_Adapter(); |
|
191 | - |
|
192 | - // Load the API Data Hooks. |
|
193 | - new Api_Data_Hooks(); |
|
194 | - |
|
195 | - add_action( |
|
196 | - 'plugins_loaded', |
|
197 | - function () { |
|
198 | - // All features from registry should be initialized here. |
|
199 | - $features_registry = Features_Registry::get_instance(); |
|
200 | - $features_registry->initialize_all_features(); |
|
201 | - }, |
|
202 | - 5 |
|
203 | - ); |
|
204 | - |
|
205 | - add_action( |
|
206 | - 'plugins_loaded', |
|
207 | - // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
208 | - function () use ( $plugin ) { |
|
209 | - |
|
210 | - new Wordlift_Products_Navigator_Shortcode_REST(); |
|
211 | - |
|
212 | - // Register the Dataset module, requires `$api_service`. |
|
213 | - require_once plugin_dir_path( __FILE__ ) . 'classes/dataset/index.php'; |
|
214 | - require_once plugin_dir_path( __FILE__ ) . 'classes/shipping-data/index.php'; |
|
215 | - |
|
216 | - /* |
|
154 | + /** |
|
155 | + * Filter: wl_feature__enable__widgets. |
|
156 | + * |
|
157 | + * @param bool whether the widgets needed to be registered, defaults to true. |
|
158 | + * |
|
159 | + * @return bool |
|
160 | + * @since 3.27.6 |
|
161 | + */ |
|
162 | + if ( apply_filters( 'wl_feature__enable__widgets', true ) ) { |
|
163 | + add_action( 'widgets_init', 'wl_register_chord_widget' ); |
|
164 | + add_action( 'widgets_init', 'wl_register_geo_widget' ); |
|
165 | + add_action( 'widgets_init', 'wl_register_timeline_widget' ); |
|
166 | + } |
|
167 | + add_filter( 'widget_text', 'do_shortcode' ); |
|
168 | + |
|
169 | + /** |
|
170 | + * Filter: wl_feature__enable__analysis |
|
171 | + * |
|
172 | + * @param bool Whether to send api request to analysis or not |
|
173 | + * |
|
174 | + * @return bool |
|
175 | + * @since 3.27.6 |
|
176 | + */ |
|
177 | + if ( apply_filters( 'wl_feature__enable__analysis', true ) ) { |
|
178 | + add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' ); |
|
179 | + } else { |
|
180 | + add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' ); |
|
181 | + } |
|
182 | + |
|
183 | + $plugin = new Wordlift(); |
|
184 | + $plugin->run(); |
|
185 | + |
|
186 | + // Initialize the TTL Cache Cleaner. |
|
187 | + new Ttl_Cache_Cleaner(); |
|
188 | + |
|
189 | + // Load the new Post Adapter. |
|
190 | + new Post_Adapter(); |
|
191 | + |
|
192 | + // Load the API Data Hooks. |
|
193 | + new Api_Data_Hooks(); |
|
194 | + |
|
195 | + add_action( |
|
196 | + 'plugins_loaded', |
|
197 | + function () { |
|
198 | + // All features from registry should be initialized here. |
|
199 | + $features_registry = Features_Registry::get_instance(); |
|
200 | + $features_registry->initialize_all_features(); |
|
201 | + }, |
|
202 | + 5 |
|
203 | + ); |
|
204 | + |
|
205 | + add_action( |
|
206 | + 'plugins_loaded', |
|
207 | + // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
|
208 | + function () use ( $plugin ) { |
|
209 | + |
|
210 | + new Wordlift_Products_Navigator_Shortcode_REST(); |
|
211 | + |
|
212 | + // Register the Dataset module, requires `$api_service`. |
|
213 | + require_once plugin_dir_path( __FILE__ ) . 'classes/dataset/index.php'; |
|
214 | + require_once plugin_dir_path( __FILE__ ) . 'classes/shipping-data/index.php'; |
|
215 | + |
|
216 | + /* |
|
217 | 217 | * Require the Entity annotation cleanup module. |
218 | 218 | * |
219 | 219 | * @since 3.34.6 |
220 | 220 | */ |
221 | - require_once plugin_dir_path( __FILE__ ) . 'classes/cleanup/index.php'; |
|
221 | + require_once plugin_dir_path( __FILE__ ) . 'classes/cleanup/index.php'; |
|
222 | 222 | |
223 | - /* |
|
223 | + /* |
|
224 | 224 | * Import LOD entities. |
225 | 225 | * |
226 | 226 | * @since 3.35.0 |
227 | 227 | */ |
228 | - require_once plugin_dir_path( __FILE__ ) . 'classes/lod-import/index.php'; |
|
228 | + require_once plugin_dir_path( __FILE__ ) . 'classes/lod-import/index.php'; |
|
229 | 229 | |
230 | - } |
|
231 | - ); |
|
230 | + } |
|
231 | + ); |
|
232 | 232 | |
233 | 233 | } |
234 | 234 | |
@@ -242,50 +242,50 @@ discard block |
||
242 | 242 | */ |
243 | 243 | function wordlift_plugin_autoload_register() { |
244 | 244 | |
245 | - spl_autoload_register( |
|
246 | - function ( $class_name ) { |
|
245 | + spl_autoload_register( |
|
246 | + function ( $class_name ) { |
|
247 | 247 | |
248 | - // Bail out if these are not our classes. |
|
249 | - if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) { |
|
250 | - return false; |
|
251 | - } |
|
248 | + // Bail out if these are not our classes. |
|
249 | + if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) { |
|
250 | + return false; |
|
251 | + } |
|
252 | 252 | |
253 | - $class_name_lc = strtolower( str_replace( '_', '-', $class_name ) ); |
|
253 | + $class_name_lc = strtolower( str_replace( '_', '-', $class_name ) ); |
|
254 | 254 | |
255 | - preg_match( '|^wordlift\\\\(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches ); |
|
255 | + preg_match( '|^wordlift\\\\(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches ); |
|
256 | 256 | |
257 | - $path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] ); |
|
258 | - $file = 'class-' . $matches[2] . '.php'; |
|
257 | + $path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] ); |
|
258 | + $file = 'class-' . $matches[2] . '.php'; |
|
259 | 259 | |
260 | - $full_path = plugin_dir_path( __FILE__ ) . 'classes' . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $file; |
|
260 | + $full_path = plugin_dir_path( __FILE__ ) . 'classes' . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $file; |
|
261 | 261 | |
262 | - if ( ! file_exists( $full_path ) ) { |
|
263 | - return false; |
|
264 | - } |
|
262 | + if ( ! file_exists( $full_path ) ) { |
|
263 | + return false; |
|
264 | + } |
|
265 | 265 | |
266 | - try { |
|
267 | - require_once $full_path; |
|
268 | - } catch ( Exception $e ) { |
|
269 | - // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log |
|
270 | - error_log( "[WordLift] $full_path not found, cannot include." ); |
|
271 | - } |
|
266 | + try { |
|
267 | + require_once $full_path; |
|
268 | + } catch ( Exception $e ) { |
|
269 | + // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log |
|
270 | + error_log( "[WordLift] $full_path not found, cannot include." ); |
|
271 | + } |
|
272 | 272 | |
273 | - return true; |
|
274 | - } |
|
275 | - ); |
|
273 | + return true; |
|
274 | + } |
|
275 | + ); |
|
276 | 276 | |
277 | 277 | } |
278 | 278 | |
279 | 279 | function wl_block_categories( $categories ) { |
280 | - return array_merge( |
|
281 | - $categories, |
|
282 | - array( |
|
283 | - array( |
|
284 | - 'slug' => 'wordlift', |
|
285 | - 'title' => __( 'WordLift', 'wordlift' ), |
|
286 | - ), |
|
287 | - ) |
|
288 | - ); |
|
280 | + return array_merge( |
|
281 | + $categories, |
|
282 | + array( |
|
283 | + array( |
|
284 | + 'slug' => 'wordlift', |
|
285 | + 'title' => __( 'WordLift', 'wordlift' ), |
|
286 | + ), |
|
287 | + ) |
|
288 | + ); |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
@@ -293,19 +293,19 @@ discard block |
||
293 | 293 | * this has to be removed when removing the legacy fields from the ui. |
294 | 294 | */ |
295 | 295 | function wl_enqueue_leaflet( $in_footer = false ) { |
296 | - // Leaflet. |
|
297 | - wp_enqueue_style( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.css', array(), '1.6.0' ); |
|
298 | - wp_enqueue_script( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer ); |
|
296 | + // Leaflet. |
|
297 | + wp_enqueue_style( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.css', array(), '1.6.0' ); |
|
298 | + wp_enqueue_script( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer ); |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | add_filter( 'block_categories', 'wl_block_categories', 10 ); |
302 | 302 | |
303 | 303 | // Temporary fix for a typo in WooCommerce Extension. |
304 | 304 | add_filter( |
305 | - 'wl_feature__enable__dataset', |
|
306 | - function ( $value ) { |
|
307 | - return apply_filters( 'wl_features__enable__dataset', $value ); |
|
308 | - } |
|
305 | + 'wl_feature__enable__dataset', |
|
306 | + function ( $value ) { |
|
307 | + return apply_filters( 'wl_features__enable__dataset', $value ); |
|
308 | + } |
|
309 | 309 | ); |
310 | 310 | |
311 | 311 | require_once __DIR__ . '/modules/food-kg/load.php'; |
@@ -320,35 +320,35 @@ discard block |
||
320 | 320 | require_once __DIR__ . '/modules/events/load.php'; |
321 | 321 | |
322 | 322 | function _wl_update_plugins_raptive_domain( $update, $plugin_data, $plugin_file ) { |
323 | - // Bail out if it's not our plugin. |
|
324 | - $update_uri = $plugin_data['UpdateURI']; |
|
325 | - if ( 'wordlift/wordlift.php' !== $plugin_file || ! isset( $update_uri ) ) { |
|
326 | - return $update; |
|
327 | - } |
|
328 | - |
|
329 | - $response = wp_remote_get( "$update_uri?nocache=" . time() ); |
|
330 | - |
|
331 | - if ( is_wp_error( $response ) ) { |
|
332 | - return $update; |
|
333 | - } |
|
334 | - |
|
335 | - try { |
|
336 | - return json_decode( wp_remote_retrieve_body( $response ) ); |
|
337 | - } catch ( Exception $e ) { |
|
338 | - return $update; |
|
339 | - } |
|
323 | + // Bail out if it's not our plugin. |
|
324 | + $update_uri = $plugin_data['UpdateURI']; |
|
325 | + if ( 'wordlift/wordlift.php' !== $plugin_file || ! isset( $update_uri ) ) { |
|
326 | + return $update; |
|
327 | + } |
|
328 | + |
|
329 | + $response = wp_remote_get( "$update_uri?nocache=" . time() ); |
|
330 | + |
|
331 | + if ( is_wp_error( $response ) ) { |
|
332 | + return $update; |
|
333 | + } |
|
334 | + |
|
335 | + try { |
|
336 | + return json_decode( wp_remote_retrieve_body( $response ) ); |
|
337 | + } catch ( Exception $e ) { |
|
338 | + return $update; |
|
339 | + } |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | add_action( |
343 | - 'update_plugins_adthrive.wordlift.io', |
|
344 | - '_wl_update_plugins_raptive_domain', |
|
345 | - 10, |
|
346 | - 3 |
|
343 | + 'update_plugins_adthrive.wordlift.io', |
|
344 | + '_wl_update_plugins_raptive_domain', |
|
345 | + 10, |
|
346 | + 3 |
|
347 | 347 | ); |
348 | 348 | |
349 | 349 | add_action( |
350 | - 'update_plugins_raptive.wordlift.io', |
|
351 | - '_wl_update_plugins_raptive_domain', |
|
352 | - 10, |
|
353 | - 3 |
|
350 | + 'update_plugins_raptive.wordlift.io', |
|
351 | + '_wl_update_plugins_raptive_domain', |
|
352 | + 10, |
|
353 | + 3 |
|
354 | 354 | ); |
@@ -31,26 +31,26 @@ discard block |
||
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.47.0-0' ); |
|
34 | +define('WORDLIFT_PLUGIN_FILE', __FILE__); |
|
35 | +define('WORDLIFT_VERSION', '3.47.0-0'); |
|
36 | 36 | |
37 | 37 | // ## DO NOT REMOVE THIS LINE: WHITELABEL PLACEHOLDER ## |
38 | 38 | |
39 | -require_once plugin_dir_path( __FILE__ ) . '/libraries/action-scheduler/action-scheduler.php'; |
|
40 | -require_once __DIR__ . '/modules/common/load.php'; |
|
41 | -require_once __DIR__ . '/modules/app/load.php'; |
|
42 | -require_once __DIR__ . '/modules/include-exclude/load.php'; |
|
39 | +require_once plugin_dir_path(__FILE__).'/libraries/action-scheduler/action-scheduler.php'; |
|
40 | +require_once __DIR__.'/modules/common/load.php'; |
|
41 | +require_once __DIR__.'/modules/app/load.php'; |
|
42 | +require_once __DIR__.'/modules/include-exclude/load.php'; |
|
43 | 43 | |
44 | 44 | /** |
45 | 45 | * Filter to disable WLP on any request, defaults to true. |
46 | 46 | * |
47 | 47 | * @since 3.33.6 |
48 | 48 | */ |
49 | -if ( ! apply_filters( 'wl_is_enabled', true ) ) { |
|
49 | +if ( ! apply_filters('wl_is_enabled', true)) { |
|
50 | 50 | return; |
51 | 51 | } |
52 | 52 | |
53 | -require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php'; |
|
53 | +require_once plugin_dir_path(__FILE__).'vendor/autoload.php'; |
|
54 | 54 | |
55 | 55 | /* |
56 | 56 | * We introduce the WordLift autoloader, since we start using classes in namespaces, i.e. Wordlift\Http. |
@@ -60,15 +60,15 @@ discard block |
||
60 | 60 | wordlift_plugin_autoload_register(); |
61 | 61 | |
62 | 62 | // Include WordLift constants. |
63 | -require_once plugin_dir_path( __FILE__ ) . 'wordlift-constants.php'; |
|
63 | +require_once plugin_dir_path(__FILE__).'wordlift-constants.php'; |
|
64 | 64 | |
65 | 65 | // Load modules. |
66 | -require_once plugin_dir_path( __FILE__ ) . 'modules/core/wordlift-core.php'; |
|
66 | +require_once plugin_dir_path(__FILE__).'modules/core/wordlift-core.php'; |
|
67 | 67 | |
68 | -require_once plugin_dir_path( __FILE__ ) . 'deprecations.php'; |
|
68 | +require_once plugin_dir_path(__FILE__).'deprecations.php'; |
|
69 | 69 | |
70 | 70 | // Load early to enable/disable features. |
71 | -require_once plugin_dir_path( __FILE__ ) . 'classes/features/index.php'; |
|
71 | +require_once plugin_dir_path(__FILE__).'classes/features/index.php'; |
|
72 | 72 | |
73 | 73 | /** |
74 | 74 | * The code that runs during plugin activation. |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | */ |
77 | 77 | function activate_wordlift() { |
78 | 78 | |
79 | - $log = Wordlift_Log_Service::get_logger( 'activate_wordlift' ); |
|
79 | + $log = Wordlift_Log_Service::get_logger('activate_wordlift'); |
|
80 | 80 | |
81 | - $log->info( 'Activating WordLift...' ); |
|
81 | + $log->info('Activating WordLift...'); |
|
82 | 82 | |
83 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-activator.php'; |
|
83 | + require_once plugin_dir_path(__FILE__).'includes/class-wordlift-activator.php'; |
|
84 | 84 | Wordlift_Activator::activate(); |
85 | 85 | |
86 | 86 | /** |
@@ -100,8 +100,8 @@ discard block |
||
100 | 100 | */ |
101 | 101 | Top_Entities::activate(); |
102 | 102 | |
103 | - if ( ! wp_next_scheduled( 'wl_daily_cron' ) ) { |
|
104 | - wp_schedule_event( time(), 'daily', 'wl_daily_cron' ); |
|
103 | + if ( ! wp_next_scheduled('wl_daily_cron')) { |
|
104 | + wp_schedule_event(time(), 'daily', 'wl_daily_cron'); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | function deactivate_wordlift() { |
114 | 114 | |
115 | - require_once plugin_dir_path( __FILE__ ) . 'includes/class-wordlift-deactivator.php'; |
|
115 | + require_once plugin_dir_path(__FILE__).'includes/class-wordlift-deactivator.php'; |
|
116 | 116 | Wordlift_Deactivator::deactivate(); |
117 | 117 | Wordlift_Http_Api::deactivate(); |
118 | 118 | Ttl_Cache_Cleaner::deactivate(); |
@@ -128,18 +128,18 @@ discard block |
||
128 | 128 | Key_Validation_Notice::remove_notification_flag(); |
129 | 129 | flush_rewrite_rules(); |
130 | 130 | |
131 | - wp_clear_scheduled_hook( 'wl_daily_cron' ); |
|
131 | + wp_clear_scheduled_hook('wl_daily_cron'); |
|
132 | 132 | |
133 | 133 | } |
134 | 134 | |
135 | -register_activation_hook( __FILE__, 'activate_wordlift' ); |
|
136 | -register_deactivation_hook( __FILE__, 'deactivate_wordlift' ); |
|
135 | +register_activation_hook(__FILE__, 'activate_wordlift'); |
|
136 | +register_deactivation_hook(__FILE__, 'deactivate_wordlift'); |
|
137 | 137 | |
138 | 138 | /** |
139 | 139 | * The core plugin class that is used to define internationalization, |
140 | 140 | * admin-specific hooks, and public-facing site hooks. |
141 | 141 | */ |
142 | -require plugin_dir_path( __FILE__ ) . 'includes/class-wordlift.php'; |
|
142 | +require plugin_dir_path(__FILE__).'includes/class-wordlift.php'; |
|
143 | 143 | |
144 | 144 | /** |
145 | 145 | * Begins execution of the plugin. |
@@ -159,12 +159,12 @@ discard block |
||
159 | 159 | * @return bool |
160 | 160 | * @since 3.27.6 |
161 | 161 | */ |
162 | - if ( apply_filters( 'wl_feature__enable__widgets', true ) ) { |
|
163 | - add_action( 'widgets_init', 'wl_register_chord_widget' ); |
|
164 | - add_action( 'widgets_init', 'wl_register_geo_widget' ); |
|
165 | - add_action( 'widgets_init', 'wl_register_timeline_widget' ); |
|
162 | + if (apply_filters('wl_feature__enable__widgets', true)) { |
|
163 | + add_action('widgets_init', 'wl_register_chord_widget'); |
|
164 | + add_action('widgets_init', 'wl_register_geo_widget'); |
|
165 | + add_action('widgets_init', 'wl_register_timeline_widget'); |
|
166 | 166 | } |
167 | - add_filter( 'widget_text', 'do_shortcode' ); |
|
167 | + add_filter('widget_text', 'do_shortcode'); |
|
168 | 168 | |
169 | 169 | /** |
170 | 170 | * Filter: wl_feature__enable__analysis |
@@ -174,10 +174,10 @@ discard block |
||
174 | 174 | * @return bool |
175 | 175 | * @since 3.27.6 |
176 | 176 | */ |
177 | - if ( apply_filters( 'wl_feature__enable__analysis', true ) ) { |
|
178 | - add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_action' ); |
|
177 | + if (apply_filters('wl_feature__enable__analysis', true)) { |
|
178 | + add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_action'); |
|
179 | 179 | } else { |
180 | - add_action( 'wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action' ); |
|
180 | + add_action('wp_ajax_wl_analyze', 'wl_ajax_analyze_disabled_action'); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | $plugin = new Wordlift(); |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | |
195 | 195 | add_action( |
196 | 196 | 'plugins_loaded', |
197 | - function () { |
|
197 | + function() { |
|
198 | 198 | // All features from registry should be initialized here. |
199 | 199 | $features_registry = Features_Registry::get_instance(); |
200 | 200 | $features_registry->initialize_all_features(); |
@@ -205,27 +205,27 @@ discard block |
||
205 | 205 | add_action( |
206 | 206 | 'plugins_loaded', |
207 | 207 | // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
208 | - function () use ( $plugin ) { |
|
208 | + function() use ($plugin) { |
|
209 | 209 | |
210 | 210 | new Wordlift_Products_Navigator_Shortcode_REST(); |
211 | 211 | |
212 | 212 | // Register the Dataset module, requires `$api_service`. |
213 | - require_once plugin_dir_path( __FILE__ ) . 'classes/dataset/index.php'; |
|
214 | - require_once plugin_dir_path( __FILE__ ) . 'classes/shipping-data/index.php'; |
|
213 | + require_once plugin_dir_path(__FILE__).'classes/dataset/index.php'; |
|
214 | + require_once plugin_dir_path(__FILE__).'classes/shipping-data/index.php'; |
|
215 | 215 | |
216 | 216 | /* |
217 | 217 | * Require the Entity annotation cleanup module. |
218 | 218 | * |
219 | 219 | * @since 3.34.6 |
220 | 220 | */ |
221 | - require_once plugin_dir_path( __FILE__ ) . 'classes/cleanup/index.php'; |
|
221 | + require_once plugin_dir_path(__FILE__).'classes/cleanup/index.php'; |
|
222 | 222 | |
223 | 223 | /* |
224 | 224 | * Import LOD entities. |
225 | 225 | * |
226 | 226 | * @since 3.35.0 |
227 | 227 | */ |
228 | - require_once plugin_dir_path( __FILE__ ) . 'classes/lod-import/index.php'; |
|
228 | + require_once plugin_dir_path(__FILE__).'classes/lod-import/index.php'; |
|
229 | 229 | |
230 | 230 | } |
231 | 231 | ); |
@@ -243,31 +243,31 @@ discard block |
||
243 | 243 | function wordlift_plugin_autoload_register() { |
244 | 244 | |
245 | 245 | spl_autoload_register( |
246 | - function ( $class_name ) { |
|
246 | + function($class_name) { |
|
247 | 247 | |
248 | 248 | // Bail out if these are not our classes. |
249 | - if ( 0 !== strpos( $class_name, 'Wordlift\\' ) ) { |
|
249 | + if (0 !== strpos($class_name, 'Wordlift\\')) { |
|
250 | 250 | return false; |
251 | 251 | } |
252 | 252 | |
253 | - $class_name_lc = strtolower( str_replace( '_', '-', $class_name ) ); |
|
253 | + $class_name_lc = strtolower(str_replace('_', '-', $class_name)); |
|
254 | 254 | |
255 | - preg_match( '|^wordlift\\\\(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches ); |
|
255 | + preg_match('|^wordlift\\\\(?:(.*)\\\\)?(.+?)$|', $class_name_lc, $matches); |
|
256 | 256 | |
257 | - $path = str_replace( '\\', DIRECTORY_SEPARATOR, $matches[1] ); |
|
258 | - $file = 'class-' . $matches[2] . '.php'; |
|
257 | + $path = str_replace('\\', DIRECTORY_SEPARATOR, $matches[1]); |
|
258 | + $file = 'class-'.$matches[2].'.php'; |
|
259 | 259 | |
260 | - $full_path = plugin_dir_path( __FILE__ ) . 'classes' . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $file; |
|
260 | + $full_path = plugin_dir_path(__FILE__).'classes'.DIRECTORY_SEPARATOR.$path.DIRECTORY_SEPARATOR.$file; |
|
261 | 261 | |
262 | - if ( ! file_exists( $full_path ) ) { |
|
262 | + if ( ! file_exists($full_path)) { |
|
263 | 263 | return false; |
264 | 264 | } |
265 | 265 | |
266 | 266 | try { |
267 | 267 | require_once $full_path; |
268 | - } catch ( Exception $e ) { |
|
268 | + } catch (Exception $e) { |
|
269 | 269 | // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log |
270 | - error_log( "[WordLift] $full_path not found, cannot include." ); |
|
270 | + error_log("[WordLift] $full_path not found, cannot include."); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | return true; |
@@ -276,13 +276,13 @@ discard block |
||
276 | 276 | |
277 | 277 | } |
278 | 278 | |
279 | -function wl_block_categories( $categories ) { |
|
279 | +function wl_block_categories($categories) { |
|
280 | 280 | return array_merge( |
281 | 281 | $categories, |
282 | 282 | array( |
283 | 283 | array( |
284 | 284 | 'slug' => 'wordlift', |
285 | - 'title' => __( 'WordLift', 'wordlift' ), |
|
285 | + 'title' => __('WordLift', 'wordlift'), |
|
286 | 286 | ), |
287 | 287 | ) |
288 | 288 | ); |
@@ -292,49 +292,49 @@ discard block |
||
292 | 292 | * This function is created temporarily to handle the legacy library, |
293 | 293 | * this has to be removed when removing the legacy fields from the ui. |
294 | 294 | */ |
295 | -function wl_enqueue_leaflet( $in_footer = false ) { |
|
295 | +function wl_enqueue_leaflet($in_footer = false) { |
|
296 | 296 | // Leaflet. |
297 | - wp_enqueue_style( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.css', array(), '1.6.0' ); |
|
298 | - wp_enqueue_script( 'wl-leaflet', plugin_dir_url( __FILE__ ) . 'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer ); |
|
297 | + wp_enqueue_style('wl-leaflet', plugin_dir_url(__FILE__).'js/leaflet/leaflet.css', array(), '1.6.0'); |
|
298 | + wp_enqueue_script('wl-leaflet', plugin_dir_url(__FILE__).'js/leaflet/leaflet.js', array(), '1.6.0', $in_footer); |
|
299 | 299 | } |
300 | 300 | |
301 | -add_filter( 'block_categories', 'wl_block_categories', 10 ); |
|
301 | +add_filter('block_categories', 'wl_block_categories', 10); |
|
302 | 302 | |
303 | 303 | // Temporary fix for a typo in WooCommerce Extension. |
304 | 304 | add_filter( |
305 | 305 | 'wl_feature__enable__dataset', |
306 | - function ( $value ) { |
|
307 | - return apply_filters( 'wl_features__enable__dataset', $value ); |
|
306 | + function($value) { |
|
307 | + return apply_filters('wl_features__enable__dataset', $value); |
|
308 | 308 | } |
309 | 309 | ); |
310 | 310 | |
311 | -require_once __DIR__ . '/modules/food-kg/load.php'; |
|
312 | -require_once __DIR__ . '/modules/gardening-kg/load.php'; |
|
313 | -require_once __DIR__ . '/modules/acf4so/load.php'; |
|
314 | -require_once __DIR__ . '/modules/dashboard/load.php'; |
|
315 | -require_once __DIR__ . '/modules/pods/load.php'; |
|
316 | -require_once __DIR__ . '/modules/include-exclude-push-config/load.php'; |
|
317 | -require_once __DIR__ . '/modules/super-resolution/load.php'; |
|
318 | -require_once __DIR__ . '/modules/redeem-code/load.php'; |
|
319 | -require_once __DIR__ . '/modules/raptive-setup/load.php'; |
|
320 | -require_once __DIR__ . '/modules/events/load.php'; |
|
321 | - |
|
322 | -function _wl_update_plugins_raptive_domain( $update, $plugin_data, $plugin_file ) { |
|
311 | +require_once __DIR__.'/modules/food-kg/load.php'; |
|
312 | +require_once __DIR__.'/modules/gardening-kg/load.php'; |
|
313 | +require_once __DIR__.'/modules/acf4so/load.php'; |
|
314 | +require_once __DIR__.'/modules/dashboard/load.php'; |
|
315 | +require_once __DIR__.'/modules/pods/load.php'; |
|
316 | +require_once __DIR__.'/modules/include-exclude-push-config/load.php'; |
|
317 | +require_once __DIR__.'/modules/super-resolution/load.php'; |
|
318 | +require_once __DIR__.'/modules/redeem-code/load.php'; |
|
319 | +require_once __DIR__.'/modules/raptive-setup/load.php'; |
|
320 | +require_once __DIR__.'/modules/events/load.php'; |
|
321 | + |
|
322 | +function _wl_update_plugins_raptive_domain($update, $plugin_data, $plugin_file) { |
|
323 | 323 | // Bail out if it's not our plugin. |
324 | 324 | $update_uri = $plugin_data['UpdateURI']; |
325 | - if ( 'wordlift/wordlift.php' !== $plugin_file || ! isset( $update_uri ) ) { |
|
325 | + if ('wordlift/wordlift.php' !== $plugin_file || ! isset($update_uri)) { |
|
326 | 326 | return $update; |
327 | 327 | } |
328 | 328 | |
329 | - $response = wp_remote_get( "$update_uri?nocache=" . time() ); |
|
329 | + $response = wp_remote_get("$update_uri?nocache=".time()); |
|
330 | 330 | |
331 | - if ( is_wp_error( $response ) ) { |
|
331 | + if (is_wp_error($response)) { |
|
332 | 332 | return $update; |
333 | 333 | } |
334 | 334 | |
335 | 335 | try { |
336 | - return json_decode( wp_remote_retrieve_body( $response ) ); |
|
337 | - } catch ( Exception $e ) { |
|
336 | + return json_decode(wp_remote_retrieve_body($response)); |
|
337 | + } catch (Exception $e) { |
|
338 | 338 | return $update; |
339 | 339 | } |
340 | 340 | } |