@@ -8,14 +8,14 @@ |
||
| 8 | 8 | ?> |
| 9 | 9 | |
| 10 | 10 | <div class="wrap" id="wl-settings-page"> |
| 11 | - <h2><?php esc_html_e( 'WorldLift Analytics Settings', 'wordlift' ); ?></h2> |
|
| 11 | + <h2><?php esc_html_e('WorldLift Analytics Settings', 'wordlift'); ?></h2> |
|
| 12 | 12 | |
| 13 | 13 | <?php settings_errors(); ?> |
| 14 | 14 | |
| 15 | 15 | <form action="options.php" method="post"> |
| 16 | 16 | <?php |
| 17 | - settings_fields( 'wl_analytics_settings' ); |
|
| 18 | - do_settings_sections( 'wl_analytics_settings' ); |
|
| 17 | + settings_fields('wl_analytics_settings'); |
|
| 18 | + do_settings_sections('wl_analytics_settings'); |
|
| 19 | 19 | submit_button(); |
| 20 | 20 | ?> |
| 21 | 21 | </form> |
@@ -44,35 +44,35 @@ |
||
| 44 | 44 | * |
| 45 | 45 | * @return $this|Wordlift_Admin_Element |
| 46 | 46 | */ |
| 47 | - public function render( $args ) { |
|
| 47 | + public function render($args) { |
|
| 48 | 48 | |
| 49 | 49 | /* |
| 50 | 50 | * Parse the arguments and merge with default values. |
| 51 | 51 | * Name intentionally do not have a default as it has to be in SyncEvent |
| 52 | 52 | * with form handling code |
| 53 | 53 | */ |
| 54 | - $pre_params = wp_parse_args( $args, array( |
|
| 55 | - 'id' => uniqid( 'wl-input-' ), |
|
| 54 | + $pre_params = wp_parse_args($args, array( |
|
| 55 | + 'id' => uniqid('wl-input-'), |
|
| 56 | 56 | 'value' => '', |
| 57 | 57 | 'readonly' => false, |
| 58 | 58 | 'css_class' => '', |
| 59 | 59 | 'description' => '', |
| 60 | - ) ); |
|
| 61 | - $params = apply_filters( 'wl_admin_input_element_params', $pre_params ); |
|
| 60 | + )); |
|
| 61 | + $params = apply_filters('wl_admin_input_element_params', $pre_params); |
|
| 62 | 62 | |
| 63 | 63 | // Set the readonly and class attributes and the description. |
| 64 | 64 | $readonly = $params['readonly'] ? ' readonly="readonly"' : ''; |
| 65 | - $css_class = ! empty( $params['css_class'] ) ? ' class="' . esc_attr( $params['css_class'] ) . '"' : ''; |
|
| 66 | - $description = ! empty( $params['description'] ) ? '<p>' . wp_kses( $params['description'], array( 'a' => array( 'href' => array() ) ) ) . '</p>' : ''; |
|
| 65 | + $css_class = ! empty($params['css_class']) ? ' class="'.esc_attr($params['css_class']).'"' : ''; |
|
| 66 | + $description = ! empty($params['description']) ? '<p>'.wp_kses($params['description'], array('a' => array('href' => array()))).'</p>' : ''; |
|
| 67 | 67 | |
| 68 | 68 | // allow different types of input - default to 'text'. |
| 69 | - $input_type = ! empty( $params['type'] ) ? $params['type'] : 'text'; |
|
| 69 | + $input_type = ! empty($params['type']) ? $params['type'] : 'text'; |
|
| 70 | 70 | ?> |
| 71 | 71 | |
| 72 | - <input type="<?php echo esc_attr( $input_type ); ?>" |
|
| 73 | - id="<?php echo esc_attr( $params['id'] ); ?>" |
|
| 74 | - name="<?php echo esc_attr( $params['name'] ); ?>" |
|
| 75 | - value="<?php echo esc_attr( $params['value'] ); ?>" |
|
| 72 | + <input type="<?php echo esc_attr($input_type); ?>" |
|
| 73 | + id="<?php echo esc_attr($params['id']); ?>" |
|
| 74 | + name="<?php echo esc_attr($params['name']); ?>" |
|
| 75 | + value="<?php echo esc_attr($params['value']); ?>" |
|
| 76 | 76 | <?php echo $readonly; ?> |
| 77 | 77 | <?php echo $css_class; ?> |
| 78 | 78 | /> |
@@ -10,7 +10,7 @@ discard block |
||
| 10 | 10 | * @since 3.6.0 |
| 11 | 11 | */ |
| 12 | 12 | |
| 13 | -if ( ! defined( 'ABSPATH' ) ) { |
|
| 13 | +if ( ! defined('ABSPATH')) { |
|
| 14 | 14 | exit; |
| 15 | 15 | } |
| 16 | 16 | |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | */ |
| 139 | 139 | public function __construct() { |
| 140 | 140 | |
| 141 | - $this->log = Wordlift_Log_Service::get_logger( get_class() ); |
|
| 141 | + $this->log = Wordlift_Log_Service::get_logger(get_class()); |
|
| 142 | 142 | |
| 143 | 143 | self::$instance = $this; |
| 144 | 144 | |
@@ -168,11 +168,11 @@ discard block |
||
| 168 | 168 | * |
| 169 | 169 | * @return mixed The configuration value or the default value if not found. |
| 170 | 170 | */ |
| 171 | - private function get( $option, $key, $default = '' ) { |
|
| 171 | + private function get($option, $key, $default = '') { |
|
| 172 | 172 | |
| 173 | - $options = get_option( $option, array() ); |
|
| 173 | + $options = get_option($option, array()); |
|
| 174 | 174 | |
| 175 | - return isset( $options[ $key ] ) ? $options[ $key ] : $default; |
|
| 175 | + return isset($options[$key]) ? $options[$key] : $default; |
|
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | /** |
@@ -184,12 +184,12 @@ discard block |
||
| 184 | 184 | * @param string $key The value key. |
| 185 | 185 | * @param mixed $value The value. |
| 186 | 186 | */ |
| 187 | - private function set( $option, $key, $value ) { |
|
| 187 | + private function set($option, $key, $value) { |
|
| 188 | 188 | |
| 189 | - $values = get_option( $option ); |
|
| 190 | - $values = isset( $values ) ? $values : array(); |
|
| 191 | - $values[ $key ] = $value; |
|
| 192 | - update_option( $option, $values ); |
|
| 189 | + $values = get_option($option); |
|
| 190 | + $values = isset($values) ? $values : array(); |
|
| 191 | + $values[$key] = $value; |
|
| 192 | + update_option($option, $values); |
|
| 193 | 193 | |
| 194 | 194 | } |
| 195 | 195 | |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | */ |
| 203 | 203 | public function get_entity_base_path() { |
| 204 | 204 | |
| 205 | - return $this->get( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, 'entity' ); |
|
| 205 | + return $this->get('wl_general_settings', self::ENTITY_BASE_PATH_KEY, 'entity'); |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /** |
@@ -212,9 +212,9 @@ discard block |
||
| 212 | 212 | * |
| 213 | 213 | * @param string $value The entity base path. |
| 214 | 214 | */ |
| 215 | - public function set_entity_base_path( $value ) { |
|
| 215 | + public function set_entity_base_path($value) { |
|
| 216 | 216 | |
| 217 | - $this->set( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, $value ); |
|
| 217 | + $this->set('wl_general_settings', self::ENTITY_BASE_PATH_KEY, $value); |
|
| 218 | 218 | |
| 219 | 219 | } |
| 220 | 220 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | */ |
| 228 | 228 | public function is_skip_wizard() { |
| 229 | 229 | |
| 230 | - return $this->get( 'wl_general_settings', self::SKIP_WIZARD, false ); |
|
| 230 | + return $this->get('wl_general_settings', self::SKIP_WIZARD, false); |
|
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | /** |
@@ -237,9 +237,9 @@ discard block |
||
| 237 | 237 | * |
| 238 | 238 | * @param bool $value True to skip the wizard. We expect a boolean value. |
| 239 | 239 | */ |
| 240 | - public function set_skip_wizard( $value ) { |
|
| 240 | + public function set_skip_wizard($value) { |
|
| 241 | 241 | |
| 242 | - $this->set( 'wl_general_settings', self::SKIP_WIZARD, true === $value ); |
|
| 242 | + $this->set('wl_general_settings', self::SKIP_WIZARD, true === $value); |
|
| 243 | 243 | |
| 244 | 244 | } |
| 245 | 245 | |
@@ -252,7 +252,7 @@ discard block |
||
| 252 | 252 | */ |
| 253 | 253 | public function get_key() { |
| 254 | 254 | |
| 255 | - return $this->get( 'wl_general_settings', self::KEY, '' ); |
|
| 255 | + return $this->get('wl_general_settings', self::KEY, ''); |
|
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | /** |
@@ -262,9 +262,9 @@ discard block |
||
| 262 | 262 | * |
| 263 | 263 | * @param string $value WordLift's key. |
| 264 | 264 | */ |
| 265 | - public function set_key( $value ) { |
|
| 265 | + public function set_key($value) { |
|
| 266 | 266 | |
| 267 | - $this->set( 'wl_general_settings', self::KEY, $value ); |
|
| 267 | + $this->set('wl_general_settings', self::KEY, $value); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | /** |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | */ |
| 279 | 279 | public function get_language_code() { |
| 280 | 280 | |
| 281 | - return $this->get( 'wl_general_settings', self::LANGUAGE, 'en' ); |
|
| 281 | + return $this->get('wl_general_settings', self::LANGUAGE, 'en'); |
|
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | /** |
@@ -288,9 +288,9 @@ discard block |
||
| 288 | 288 | * |
| 289 | 289 | * @param string $value WordLift's language code. |
| 290 | 290 | */ |
| 291 | - public function set_language_code( $value ) { |
|
| 291 | + public function set_language_code($value) { |
|
| 292 | 292 | |
| 293 | - $this->set( 'wl_general_settings', self::LANGUAGE, $value ); |
|
| 293 | + $this->set('wl_general_settings', self::LANGUAGE, $value); |
|
| 294 | 294 | |
| 295 | 295 | } |
| 296 | 296 | |
@@ -301,9 +301,9 @@ discard block |
||
| 301 | 301 | * |
| 302 | 302 | * @param string $value The user preferences(yes/no). |
| 303 | 303 | */ |
| 304 | - public function set_diagnostic_preferences( $value ) { |
|
| 304 | + public function set_diagnostic_preferences($value) { |
|
| 305 | 305 | |
| 306 | - $this->set( 'wl_general_settings', self::SEND_DIAGNOSTIC, $value ); |
|
| 306 | + $this->set('wl_general_settings', self::SEND_DIAGNOSTIC, $value); |
|
| 307 | 307 | |
| 308 | 308 | } |
| 309 | 309 | |
@@ -314,7 +314,7 @@ discard block |
||
| 314 | 314 | */ |
| 315 | 315 | public function get_diagnostic_preferences() { |
| 316 | 316 | |
| 317 | - return $this->get( 'wl_general_settings', self::SEND_DIAGNOSTIC, 'no' ); |
|
| 317 | + return $this->get('wl_general_settings', self::SEND_DIAGNOSTIC, 'no'); |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | /** |
@@ -326,7 +326,7 @@ discard block |
||
| 326 | 326 | */ |
| 327 | 327 | public function get_country_code() { |
| 328 | 328 | |
| 329 | - return $this->get( 'wl_general_settings', self::COUNTRY_CODE, 'us' ); |
|
| 329 | + return $this->get('wl_general_settings', self::COUNTRY_CODE, 'us'); |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | /** |
@@ -336,9 +336,9 @@ discard block |
||
| 336 | 336 | * |
| 337 | 337 | * @param string $value WordLift's country code. |
| 338 | 338 | */ |
| 339 | - public function set_country_code( $value ) { |
|
| 339 | + public function set_country_code($value) { |
|
| 340 | 340 | |
| 341 | - $this->set( 'wl_general_settings', self::COUNTRY_CODE, $value ); |
|
| 341 | + $this->set('wl_general_settings', self::COUNTRY_CODE, $value); |
|
| 342 | 342 | |
| 343 | 343 | } |
| 344 | 344 | |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | */ |
| 355 | 355 | public function get_publisher_id() { |
| 356 | 356 | |
| 357 | - return $this->get( 'wl_general_settings', self::PUBLISHER_ID, null ); |
|
| 357 | + return $this->get('wl_general_settings', self::PUBLISHER_ID, null); |
|
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | /** |
@@ -364,9 +364,9 @@ discard block |
||
| 364 | 364 | * |
| 365 | 365 | * @param int $value The publisher entity post id. |
| 366 | 366 | */ |
| 367 | - public function set_publisher_id( $value ) { |
|
| 367 | + public function set_publisher_id($value) { |
|
| 368 | 368 | |
| 369 | - $this->set( 'wl_general_settings', self::PUBLISHER_ID, $value ); |
|
| 369 | + $this->set('wl_general_settings', self::PUBLISHER_ID, $value); |
|
| 370 | 370 | |
| 371 | 371 | } |
| 372 | 372 | |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | */ |
| 380 | 380 | public function get_dataset_uri() { |
| 381 | 381 | |
| 382 | - return $this->get( 'wl_advanced_settings', self::DATASET_URI, null ); |
|
| 382 | + return $this->get('wl_advanced_settings', self::DATASET_URI, null); |
|
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | /** |
@@ -389,9 +389,9 @@ discard block |
||
| 389 | 389 | * |
| 390 | 390 | * @param string $value The dataset URI. |
| 391 | 391 | */ |
| 392 | - public function set_dataset_uri( $value ) { |
|
| 392 | + public function set_dataset_uri($value) { |
|
| 393 | 393 | |
| 394 | - $this->set( 'wl_advanced_settings', self::DATASET_URI, $value ); |
|
| 394 | + $this->set('wl_advanced_settings', self::DATASET_URI, $value); |
|
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | /** |
@@ -403,7 +403,7 @@ discard block |
||
| 403 | 403 | */ |
| 404 | 404 | public function get_package_type() { |
| 405 | 405 | |
| 406 | - return $this->get( 'wl_advanced_settings', self::PACKAGE_TYPE, null ); |
|
| 406 | + return $this->get('wl_advanced_settings', self::PACKAGE_TYPE, null); |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | /** |
@@ -413,9 +413,9 @@ discard block |
||
| 413 | 413 | * |
| 414 | 414 | * @param string $value The package type. |
| 415 | 415 | */ |
| 416 | - public function set_package_type( $value ) { |
|
| 416 | + public function set_package_type($value) { |
|
| 417 | 417 | |
| 418 | - $this->set( 'wl_advanced_settings', self::PACKAGE_TYPE, $value ); |
|
| 418 | + $this->set('wl_advanced_settings', self::PACKAGE_TYPE, $value); |
|
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | /** |
@@ -431,11 +431,11 @@ discard block |
||
| 431 | 431 | * @param array $old_value The old settings. |
| 432 | 432 | * @param array $new_value The new settings. |
| 433 | 433 | */ |
| 434 | - public function update_key( $old_value, $new_value ) { |
|
| 434 | + public function update_key($old_value, $new_value) { |
|
| 435 | 435 | |
| 436 | 436 | // Check the old key value and the new one. We're going to ask for the dataset URI only if the key has changed. |
| 437 | 437 | // $old_key = isset( $old_value['key'] ) ? $old_value['key'] : ''; |
| 438 | - $new_key = isset( $new_value['key'] ) ? $new_value['key'] : ''; |
|
| 438 | + $new_key = isset($new_value['key']) ? $new_value['key'] : ''; |
|
| 439 | 439 | |
| 440 | 440 | // If the key hasn't changed, don't do anything. |
| 441 | 441 | // WARN The 'update_option' hook is fired only if the new and old value are not equal. |
@@ -444,12 +444,12 @@ discard block |
||
| 444 | 444 | // } |
| 445 | 445 | |
| 446 | 446 | // If the key is empty, empty the dataset URI. |
| 447 | - if ( '' === $new_key ) { |
|
| 448 | - $this->set_dataset_uri( '' ); |
|
| 447 | + if ('' === $new_key) { |
|
| 448 | + $this->set_dataset_uri(''); |
|
| 449 | 449 | } |
| 450 | 450 | |
| 451 | 451 | // make the request to the remote server. |
| 452 | - $this->get_remote_dataset_uri( $new_key ); |
|
| 452 | + $this->get_remote_dataset_uri($new_key); |
|
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | /** |
@@ -463,9 +463,9 @@ discard block |
||
| 463 | 463 | * |
| 464 | 464 | * @param string $key The key to be used. |
| 465 | 465 | */ |
| 466 | - public function get_remote_dataset_uri( $key ) { |
|
| 466 | + public function get_remote_dataset_uri($key) { |
|
| 467 | 467 | |
| 468 | - $this->log->trace( 'Getting the remote dataset URI and package type...' ); |
|
| 468 | + $this->log->trace('Getting the remote dataset URI and package type...'); |
|
| 469 | 469 | |
| 470 | 470 | /** |
| 471 | 471 | * Allow 3rd parties to change the site_url. |
@@ -476,36 +476,36 @@ discard block |
||
| 476 | 476 | * |
| 477 | 477 | * @param string $site_url The site url. |
| 478 | 478 | */ |
| 479 | - $site_url = apply_filters( 'wl_production_site_url', site_url() ); |
|
| 479 | + $site_url = apply_filters('wl_production_site_url', site_url()); |
|
| 480 | 480 | |
| 481 | 481 | // Build the URL. |
| 482 | 482 | $url = $this->get_accounts() |
| 483 | - . '?key=' . rawurlencode( $key ) |
|
| 484 | - . '&url=' . rawurlencode( $site_url ) |
|
| 485 | - . '&country=' . $this->get_country_code() |
|
| 486 | - . '&language=' . $this->get_language_code(); |
|
| 483 | + . '?key='.rawurlencode($key) |
|
| 484 | + . '&url='.rawurlencode($site_url) |
|
| 485 | + . '&country='.$this->get_country_code() |
|
| 486 | + . '&language='.$this->get_language_code(); |
|
| 487 | 487 | |
| 488 | - $args = wp_parse_args( unserialize( WL_REDLINK_API_HTTP_OPTIONS ), array( |
|
| 488 | + $args = wp_parse_args(unserialize(WL_REDLINK_API_HTTP_OPTIONS), array( |
|
| 489 | 489 | 'method' => 'PUT', |
| 490 | - ) ); |
|
| 491 | - $response = wp_remote_request( $url, $args ); |
|
| 490 | + )); |
|
| 491 | + $response = wp_remote_request($url, $args); |
|
| 492 | 492 | |
| 493 | 493 | // The response is an error. |
| 494 | - if ( is_wp_error( $response ) ) { |
|
| 495 | - $this->log->error( 'An error occurred setting the dataset URI: ' . $response->get_error_message() ); |
|
| 494 | + if (is_wp_error($response)) { |
|
| 495 | + $this->log->error('An error occurred setting the dataset URI: '.$response->get_error_message()); |
|
| 496 | 496 | |
| 497 | - $this->set_dataset_uri( '' ); |
|
| 498 | - $this->set_package_type( null ); |
|
| 497 | + $this->set_dataset_uri(''); |
|
| 498 | + $this->set_package_type(null); |
|
| 499 | 499 | |
| 500 | 500 | return; |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | // The response is not OK. |
| 504 | - if ( 200 !== (int) $response['response']['code'] ) { |
|
| 505 | - $this->log->error( "Unexpected status code when opening URL $url: " . $response['response']['code'] ); |
|
| 504 | + if (200 !== (int) $response['response']['code']) { |
|
| 505 | + $this->log->error("Unexpected status code when opening URL $url: ".$response['response']['code']); |
|
| 506 | 506 | |
| 507 | - $this->set_dataset_uri( '' ); |
|
| 508 | - $this->set_package_type( null ); |
|
| 507 | + $this->set_dataset_uri(''); |
|
| 508 | + $this->set_package_type(null); |
|
| 509 | 509 | |
| 510 | 510 | return; |
| 511 | 511 | } |
@@ -515,14 +515,14 @@ discard block |
||
| 515 | 515 | * |
| 516 | 516 | * @since 3.20.0 |
| 517 | 517 | */ |
| 518 | - $json = json_decode( $response['body'] ); |
|
| 518 | + $json = json_decode($response['body']); |
|
| 519 | 519 | $dataset_uri = $json->datasetURI; |
| 520 | - $package_type = isset( $json->packageType ) ? $json->packageType : null; |
|
| 520 | + $package_type = isset($json->packageType) ? $json->packageType : null; |
|
| 521 | 521 | |
| 522 | - $this->log->info( "Updating [ dataset uri :: $dataset_uri ][ package type :: $package_type ]..." ); |
|
| 522 | + $this->log->info("Updating [ dataset uri :: $dataset_uri ][ package type :: $package_type ]..."); |
|
| 523 | 523 | |
| 524 | - $this->set_dataset_uri( $dataset_uri ); |
|
| 525 | - $this->set_package_type( $package_type ); |
|
| 524 | + $this->set_dataset_uri($dataset_uri); |
|
| 525 | + $this->set_package_type($package_type); |
|
| 526 | 526 | |
| 527 | 527 | } |
| 528 | 528 | |
@@ -541,20 +541,20 @@ discard block |
||
| 541 | 541 | * |
| 542 | 542 | * @return mixed The same value in the $value parameter |
| 543 | 543 | */ |
| 544 | - function maybe_update_dataset_uri( $value, $old_value ) { |
|
| 544 | + function maybe_update_dataset_uri($value, $old_value) { |
|
| 545 | 545 | |
| 546 | 546 | // Check the old key value and the new one. Here we're only handling the |
| 547 | 547 | // case where the key hasn't changed and the dataset URI isn't set. The |
| 548 | 548 | // other case, i.e. a new key is inserted, is handled at `update_key`. |
| 549 | - $old_key = isset( $old_value['key'] ) ? $old_value['key'] : ''; |
|
| 550 | - $new_key = isset( $value['key'] ) ? $value['key'] : ''; |
|
| 549 | + $old_key = isset($old_value['key']) ? $old_value['key'] : ''; |
|
| 550 | + $new_key = isset($value['key']) ? $value['key'] : ''; |
|
| 551 | 551 | |
| 552 | 552 | $dataset_uri = $this->get_dataset_uri(); |
| 553 | 553 | |
| 554 | - if ( ! empty( $new_key ) && $new_key === $old_key && empty( $dataset_uri ) ) { |
|
| 554 | + if ( ! empty($new_key) && $new_key === $old_key && empty($dataset_uri)) { |
|
| 555 | 555 | |
| 556 | 556 | // make the request to the remote server to try to get the dataset uri. |
| 557 | - $this->get_remote_dataset_uri( $new_key ); |
|
| 557 | + $this->get_remote_dataset_uri($new_key); |
|
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | return $value; |
@@ -569,9 +569,9 @@ discard block |
||
| 569 | 569 | * |
| 570 | 570 | * @return string The API URI. |
| 571 | 571 | */ |
| 572 | - public function get_accounts_by_key_dataset_uri( $key ) { |
|
| 572 | + public function get_accounts_by_key_dataset_uri($key) { |
|
| 573 | 573 | |
| 574 | - return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . "accounts/key=$key/dataset_uri"; |
|
| 574 | + return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE."accounts/key=$key/dataset_uri"; |
|
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | /** |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | */ |
| 584 | 584 | public function get_accounts() { |
| 585 | 585 | |
| 586 | - return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'accounts'; |
|
| 586 | + return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE.'accounts'; |
|
| 587 | 587 | } |
| 588 | 588 | |
| 589 | 589 | /** |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | */ |
| 596 | 596 | public function is_link_by_default() { |
| 597 | 597 | |
| 598 | - return 'yes' === $this->get( 'wl_general_settings', self::LINK_BY_DEFAULT, 'yes' ); |
|
| 598 | + return 'yes' === $this->get('wl_general_settings', self::LINK_BY_DEFAULT, 'yes'); |
|
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | /** |
@@ -605,9 +605,9 @@ discard block |
||
| 605 | 605 | * |
| 606 | 606 | * @param bool $value True to enabling linking by default, otherwise false. |
| 607 | 607 | */ |
| 608 | - public function set_link_by_default( $value ) { |
|
| 608 | + public function set_link_by_default($value) { |
|
| 609 | 609 | |
| 610 | - $this->set( 'wl_general_settings', self::LINK_BY_DEFAULT, true === $value ? 'yes' : 'no' ); |
|
| 610 | + $this->set('wl_general_settings', self::LINK_BY_DEFAULT, true === $value ? 'yes' : 'no'); |
|
| 611 | 611 | } |
| 612 | 612 | |
| 613 | 613 | /** |
@@ -618,7 +618,7 @@ discard block |
||
| 618 | 618 | * @return string 'no' or 'yes' representing bool. |
| 619 | 619 | */ |
| 620 | 620 | public function is_analytics_enable() { |
| 621 | - return 'yes' === $this->get( 'wl_analytics_settings', self::ANALYTICS_ENABLE, 'no' ); |
|
| 621 | + return 'yes' === $this->get('wl_analytics_settings', self::ANALYTICS_ENABLE, 'no'); |
|
| 622 | 622 | } |
| 623 | 623 | |
| 624 | 624 | /** |
@@ -628,9 +628,9 @@ discard block |
||
| 628 | 628 | * |
| 629 | 629 | * @param bool $value True to enabling analytics, otherwise false. |
| 630 | 630 | */ |
| 631 | - public function set_is_analytics_enable( $value ) { |
|
| 631 | + public function set_is_analytics_enable($value) { |
|
| 632 | 632 | |
| 633 | - $this->set( 'wl_general_settings', self::ANALYTICS_ENABLE, true === $value ? 'yes' : 'no' ); |
|
| 633 | + $this->set('wl_general_settings', self::ANALYTICS_ENABLE, true === $value ? 'yes' : 'no'); |
|
| 634 | 634 | } |
| 635 | 635 | |
| 636 | 636 | /** |
@@ -641,7 +641,7 @@ discard block |
||
| 641 | 641 | * @return int |
| 642 | 642 | */ |
| 643 | 643 | public function get_analytics_entity_uri_dimension() { |
| 644 | - return (int) $this->get( 'wl_analytics_settings', self::ANALYTICS_ENTITY_URI_DIMENSION, 2 ); |
|
| 644 | + return (int) $this->get('wl_analytics_settings', self::ANALYTICS_ENTITY_URI_DIMENSION, 2); |
|
| 645 | 645 | } |
| 646 | 646 | |
| 647 | 647 | /** |
@@ -652,7 +652,7 @@ discard block |
||
| 652 | 652 | * @return int |
| 653 | 653 | */ |
| 654 | 654 | public function get_analytics_entity_type_dimension() { |
| 655 | - return $this->get( 'wl_analytics_settings', self::ANALYTICS_ENTITY_TYPE_DIMENSION, 1 ); |
|
| 655 | + return $this->get('wl_analytics_settings', self::ANALYTICS_ENTITY_TYPE_DIMENSION, 1); |
|
| 656 | 656 | } |
| 657 | 657 | |
| 658 | 658 | /** |
@@ -664,7 +664,7 @@ discard block |
||
| 664 | 664 | */ |
| 665 | 665 | public function get_batch_analysis_url() { |
| 666 | 666 | |
| 667 | - return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'batch-analyses'; |
|
| 667 | + return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE.'batch-analyses'; |
|
| 668 | 668 | |
| 669 | 669 | } |
| 670 | 670 | |
@@ -677,7 +677,7 @@ discard block |
||
| 677 | 677 | */ |
| 678 | 678 | public function get_autocomplete_url() { |
| 679 | 679 | |
| 680 | - return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'autocomplete'; |
|
| 680 | + return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE.'autocomplete'; |
|
| 681 | 681 | |
| 682 | 682 | } |
| 683 | 683 | |
@@ -690,7 +690,7 @@ discard block |
||
| 690 | 690 | */ |
| 691 | 691 | public function get_deactivation_feedback_url() { |
| 692 | 692 | |
| 693 | - return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'feedbacks'; |
|
| 693 | + return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE.'feedbacks'; |
|
| 694 | 694 | |
| 695 | 695 | } |
| 696 | 696 | |
@@ -21,29 +21,29 @@ discard block |
||
| 21 | 21 | * @param int $post_id post id we want related data for. |
| 22 | 22 | * @return array |
| 23 | 23 | */ |
| 24 | - public static function get_analytics_event_data( $post_id ) { |
|
| 24 | + public static function get_analytics_event_data($post_id) { |
|
| 25 | 25 | // If no ID was passed get current ID. |
| 26 | - if ( ! $post_id ) { |
|
| 26 | + if ( ! $post_id) { |
|
| 27 | 27 | $post_id = get_queried_object_id(); |
| 28 | 28 | } |
| 29 | 29 | /** |
| 30 | 30 | * TODO: set/get this from cache. |
| 31 | 31 | */ |
| 32 | 32 | $related_items = array(); |
| 33 | - $related_ids = wl_core_get_related_entity_ids( $post_id ); |
|
| 33 | + $related_ids = wl_core_get_related_entity_ids($post_id); |
|
| 34 | 34 | |
| 35 | 35 | $entity_service = Wordlift_Entity_Service::get_instance(); |
| 36 | 36 | // If the current item is also an entity then add it to the list of IDs. |
| 37 | - if ( $entity_service->is_entity( $post_id ) ) { |
|
| 37 | + if ($entity_service->is_entity($post_id)) { |
|
| 38 | 38 | $related_ids[] = $post_id; |
| 39 | 39 | } |
| 40 | 40 | $entity_type_service = Wordlift_Entity_Type_Service::get_instance(); |
| 41 | 41 | // Get the post titles of related items and connect them in an array. |
| 42 | - foreach ( $related_ids as $related_id ) { |
|
| 43 | - $related_items[ $related_id ] = array( |
|
| 44 | - 'uri' => $entity_service->get_uri( $related_id ), |
|
| 45 | - 'type' => $entity_type_service->get( $related_id )['label'], |
|
| 46 | - 'label' => $entity_service->get_labels( $related_id )[0], |
|
| 42 | + foreach ($related_ids as $related_id) { |
|
| 43 | + $related_items[$related_id] = array( |
|
| 44 | + 'uri' => $entity_service->get_uri($related_id), |
|
| 45 | + 'type' => $entity_type_service->get($related_id)['label'], |
|
| 46 | + 'label' => $entity_service->get_labels($related_id)[0], |
|
| 47 | 47 | ); |
| 48 | 48 | } |
| 49 | 49 | return $related_items; |
@@ -66,17 +66,17 @@ discard block |
||
| 66 | 66 | * @method enqueue_scripts |
| 67 | 67 | */ |
| 68 | 68 | public function enqueue_scripts() { |
| 69 | - $entity_data = self::get_analytics_event_data( get_the_ID() ); |
|
| 69 | + $entity_data = self::get_analytics_event_data(get_the_ID()); |
|
| 70 | 70 | // Bail early if there is no event data that we would send. |
| 71 | - if ( ! $entity_data ) { |
|
| 71 | + if ( ! $entity_data) { |
|
| 72 | 72 | return; |
| 73 | 73 | } |
| 74 | 74 | $data = self::get_analytics_config_data(); |
| 75 | 75 | /** |
| 76 | 76 | * TODO: Look into using a constant for defining pase plugin url. |
| 77 | 77 | */ |
| 78 | - wp_enqueue_script( 'wordlift-analytics', plugin_dir_url( dirname( dirname( __FILE__ ) ) ) . 'js/wordlift-analytics.js', array(), '1.0.0', true ); |
|
| 79 | - wp_localize_script( 'wordlift-analytics', 'wordliftAnalyticsConfigData', $data ); |
|
| 80 | - wp_localize_script( 'wordlift-analytics', 'wordliftAnalyticsEntityData', $entity_data ); |
|
| 78 | + wp_enqueue_script('wordlift-analytics', plugin_dir_url(dirname(dirname(__FILE__))).'js/wordlift-analytics.js', array(), '1.0.0', true); |
|
| 79 | + wp_localize_script('wordlift-analytics', 'wordliftAnalyticsConfigData', $data); |
|
| 80 | + wp_localize_script('wordlift-analytics', 'wordliftAnalyticsEntityData', $entity_data); |
|
| 81 | 81 | } |
| 82 | 82 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @param \Wordlift_Admin_Analytics_Settings_Page $settings_page The {@link Wordlift_Admin_Analytics_Settings_Page} instance. |
| 37 | 37 | */ |
| 38 | - public function __construct( $settings_page ) { |
|
| 38 | + public function __construct($settings_page) { |
|
| 39 | 39 | |
| 40 | 40 | $this->settings_page = $settings_page; |
| 41 | 41 | |
@@ -50,21 +50,21 @@ discard block |
||
| 50 | 50 | * |
| 51 | 51 | * @return array An array of links including those added by the plugin. |
| 52 | 52 | */ |
| 53 | - public function action_links( $links ) { |
|
| 53 | + public function action_links($links) { |
|
| 54 | 54 | |
| 55 | 55 | // Get the menu slug from the page, then prepare the path, hence the url. |
| 56 | 56 | $menu_slug = $this->settings_page->get_menu_slug(); |
| 57 | 57 | $path = "admin.php?page=$menu_slug"; |
| 58 | - $url = get_admin_url( null, $path ); |
|
| 58 | + $url = get_admin_url(null, $path); |
|
| 59 | 59 | |
| 60 | 60 | // Add our own link to the list of links. |
| 61 | - return array_merge( $links, array( |
|
| 61 | + return array_merge($links, array( |
|
| 62 | 62 | sprintf( |
| 63 | 63 | '<a href="%1$s">%2$s</a>', |
| 64 | 64 | $url, |
| 65 | - __( 'Analytics Settings', 'wordlift' ) |
|
| 65 | + __('Analytics Settings', 'wordlift') |
|
| 66 | 66 | ), |
| 67 | - ) ); |
|
| 67 | + )); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * @param \Wordlift_Admin_Input_Element $input_element An input element class to output input boxes in a settings form. |
| 64 | 64 | * @param \Wordlift_Admin_Radio_Input_Element $radio_input_element A radio element input class for use in a settings form. |
| 65 | 65 | */ |
| 66 | - public function __construct( $configuration_service, $input_element, $radio_input_element ) { |
|
| 66 | + public function __construct($configuration_service, $input_element, $radio_input_element) { |
|
| 67 | 67 | |
| 68 | 68 | $this->configuration_service = $configuration_service; |
| 69 | 69 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | register_setting( |
| 147 | 147 | 'wl_analytics_settings', |
| 148 | 148 | 'wl_analytics_settings', |
| 149 | - array( $this, 'sanitize_callback' ) |
|
| 149 | + array($this, 'sanitize_callback') |
|
| 150 | 150 | ); |
| 151 | 151 | |
| 152 | 152 | // Add the analytics settings setction. |
@@ -161,15 +161,15 @@ discard block |
||
| 161 | 161 | // NOTE: this uses yes/no rather than true/false. |
| 162 | 162 | add_settings_field( |
| 163 | 163 | 'wl-analytics-enabled', |
| 164 | - __( 'Enable Analytics', 'wordlift' ), |
|
| 165 | - array( $this->radio_input_element, 'render' ), |
|
| 164 | + __('Enable Analytics', 'wordlift'), |
|
| 165 | + array($this->radio_input_element, 'render'), |
|
| 166 | 166 | 'wl_analytics_settings', |
| 167 | 167 | 'wl_analytics_settings_section', |
| 168 | 168 | array( |
| 169 | 169 | 'id' => 'wl-analytics-enable', |
| 170 | - 'name' => 'wl_analytics_settings[' . Wordlift_Configuration_Service::ANALYTICS_ENABLE . ']', |
|
| 170 | + 'name' => 'wl_analytics_settings['.Wordlift_Configuration_Service::ANALYTICS_ENABLE.']', |
|
| 171 | 171 | 'value' => $this->configuration_service->is_analytics_enable() ? 'yes' : 'no', |
| 172 | - 'description' => __( 'Toggle on/off the default values.', 'wordlift' ), |
|
| 172 | + 'description' => __('Toggle on/off the default values.', 'wordlift'), |
|
| 173 | 173 | ) |
| 174 | 174 | ); |
| 175 | 175 | |
@@ -180,16 +180,16 @@ discard block |
||
| 180 | 180 | */ |
| 181 | 181 | add_settings_field( |
| 182 | 182 | 'wl-analytics-entity-uri-dimension', |
| 183 | - __( 'Entity URI dimension', 'wordlift' ), |
|
| 184 | - array( $this->input_element, 'render' ), |
|
| 183 | + __('Entity URI dimension', 'wordlift'), |
|
| 184 | + array($this->input_element, 'render'), |
|
| 185 | 185 | 'wl_analytics_settings', |
| 186 | 186 | 'wl_analytics_settings_section', |
| 187 | 187 | array( |
| 188 | 188 | 'id' => 'wl-analytics-entity-uri-dimension', |
| 189 | - 'name' => 'wl_analytics_settings[' . Wordlift_Configuration_Service::ANALYTICS_ENTITY_URI_DIMENSION . ']', |
|
| 189 | + 'name' => 'wl_analytics_settings['.Wordlift_Configuration_Service::ANALYTICS_ENTITY_URI_DIMENSION.']', |
|
| 190 | 190 | 'type' => 'number', |
| 191 | 191 | 'value' => $this->configuration_service->get_analytics_entity_uri_dimension(), |
| 192 | - 'description' => __( 'Entity URI diemsion', 'wordlift' ), |
|
| 192 | + 'description' => __('Entity URI diemsion', 'wordlift'), |
|
| 193 | 193 | ) |
| 194 | 194 | ); |
| 195 | 195 | |
@@ -200,16 +200,16 @@ discard block |
||
| 200 | 200 | */ |
| 201 | 201 | add_settings_field( |
| 202 | 202 | 'wl-analytics-entity-type-dimension', |
| 203 | - __( 'Entity Type dimension', 'wordlift' ), |
|
| 204 | - array( $this->input_element, 'render' ), |
|
| 203 | + __('Entity Type dimension', 'wordlift'), |
|
| 204 | + array($this->input_element, 'render'), |
|
| 205 | 205 | 'wl_analytics_settings', |
| 206 | 206 | 'wl_analytics_settings_section', |
| 207 | 207 | array( |
| 208 | 208 | 'id' => 'wl-analytics-entity-type-dimension', |
| 209 | - 'name' => 'wl_analytics_settings[' . Wordlift_Configuration_Service::ANALYTICS_ENTITY_TYPE_DIMENSION . ']', |
|
| 209 | + 'name' => 'wl_analytics_settings['.Wordlift_Configuration_Service::ANALYTICS_ENTITY_TYPE_DIMENSION.']', |
|
| 210 | 210 | 'type' => 'number', |
| 211 | 211 | 'value' => $this->configuration_service->get_analytics_entity_type_dimension(), |
| 212 | - 'description' => __( 'Entity Type dimension', 'wordlift' ), |
|
| 212 | + 'description' => __('Entity Type dimension', 'wordlift'), |
|
| 213 | 213 | ) |
| 214 | 214 | ); |
| 215 | 215 | |
@@ -225,15 +225,15 @@ discard block |
||
| 225 | 225 | * @param string $uri a sting representing an entity ID that can be converted to a uri. |
| 226 | 226 | * @return int |
| 227 | 227 | */ |
| 228 | - public function validate_entity_uri( $uri ) { |
|
| 228 | + public function validate_entity_uri($uri) { |
|
| 229 | 229 | // Basic validation is to ensure number is between 1 and 20. |
| 230 | 230 | // NOTE: certain analytics accounts have a much higher value - as many |
| 231 | 231 | // as 200 are allowed. |
| 232 | - if ( (int) $uri < 1 || (int) $uri > 20 ) { |
|
| 232 | + if ((int) $uri < 1 || (int) $uri > 20) { |
|
| 233 | 233 | // if we are out of range then pass the default value. |
| 234 | 234 | $uri = $this->configuration_service->get_analytics_entity_uri_dimension(); |
| 235 | 235 | } |
| 236 | - return absint( $uri ); |
|
| 236 | + return absint($uri); |
|
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | /** |
@@ -246,15 +246,15 @@ discard block |
||
| 246 | 246 | * @param string $type This is an entity type ID in string form - really a number. |
| 247 | 247 | * @return int |
| 248 | 248 | */ |
| 249 | - public function validate_entity_type( $type ) { |
|
| 249 | + public function validate_entity_type($type) { |
|
| 250 | 250 | // Basic validation is to ensure number is between 1 and 20. |
| 251 | 251 | // NOTE: certain analytics accounts have a much higher value - as many |
| 252 | 252 | // as 200 are allowed. |
| 253 | - if ( (int) $type < 1 || (int) $type > 20 ) { |
|
| 253 | + if ((int) $type < 1 || (int) $type > 20) { |
|
| 254 | 254 | // if we are out of range then pass the default value. |
| 255 | 255 | $type = $this->configuration_service->get_analytics_entity_type_dimension(); |
| 256 | 256 | } |
| 257 | - return absint( $type ); |
|
| 257 | + return absint($type); |
|
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | /** |
@@ -269,8 +269,8 @@ discard block |
||
| 269 | 269 | * |
| 270 | 270 | * @return array The sanitized input array. |
| 271 | 271 | */ |
| 272 | - public function sanitize_callback( $input ) { |
|
| 273 | - if ( ! check_admin_referer( 'wl_analytics_settings-options' ) ) { |
|
| 272 | + public function sanitize_callback($input) { |
|
| 273 | + if ( ! check_admin_referer('wl_analytics_settings-options')) { |
|
| 274 | 274 | // Any failing nonce checks already die(). |
| 275 | 275 | return; |
| 276 | 276 | } |
@@ -279,19 +279,19 @@ discard block |
||
| 279 | 279 | * Validate and sanitize the $inputs and store them in $output saved. |
| 280 | 280 | */ |
| 281 | 281 | $output = array(); |
| 282 | - if ( isset( $input['analytics_enable'] ) ) { |
|
| 283 | - $output['analytics_enable'] = ( 'yes' === $input['analytics_enable'] ) ? 'yes' : 'no'; |
|
| 282 | + if (isset($input['analytics_enable'])) { |
|
| 283 | + $output['analytics_enable'] = ('yes' === $input['analytics_enable']) ? 'yes' : 'no'; |
|
| 284 | 284 | } |
| 285 | - if ( isset( $input['analytics_entity_uri_dimension'] ) ) { |
|
| 286 | - $output['analytics_entity_uri_dimension'] = (int) $this->validate_entity_uri( $input['analytics_entity_uri_dimension'] ); |
|
| 285 | + if (isset($input['analytics_entity_uri_dimension'])) { |
|
| 286 | + $output['analytics_entity_uri_dimension'] = (int) $this->validate_entity_uri($input['analytics_entity_uri_dimension']); |
|
| 287 | 287 | } |
| 288 | - if ( isset( $input['analytics_entity_type_dimension'] ) ) { |
|
| 288 | + if (isset($input['analytics_entity_type_dimension'])) { |
|
| 289 | 289 | // This dimention cannot be the same as the one set above. If it is |
| 290 | 290 | // then zero it out and it will fail validation. |
| 291 | - if ( isset( $output['analytics_entity_uri_dimension'] ) && $output['analytics_entity_uri_dimension'] === (int) $input['analytics_entity_type_dimension'] ) { |
|
| 291 | + if (isset($output['analytics_entity_uri_dimension']) && $output['analytics_entity_uri_dimension'] === (int) $input['analytics_entity_type_dimension']) { |
|
| 292 | 292 | $input['analytics_entity_type_dimension'] = 0; |
| 293 | 293 | } |
| 294 | - $output['analytics_entity_type_dimension'] = (int) $this->validate_entity_type( $input['analytics_entity_type_dimension'] ); |
|
| 294 | + $output['analytics_entity_type_dimension'] = (int) $this->validate_entity_type($input['analytics_entity_type_dimension']); |
|
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | // return items added to the output for saving. |
@@ -749,7 +749,7 @@ discard block |
||
| 749 | 749 | $this->define_public_hooks(); |
| 750 | 750 | |
| 751 | 751 | // If we're in `WP_CLI` load the related files. |
| 752 | - if ( class_exists( 'WP_CLI' ) ) { |
|
| 752 | + if (class_exists('WP_CLI')) { |
|
| 753 | 753 | $this->load_cli_dependencies(); |
| 754 | 754 | } |
| 755 | 755 | |
@@ -789,379 +789,379 @@ discard block |
||
| 789 | 789 | * The class responsible for orchestrating the actions and filters of the |
| 790 | 790 | * core plugin. |
| 791 | 791 | */ |
| 792 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php'; |
|
| 792 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php'; |
|
| 793 | 793 | |
| 794 | 794 | // The class responsible for plugin uninstall. |
| 795 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php'; |
|
| 795 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-deactivator-feedback.php'; |
|
| 796 | 796 | |
| 797 | 797 | /** |
| 798 | 798 | * The class responsible for defining internationalization functionality |
| 799 | 799 | * of the plugin. |
| 800 | 800 | */ |
| 801 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php'; |
|
| 801 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php'; |
|
| 802 | 802 | |
| 803 | 803 | /** |
| 804 | 804 | * WordLift's supported languages. |
| 805 | 805 | */ |
| 806 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php'; |
|
| 806 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php'; |
|
| 807 | 807 | |
| 808 | 808 | /** |
| 809 | 809 | * WordLift's supported countries. |
| 810 | 810 | */ |
| 811 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php'; |
|
| 811 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-countries.php'; |
|
| 812 | 812 | |
| 813 | 813 | /** |
| 814 | 814 | * Provide support functions to sanitize data. |
| 815 | 815 | */ |
| 816 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php'; |
|
| 816 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php'; |
|
| 817 | 817 | |
| 818 | 818 | /** Services. */ |
| 819 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php'; |
|
| 820 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php'; |
|
| 821 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php'; |
|
| 822 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php'; |
|
| 823 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php'; |
|
| 824 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php'; |
|
| 825 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php'; |
|
| 826 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php'; |
|
| 827 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php'; |
|
| 828 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php'; |
|
| 819 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php'; |
|
| 820 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php'; |
|
| 821 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php'; |
|
| 822 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php'; |
|
| 823 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php'; |
|
| 824 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php'; |
|
| 825 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php'; |
|
| 826 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-linked-data-service.php'; |
|
| 827 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php'; |
|
| 828 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-image-service.php'; |
|
| 829 | 829 | |
| 830 | 830 | /** |
| 831 | 831 | * The Query builder. |
| 832 | 832 | */ |
| 833 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php'; |
|
| 833 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php'; |
|
| 834 | 834 | |
| 835 | 835 | /** |
| 836 | 836 | * The Schema service. |
| 837 | 837 | */ |
| 838 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php'; |
|
| 838 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php'; |
|
| 839 | 839 | |
| 840 | 840 | /** |
| 841 | 841 | * The schema:url property service. |
| 842 | 842 | */ |
| 843 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php'; |
|
| 844 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php'; |
|
| 843 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php'; |
|
| 844 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php'; |
|
| 845 | 845 | |
| 846 | 846 | /** |
| 847 | 847 | * The UI service. |
| 848 | 848 | */ |
| 849 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php'; |
|
| 849 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php'; |
|
| 850 | 850 | |
| 851 | 851 | /** |
| 852 | 852 | * The Thumbnail service. |
| 853 | 853 | */ |
| 854 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php'; |
|
| 854 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php'; |
|
| 855 | 855 | |
| 856 | 856 | /** |
| 857 | 857 | * The Entity Types Taxonomy service. |
| 858 | 858 | */ |
| 859 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 859 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-taxonomy-service.php'; |
|
| 860 | 860 | |
| 861 | 861 | /** |
| 862 | 862 | * The Entity service. |
| 863 | 863 | */ |
| 864 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php'; |
|
| 865 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php'; |
|
| 864 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php'; |
|
| 865 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php'; |
|
| 866 | 866 | |
| 867 | 867 | // Add the entity rating service. |
| 868 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php'; |
|
| 868 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php'; |
|
| 869 | 869 | |
| 870 | 870 | /** |
| 871 | 871 | * The User service. |
| 872 | 872 | */ |
| 873 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php'; |
|
| 873 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php'; |
|
| 874 | 874 | |
| 875 | 875 | /** |
| 876 | 876 | * The Timeline service. |
| 877 | 877 | */ |
| 878 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php'; |
|
| 878 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php'; |
|
| 879 | 879 | |
| 880 | 880 | /** |
| 881 | 881 | * The Topic Taxonomy service. |
| 882 | 882 | */ |
| 883 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 883 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php'; |
|
| 884 | 884 | |
| 885 | 885 | /** |
| 886 | 886 | * The SPARQL service. |
| 887 | 887 | */ |
| 888 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php'; |
|
| 888 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php'; |
|
| 889 | 889 | |
| 890 | 890 | /** |
| 891 | 891 | * The WordLift import service. |
| 892 | 892 | */ |
| 893 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php'; |
|
| 893 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php'; |
|
| 894 | 894 | |
| 895 | 895 | /** |
| 896 | 896 | * The WordLift URI service. |
| 897 | 897 | */ |
| 898 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php'; |
|
| 899 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php'; |
|
| 900 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php'; |
|
| 898 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php'; |
|
| 899 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php'; |
|
| 900 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php'; |
|
| 901 | 901 | |
| 902 | 902 | /** |
| 903 | 903 | * The WordLift rebuild service, used to rebuild the remote dataset using the local data. |
| 904 | 904 | */ |
| 905 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php'; |
|
| 906 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 907 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 908 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 909 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 905 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-listable.php'; |
|
| 906 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-rebuild-service.php'; |
|
| 907 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-reference-rebuild-service.php'; |
|
| 908 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-service.php'; |
|
| 909 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-adapter.php'; |
|
| 910 | 910 | |
| 911 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 912 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php'; |
|
| 911 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php'; |
|
| 912 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php'; |
|
| 913 | 913 | |
| 914 | 914 | /** |
| 915 | 915 | * Load the converters. |
| 916 | 916 | */ |
| 917 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php'; |
|
| 918 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 919 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 920 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 921 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 922 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 917 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php'; |
|
| 918 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php'; |
|
| 919 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php'; |
|
| 920 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php'; |
|
| 921 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php'; |
|
| 922 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php'; |
|
| 923 | 923 | |
| 924 | 924 | /** |
| 925 | 925 | * Load cache-related files. |
| 926 | 926 | */ |
| 927 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php'; |
|
| 927 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php'; |
|
| 928 | 928 | |
| 929 | 929 | /** |
| 930 | 930 | * Load the content filter. |
| 931 | 931 | */ |
| 932 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php'; |
|
| 932 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php'; |
|
| 933 | 933 | |
| 934 | 934 | /* |
| 935 | 935 | * Load the excerpt helper. |
| 936 | 936 | */ |
| 937 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 937 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php'; |
|
| 938 | 938 | |
| 939 | 939 | /** |
| 940 | 940 | * Load the JSON-LD service to publish entities using JSON-LD.s |
| 941 | 941 | * |
| 942 | 942 | * @since 3.8.0 |
| 943 | 943 | */ |
| 944 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php'; |
|
| 944 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php'; |
|
| 945 | 945 | |
| 946 | 946 | // The Publisher Service and the AJAX adapter. |
| 947 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php'; |
|
| 948 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 947 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php'; |
|
| 948 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php'; |
|
| 949 | 949 | |
| 950 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php'; |
|
| 950 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php'; |
|
| 951 | 951 | |
| 952 | 952 | /** |
| 953 | 953 | * Load the WordLift key validation service. |
| 954 | 954 | */ |
| 955 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php'; |
|
| 955 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php'; |
|
| 956 | 956 | |
| 957 | 957 | // Load the `Wordlift_Category_Taxonomy_Service` class definition. |
| 958 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 958 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php'; |
|
| 959 | 959 | |
| 960 | 960 | // Load the `Wordlift_Entity_Page_Service` class definition. |
| 961 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php'; |
|
| 962 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php'; |
|
| 963 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-service.php'; |
|
| 961 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php'; |
|
| 962 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php'; |
|
| 963 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch-analysis/class-wordlift-batch-analysis-service.php'; |
|
| 964 | 964 | |
| 965 | 965 | /** Linked Data. */ |
| 966 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 967 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 968 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 969 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 970 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 971 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 972 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 973 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 974 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 975 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 976 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 966 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php'; |
|
| 967 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php'; |
|
| 968 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php'; |
|
| 969 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php'; |
|
| 970 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php'; |
|
| 971 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php'; |
|
| 972 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php'; |
|
| 973 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php'; |
|
| 974 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php'; |
|
| 975 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php'; |
|
| 976 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php'; |
|
| 977 | 977 | |
| 978 | 978 | /** Linked Data Rendition. */ |
| 979 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 980 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 981 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 982 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 979 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php'; |
|
| 980 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php'; |
|
| 981 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php'; |
|
| 982 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php'; |
|
| 983 | 983 | |
| 984 | 984 | /** Services. */ |
| 985 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 986 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php'; |
|
| 987 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php'; |
|
| 985 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php'; |
|
| 986 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-api-service.php'; |
|
| 987 | + require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php'; |
|
| 988 | 988 | |
| 989 | 989 | /** Adapters. */ |
| 990 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php'; |
|
| 991 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php'; |
|
| 992 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 993 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php'; |
|
| 994 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php'; |
|
| 995 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php'; |
|
| 990 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php'; |
|
| 991 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php'; |
|
| 992 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php'; |
|
| 993 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php'; |
|
| 994 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php'; |
|
| 995 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-wprocket-adapter.php'; |
|
| 996 | 996 | |
| 997 | 997 | /** Async Tasks. */ |
| 998 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 999 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1000 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php'; |
|
| 1001 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php'; |
|
| 1002 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 998 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-async-task.php'; |
|
| 999 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php'; |
|
| 1000 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php'; |
|
| 1001 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php'; |
|
| 1002 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-push-references-async-task.php'; |
|
| 1003 | 1003 | |
| 1004 | 1004 | /** Autocomplete. */ |
| 1005 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php'; |
|
| 1006 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1005 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-service.php'; |
|
| 1006 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php'; |
|
| 1007 | 1007 | |
| 1008 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php'; |
|
| 1008 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php'; |
|
| 1009 | 1009 | |
| 1010 | 1010 | /** Analytics */ |
| 1011 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1011 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/analytics/class-wordlift-analytics-connect.php'; |
|
| 1012 | 1012 | |
| 1013 | 1013 | /** |
| 1014 | 1014 | * The class responsible for defining all actions that occur in the admin area. |
| 1015 | 1015 | */ |
| 1016 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php'; |
|
| 1016 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php'; |
|
| 1017 | 1017 | |
| 1018 | 1018 | /** |
| 1019 | 1019 | * The class to customize the entity list admin page. |
| 1020 | 1020 | */ |
| 1021 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php'; |
|
| 1021 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php'; |
|
| 1022 | 1022 | |
| 1023 | 1023 | /** |
| 1024 | 1024 | * The Entity Types Taxonomy Walker (transforms checkboxes into radios). |
| 1025 | 1025 | */ |
| 1026 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1026 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php'; |
|
| 1027 | 1027 | |
| 1028 | 1028 | /** |
| 1029 | 1029 | * The Notice service. |
| 1030 | 1030 | */ |
| 1031 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php'; |
|
| 1031 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php'; |
|
| 1032 | 1032 | |
| 1033 | 1033 | /** |
| 1034 | 1034 | * The PrimaShop adapter. |
| 1035 | 1035 | */ |
| 1036 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php'; |
|
| 1036 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php'; |
|
| 1037 | 1037 | |
| 1038 | 1038 | /** |
| 1039 | 1039 | * The WordLift Dashboard service. |
| 1040 | 1040 | */ |
| 1041 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php'; |
|
| 1041 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php'; |
|
| 1042 | 1042 | |
| 1043 | 1043 | /** |
| 1044 | 1044 | * The admin 'Install wizard' page. |
| 1045 | 1045 | */ |
| 1046 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php'; |
|
| 1046 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php'; |
|
| 1047 | 1047 | |
| 1048 | 1048 | /** |
| 1049 | 1049 | * The WordLift entity type list admin page controller. |
| 1050 | 1050 | */ |
| 1051 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1051 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php'; |
|
| 1052 | 1052 | |
| 1053 | 1053 | /** |
| 1054 | 1054 | * The WordLift entity type settings admin page controller. |
| 1055 | 1055 | */ |
| 1056 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php'; |
|
| 1056 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php'; |
|
| 1057 | 1057 | |
| 1058 | 1058 | /** |
| 1059 | 1059 | * The admin 'Download Your Data' page. |
| 1060 | 1060 | */ |
| 1061 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php'; |
|
| 1061 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php'; |
|
| 1062 | 1062 | |
| 1063 | 1063 | /** |
| 1064 | 1064 | * The admin 'WordLift Settings' page. |
| 1065 | 1065 | */ |
| 1066 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1067 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1068 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1069 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1070 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1071 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1072 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1073 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1074 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1075 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1076 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php'; |
|
| 1077 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php'; |
|
| 1078 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-analytics-settings-page.php'; |
|
| 1079 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php'; |
|
| 1080 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1081 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-analytics-settings-page-action-link.php'; |
|
| 1066 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/intf-wordlift-admin-element.php'; |
|
| 1067 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-element.php'; |
|
| 1068 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-radio-element.php'; |
|
| 1069 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select-element.php'; |
|
| 1070 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select2-element.php'; |
|
| 1071 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-language-select-element.php'; |
|
| 1072 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-country-select-element.php'; |
|
| 1073 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-tabs-element.php'; |
|
| 1074 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-author-element.php'; |
|
| 1075 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-publisher-element.php'; |
|
| 1076 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php'; |
|
| 1077 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php'; |
|
| 1078 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-analytics-settings-page.php'; |
|
| 1079 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-batch-analysis-page.php'; |
|
| 1080 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php'; |
|
| 1081 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-analytics-settings-page-action-link.php'; |
|
| 1082 | 1082 | |
| 1083 | 1083 | /** Admin Pages */ |
| 1084 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1085 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1086 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php'; |
|
| 1087 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1088 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1084 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php'; |
|
| 1085 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php'; |
|
| 1086 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php'; |
|
| 1087 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-search-rankings-page.php'; |
|
| 1088 | + require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php'; |
|
| 1089 | 1089 | |
| 1090 | 1090 | /** |
| 1091 | 1091 | * The class responsible for defining all actions that occur in the public-facing |
| 1092 | 1092 | * side of the site. |
| 1093 | 1093 | */ |
| 1094 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php'; |
|
| 1094 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php'; |
|
| 1095 | 1095 | |
| 1096 | 1096 | /** |
| 1097 | 1097 | * The shortcode abstract class. |
| 1098 | 1098 | */ |
| 1099 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php'; |
|
| 1099 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php'; |
|
| 1100 | 1100 | |
| 1101 | 1101 | /** |
| 1102 | 1102 | * The Timeline shortcode. |
| 1103 | 1103 | */ |
| 1104 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php'; |
|
| 1104 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php'; |
|
| 1105 | 1105 | |
| 1106 | 1106 | /** |
| 1107 | 1107 | * The Navigator shortcode. |
| 1108 | 1108 | */ |
| 1109 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php'; |
|
| 1109 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php'; |
|
| 1110 | 1110 | |
| 1111 | 1111 | /** |
| 1112 | 1112 | * The chord shortcode. |
| 1113 | 1113 | */ |
| 1114 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php'; |
|
| 1114 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php'; |
|
| 1115 | 1115 | |
| 1116 | 1116 | /** |
| 1117 | 1117 | * The geomap shortcode. |
| 1118 | 1118 | */ |
| 1119 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php'; |
|
| 1119 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php'; |
|
| 1120 | 1120 | |
| 1121 | 1121 | /** |
| 1122 | 1122 | * The entity cloud shortcode. |
| 1123 | 1123 | */ |
| 1124 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1124 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php'; |
|
| 1125 | 1125 | |
| 1126 | 1126 | /** |
| 1127 | 1127 | * The entity glossary shortcode. |
| 1128 | 1128 | */ |
| 1129 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php'; |
|
| 1130 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1129 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-alphabet-service.php'; |
|
| 1130 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-vocabulary-shortcode.php'; |
|
| 1131 | 1131 | |
| 1132 | 1132 | /** |
| 1133 | 1133 | * Faceted Search shortcode. |
| 1134 | 1134 | */ |
| 1135 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1135 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-faceted-search-shortcode.php'; |
|
| 1136 | 1136 | |
| 1137 | 1137 | /** |
| 1138 | 1138 | * The ShareThis service. |
| 1139 | 1139 | */ |
| 1140 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php'; |
|
| 1140 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php'; |
|
| 1141 | 1141 | |
| 1142 | 1142 | /** |
| 1143 | 1143 | * The SEO service. |
| 1144 | 1144 | */ |
| 1145 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php'; |
|
| 1145 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php'; |
|
| 1146 | 1146 | |
| 1147 | 1147 | /** |
| 1148 | 1148 | * The AMP service. |
| 1149 | 1149 | */ |
| 1150 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php'; |
|
| 1150 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php'; |
|
| 1151 | 1151 | |
| 1152 | 1152 | /** Widgets */ |
| 1153 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php'; |
|
| 1154 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1153 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php'; |
|
| 1154 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php'; |
|
| 1155 | 1155 | |
| 1156 | 1156 | /* |
| 1157 | 1157 | * Schema.org Services. |
| 1158 | 1158 | * |
| 1159 | 1159 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1160 | 1160 | */ |
| 1161 | - if ( WL_ALL_ENTITY_TYPES ) { |
|
| 1162 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1163 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1164 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1161 | + if (WL_ALL_ENTITY_TYPES) { |
|
| 1162 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php'; |
|
| 1163 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-property-service.php'; |
|
| 1164 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-class-service.php'; |
|
| 1165 | 1165 | new Wordlift_Schemaorg_Sync_Service(); |
| 1166 | 1166 | $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service(); |
| 1167 | 1167 | new Wordlift_Schemaorg_Class_Service(); |
@@ -1173,7 +1173,7 @@ discard block |
||
| 1173 | 1173 | |
| 1174 | 1174 | // Instantiate a global logger. |
| 1175 | 1175 | global $wl_logger; |
| 1176 | - $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' ); |
|
| 1176 | + $wl_logger = Wordlift_Log_Service::get_logger('WordLift'); |
|
| 1177 | 1177 | |
| 1178 | 1178 | // Load the `wl-api` end-point. |
| 1179 | 1179 | new Wordlift_Http_Api(); |
@@ -1184,13 +1184,13 @@ discard block |
||
| 1184 | 1184 | /** Services. */ |
| 1185 | 1185 | // Create the configuration service. |
| 1186 | 1186 | $this->configuration_service = new Wordlift_Configuration_Service(); |
| 1187 | - $api_service = new Wordlift_Api_Service( $this->configuration_service ); |
|
| 1187 | + $api_service = new Wordlift_Api_Service($this->configuration_service); |
|
| 1188 | 1188 | |
| 1189 | 1189 | // Create an entity type service instance. It'll be later bound to the init action. |
| 1190 | - $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() ); |
|
| 1190 | + $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path()); |
|
| 1191 | 1191 | |
| 1192 | 1192 | // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions. |
| 1193 | - $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() ); |
|
| 1193 | + $this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path()); |
|
| 1194 | 1194 | |
| 1195 | 1195 | // Create an instance of the UI service. |
| 1196 | 1196 | $this->ui_service = new Wordlift_UI_Service(); |
@@ -1199,34 +1199,34 @@ discard block |
||
| 1199 | 1199 | $this->thumbnail_service = new Wordlift_Thumbnail_Service(); |
| 1200 | 1200 | |
| 1201 | 1201 | $this->sparql_service = new Wordlift_Sparql_Service(); |
| 1202 | - $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service ); |
|
| 1202 | + $schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service); |
|
| 1203 | 1203 | $this->notice_service = new Wordlift_Notice_Service(); |
| 1204 | 1204 | $this->relation_service = new Wordlift_Relation_Service(); |
| 1205 | 1205 | |
| 1206 | - $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' ); |
|
| 1207 | - $this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' ); |
|
| 1208 | - $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service ); |
|
| 1209 | - $this->entity_service = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service ); |
|
| 1210 | - $this->user_service = new Wordlift_User_Service( $this->sparql_service, $this->entity_service ); |
|
| 1206 | + $entity_uri_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'entity_uri/'); |
|
| 1207 | + $this->file_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'converter/'); |
|
| 1208 | + $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service($this->configuration_service, $entity_uri_cache_service); |
|
| 1209 | + $this->entity_service = new Wordlift_Entity_Service($this->ui_service, $this->relation_service, $this->entity_uri_service); |
|
| 1210 | + $this->user_service = new Wordlift_User_Service($this->sparql_service, $this->entity_service); |
|
| 1211 | 1211 | |
| 1212 | 1212 | // Instantiate the JSON-LD service. |
| 1213 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1213 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1214 | 1214 | |
| 1215 | 1215 | /** Linked Data. */ |
| 1216 | - $this->storage_factory = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter ); |
|
| 1217 | - $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service ); |
|
| 1216 | + $this->storage_factory = new Wordlift_Storage_Factory($this->entity_service, $this->user_service, $property_getter); |
|
| 1217 | + $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory($this->entity_service); |
|
| 1218 | 1218 | |
| 1219 | - $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service ); |
|
| 1219 | + $this->schema_service = new Wordlift_Schema_Service($this->storage_factory, $this->rendition_factory, $this->configuration_service); |
|
| 1220 | 1220 | |
| 1221 | 1221 | // Create a new instance of the Redirect service. |
| 1222 | - $this->redirect_service = new Wordlift_Redirect_Service( $this->entity_service ); |
|
| 1223 | - $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service ); |
|
| 1224 | - $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service ); |
|
| 1222 | + $this->redirect_service = new Wordlift_Redirect_Service($this->entity_service); |
|
| 1223 | + $this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service); |
|
| 1224 | + $this->linked_data_service = new Wordlift_Linked_Data_Service($this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service); |
|
| 1225 | 1225 | |
| 1226 | 1226 | // Create a new instance of the Timeline service and Timeline shortcode. |
| 1227 | - $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service ); |
|
| 1227 | + $this->timeline_service = new Wordlift_Timeline_Service($this->entity_service, $this->entity_type_service); |
|
| 1228 | 1228 | |
| 1229 | - $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service ); |
|
| 1229 | + $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service($this, $this->configuration_service, $this->file_cache_service); |
|
| 1230 | 1230 | |
| 1231 | 1231 | $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker(); |
| 1232 | 1232 | |
@@ -1240,68 +1240,68 @@ discard block |
||
| 1240 | 1240 | $this->primashop_adapter = new Wordlift_PrimaShop_Adapter(); |
| 1241 | 1241 | |
| 1242 | 1242 | // Create an import service instance to hook later to WP's import function. |
| 1243 | - $this->import_service = new Wordlift_Import_Service( $this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri() ); |
|
| 1243 | + $this->import_service = new Wordlift_Import_Service($this->entity_post_type_service, $this->entity_service, $this->schema_service, $this->sparql_service, $this->configuration_service->get_dataset_uri()); |
|
| 1244 | 1244 | |
| 1245 | - $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] ); |
|
| 1245 | + $uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']); |
|
| 1246 | 1246 | |
| 1247 | 1247 | // Create the entity rating service. |
| 1248 | - $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service ); |
|
| 1248 | + $this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service); |
|
| 1249 | 1249 | |
| 1250 | 1250 | // Create entity list customization (wp-admin/edit.php). |
| 1251 | - $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service ); |
|
| 1251 | + $this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service); |
|
| 1252 | 1252 | |
| 1253 | 1253 | // Create a new instance of the Redirect service. |
| 1254 | - $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service ); |
|
| 1254 | + $this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service, $this->entity_service); |
|
| 1255 | 1255 | |
| 1256 | 1256 | // Create an instance of the Publisher Service and the AJAX Adapter. |
| 1257 | - $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service ); |
|
| 1258 | - $this->property_factory = new Wordlift_Property_Factory( $schema_url_property_service ); |
|
| 1259 | - $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service ); |
|
| 1257 | + $this->publisher_service = new Wordlift_Publisher_Service($this->configuration_service); |
|
| 1258 | + $this->property_factory = new Wordlift_Property_Factory($schema_url_property_service); |
|
| 1259 | + $this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service); |
|
| 1260 | 1260 | |
| 1261 | 1261 | $attachment_service = new Wordlift_Attachment_Service(); |
| 1262 | 1262 | |
| 1263 | 1263 | // Instantiate the JSON-LD service. |
| 1264 | - $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service ); |
|
| 1265 | - $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service ); |
|
| 1266 | - $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1267 | - $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter( $this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter ); |
|
| 1268 | - $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service ); |
|
| 1269 | - $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service ); |
|
| 1270 | - $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter ); |
|
| 1271 | - |
|
| 1272 | - |
|
| 1273 | - $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service ); |
|
| 1274 | - $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service ); |
|
| 1275 | - $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service ); |
|
| 1276 | - $this->sample_data_service = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service ); |
|
| 1277 | - $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service ); |
|
| 1278 | - $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service ); |
|
| 1264 | + $property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service); |
|
| 1265 | + $this->entity_post_to_jsonld_converter = new Wordlift_Entity_Post_To_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $property_getter, $schemaorg_property_service); |
|
| 1266 | + $this->post_to_jsonld_converter = new Wordlift_Post_To_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service); |
|
| 1267 | + $this->postid_to_jsonld_converter = new Wordlift_Postid_To_Jsonld_Converter($this->entity_service, $this->entity_post_to_jsonld_converter, $this->post_to_jsonld_converter); |
|
| 1268 | + $this->jsonld_website_converter = new Wordlift_Website_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service); |
|
| 1269 | + $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service); |
|
| 1270 | + $this->jsonld_service = new Wordlift_Jsonld_Service($this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter); |
|
| 1271 | + |
|
| 1272 | + |
|
| 1273 | + $this->key_validation_service = new Wordlift_Key_Validation_Service($this->configuration_service); |
|
| 1274 | + $this->content_filter_service = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service, $this->entity_uri_service); |
|
| 1275 | + $this->relation_rebuild_service = new Wordlift_Relation_Rebuild_Service($this->content_filter_service, $this->entity_service); |
|
| 1276 | + $this->sample_data_service = new Wordlift_Sample_Data_Service($this->entity_type_service, $this->configuration_service, $this->user_service); |
|
| 1277 | + $this->sample_data_ajax_adapter = new Wordlift_Sample_Data_Ajax_Adapter($this->sample_data_service); |
|
| 1278 | + $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service($this->linked_data_service, $this->entity_service, $this->relation_service); |
|
| 1279 | 1279 | |
| 1280 | 1280 | // Initialize the shortcodes. |
| 1281 | 1281 | new Wordlift_Navigator_Shortcode(); |
| 1282 | 1282 | new Wordlift_Chord_Shortcode(); |
| 1283 | 1283 | new Wordlift_Geomap_Shortcode(); |
| 1284 | 1284 | new Wordlift_Timeline_Shortcode(); |
| 1285 | - new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service ); |
|
| 1286 | - new Wordlift_Vocabulary_Shortcode( $this->configuration_service ); |
|
| 1285 | + new Wordlift_Related_Entities_Cloud_Shortcode($this->relation_service); |
|
| 1286 | + new Wordlift_Vocabulary_Shortcode($this->configuration_service); |
|
| 1287 | 1287 | new Wordlift_Faceted_Search_Shortcode(); |
| 1288 | 1288 | |
| 1289 | 1289 | // Initialize the SEO service. |
| 1290 | 1290 | new Wordlift_Seo_Service(); |
| 1291 | 1291 | |
| 1292 | 1292 | // Initialize the AMP service. |
| 1293 | - new Wordlift_AMP_Service( $this->jsonld_service ); |
|
| 1293 | + new Wordlift_AMP_Service($this->jsonld_service); |
|
| 1294 | 1294 | |
| 1295 | 1295 | /** Services. */ |
| 1296 | 1296 | $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service(); |
| 1297 | 1297 | new Wordlift_Image_Service(); |
| 1298 | 1298 | |
| 1299 | 1299 | /** Adapters. */ |
| 1300 | - $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter( $this->entity_type_service ); |
|
| 1301 | - $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service ); |
|
| 1302 | - $this->tinymce_adapter = new Wordlift_Tinymce_Adapter( $this ); |
|
| 1303 | - $this->batch_analysis_adapter = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service ); |
|
| 1304 | - $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service ); |
|
| 1300 | + $this->entity_type_adapter = new Wordlift_Entity_Type_Adapter($this->entity_type_service); |
|
| 1301 | + $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($this->publisher_service); |
|
| 1302 | + $this->tinymce_adapter = new Wordlift_Tinymce_Adapter($this); |
|
| 1303 | + $this->batch_analysis_adapter = new Wordlift_Batch_Analysis_Adapter($this->batch_analysis_service); |
|
| 1304 | + $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter($this->relation_rebuild_service); |
|
| 1305 | 1305 | |
| 1306 | 1306 | /* |
| 1307 | 1307 | * Exclude our public js from WP-Rocket. |
@@ -1325,8 +1325,8 @@ discard block |
||
| 1325 | 1325 | new Wordlift_Push_References_Async_Task(); |
| 1326 | 1326 | |
| 1327 | 1327 | /** WL Autocomplete. */ |
| 1328 | - $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service ); |
|
| 1329 | - $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service ); |
|
| 1328 | + $this->autocomplete_service = new Wordlift_Autocomplete_Service($this->configuration_service); |
|
| 1329 | + $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($this->autocomplete_service); |
|
| 1330 | 1330 | |
| 1331 | 1331 | /** WordPress Admin UI. */ |
| 1332 | 1332 | |
@@ -1337,19 +1337,19 @@ discard block |
||
| 1337 | 1337 | $this->language_select_element = new Wordlift_Admin_Language_Select_Element(); |
| 1338 | 1338 | $this->country_select_element = new Wordlift_Admin_Country_Select_Element(); |
| 1339 | 1339 | $tabs_element = new Wordlift_Admin_Tabs_Element(); |
| 1340 | - $this->publisher_element = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element ); |
|
| 1341 | - $this->author_element = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element ); |
|
| 1340 | + $this->publisher_element = new Wordlift_Admin_Publisher_Element($this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element); |
|
| 1341 | + $this->author_element = new Wordlift_Admin_Author_Element($this->publisher_service, $this->select2_element); |
|
| 1342 | 1342 | |
| 1343 | - $this->settings_page = new Wordlift_Admin_Settings_Page( $this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element ); |
|
| 1344 | - $this->batch_analysis_page = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service ); |
|
| 1345 | - $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page ); |
|
| 1343 | + $this->settings_page = new Wordlift_Admin_Settings_Page($this->configuration_service, $this->entity_service, $this->input_element, $this->language_select_element, $this->country_select_element, $this->publisher_element, $this->radio_input_element); |
|
| 1344 | + $this->batch_analysis_page = new Wordlift_Batch_Analysis_Page($this->batch_analysis_service); |
|
| 1345 | + $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page); |
|
| 1346 | 1346 | |
| 1347 | - $this->analytics_settings_page = new Wordlift_Admin_Analytics_Settings_Page( $this->configuration_service, $this->input_element, $this->radio_input_element ); |
|
| 1348 | - $this->analytics_settings_page_action_link = new Wordlift_Admin_Analytics_Settings_Page_Action_Link( $this->analytics_settings_page ); |
|
| 1347 | + $this->analytics_settings_page = new Wordlift_Admin_Analytics_Settings_Page($this->configuration_service, $this->input_element, $this->radio_input_element); |
|
| 1348 | + $this->analytics_settings_page_action_link = new Wordlift_Admin_Analytics_Settings_Page_Action_Link($this->analytics_settings_page); |
|
| 1349 | 1349 | $this->analytics_connect = new Wordlift_Analytics_Connect(); |
| 1350 | 1350 | |
| 1351 | 1351 | // Pages. |
| 1352 | - new Wordlift_Admin_Post_Edit_Page( $this ); |
|
| 1352 | + new Wordlift_Admin_Post_Edit_Page($this); |
|
| 1353 | 1353 | new Wordlift_Entity_Type_Admin_Service(); |
| 1354 | 1354 | |
| 1355 | 1355 | // create an instance of the entity type list admin page controller. |
@@ -1362,23 +1362,23 @@ discard block |
||
| 1362 | 1362 | $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget(); |
| 1363 | 1363 | |
| 1364 | 1364 | /* WordPress Admin. */ |
| 1365 | - $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service ); |
|
| 1366 | - $this->status_page = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service ); |
|
| 1365 | + $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service); |
|
| 1366 | + $this->status_page = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service); |
|
| 1367 | 1367 | |
| 1368 | 1368 | // Create an instance of the install wizard. |
| 1369 | - $this->admin_setup = new Wordlift_Admin_Setup( $this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element ); |
|
| 1369 | + $this->admin_setup = new Wordlift_Admin_Setup($this->configuration_service, $this->key_validation_service, $this->entity_service, $this->language_select_element, $this->country_select_element); |
|
| 1370 | 1370 | |
| 1371 | - $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service ); |
|
| 1371 | + $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service); |
|
| 1372 | 1372 | |
| 1373 | 1373 | // User Profile. |
| 1374 | - new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service ); |
|
| 1374 | + new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service); |
|
| 1375 | 1375 | |
| 1376 | 1376 | $this->entity_page_service = new Wordlift_Entity_Page_Service(); |
| 1377 | 1377 | |
| 1378 | 1378 | // Load the debug service if WP is in debug mode. |
| 1379 | - if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) { |
|
| 1380 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php'; |
|
| 1381 | - new Wordlift_Debug_Service( $this->entity_service, $uri_service ); |
|
| 1379 | + if (defined('WP_DEBUG') && WP_DEBUG) { |
|
| 1380 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php'; |
|
| 1381 | + new Wordlift_Debug_Service($this->entity_service, $uri_service); |
|
| 1382 | 1382 | } |
| 1383 | 1383 | |
| 1384 | 1384 | // Remote Image Service. |
@@ -1391,12 +1391,12 @@ discard block |
||
| 1391 | 1391 | * |
| 1392 | 1392 | * @see https://github.com/insideout10/wordlift-plugin/issues/852. |
| 1393 | 1393 | */ |
| 1394 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php'; |
|
| 1395 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1396 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1394 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-action.php'; |
|
| 1395 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-service.php'; |
|
| 1396 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-ajax-adapter.php'; |
|
| 1397 | 1397 | |
| 1398 | 1398 | // Create an instance of the Mapping Service and assign it to the Ajax Adapter. |
| 1399 | - new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) ); |
|
| 1399 | + new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance())); |
|
| 1400 | 1400 | |
| 1401 | 1401 | /* |
| 1402 | 1402 | * Batch Operations. They're similar to Batch Actions but do not require working on post types. |
@@ -1405,8 +1405,8 @@ discard block |
||
| 1405 | 1405 | * |
| 1406 | 1406 | * @since 3.20.0 |
| 1407 | 1407 | */ |
| 1408 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1409 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1408 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/intf-wordlift-batch-operation.php'; |
|
| 1409 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php'; |
|
| 1410 | 1410 | |
| 1411 | 1411 | /* |
| 1412 | 1412 | * Add the Search Keywords taxonomy to manage the Search Keywords on WLS. |
@@ -1415,15 +1415,15 @@ discard block |
||
| 1415 | 1415 | * |
| 1416 | 1416 | * @since 3.20.0 |
| 1417 | 1417 | */ |
| 1418 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1419 | - new Wordlift_Search_Keyword_Taxonomy( $api_service ); |
|
| 1418 | + require_once plugin_dir_path(dirname(__FILE__)).'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php'; |
|
| 1419 | + new Wordlift_Search_Keyword_Taxonomy($api_service); |
|
| 1420 | 1420 | |
| 1421 | 1421 | /* |
| 1422 | 1422 | * Load dependencies for the front-end. |
| 1423 | 1423 | * |
| 1424 | 1424 | * @since 3.20.0 |
| 1425 | 1425 | */ |
| 1426 | - if ( ! is_admin() ) { |
|
| 1426 | + if ( ! is_admin()) { |
|
| 1427 | 1427 | /* |
| 1428 | 1428 | * Load the `Wordlift_Term_JsonLd_Adapter`. |
| 1429 | 1429 | * |
@@ -1431,8 +1431,8 @@ discard block |
||
| 1431 | 1431 | * |
| 1432 | 1432 | * @since 3.20.0 |
| 1433 | 1433 | */ |
| 1434 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1435 | - new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->jsonld_service ); |
|
| 1434 | + require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-term-jsonld-adapter.php'; |
|
| 1435 | + new Wordlift_Term_JsonLd_Adapter($this->entity_uri_service, $this->jsonld_service); |
|
| 1436 | 1436 | } |
| 1437 | 1437 | |
| 1438 | 1438 | } |
@@ -1449,9 +1449,9 @@ discard block |
||
| 1449 | 1449 | private function set_locale() { |
| 1450 | 1450 | |
| 1451 | 1451 | $plugin_i18n = new Wordlift_i18n(); |
| 1452 | - $plugin_i18n->set_domain( $this->get_plugin_name() ); |
|
| 1452 | + $plugin_i18n->set_domain($this->get_plugin_name()); |
|
| 1453 | 1453 | |
| 1454 | - $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
|
| 1454 | + $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); |
|
| 1455 | 1455 | |
| 1456 | 1456 | } |
| 1457 | 1457 | |
@@ -1472,29 +1472,29 @@ discard block |
||
| 1472 | 1472 | $this->user_service |
| 1473 | 1473 | ); |
| 1474 | 1474 | |
| 1475 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
|
| 1476 | - $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 ); |
|
| 1475 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); |
|
| 1476 | + $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11); |
|
| 1477 | 1477 | |
| 1478 | 1478 | // Hook the init action to taxonomy services. |
| 1479 | - $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 ); |
|
| 1480 | - $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 ); |
|
| 1479 | + $this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0); |
|
| 1480 | + $this->loader->add_action('init', $this->entity_types_taxonomy_service, 'init', 0); |
|
| 1481 | 1481 | |
| 1482 | 1482 | // Hook the deleted_post_meta action to the Thumbnail service. |
| 1483 | - $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 ); |
|
| 1483 | + $this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4); |
|
| 1484 | 1484 | |
| 1485 | 1485 | // Hook the added_post_meta action to the Thumbnail service. |
| 1486 | - $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1486 | + $this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1487 | 1487 | |
| 1488 | 1488 | // Hook the updated_post_meta action to the Thumbnail service. |
| 1489 | - $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 ); |
|
| 1489 | + $this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4); |
|
| 1490 | 1490 | |
| 1491 | 1491 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1492 | - $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1492 | + $this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1493 | 1493 | |
| 1494 | 1494 | // Register custom allowed redirect hosts. |
| 1495 | - $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' ); |
|
| 1495 | + $this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts'); |
|
| 1496 | 1496 | // Hook the AJAX wordlift_redirect action to the Redirect service. |
| 1497 | - $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' ); |
|
| 1497 | + $this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect'); |
|
| 1498 | 1498 | |
| 1499 | 1499 | /* |
| 1500 | 1500 | * The old dashboard is replaced with dashboard v2. |
@@ -1512,81 +1512,81 @@ discard block |
||
| 1512 | 1512 | |
| 1513 | 1513 | // Hook save_post to the entity service to update custom fields (such as alternate labels). |
| 1514 | 1514 | // We have a priority of 9 because we want to be executed before data is sent to Redlink. |
| 1515 | - $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 ); |
|
| 1516 | - $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 ); |
|
| 1515 | + $this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3); |
|
| 1516 | + $this->loader->add_action('save_post', $this->rating_service, 'set_rating_for', 20, 1); |
|
| 1517 | 1517 | |
| 1518 | - $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 ); |
|
| 1519 | - $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' ); |
|
| 1518 | + $this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1); |
|
| 1519 | + $this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header'); |
|
| 1520 | 1520 | |
| 1521 | 1521 | // Entity listing customization (wp-admin/edit.php) |
| 1522 | 1522 | // Add custom columns. |
| 1523 | - $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' ); |
|
| 1523 | + $this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns'); |
|
| 1524 | 1524 | // no explicit entity as it prevents handling of other post types. |
| 1525 | - $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 ); |
|
| 1525 | + $this->loader->add_filter('manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2); |
|
| 1526 | 1526 | // Add 4W selection. |
| 1527 | - $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' ); |
|
| 1528 | - $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' ); |
|
| 1529 | - $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' ); |
|
| 1530 | - $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' ); |
|
| 1527 | + $this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope'); |
|
| 1528 | + $this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope'); |
|
| 1529 | + $this->loader->add_action('pre_get_posts', $this->entity_list_service, 'pre_get_posts'); |
|
| 1530 | + $this->loader->add_action('load-edit.php', $this->entity_list_service, 'load_edit'); |
|
| 1531 | 1531 | |
| 1532 | 1532 | /* |
| 1533 | 1533 | * If `All Entity Types` is disable, use the radio button Walker. |
| 1534 | 1534 | * |
| 1535 | 1535 | * @see https://github.com/insideout10/wordlift-plugin/issues/835 |
| 1536 | 1536 | */ |
| 1537 | - if ( ! WL_ALL_ENTITY_TYPES ) { |
|
| 1538 | - $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' ); |
|
| 1537 | + if ( ! WL_ALL_ENTITY_TYPES) { |
|
| 1538 | + $this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args'); |
|
| 1539 | 1539 | } |
| 1540 | 1540 | |
| 1541 | 1541 | // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for |
| 1542 | 1542 | // entities. |
| 1543 | - $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 ); |
|
| 1543 | + $this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2); |
|
| 1544 | 1544 | |
| 1545 | 1545 | // Filter imported post meta. |
| 1546 | - $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 ); |
|
| 1546 | + $this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3); |
|
| 1547 | 1547 | |
| 1548 | 1548 | // Notify the import service when an import starts and ends. |
| 1549 | - $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 ); |
|
| 1550 | - $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 ); |
|
| 1549 | + $this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0); |
|
| 1550 | + $this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0); |
|
| 1551 | 1551 | |
| 1552 | 1552 | // Hook the AJAX wl_rebuild action to the Rebuild Service. |
| 1553 | - $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' ); |
|
| 1554 | - $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' ); |
|
| 1553 | + $this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild'); |
|
| 1554 | + $this->loader->add_action('wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild'); |
|
| 1555 | 1555 | |
| 1556 | 1556 | // Hook the menu to the Download Your Data page. |
| 1557 | - $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 ); |
|
| 1558 | - $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 ); |
|
| 1559 | - $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 ); |
|
| 1557 | + $this->loader->add_action('admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0); |
|
| 1558 | + $this->loader->add_action('admin_menu', $this->status_page, 'admin_menu', 100, 0); |
|
| 1559 | + $this->loader->add_action('admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0); |
|
| 1560 | 1560 | |
| 1561 | 1561 | // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links. |
| 1562 | - $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 ); |
|
| 1562 | + $this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10); |
|
| 1563 | 1563 | |
| 1564 | 1564 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1565 | - $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1566 | - $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1567 | - $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1565 | + $this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1566 | + $this->loader->add_action('admin_post_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1567 | + $this->loader->add_action('admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1568 | 1568 | |
| 1569 | 1569 | // Hook the AJAX wl_validate_key action to the Key Validation service. |
| 1570 | - $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' ); |
|
| 1570 | + $this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key'); |
|
| 1571 | 1571 | |
| 1572 | 1572 | // Hook the AJAX wl_update_country_options action to the countries. |
| 1573 | - $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' ); |
|
| 1573 | + $this->loader->add_action('wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html'); |
|
| 1574 | 1574 | |
| 1575 | 1575 | // Hook the `admin_init` function to the Admin Setup. |
| 1576 | - $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' ); |
|
| 1576 | + $this->loader->add_action('admin_init', $this->admin_setup, 'admin_init'); |
|
| 1577 | 1577 | |
| 1578 | 1578 | // Hook the admin_init to the settings page. |
| 1579 | - $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' ); |
|
| 1580 | - $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' ); |
|
| 1579 | + $this->loader->add_action('admin_init', $this->settings_page, 'admin_init'); |
|
| 1580 | + $this->loader->add_action('admin_init', $this->analytics_settings_page, 'admin_init'); |
|
| 1581 | 1581 | |
| 1582 | - $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' ); |
|
| 1582 | + $this->loader->add_filter('admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction'); |
|
| 1583 | 1583 | |
| 1584 | 1584 | // Hook the menu creation on the general wordlift menu creation. |
| 1585 | - $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 ); |
|
| 1586 | - $this->loader->add_action( 'wl_admin_menu', $this->analytics_settings_page, 'admin_menu', 10, 2 ); |
|
| 1587 | - if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) { |
|
| 1585 | + $this->loader->add_action('wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2); |
|
| 1586 | + $this->loader->add_action('wl_admin_menu', $this->analytics_settings_page, 'admin_menu', 10, 2); |
|
| 1587 | + if (defined('WORDLIFT_BATCH') && WORDLIFT_BATCH) { |
|
| 1588 | 1588 | // Add the functionality only if a flag is set in wp-config.php . |
| 1589 | - $this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 ); |
|
| 1589 | + $this->loader->add_action('wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2); |
|
| 1590 | 1590 | } |
| 1591 | 1591 | |
| 1592 | 1592 | /* |
@@ -1596,72 +1596,72 @@ discard block |
||
| 1596 | 1596 | * |
| 1597 | 1597 | * @since 3.20.0 |
| 1598 | 1598 | */ |
| 1599 | - if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) { |
|
| 1599 | + if (in_array($this->configuration_service->get_package_type(), array('editorial', 'business'))) { |
|
| 1600 | 1600 | $admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page(); |
| 1601 | - $this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' ); |
|
| 1601 | + $this->loader->add_action('wl_admin_menu', $admin_search_rankings_page, 'admin_menu'); |
|
| 1602 | 1602 | } |
| 1603 | 1603 | |
| 1604 | 1604 | // Hook key update. |
| 1605 | - $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 ); |
|
| 1606 | - $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 ); |
|
| 1605 | + $this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2); |
|
| 1606 | + $this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2); |
|
| 1607 | 1607 | |
| 1608 | 1608 | // Add additional action links to the WordLift plugin in the plugins page. |
| 1609 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1610 | - $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 ); |
|
| 1609 | + $this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1); |
|
| 1610 | + $this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1); |
|
| 1611 | 1611 | |
| 1612 | 1612 | // Hook the AJAX `wl_publisher` action name. |
| 1613 | - $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' ); |
|
| 1613 | + $this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher'); |
|
| 1614 | 1614 | |
| 1615 | 1615 | // Hook row actions for the entity type list admin. |
| 1616 | - $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 ); |
|
| 1616 | + $this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2); |
|
| 1617 | 1617 | |
| 1618 | 1618 | /** Ajax actions. */ |
| 1619 | - $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' ); |
|
| 1619 | + $this->loader->add_action('wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export'); |
|
| 1620 | 1620 | |
| 1621 | 1621 | // Hook capabilities manipulation to allow access to entity type admin |
| 1622 | 1622 | // page on WordPress versions before 4.7. |
| 1623 | 1623 | global $wp_version; |
| 1624 | - if ( version_compare( $wp_version, '4.7', '<' ) ) { |
|
| 1625 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 ); |
|
| 1624 | + if (version_compare($wp_version, '4.7', '<')) { |
|
| 1625 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4); |
|
| 1626 | 1626 | } |
| 1627 | 1627 | |
| 1628 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1628 | + $this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1629 | 1629 | |
| 1630 | 1630 | /** Adapters. */ |
| 1631 | - $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 ); |
|
| 1632 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit' ); |
|
| 1633 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts' ); |
|
| 1634 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel' ); |
|
| 1635 | - $this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning' ); |
|
| 1636 | - $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' ); |
|
| 1631 | + $this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1); |
|
| 1632 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit'); |
|
| 1633 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts'); |
|
| 1634 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel'); |
|
| 1635 | + $this->loader->add_action('wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning'); |
|
| 1636 | + $this->loader->add_action('wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all'); |
|
| 1637 | 1637 | |
| 1638 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' ); |
|
| 1639 | - $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' ); |
|
| 1638 | + $this->loader->add_action('wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create'); |
|
| 1639 | + $this->loader->add_action('wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete'); |
|
| 1640 | 1640 | |
| 1641 | 1641 | |
| 1642 | - $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 ); |
|
| 1643 | - $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 ); |
|
| 1642 | + $this->loader->add_action('update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5); |
|
| 1643 | + $this->loader->add_action('delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5); |
|
| 1644 | 1644 | |
| 1645 | 1645 | // Handle the autocomplete request. |
| 1646 | - add_action( 'wp_ajax_wl_autocomplete', array( |
|
| 1646 | + add_action('wp_ajax_wl_autocomplete', array( |
|
| 1647 | 1647 | $this->autocomplete_adapter, |
| 1648 | 1648 | 'wl_autocomplete', |
| 1649 | - ) ); |
|
| 1650 | - add_action( 'wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1649 | + )); |
|
| 1650 | + add_action('wp_ajax_nopriv_wl_autocomplete', array( |
|
| 1651 | 1651 | $this->autocomplete_adapter, |
| 1652 | 1652 | 'wl_autocomplete', |
| 1653 | - ) ); |
|
| 1653 | + )); |
|
| 1654 | 1654 | |
| 1655 | 1655 | // Hooks to restrict multisite super admin from manipulating entity types. |
| 1656 | - if ( is_multisite() ) { |
|
| 1657 | - $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 ); |
|
| 1656 | + if (is_multisite()) { |
|
| 1657 | + $this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4); |
|
| 1658 | 1658 | } |
| 1659 | 1659 | |
| 1660 | - $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service ); |
|
| 1660 | + $deactivator_feedback = new Wordlift_Deactivator_Feedback($this->configuration_service); |
|
| 1661 | 1661 | |
| 1662 | - add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) ); |
|
| 1663 | - add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) ); |
|
| 1664 | - add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) ); |
|
| 1662 | + add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup')); |
|
| 1663 | + add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts')); |
|
| 1664 | + add_action('wp_ajax_wl_deactivation_feedback', array($deactivator_feedback, 'wl_deactivation_feedback')); |
|
| 1665 | 1665 | } |
| 1666 | 1666 | |
| 1667 | 1667 | /** |
@@ -1673,56 +1673,56 @@ discard block |
||
| 1673 | 1673 | */ |
| 1674 | 1674 | private function define_public_hooks() { |
| 1675 | 1675 | |
| 1676 | - $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() ); |
|
| 1676 | + $plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version()); |
|
| 1677 | 1677 | |
| 1678 | 1678 | // Register the entity post type. |
| 1679 | - $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' ); |
|
| 1680 | - $this->loader->add_action( 'init', $this->install_service, 'install' ); |
|
| 1679 | + $this->loader->add_action('init', $this->entity_post_type_service, 'register'); |
|
| 1680 | + $this->loader->add_action('init', $this->install_service, 'install'); |
|
| 1681 | 1681 | |
| 1682 | 1682 | // Bind the link generation and handling hooks to the entity link service. |
| 1683 | - $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 ); |
|
| 1684 | - $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 ); |
|
| 1685 | - $this->loader->add_filter( 'wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3 ); |
|
| 1686 | - $this->loader->add_filter( 'wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4 ); |
|
| 1683 | + $this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4); |
|
| 1684 | + $this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1); |
|
| 1685 | + $this->loader->add_filter('wp_unique_post_slug_is_bad_flat_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_flat_slug', 10, 3); |
|
| 1686 | + $this->loader->add_filter('wp_unique_post_slug_is_bad_hierarchical_slug', $this->entity_link_service, 'wp_unique_post_slug_is_bad_hierarchical_slug', 10, 4); |
|
| 1687 | 1687 | |
| 1688 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
|
| 1689 | - $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
|
| 1688 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); |
|
| 1689 | + $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts'); |
|
| 1690 | 1690 | |
| 1691 | 1691 | // Hook the content filter service to add entity links. |
| 1692 | - if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) { |
|
| 1693 | - $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' ); |
|
| 1692 | + if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) { |
|
| 1693 | + $this->loader->add_filter('the_content', $this->content_filter_service, 'the_content'); |
|
| 1694 | 1694 | } |
| 1695 | 1695 | |
| 1696 | 1696 | // Hook the AJAX wl_timeline action to the Timeline service. |
| 1697 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' ); |
|
| 1697 | + $this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline'); |
|
| 1698 | 1698 | |
| 1699 | 1699 | // Hook the ShareThis service. |
| 1700 | - $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 ); |
|
| 1701 | - $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 ); |
|
| 1700 | + $this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99); |
|
| 1701 | + $this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99); |
|
| 1702 | 1702 | |
| 1703 | 1703 | // Hook the AJAX wl_jsonld action to the JSON-LD service. |
| 1704 | - $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' ); |
|
| 1704 | + $this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get'); |
|
| 1705 | 1705 | |
| 1706 | 1706 | // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service` |
| 1707 | 1707 | // in order to tweak WP's `WP_Query` to include entities in queries related |
| 1708 | 1708 | // to categories. |
| 1709 | - $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 ); |
|
| 1709 | + $this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1); |
|
| 1710 | 1710 | |
| 1711 | 1711 | /* |
| 1712 | 1712 | * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service` |
| 1713 | 1713 | * in order to tweak WP's `WP_Query` to show event related entities in reverse |
| 1714 | 1714 | * order of start time. |
| 1715 | 1715 | */ |
| 1716 | - $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 ); |
|
| 1716 | + $this->loader->add_action('pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1); |
|
| 1717 | 1717 | |
| 1718 | - $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 ); |
|
| 1718 | + $this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1); |
|
| 1719 | 1719 | |
| 1720 | 1720 | // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done. |
| 1721 | - $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 ); |
|
| 1721 | + $this->loader->add_action('save_post', $this->entity_type_adapter, 'save_post', 9, 3); |
|
| 1722 | 1722 | |
| 1723 | 1723 | // Analytics Script Frontend. |
| 1724 | - if ( $this->configuration_service->is_analytics_enable() ) { |
|
| 1725 | - $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 ); |
|
| 1724 | + if ($this->configuration_service->is_analytics_enable()) { |
|
| 1725 | + $this->loader->add_action('wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10); |
|
| 1726 | 1726 | } |
| 1727 | 1727 | |
| 1728 | 1728 | } |
@@ -1775,11 +1775,11 @@ discard block |
||
| 1775 | 1775 | */ |
| 1776 | 1776 | private function load_cli_dependencies() { |
| 1777 | 1777 | |
| 1778 | - require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1778 | + require_once plugin_dir_path(dirname(__FILE__)).'cli/class-wordlift-push-reference-data-command.php'; |
|
| 1779 | 1779 | |
| 1780 | - $push_reference_data_command = new Wordlift_Push_Reference_Data_Command( $this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service ); |
|
| 1780 | + $push_reference_data_command = new Wordlift_Push_Reference_Data_Command($this->relation_service, $this->entity_service, $this->sparql_service, $this->configuration_service, $this->entity_type_service); |
|
| 1781 | 1781 | |
| 1782 | - WP_CLI::add_command( 'wl references push', $push_reference_data_command ); |
|
| 1782 | + WP_CLI::add_command('wl references push', $push_reference_data_command); |
|
| 1783 | 1783 | |
| 1784 | 1784 | } |
| 1785 | 1785 | |