Completed
Push — develop ( a26bb7...1c8b88 )
by David
06:22 queued 10s
created
src/modules/core/wordlift_core_constants.php 2 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -14,55 +14,55 @@
 block discarded – undo
14 14
 // Mapping options / validations rules used by wl_core_get_posts to perform validation on args
15 15
 // The array is serialized because array constants are only from php 5.6 on.
16 16
 define( 'WL_CORE_GET_POSTS_VALIDATION_RULES', serialize( array(
17
-	'get'            => array( 'posts', 'post_ids' ),
18
-	'as'             => array( 'object', 'subject' ),
19
-	'post_type'      => array( 'post', 'entity' ),
20
-	'post_status'    => array( 'draft', 'trash', 'publish' ),
21
-	'with_predicate' => array(
22
-		WL_WHAT_RELATION,
23
-		WL_WHEN_RELATION,
24
-		WL_WHERE_RELATION,
25
-		WL_WHO_RELATION,
26
-	),
17
+    'get'            => array( 'posts', 'post_ids' ),
18
+    'as'             => array( 'object', 'subject' ),
19
+    'post_type'      => array( 'post', 'entity' ),
20
+    'post_status'    => array( 'draft', 'trash', 'publish' ),
21
+    'with_predicate' => array(
22
+        WL_WHAT_RELATION,
23
+        WL_WHEN_RELATION,
24
+        WL_WHERE_RELATION,
25
+        WL_WHO_RELATION,
26
+    ),
27 27
 ) ) );
28 28
 
29 29
 // Classification boxes configuration for angularjs edit-post widget
30 30
 // The array is serialized because array constants are only from php 5.6 on.
31 31
 
32 32
 define( 'WL_CORE_POST_CLASSIFICATION_BOXES', serialize( array(
33
-	array(
34
-		'id'               => WL_WHAT_RELATION,
35
-		'label'            => 'What',
36
-		'registeredTypes'  => array(
37
-			'thing',
38
-			'creative-work',
39
-			'recipe',
40
-		),
41
-		'selectedEntities' => array(),
42
-	),
43
-	array(
44
-		'id'               => WL_WHO_RELATION,
45
-		'label'            => 'Who',
46
-		'registeredTypes'  => array(
47
-			'organization',
48
-			'person',
49
-			'local-business',
50
-			'localbusiness',
51
-		),
52
-		'selectedEntities' => array(),
53
-	),
54
-	array(
55
-		'id'               => WL_WHERE_RELATION,
56
-		'label'            => 'Where',
57
-		'registeredTypes'  => array( 'place' ),
58
-		'selectedEntities' => array(),
59
-	),
60
-	array(
61
-		'id'               => WL_WHEN_RELATION,
62
-		'label'            => 'When',
63
-		'registeredTypes'  => array( 'event' ),
64
-		'selectedEntities' => array(),
65
-	),
33
+    array(
34
+        'id'               => WL_WHAT_RELATION,
35
+        'label'            => 'What',
36
+        'registeredTypes'  => array(
37
+            'thing',
38
+            'creative-work',
39
+            'recipe',
40
+        ),
41
+        'selectedEntities' => array(),
42
+    ),
43
+    array(
44
+        'id'               => WL_WHO_RELATION,
45
+        'label'            => 'Who',
46
+        'registeredTypes'  => array(
47
+            'organization',
48
+            'person',
49
+            'local-business',
50
+            'localbusiness',
51
+        ),
52
+        'selectedEntities' => array(),
53
+    ),
54
+    array(
55
+        'id'               => WL_WHERE_RELATION,
56
+        'label'            => 'Where',
57
+        'registeredTypes'  => array( 'place' ),
58
+        'selectedEntities' => array(),
59
+    ),
60
+    array(
61
+        'id'               => WL_WHEN_RELATION,
62
+        'label'            => 'When',
63
+        'registeredTypes'  => array( 'event' ),
64
+        'selectedEntities' => array(),
65
+    ),
66 66
 ) ) );
67 67
 
68 68
 // Default namespace for wp-json
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,35 +1,35 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-define( 'WL_DEFAULT_THUMBNAIL_PATH', dirname( dirname( plugin_dir_url( __FILE__ ) ) ) . '/public/images/missing-image-150x150.png' );
4
-define( 'WL_DEFAULT_PATH', dirname( dirname( plugin_dir_url( __FILE__ ) ) ) . '/' );
3
+define('WL_DEFAULT_THUMBNAIL_PATH', dirname(dirname(plugin_dir_url(__FILE__))).'/public/images/missing-image-150x150.png');
4
+define('WL_DEFAULT_PATH', dirname(dirname(plugin_dir_url(__FILE__))).'/');
5 5
 
6 6
 // Custom table name
7
-define( 'WL_DB_RELATION_INSTANCES_TABLE_NAME', 'wl_relation_instances' );
7
+define('WL_DB_RELATION_INSTANCES_TABLE_NAME', 'wl_relation_instances');
8 8
 
9
-define( 'WL_WHAT_RELATION', 'what' );
10
-define( 'WL_WHO_RELATION', 'who' );
11
-define( 'WL_WHERE_RELATION', 'where' );
12
-define( 'WL_WHEN_RELATION', 'when' );
9
+define('WL_WHAT_RELATION', 'what');
10
+define('WL_WHO_RELATION', 'who');
11
+define('WL_WHERE_RELATION', 'where');
12
+define('WL_WHEN_RELATION', 'when');
13 13
 
14 14
 // Mapping options / validations rules used by wl_core_get_posts to perform validation on args
15 15
 // The array is serialized because array constants are only from php 5.6 on.
16
-define( 'WL_CORE_GET_POSTS_VALIDATION_RULES', serialize( array(
17
-	'get'            => array( 'posts', 'post_ids' ),
18
-	'as'             => array( 'object', 'subject' ),
19
-	'post_type'      => array( 'post', 'entity' ),
20
-	'post_status'    => array( 'draft', 'trash', 'publish' ),
16
+define('WL_CORE_GET_POSTS_VALIDATION_RULES', serialize(array(
17
+	'get'            => array('posts', 'post_ids'),
18
+	'as'             => array('object', 'subject'),
19
+	'post_type'      => array('post', 'entity'),
20
+	'post_status'    => array('draft', 'trash', 'publish'),
21 21
 	'with_predicate' => array(
22 22
 		WL_WHAT_RELATION,
23 23
 		WL_WHEN_RELATION,
24 24
 		WL_WHERE_RELATION,
25 25
 		WL_WHO_RELATION,
26 26
 	),
27
-) ) );
27
+)));
28 28
 
29 29
 // Classification boxes configuration for angularjs edit-post widget
30 30
 // The array is serialized because array constants are only from php 5.6 on.
31 31
 
32
-define( 'WL_CORE_POST_CLASSIFICATION_BOXES', serialize( array(
32
+define('WL_CORE_POST_CLASSIFICATION_BOXES', serialize(array(
33 33
 	array(
34 34
 		'id'               => WL_WHAT_RELATION,
35 35
 		'label'            => 'What',
@@ -54,16 +54,16 @@  discard block
 block discarded – undo
54 54
 	array(
55 55
 		'id'               => WL_WHERE_RELATION,
56 56
 		'label'            => 'Where',
57
-		'registeredTypes'  => array( 'place' ),
57
+		'registeredTypes'  => array('place'),
58 58
 		'selectedEntities' => array(),
59 59
 	),
60 60
 	array(
61 61
 		'id'               => WL_WHEN_RELATION,
62 62
 		'label'            => 'When',
63
-		'registeredTypes'  => array( 'event' ),
63
+		'registeredTypes'  => array('event'),
64 64
 		'selectedEntities' => array(),
65 65
 	),
66
-) ) );
66
+)));
67 67
 
68 68
 // Default namespace for wp-json
69
-define( 'WL_REST_ROUTE_DEFAULT_NAMESPACE', 'wordlift/v1' );
69
+define('WL_REST_ROUTE_DEFAULT_NAMESPACE', 'wordlift/v1');
Please login to merge, or discard this patch.
src/public/class-wordlift-faceted-search-shortcode.php 2 patches
Indentation   +203 added lines, -203 removed lines patch added patch discarded remove patch
@@ -17,197 +17,197 @@  discard block
 block discarded – undo
17 17
  */
18 18
 class Wordlift_Faceted_Search_Shortcode extends Wordlift_Shortcode {
19 19
 
20
-	/**
21
-	 * {@inheritdoc}
22
-	 */
23
-	const SHORTCODE = 'wl_faceted_search';
24
-
25
-	/**
26
-	 * {@inheritdoc}
27
-	 */
28
-	public function render( $atts ) {
29
-
30
-		return Wordlift_AMP_Service::is_amp_endpoint() ? $this->amp_shortcode( $atts )
31
-			: $this->web_shortcode( $atts );
32
-	}
33
-
34
-	/**
35
-	 * Shared function used by web_shortcode and amp_shortcode
36
-	 * Bootstrap logic for attributes extraction and boolean filtering
37
-	 *
38
-	 * @since      3.20.0
39
-	 *
40
-	 * @param array $atts Shortcode attributes.
41
-	 *
42
-	 * @return array $shortcode_atts
43
-	 */
44
-	private function make_shortcode_atts( $atts ) {
45
-
46
-		// Extract attributes and set default values.
47
-		$shortcode_atts = shortcode_atts( array(
48
-			'title'          => __( 'Related articles', 'wordlift' ),
49
-			'show_facets'    => true,
50
-			'with_carousel'  => true,
51
-			'squared_thumbs' => false,
52
-			'limit'          => 20,
53
-		), $atts );
54
-
55
-		foreach (
56
-			array(
57
-				'show_facets',
58
-				'with_carousel',
59
-				'squared_thumbs',
60
-			) as $att
61
-		) {
62
-
63
-			// See http://wordpress.stackexchange.com/questions/119294/pass-boolean-value-in-shortcode
64
-			$shortcode_atts[ $att ] = filter_var(
65
-				$shortcode_atts[ $att ], FILTER_VALIDATE_BOOLEAN
66
-			);
67
-		}
68
-
69
-		return $shortcode_atts;
70
-	}
71
-
72
-	/**
73
-	 * Function in charge of diplaying the [wl-faceted-search] in web mode.
74
-	 *
75
-	 * @since 3.20.0
76
-	 *
77
-	 * @param array $atts Shortcode attributes.
78
-	 *
79
-	 * @return string Shortcode HTML for web
80
-	 */
81
-	private function web_shortcode( $atts ) {
82
-
83
-		// attributes extraction and boolean filtering
84
-		$shortcode_atts = $this->make_shortcode_atts( $atts );
85
-
86
-		// If the current post is not an entity and has no related entities
87
-		// than the shortcode cannot be rendered
88
-		// TODO Add an alert visibile only for connected admin users.
89
-		$current_post = get_post();
90
-
91
-		$entity_service = Wordlift_Entity_Service::get_instance();
92
-		$entity_ids     = $entity_service->is_entity( $current_post->ID ) ?
93
-			array( $current_post->ID ) :
94
-			wl_core_get_related_entity_ids( $current_post->ID );
95
-
96
-		// Bail if there are no entity ids.
97
-		if ( 0 === count( $entity_ids ) ) {
98
-			return '';
99
-		}
100
-
101
-		$div_id = 'wordlift-faceted-entity-search-widget';
102
-
103
-		// Enqueue common shortcode scripts.
104
-		$this->enqueue_scripts();
105
-
106
-		// Enqueue shortcode specific scripts and styles.
107
-		$deps = apply_filters( 'wl_include_font_awesome', true )
108
-			? array( 'wordlift-font-awesome' )
109
-			: array();
110
-		wp_enqueue_style( 'wordlift-faceted-search', dirname( plugin_dir_url( __FILE__ ) ) . '/css/wordlift-faceted-entity-search-widget.min.css', $deps, Wordlift::get_instance()->get_version() );
111
-		wp_enqueue_script( 'wordlift-faceted-search', dirname( plugin_dir_url( __FILE__ ) ) . '/js/wordlift-faceted-entity-search-widget.js' );
112
-
113
-		wp_localize_script(
114
-			'wordlift-faceted-search',
115
-			'wl_faceted_search_params', array(
116
-				'ajax_url'             => admin_url( 'admin-ajax.php' ),
117
-				'action'               => 'wl_faceted_search',
118
-				'post_id'              => $current_post->ID,
119
-				'entity_ids'           => $entity_ids,
120
-				'limit'                => apply_filters( 'wl_faceted_search_limit', $shortcode_atts['limit'] ),
121
-				'div_id'               => $div_id,
122
-				'defaultThumbnailPath' => WL_DEFAULT_THUMBNAIL_PATH,
123
-				'attrs'                => $shortcode_atts,
124
-				'l10n'                 => array(
125
-					'what'  => _x( 'What', 'Faceted Search Widget', 'wordlift' ),
126
-					'who'   => _x( 'Who', 'Faceted Search Widget', 'wordlift' ),
127
-					'where' => _x( 'Where', 'Faceted Search Widget', 'wordlift' ),
128
-					'when'  => _x( 'When', 'Faceted Search Widget', 'wordlift' ),
129
-				),
130
-			)
131
-		);
132
-
133
-		return '<div id="' . $div_id . '" style="width:100%"></div>';
134
-	}
135
-
136
-	/**
137
-	 * Function in charge of diplaying the [wl-faceted-search] in amp mode.
138
-	 *
139
-	 * @since 3.20.0
140
-	 *
141
-	 * @param array $atts Shortcode attributes.
142
-	 *
143
-	 * @return string Shortcode HTML for amp
144
-	 */
145
-	private function amp_shortcode( $atts ) {
146
-
147
-		// attributes extraction and boolean filtering
148
-		$shortcode_atts = $this->make_shortcode_atts( $atts );
149
-
150
-		// If the current post is not an entity and has no related entities
151
-		// than the shortcode cannot be rendered
152
-		// TODO Add an alert visibile only for connected admin users.
153
-		$current_post = get_post();
154
-
155
-		$entity_service = Wordlift_Entity_Service::get_instance();
156
-		$entity_ids     = $entity_service->is_entity( $current_post->ID ) ?
157
-			array( $current_post->ID ) :
158
-			wl_core_get_related_entity_ids( $current_post->ID );
159
-
160
-		// Bail if there are no entity ids.
161
-		if ( 0 === count( $entity_ids ) ) {
162
-			return '';
163
-		}
164
-
165
-		$div_id = 'wordlift-faceted-entity-search-widget';
166
-
167
-		// Inject amp specific styles inline
168
-		add_action( 'amp_post_template_css', array(
169
-			$this,
170
-			'amp_post_template_css',
171
-		) );
172
-
173
-		$wp_json_base = get_rest_url() . WL_REST_ROUTE_DEFAULT_NAMESPACE;
174
-
175
-		$query_posts = array(
176
-			'post_id' => $current_post->ID,
177
-			'limit'   => apply_filters( 'wl_faceted_search_limit', $shortcode_atts['limit'] ),
178
-			'type'    => 'posts',
179
-		);
180
-
181
-		$query_facets = array(
182
-			'post_id' => $current_post->ID,
183
-			'limit'   => apply_filters( 'wl_faceted_search_limit', $shortcode_atts['limit'] ),
184
-			'type'    => 'facets',
185
-			'l10n'    => array(
186
-				'what'  => _x( 'What', 'Faceted Search Widget', 'wordlift' ),
187
-				'who'   => _x( 'Who', 'Faceted Search Widget', 'wordlift' ),
188
-				'where' => _x( 'Where', 'Faceted Search Widget', 'wordlift' ),
189
-				'when'  => _x( 'When', 'Faceted Search Widget', 'wordlift' ),
190
-			),
191
-		);
192
-
193
-		if ( strpos( $wp_json_base, 'wp-json/' . WL_REST_ROUTE_DEFAULT_NAMESPACE ) ) {
194
-			$delimiter = '?';
195
-		} else {
196
-			$delimiter = '&';
197
-		}
198
-
199
-		// Use a protocol-relative URL as amp-list spec says that URL's protocol must be HTTPS.
200
-		// This is a hackish way, but this works for http and https URLs
201
-		$wp_json_url_posts  = str_replace( array(
202
-				'http:',
203
-				'https:',
204
-			), '', $wp_json_base ) . '/faceted-search' . $delimiter . http_build_query( $query_posts );
205
-		$wp_json_url_facets = str_replace( array(
206
-				'http:',
207
-				'https:',
208
-			), '', $wp_json_base ) . '/faceted-search' . $delimiter . http_build_query( $query_facets );
209
-
210
-		/*
20
+    /**
21
+     * {@inheritdoc}
22
+     */
23
+    const SHORTCODE = 'wl_faceted_search';
24
+
25
+    /**
26
+     * {@inheritdoc}
27
+     */
28
+    public function render( $atts ) {
29
+
30
+        return Wordlift_AMP_Service::is_amp_endpoint() ? $this->amp_shortcode( $atts )
31
+            : $this->web_shortcode( $atts );
32
+    }
33
+
34
+    /**
35
+     * Shared function used by web_shortcode and amp_shortcode
36
+     * Bootstrap logic for attributes extraction and boolean filtering
37
+     *
38
+     * @since      3.20.0
39
+     *
40
+     * @param array $atts Shortcode attributes.
41
+     *
42
+     * @return array $shortcode_atts
43
+     */
44
+    private function make_shortcode_atts( $atts ) {
45
+
46
+        // Extract attributes and set default values.
47
+        $shortcode_atts = shortcode_atts( array(
48
+            'title'          => __( 'Related articles', 'wordlift' ),
49
+            'show_facets'    => true,
50
+            'with_carousel'  => true,
51
+            'squared_thumbs' => false,
52
+            'limit'          => 20,
53
+        ), $atts );
54
+
55
+        foreach (
56
+            array(
57
+                'show_facets',
58
+                'with_carousel',
59
+                'squared_thumbs',
60
+            ) as $att
61
+        ) {
62
+
63
+            // See http://wordpress.stackexchange.com/questions/119294/pass-boolean-value-in-shortcode
64
+            $shortcode_atts[ $att ] = filter_var(
65
+                $shortcode_atts[ $att ], FILTER_VALIDATE_BOOLEAN
66
+            );
67
+        }
68
+
69
+        return $shortcode_atts;
70
+    }
71
+
72
+    /**
73
+     * Function in charge of diplaying the [wl-faceted-search] in web mode.
74
+     *
75
+     * @since 3.20.0
76
+     *
77
+     * @param array $atts Shortcode attributes.
78
+     *
79
+     * @return string Shortcode HTML for web
80
+     */
81
+    private function web_shortcode( $atts ) {
82
+
83
+        // attributes extraction and boolean filtering
84
+        $shortcode_atts = $this->make_shortcode_atts( $atts );
85
+
86
+        // If the current post is not an entity and has no related entities
87
+        // than the shortcode cannot be rendered
88
+        // TODO Add an alert visibile only for connected admin users.
89
+        $current_post = get_post();
90
+
91
+        $entity_service = Wordlift_Entity_Service::get_instance();
92
+        $entity_ids     = $entity_service->is_entity( $current_post->ID ) ?
93
+            array( $current_post->ID ) :
94
+            wl_core_get_related_entity_ids( $current_post->ID );
95
+
96
+        // Bail if there are no entity ids.
97
+        if ( 0 === count( $entity_ids ) ) {
98
+            return '';
99
+        }
100
+
101
+        $div_id = 'wordlift-faceted-entity-search-widget';
102
+
103
+        // Enqueue common shortcode scripts.
104
+        $this->enqueue_scripts();
105
+
106
+        // Enqueue shortcode specific scripts and styles.
107
+        $deps = apply_filters( 'wl_include_font_awesome', true )
108
+            ? array( 'wordlift-font-awesome' )
109
+            : array();
110
+        wp_enqueue_style( 'wordlift-faceted-search', dirname( plugin_dir_url( __FILE__ ) ) . '/css/wordlift-faceted-entity-search-widget.min.css', $deps, Wordlift::get_instance()->get_version() );
111
+        wp_enqueue_script( 'wordlift-faceted-search', dirname( plugin_dir_url( __FILE__ ) ) . '/js/wordlift-faceted-entity-search-widget.js' );
112
+
113
+        wp_localize_script(
114
+            'wordlift-faceted-search',
115
+            'wl_faceted_search_params', array(
116
+                'ajax_url'             => admin_url( 'admin-ajax.php' ),
117
+                'action'               => 'wl_faceted_search',
118
+                'post_id'              => $current_post->ID,
119
+                'entity_ids'           => $entity_ids,
120
+                'limit'                => apply_filters( 'wl_faceted_search_limit', $shortcode_atts['limit'] ),
121
+                'div_id'               => $div_id,
122
+                'defaultThumbnailPath' => WL_DEFAULT_THUMBNAIL_PATH,
123
+                'attrs'                => $shortcode_atts,
124
+                'l10n'                 => array(
125
+                    'what'  => _x( 'What', 'Faceted Search Widget', 'wordlift' ),
126
+                    'who'   => _x( 'Who', 'Faceted Search Widget', 'wordlift' ),
127
+                    'where' => _x( 'Where', 'Faceted Search Widget', 'wordlift' ),
128
+                    'when'  => _x( 'When', 'Faceted Search Widget', 'wordlift' ),
129
+                ),
130
+            )
131
+        );
132
+
133
+        return '<div id="' . $div_id . '" style="width:100%"></div>';
134
+    }
135
+
136
+    /**
137
+     * Function in charge of diplaying the [wl-faceted-search] in amp mode.
138
+     *
139
+     * @since 3.20.0
140
+     *
141
+     * @param array $atts Shortcode attributes.
142
+     *
143
+     * @return string Shortcode HTML for amp
144
+     */
145
+    private function amp_shortcode( $atts ) {
146
+
147
+        // attributes extraction and boolean filtering
148
+        $shortcode_atts = $this->make_shortcode_atts( $atts );
149
+
150
+        // If the current post is not an entity and has no related entities
151
+        // than the shortcode cannot be rendered
152
+        // TODO Add an alert visibile only for connected admin users.
153
+        $current_post = get_post();
154
+
155
+        $entity_service = Wordlift_Entity_Service::get_instance();
156
+        $entity_ids     = $entity_service->is_entity( $current_post->ID ) ?
157
+            array( $current_post->ID ) :
158
+            wl_core_get_related_entity_ids( $current_post->ID );
159
+
160
+        // Bail if there are no entity ids.
161
+        if ( 0 === count( $entity_ids ) ) {
162
+            return '';
163
+        }
164
+
165
+        $div_id = 'wordlift-faceted-entity-search-widget';
166
+
167
+        // Inject amp specific styles inline
168
+        add_action( 'amp_post_template_css', array(
169
+            $this,
170
+            'amp_post_template_css',
171
+        ) );
172
+
173
+        $wp_json_base = get_rest_url() . WL_REST_ROUTE_DEFAULT_NAMESPACE;
174
+
175
+        $query_posts = array(
176
+            'post_id' => $current_post->ID,
177
+            'limit'   => apply_filters( 'wl_faceted_search_limit', $shortcode_atts['limit'] ),
178
+            'type'    => 'posts',
179
+        );
180
+
181
+        $query_facets = array(
182
+            'post_id' => $current_post->ID,
183
+            'limit'   => apply_filters( 'wl_faceted_search_limit', $shortcode_atts['limit'] ),
184
+            'type'    => 'facets',
185
+            'l10n'    => array(
186
+                'what'  => _x( 'What', 'Faceted Search Widget', 'wordlift' ),
187
+                'who'   => _x( 'Who', 'Faceted Search Widget', 'wordlift' ),
188
+                'where' => _x( 'Where', 'Faceted Search Widget', 'wordlift' ),
189
+                'when'  => _x( 'When', 'Faceted Search Widget', 'wordlift' ),
190
+            ),
191
+        );
192
+
193
+        if ( strpos( $wp_json_base, 'wp-json/' . WL_REST_ROUTE_DEFAULT_NAMESPACE ) ) {
194
+            $delimiter = '?';
195
+        } else {
196
+            $delimiter = '&';
197
+        }
198
+
199
+        // Use a protocol-relative URL as amp-list spec says that URL's protocol must be HTTPS.
200
+        // This is a hackish way, but this works for http and https URLs
201
+        $wp_json_url_posts  = str_replace( array(
202
+                'http:',
203
+                'https:',
204
+            ), '', $wp_json_base ) . '/faceted-search' . $delimiter . http_build_query( $query_posts );
205
+        $wp_json_url_facets = str_replace( array(
206
+                'http:',
207
+                'https:',
208
+            ), '', $wp_json_base ) . '/faceted-search' . $delimiter . http_build_query( $query_facets );
209
+
210
+        /*
211 211
 		 * Notes about amp code:
212 212
 		 *
213 213
 		 * amp-list src is the only way to do an xhr fetch so we need it for both facets and posts
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 		 * All JS code in amp has to be done using limited JS expressions `see https://www.ampproject.org/docs/reference/components/amp-bind#expressions`
222 222
 		 */
223 223
 
224
-		return <<<HTML
224
+        return <<<HTML
225 225
 		<div id="{$div_id}" class="wl-amp-fs">
226 226
 			<amp-state id="currentEntities">
227 227
 				<script type="application/json">
@@ -308,16 +308,16 @@  discard block
 block discarded – undo
308 308
 			</amp-list>			
309 309
 		</div>
310 310
 HTML;
311
-	}
312
-
313
-	/**
314
-	 * Customize the CSS when in AMP.
315
-	 * Should echo (not return) CSS code
316
-	 *
317
-	 * @since 3.20.0
318
-	 */
319
-	public function amp_post_template_css() {
320
-		echo file_get_contents( dirname( plugin_dir_url( __FILE__ ) ) . '/css/wordlift-amp-custom.min.css' );
321
-	}
311
+    }
312
+
313
+    /**
314
+     * Customize the CSS when in AMP.
315
+     * Should echo (not return) CSS code
316
+     *
317
+     * @since 3.20.0
318
+     */
319
+    public function amp_post_template_css() {
320
+        echo file_get_contents( dirname( plugin_dir_url( __FILE__ ) ) . '/css/wordlift-amp-custom.min.css' );
321
+    }
322 322
 
323 323
 }
Please login to merge, or discard this patch.
Spacing   +45 added lines, -47 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
 	/**
26 26
 	 * {@inheritdoc}
27 27
 	 */
28
-	public function render( $atts ) {
28
+	public function render($atts) {
29 29
 
30
-		return Wordlift_AMP_Service::is_amp_endpoint() ? $this->amp_shortcode( $atts )
31
-			: $this->web_shortcode( $atts );
30
+		return Wordlift_AMP_Service::is_amp_endpoint() ? $this->amp_shortcode($atts)
31
+			: $this->web_shortcode($atts);
32 32
 	}
33 33
 
34 34
 	/**
@@ -41,16 +41,16 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @return array $shortcode_atts
43 43
 	 */
44
-	private function make_shortcode_atts( $atts ) {
44
+	private function make_shortcode_atts($atts) {
45 45
 
46 46
 		// Extract attributes and set default values.
47
-		$shortcode_atts = shortcode_atts( array(
48
-			'title'          => __( 'Related articles', 'wordlift' ),
47
+		$shortcode_atts = shortcode_atts(array(
48
+			'title'          => __('Related articles', 'wordlift'),
49 49
 			'show_facets'    => true,
50 50
 			'with_carousel'  => true,
51 51
 			'squared_thumbs' => false,
52 52
 			'limit'          => 20,
53
-		), $atts );
53
+		), $atts);
54 54
 
55 55
 		foreach (
56 56
 			array(
@@ -61,8 +61,8 @@  discard block
 block discarded – undo
61 61
 		) {
62 62
 
63 63
 			// See http://wordpress.stackexchange.com/questions/119294/pass-boolean-value-in-shortcode
64
-			$shortcode_atts[ $att ] = filter_var(
65
-				$shortcode_atts[ $att ], FILTER_VALIDATE_BOOLEAN
64
+			$shortcode_atts[$att] = filter_var(
65
+				$shortcode_atts[$att], FILTER_VALIDATE_BOOLEAN
66 66
 			);
67 67
 		}
68 68
 
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 	 *
79 79
 	 * @return string Shortcode HTML for web
80 80
 	 */
81
-	private function web_shortcode( $atts ) {
81
+	private function web_shortcode($atts) {
82 82
 
83 83
 		// attributes extraction and boolean filtering
84
-		$shortcode_atts = $this->make_shortcode_atts( $atts );
84
+		$shortcode_atts = $this->make_shortcode_atts($atts);
85 85
 
86 86
 		// If the current post is not an entity and has no related entities
87 87
 		// than the shortcode cannot be rendered
@@ -89,12 +89,11 @@  discard block
 block discarded – undo
89 89
 		$current_post = get_post();
90 90
 
91 91
 		$entity_service = Wordlift_Entity_Service::get_instance();
92
-		$entity_ids     = $entity_service->is_entity( $current_post->ID ) ?
93
-			array( $current_post->ID ) :
94
-			wl_core_get_related_entity_ids( $current_post->ID );
92
+		$entity_ids     = $entity_service->is_entity($current_post->ID) ?
93
+			array($current_post->ID) : wl_core_get_related_entity_ids($current_post->ID);
95 94
 
96 95
 		// Bail if there are no entity ids.
97
-		if ( 0 === count( $entity_ids ) ) {
96
+		if (0 === count($entity_ids)) {
98 97
 			return '';
99 98
 		}
100 99
 
@@ -104,33 +103,33 @@  discard block
 block discarded – undo
104 103
 		$this->enqueue_scripts();
105 104
 
106 105
 		// Enqueue shortcode specific scripts and styles.
107
-		$deps = apply_filters( 'wl_include_font_awesome', true )
108
-			? array( 'wordlift-font-awesome' )
106
+		$deps = apply_filters('wl_include_font_awesome', true)
107
+			? array('wordlift-font-awesome')
109 108
 			: array();
110
-		wp_enqueue_style( 'wordlift-faceted-search', dirname( plugin_dir_url( __FILE__ ) ) . '/css/wordlift-faceted-entity-search-widget.min.css', $deps, Wordlift::get_instance()->get_version() );
111
-		wp_enqueue_script( 'wordlift-faceted-search', dirname( plugin_dir_url( __FILE__ ) ) . '/js/wordlift-faceted-entity-search-widget.js' );
109
+		wp_enqueue_style('wordlift-faceted-search', dirname(plugin_dir_url(__FILE__)).'/css/wordlift-faceted-entity-search-widget.min.css', $deps, Wordlift::get_instance()->get_version());
110
+		wp_enqueue_script('wordlift-faceted-search', dirname(plugin_dir_url(__FILE__)).'/js/wordlift-faceted-entity-search-widget.js');
112 111
 
113 112
 		wp_localize_script(
114 113
 			'wordlift-faceted-search',
115 114
 			'wl_faceted_search_params', array(
116
-				'ajax_url'             => admin_url( 'admin-ajax.php' ),
115
+				'ajax_url'             => admin_url('admin-ajax.php'),
117 116
 				'action'               => 'wl_faceted_search',
118 117
 				'post_id'              => $current_post->ID,
119 118
 				'entity_ids'           => $entity_ids,
120
-				'limit'                => apply_filters( 'wl_faceted_search_limit', $shortcode_atts['limit'] ),
119
+				'limit'                => apply_filters('wl_faceted_search_limit', $shortcode_atts['limit']),
121 120
 				'div_id'               => $div_id,
122 121
 				'defaultThumbnailPath' => WL_DEFAULT_THUMBNAIL_PATH,
123 122
 				'attrs'                => $shortcode_atts,
124 123
 				'l10n'                 => array(
125
-					'what'  => _x( 'What', 'Faceted Search Widget', 'wordlift' ),
126
-					'who'   => _x( 'Who', 'Faceted Search Widget', 'wordlift' ),
127
-					'where' => _x( 'Where', 'Faceted Search Widget', 'wordlift' ),
128
-					'when'  => _x( 'When', 'Faceted Search Widget', 'wordlift' ),
124
+					'what'  => _x('What', 'Faceted Search Widget', 'wordlift'),
125
+					'who'   => _x('Who', 'Faceted Search Widget', 'wordlift'),
126
+					'where' => _x('Where', 'Faceted Search Widget', 'wordlift'),
127
+					'when'  => _x('When', 'Faceted Search Widget', 'wordlift'),
129 128
 				),
130 129
 			)
131 130
 		);
132 131
 
133
-		return '<div id="' . $div_id . '" style="width:100%"></div>';
132
+		return '<div id="'.$div_id.'" style="width:100%"></div>';
134 133
 	}
135 134
 
136 135
 	/**
@@ -142,10 +141,10 @@  discard block
 block discarded – undo
142 141
 	 *
143 142
 	 * @return string Shortcode HTML for amp
144 143
 	 */
145
-	private function amp_shortcode( $atts ) {
144
+	private function amp_shortcode($atts) {
146 145
 
147 146
 		// attributes extraction and boolean filtering
148
-		$shortcode_atts = $this->make_shortcode_atts( $atts );
147
+		$shortcode_atts = $this->make_shortcode_atts($atts);
149 148
 
150 149
 		// If the current post is not an entity and has no related entities
151 150
 		// than the shortcode cannot be rendered
@@ -153,44 +152,43 @@  discard block
 block discarded – undo
153 152
 		$current_post = get_post();
154 153
 
155 154
 		$entity_service = Wordlift_Entity_Service::get_instance();
156
-		$entity_ids     = $entity_service->is_entity( $current_post->ID ) ?
157
-			array( $current_post->ID ) :
158
-			wl_core_get_related_entity_ids( $current_post->ID );
155
+		$entity_ids     = $entity_service->is_entity($current_post->ID) ?
156
+			array($current_post->ID) : wl_core_get_related_entity_ids($current_post->ID);
159 157
 
160 158
 		// Bail if there are no entity ids.
161
-		if ( 0 === count( $entity_ids ) ) {
159
+		if (0 === count($entity_ids)) {
162 160
 			return '';
163 161
 		}
164 162
 
165 163
 		$div_id = 'wordlift-faceted-entity-search-widget';
166 164
 
167 165
 		// Inject amp specific styles inline
168
-		add_action( 'amp_post_template_css', array(
166
+		add_action('amp_post_template_css', array(
169 167
 			$this,
170 168
 			'amp_post_template_css',
171
-		) );
169
+		));
172 170
 
173
-		$wp_json_base = get_rest_url() . WL_REST_ROUTE_DEFAULT_NAMESPACE;
171
+		$wp_json_base = get_rest_url().WL_REST_ROUTE_DEFAULT_NAMESPACE;
174 172
 
175 173
 		$query_posts = array(
176 174
 			'post_id' => $current_post->ID,
177
-			'limit'   => apply_filters( 'wl_faceted_search_limit', $shortcode_atts['limit'] ),
175
+			'limit'   => apply_filters('wl_faceted_search_limit', $shortcode_atts['limit']),
178 176
 			'type'    => 'posts',
179 177
 		);
180 178
 
181 179
 		$query_facets = array(
182 180
 			'post_id' => $current_post->ID,
183
-			'limit'   => apply_filters( 'wl_faceted_search_limit', $shortcode_atts['limit'] ),
181
+			'limit'   => apply_filters('wl_faceted_search_limit', $shortcode_atts['limit']),
184 182
 			'type'    => 'facets',
185 183
 			'l10n'    => array(
186
-				'what'  => _x( 'What', 'Faceted Search Widget', 'wordlift' ),
187
-				'who'   => _x( 'Who', 'Faceted Search Widget', 'wordlift' ),
188
-				'where' => _x( 'Where', 'Faceted Search Widget', 'wordlift' ),
189
-				'when'  => _x( 'When', 'Faceted Search Widget', 'wordlift' ),
184
+				'what'  => _x('What', 'Faceted Search Widget', 'wordlift'),
185
+				'who'   => _x('Who', 'Faceted Search Widget', 'wordlift'),
186
+				'where' => _x('Where', 'Faceted Search Widget', 'wordlift'),
187
+				'when'  => _x('When', 'Faceted Search Widget', 'wordlift'),
190 188
 			),
191 189
 		);
192 190
 
193
-		if ( strpos( $wp_json_base, 'wp-json/' . WL_REST_ROUTE_DEFAULT_NAMESPACE ) ) {
191
+		if (strpos($wp_json_base, 'wp-json/'.WL_REST_ROUTE_DEFAULT_NAMESPACE)) {
194 192
 			$delimiter = '?';
195 193
 		} else {
196 194
 			$delimiter = '&';
@@ -198,14 +196,14 @@  discard block
 block discarded – undo
198 196
 
199 197
 		// Use a protocol-relative URL as amp-list spec says that URL's protocol must be HTTPS.
200 198
 		// This is a hackish way, but this works for http and https URLs
201
-		$wp_json_url_posts  = str_replace( array(
199
+		$wp_json_url_posts = str_replace(array(
202 200
 				'http:',
203 201
 				'https:',
204
-			), '', $wp_json_base ) . '/faceted-search' . $delimiter . http_build_query( $query_posts );
205
-		$wp_json_url_facets = str_replace( array(
202
+			), '', $wp_json_base).'/faceted-search'.$delimiter.http_build_query($query_posts);
203
+		$wp_json_url_facets = str_replace(array(
206 204
 				'http:',
207 205
 				'https:',
208
-			), '', $wp_json_base ) . '/faceted-search' . $delimiter . http_build_query( $query_facets );
206
+			), '', $wp_json_base).'/faceted-search'.$delimiter.http_build_query($query_facets);
209 207
 
210 208
 		/*
211 209
 		 * Notes about amp code:
@@ -317,7 +315,7 @@  discard block
 block discarded – undo
317 315
 	 * @since 3.20.0
318 316
 	 */
319 317
 	public function amp_post_template_css() {
320
-		echo file_get_contents( dirname( plugin_dir_url( __FILE__ ) ) . '/css/wordlift-amp-custom.min.css' );
318
+		echo file_get_contents(dirname(plugin_dir_url(__FILE__)).'/css/wordlift-amp-custom.min.css');
321 319
 	}
322 320
 
323 321
 }
Please login to merge, or discard this patch.
src/public/class-wordlift-amp-service.php 2 patches
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -21,75 +21,75 @@
 block discarded – undo
21 21
  */
22 22
 class Wordlift_AMP_Service {
23 23
 
24
-	/**
25
-	 * The {@link \Wordlift_Jsonld_Service} instance.
26
-	 *
27
-	 * @since 3.19.1
28
-	 * @access private
29
-	 * @var \Wordlift_Jsonld_Service $jsonld_service The {@link \Wordlift_Jsonld_Service} instance.
30
-	 */
31
-	private $jsonld_service;
24
+    /**
25
+     * The {@link \Wordlift_Jsonld_Service} instance.
26
+     *
27
+     * @since 3.19.1
28
+     * @access private
29
+     * @var \Wordlift_Jsonld_Service $jsonld_service The {@link \Wordlift_Jsonld_Service} instance.
30
+     */
31
+    private $jsonld_service;
32 32
 
33
-	/**
34
-	 * Create a {@link Wordlift_AMP_Service} instance.
35
-	 * @since 3.19.1
36
-	 *
37
-	 * @param \Wordlift_Jsonld_Service $jsonld_service
38
-	 */
39
-	function __construct( $jsonld_service ) {
33
+    /**
34
+     * Create a {@link Wordlift_AMP_Service} instance.
35
+     * @since 3.19.1
36
+     *
37
+     * @param \Wordlift_Jsonld_Service $jsonld_service
38
+     */
39
+    function __construct( $jsonld_service ) {
40 40
 
41
-		$this->jsonld_service = $jsonld_service;
41
+        $this->jsonld_service = $jsonld_service;
42 42
 
43
-		add_action( 'amp_init', array( $this, 'register_entity_cpt_with_amp_plugin', ) );
44
-		add_filter( 'amp_post_template_metadata', array( $this, 'amp_post_template_metadata', ), 99, 2 );
43
+        add_action( 'amp_init', array( $this, 'register_entity_cpt_with_amp_plugin', ) );
44
+        add_filter( 'amp_post_template_metadata', array( $this, 'amp_post_template_metadata', ), 99, 2 );
45 45
 
46
-	}
46
+    }
47 47
 
48
-	/**
49
-	 * Register the `entity` post type with the AMP plugin.
50
-	 *
51
-	 * @since 3.12.0
52
-	 */
53
-	function register_entity_cpt_with_amp_plugin() {
48
+    /**
49
+     * Register the `entity` post type with the AMP plugin.
50
+     *
51
+     * @since 3.12.0
52
+     */
53
+    function register_entity_cpt_with_amp_plugin() {
54 54
 
55
-		if ( ! defined( 'AMP_QUERY_VAR' ) ) {
56
-			return;
57
-		}
55
+        if ( ! defined( 'AMP_QUERY_VAR' ) ) {
56
+            return;
57
+        }
58 58
 
59
-		foreach ( Wordlift_Entity_Service::valid_entity_post_types() as $post_type ) {
60
-			// Do not change anything for posts and pages.
61
-			if ( 'post' === $post_type || 'page' === $post_type ) {
62
-				continue;
63
-			}
64
-			add_post_type_support( $post_type, AMP_QUERY_VAR );
65
-		}
59
+        foreach ( Wordlift_Entity_Service::valid_entity_post_types() as $post_type ) {
60
+            // Do not change anything for posts and pages.
61
+            if ( 'post' === $post_type || 'page' === $post_type ) {
62
+                continue;
63
+            }
64
+            add_post_type_support( $post_type, AMP_QUERY_VAR );
65
+        }
66 66
 
67
-	}
67
+    }
68 68
 
69
-	/**
70
-	 * Filters Schema.org metadata for a post.
71
-	 *
72
-	 * @since 3.19.1
73
-	 *
74
-	 * @param array $metadata Metadata.
75
-	 * @param WP_Post $post Post.
76
-	 *
77
-	 * @return array Return WordLift's generated JSON-LD.
78
-	 */
79
-	function amp_post_template_metadata( $metadata, $post ) {
69
+    /**
70
+     * Filters Schema.org metadata for a post.
71
+     *
72
+     * @since 3.19.1
73
+     *
74
+     * @param array $metadata Metadata.
75
+     * @param WP_Post $post Post.
76
+     *
77
+     * @return array Return WordLift's generated JSON-LD.
78
+     */
79
+    function amp_post_template_metadata( $metadata, $post ) {
80 80
 
81
-		return $this->jsonld_service->get_jsonld( false, $post->ID );
82
-	}
81
+        return $this->jsonld_service->get_jsonld( false, $post->ID );
82
+    }
83 83
 
84
-	/**
85
-	 * Check if current page is amp endpoint.
86
-	 *
87
-	 * @since 3.20.0
88
-	 * 
89
-	 * @return bool
90
-	 */
91
-	public static function is_amp_endpoint() {
92
-		return function_exists('is_amp_endpoint') && is_amp_endpoint();
93
-	}
84
+    /**
85
+     * Check if current page is amp endpoint.
86
+     *
87
+     * @since 3.20.0
88
+     * 
89
+     * @return bool
90
+     */
91
+    public static function is_amp_endpoint() {
92
+        return function_exists('is_amp_endpoint') && is_amp_endpoint();
93
+    }
94 94
 
95 95
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
 	 *
37 37
 	 * @param \Wordlift_Jsonld_Service $jsonld_service
38 38
 	 */
39
-	function __construct( $jsonld_service ) {
39
+	function __construct($jsonld_service) {
40 40
 
41 41
 		$this->jsonld_service = $jsonld_service;
42 42
 
43
-		add_action( 'amp_init', array( $this, 'register_entity_cpt_with_amp_plugin', ) );
44
-		add_filter( 'amp_post_template_metadata', array( $this, 'amp_post_template_metadata', ), 99, 2 );
43
+		add_action('amp_init', array($this, 'register_entity_cpt_with_amp_plugin',));
44
+		add_filter('amp_post_template_metadata', array($this, 'amp_post_template_metadata',), 99, 2);
45 45
 
46 46
 	}
47 47
 
@@ -52,16 +52,16 @@  discard block
 block discarded – undo
52 52
 	 */
53 53
 	function register_entity_cpt_with_amp_plugin() {
54 54
 
55
-		if ( ! defined( 'AMP_QUERY_VAR' ) ) {
55
+		if ( ! defined('AMP_QUERY_VAR')) {
56 56
 			return;
57 57
 		}
58 58
 
59
-		foreach ( Wordlift_Entity_Service::valid_entity_post_types() as $post_type ) {
59
+		foreach (Wordlift_Entity_Service::valid_entity_post_types() as $post_type) {
60 60
 			// Do not change anything for posts and pages.
61
-			if ( 'post' === $post_type || 'page' === $post_type ) {
61
+			if ('post' === $post_type || 'page' === $post_type) {
62 62
 				continue;
63 63
 			}
64
-			add_post_type_support( $post_type, AMP_QUERY_VAR );
64
+			add_post_type_support($post_type, AMP_QUERY_VAR);
65 65
 		}
66 66
 
67 67
 	}
@@ -76,9 +76,9 @@  discard block
 block discarded – undo
76 76
 	 *
77 77
 	 * @return array Return WordLift's generated JSON-LD.
78 78
 	 */
79
-	function amp_post_template_metadata( $metadata, $post ) {
79
+	function amp_post_template_metadata($metadata, $post) {
80 80
 
81
-		return $this->jsonld_service->get_jsonld( false, $post->ID );
81
+		return $this->jsonld_service->get_jsonld(false, $post->ID);
82 82
 	}
83 83
 
84 84
 	/**
Please login to merge, or discard this patch.
src/public/class-wordlift-navigator-shortcode.php 2 patches
Indentation   +153 added lines, -153 removed lines patch added patch discarded remove patch
@@ -17,154 +17,154 @@  discard block
 block discarded – undo
17 17
  */
18 18
 class Wordlift_Navigator_Shortcode extends Wordlift_Shortcode {
19 19
 
20
-	/**
21
-	 * {@inheritdoc}
22
-	 */
23
-	const SHORTCODE = 'wl_navigator';
24
-
25
-	/**
26
-	 * {@inheritdoc}
27
-	 */
28
-	public function render( $atts ) {
29
-
30
-		return Wordlift_AMP_Service::is_amp_endpoint() ? $this->amp_shortcode( $atts )
31
-			: $this->web_shortcode( $atts );
32
-	}
33
-
34
-	/**
35
-	 * Shared function used by web_shortcode and amp_shortcode
36
-	 * Bootstrap logic for attributes extraction and boolean filtering
37
-	 *
38
-	 * @since      3.20.0
39
-	 *
40
-	 * @param array $atts Shortcode attributes.
41
-	 *
42
-	 * @return array $shortcode_atts
43
-	 */
44
-	private function make_shortcode_atts( $atts ) {
45
-
46
-		// Extract attributes and set default values.
47
-		$shortcode_atts = shortcode_atts( array(
48
-			'title'          => __( 'Related articles', 'wordlift' ),
49
-			'with_carousel'  => true,
50
-			'squared_thumbs' => false,
51
-		), $atts );
52
-
53
-		foreach (
54
-			array(
55
-				'with_carousel',
56
-				'squared_thumbs',
57
-			) as $att
58
-		) {
59
-
60
-			// See http://wordpress.stackexchange.com/questions/119294/pass-boolean-value-in-shortcode
61
-			$shortcode_atts[ $att ] = filter_var(
62
-				$shortcode_atts[ $att ], FILTER_VALIDATE_BOOLEAN
63
-			);
64
-		}
65
-
66
-		return $shortcode_atts;
67
-	}
68
-
69
-	/**
70
-	 * Function in charge of diplaying the [wl-navigator] in web mode.
71
-	 *
72
-	 * @since 3.20.0
73
-	 *
74
-	 * @param array $atts Shortcode attributes.
75
-	 *
76
-	 * @return string Shortcode HTML for web
77
-	 */
78
-	private function web_shortcode( $atts ) {
79
-
80
-		// attributes extraction and boolean filtering
81
-		$shortcode_atts = $this->make_shortcode_atts( $atts );
82
-
83
-		/*
20
+    /**
21
+     * {@inheritdoc}
22
+     */
23
+    const SHORTCODE = 'wl_navigator';
24
+
25
+    /**
26
+     * {@inheritdoc}
27
+     */
28
+    public function render( $atts ) {
29
+
30
+        return Wordlift_AMP_Service::is_amp_endpoint() ? $this->amp_shortcode( $atts )
31
+            : $this->web_shortcode( $atts );
32
+    }
33
+
34
+    /**
35
+     * Shared function used by web_shortcode and amp_shortcode
36
+     * Bootstrap logic for attributes extraction and boolean filtering
37
+     *
38
+     * @since      3.20.0
39
+     *
40
+     * @param array $atts Shortcode attributes.
41
+     *
42
+     * @return array $shortcode_atts
43
+     */
44
+    private function make_shortcode_atts( $atts ) {
45
+
46
+        // Extract attributes and set default values.
47
+        $shortcode_atts = shortcode_atts( array(
48
+            'title'          => __( 'Related articles', 'wordlift' ),
49
+            'with_carousel'  => true,
50
+            'squared_thumbs' => false,
51
+        ), $atts );
52
+
53
+        foreach (
54
+            array(
55
+                'with_carousel',
56
+                'squared_thumbs',
57
+            ) as $att
58
+        ) {
59
+
60
+            // See http://wordpress.stackexchange.com/questions/119294/pass-boolean-value-in-shortcode
61
+            $shortcode_atts[ $att ] = filter_var(
62
+                $shortcode_atts[ $att ], FILTER_VALIDATE_BOOLEAN
63
+            );
64
+        }
65
+
66
+        return $shortcode_atts;
67
+    }
68
+
69
+    /**
70
+     * Function in charge of diplaying the [wl-navigator] in web mode.
71
+     *
72
+     * @since 3.20.0
73
+     *
74
+     * @param array $atts Shortcode attributes.
75
+     *
76
+     * @return string Shortcode HTML for web
77
+     */
78
+    private function web_shortcode( $atts ) {
79
+
80
+        // attributes extraction and boolean filtering
81
+        $shortcode_atts = $this->make_shortcode_atts( $atts );
82
+
83
+        /*
84 84
 		 * Display the navigator only on the single post/page.
85 85
 		 *
86 86
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/831
87 87
 		 *
88 88
 		 * @since 3.19.3 we're using `is_singular` instead of `is_single` to allow the navigator also on pages.
89 89
 		 */
90
-		// avoid building the widget when there is a list of posts.
91
-		if ( ! is_singular() ) {
92
-			return '';
93
-		}
94
-
95
-		$current_post = get_post();
96
-
97
-		// Enqueue common shortcode scripts.
98
-		$this->enqueue_scripts();
99
-
100
-		// Use the registered style which define an optional dependency to font-awesome.
101
-		//
102
-		// @see https://github.com/insideout10/wordlift-plugin/issues/699
103
-		//		wp_enqueue_style( 'wordlift-ui', dirname( plugin_dir_url( __FILE__ ) ) . '/css/wordlift-ui.min.css' );
104
-		wp_enqueue_style( 'wordlift-ui' );
105
-
106
-		$navigator_id = uniqid( 'wl-navigator-widget-' );
107
-
108
-		wp_localize_script( 'wordlift-ui', 'wl_navigator_params', array(
109
-				'ajax_url' => admin_url( 'admin-ajax.php' ),
110
-				'action'   => 'wl_navigator',
111
-				'post_id'  => $current_post->ID,
112
-				'attrs'    => $shortcode_atts,
113
-			)
114
-		);
115
-
116
-		return "<div id='$navigator_id' class='wl-navigator-widget'></div>";
117
-	}
118
-
119
-	/**
120
-	 * Function in charge of diplaying the [wl-faceted-search] in amp mode.
121
-	 *
122
-	 * @since 3.20.0
123
-	 *
124
-	 * @param array $atts Shortcode attributes.
125
-	 *
126
-	 * @return string Shortcode HTML for amp
127
-	 */
128
-	private function amp_shortcode( $atts ) {
129
-
130
-		// attributes extraction and boolean filtering
131
-		$shortcode_atts = $this->make_shortcode_atts( $atts );
132
-
133
-		// avoid building the widget when there is a list of posts.
134
-		if ( ! is_singular() ) {
135
-			return '';
136
-		}
137
-
138
-		$current_post = get_post();
139
-
140
-		// Inject amp specific styles inline
141
-		add_action( 'amp_post_template_css', array(
142
-			$this,
143
-			'amp_post_template_css',
144
-		) );
145
-
146
-		$navigator_id = uniqid( 'wl-navigator-widget-' );
147
-
148
-		$wp_json_base = get_rest_url() . WL_REST_ROUTE_DEFAULT_NAMESPACE;
149
-
150
-		$query_posts = array(
151
-			'post_id' => $current_post->ID,
152
-		);
153
-
154
-		if ( strpos( $wp_json_base, 'wp-json/' . WL_REST_ROUTE_DEFAULT_NAMESPACE ) ) {
155
-			$delimiter = '?';
156
-		} else {
157
-			$delimiter = '&';
158
-		}
159
-
160
-		// Use a protocol-relative URL as amp-list spec says that URL's protocol must be HTTPS.
161
-		// This is a hackish way, but this works for http and https URLs
162
-		$wp_json_url_posts = str_replace( array(
163
-				'http:',
164
-				'https:',
165
-			), '', $wp_json_base ) . '/navigator' . $delimiter . http_build_query( $query_posts );
166
-
167
-		return <<<HTML
90
+        // avoid building the widget when there is a list of posts.
91
+        if ( ! is_singular() ) {
92
+            return '';
93
+        }
94
+
95
+        $current_post = get_post();
96
+
97
+        // Enqueue common shortcode scripts.
98
+        $this->enqueue_scripts();
99
+
100
+        // Use the registered style which define an optional dependency to font-awesome.
101
+        //
102
+        // @see https://github.com/insideout10/wordlift-plugin/issues/699
103
+        //		wp_enqueue_style( 'wordlift-ui', dirname( plugin_dir_url( __FILE__ ) ) . '/css/wordlift-ui.min.css' );
104
+        wp_enqueue_style( 'wordlift-ui' );
105
+
106
+        $navigator_id = uniqid( 'wl-navigator-widget-' );
107
+
108
+        wp_localize_script( 'wordlift-ui', 'wl_navigator_params', array(
109
+                'ajax_url' => admin_url( 'admin-ajax.php' ),
110
+                'action'   => 'wl_navigator',
111
+                'post_id'  => $current_post->ID,
112
+                'attrs'    => $shortcode_atts,
113
+            )
114
+        );
115
+
116
+        return "<div id='$navigator_id' class='wl-navigator-widget'></div>";
117
+    }
118
+
119
+    /**
120
+     * Function in charge of diplaying the [wl-faceted-search] in amp mode.
121
+     *
122
+     * @since 3.20.0
123
+     *
124
+     * @param array $atts Shortcode attributes.
125
+     *
126
+     * @return string Shortcode HTML for amp
127
+     */
128
+    private function amp_shortcode( $atts ) {
129
+
130
+        // attributes extraction and boolean filtering
131
+        $shortcode_atts = $this->make_shortcode_atts( $atts );
132
+
133
+        // avoid building the widget when there is a list of posts.
134
+        if ( ! is_singular() ) {
135
+            return '';
136
+        }
137
+
138
+        $current_post = get_post();
139
+
140
+        // Inject amp specific styles inline
141
+        add_action( 'amp_post_template_css', array(
142
+            $this,
143
+            'amp_post_template_css',
144
+        ) );
145
+
146
+        $navigator_id = uniqid( 'wl-navigator-widget-' );
147
+
148
+        $wp_json_base = get_rest_url() . WL_REST_ROUTE_DEFAULT_NAMESPACE;
149
+
150
+        $query_posts = array(
151
+            'post_id' => $current_post->ID,
152
+        );
153
+
154
+        if ( strpos( $wp_json_base, 'wp-json/' . WL_REST_ROUTE_DEFAULT_NAMESPACE ) ) {
155
+            $delimiter = '?';
156
+        } else {
157
+            $delimiter = '&';
158
+        }
159
+
160
+        // Use a protocol-relative URL as amp-list spec says that URL's protocol must be HTTPS.
161
+        // This is a hackish way, but this works for http and https URLs
162
+        $wp_json_url_posts = str_replace( array(
163
+                'http:',
164
+                'https:',
165
+            ), '', $wp_json_base ) . '/navigator' . $delimiter . http_build_query( $query_posts );
166
+
167
+        return <<<HTML
168 168
 		<div id="{$navigator_id}" class="wl-navigator-widget">
169 169
 			<h3 class="wl-headline">{$shortcode_atts['title']}</h3>
170 170
 			<amp-list 
@@ -221,16 +221,16 @@  discard block
 block discarded – undo
221 221
 			</amp-list>	
222 222
 		</div>
223 223
 HTML;
224
-	}
225
-
226
-	/**
227
-	 * Customize the CSS when in AMP.
228
-	 * Should echo (not return) CSS code
229
-	 *
230
-	 * @since 3.20.0
231
-	 */
232
-	public function amp_post_template_css() {
233
-		echo file_get_contents( dirname( plugin_dir_url( __FILE__ ) ) . '/css/wordlift-amp-custom.min.css' );
234
-	}
224
+    }
225
+
226
+    /**
227
+     * Customize the CSS when in AMP.
228
+     * Should echo (not return) CSS code
229
+     *
230
+     * @since 3.20.0
231
+     */
232
+    public function amp_post_template_css() {
233
+        echo file_get_contents( dirname( plugin_dir_url( __FILE__ ) ) . '/css/wordlift-amp-custom.min.css' );
234
+    }
235 235
 
236 236
 }
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
 	/**
26 26
 	 * {@inheritdoc}
27 27
 	 */
28
-	public function render( $atts ) {
28
+	public function render($atts) {
29 29
 
30
-		return Wordlift_AMP_Service::is_amp_endpoint() ? $this->amp_shortcode( $atts )
31
-			: $this->web_shortcode( $atts );
30
+		return Wordlift_AMP_Service::is_amp_endpoint() ? $this->amp_shortcode($atts)
31
+			: $this->web_shortcode($atts);
32 32
 	}
33 33
 
34 34
 	/**
@@ -41,14 +41,14 @@  discard block
 block discarded – undo
41 41
 	 *
42 42
 	 * @return array $shortcode_atts
43 43
 	 */
44
-	private function make_shortcode_atts( $atts ) {
44
+	private function make_shortcode_atts($atts) {
45 45
 
46 46
 		// Extract attributes and set default values.
47
-		$shortcode_atts = shortcode_atts( array(
48
-			'title'          => __( 'Related articles', 'wordlift' ),
47
+		$shortcode_atts = shortcode_atts(array(
48
+			'title'          => __('Related articles', 'wordlift'),
49 49
 			'with_carousel'  => true,
50 50
 			'squared_thumbs' => false,
51
-		), $atts );
51
+		), $atts);
52 52
 
53 53
 		foreach (
54 54
 			array(
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
 		) {
59 59
 
60 60
 			// See http://wordpress.stackexchange.com/questions/119294/pass-boolean-value-in-shortcode
61
-			$shortcode_atts[ $att ] = filter_var(
62
-				$shortcode_atts[ $att ], FILTER_VALIDATE_BOOLEAN
61
+			$shortcode_atts[$att] = filter_var(
62
+				$shortcode_atts[$att], FILTER_VALIDATE_BOOLEAN
63 63
 			);
64 64
 		}
65 65
 
@@ -75,10 +75,10 @@  discard block
 block discarded – undo
75 75
 	 *
76 76
 	 * @return string Shortcode HTML for web
77 77
 	 */
78
-	private function web_shortcode( $atts ) {
78
+	private function web_shortcode($atts) {
79 79
 
80 80
 		// attributes extraction and boolean filtering
81
-		$shortcode_atts = $this->make_shortcode_atts( $atts );
81
+		$shortcode_atts = $this->make_shortcode_atts($atts);
82 82
 
83 83
 		/*
84 84
 		 * Display the navigator only on the single post/page.
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 		 * @since 3.19.3 we're using `is_singular` instead of `is_single` to allow the navigator also on pages.
89 89
 		 */
90 90
 		// avoid building the widget when there is a list of posts.
91
-		if ( ! is_singular() ) {
91
+		if ( ! is_singular()) {
92 92
 			return '';
93 93
 		}
94 94
 
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
101 101
 		//
102 102
 		// @see https://github.com/insideout10/wordlift-plugin/issues/699
103 103
 		//		wp_enqueue_style( 'wordlift-ui', dirname( plugin_dir_url( __FILE__ ) ) . '/css/wordlift-ui.min.css' );
104
-		wp_enqueue_style( 'wordlift-ui' );
104
+		wp_enqueue_style('wordlift-ui');
105 105
 
106
-		$navigator_id = uniqid( 'wl-navigator-widget-' );
106
+		$navigator_id = uniqid('wl-navigator-widget-');
107 107
 
108
-		wp_localize_script( 'wordlift-ui', 'wl_navigator_params', array(
109
-				'ajax_url' => admin_url( 'admin-ajax.php' ),
108
+		wp_localize_script('wordlift-ui', 'wl_navigator_params', array(
109
+				'ajax_url' => admin_url('admin-ajax.php'),
110 110
 				'action'   => 'wl_navigator',
111 111
 				'post_id'  => $current_post->ID,
112 112
 				'attrs'    => $shortcode_atts,
@@ -125,33 +125,33 @@  discard block
 block discarded – undo
125 125
 	 *
126 126
 	 * @return string Shortcode HTML for amp
127 127
 	 */
128
-	private function amp_shortcode( $atts ) {
128
+	private function amp_shortcode($atts) {
129 129
 
130 130
 		// attributes extraction and boolean filtering
131
-		$shortcode_atts = $this->make_shortcode_atts( $atts );
131
+		$shortcode_atts = $this->make_shortcode_atts($atts);
132 132
 
133 133
 		// avoid building the widget when there is a list of posts.
134
-		if ( ! is_singular() ) {
134
+		if ( ! is_singular()) {
135 135
 			return '';
136 136
 		}
137 137
 
138 138
 		$current_post = get_post();
139 139
 
140 140
 		// Inject amp specific styles inline
141
-		add_action( 'amp_post_template_css', array(
141
+		add_action('amp_post_template_css', array(
142 142
 			$this,
143 143
 			'amp_post_template_css',
144
-		) );
144
+		));
145 145
 
146
-		$navigator_id = uniqid( 'wl-navigator-widget-' );
146
+		$navigator_id = uniqid('wl-navigator-widget-');
147 147
 
148
-		$wp_json_base = get_rest_url() . WL_REST_ROUTE_DEFAULT_NAMESPACE;
148
+		$wp_json_base = get_rest_url().WL_REST_ROUTE_DEFAULT_NAMESPACE;
149 149
 
150 150
 		$query_posts = array(
151 151
 			'post_id' => $current_post->ID,
152 152
 		);
153 153
 
154
-		if ( strpos( $wp_json_base, 'wp-json/' . WL_REST_ROUTE_DEFAULT_NAMESPACE ) ) {
154
+		if (strpos($wp_json_base, 'wp-json/'.WL_REST_ROUTE_DEFAULT_NAMESPACE)) {
155 155
 			$delimiter = '?';
156 156
 		} else {
157 157
 			$delimiter = '&';
@@ -159,10 +159,10 @@  discard block
 block discarded – undo
159 159
 
160 160
 		// Use a protocol-relative URL as amp-list spec says that URL's protocol must be HTTPS.
161 161
 		// This is a hackish way, but this works for http and https URLs
162
-		$wp_json_url_posts = str_replace( array(
162
+		$wp_json_url_posts = str_replace(array(
163 163
 				'http:',
164 164
 				'https:',
165
-			), '', $wp_json_base ) . '/navigator' . $delimiter . http_build_query( $query_posts );
165
+			), '', $wp_json_base).'/navigator'.$delimiter.http_build_query($query_posts);
166 166
 
167 167
 		return <<<HTML
168 168
 		<div id="{$navigator_id}" class="wl-navigator-widget">
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 	 * @since 3.20.0
231 231
 	 */
232 232
 	public function amp_post_template_css() {
233
-		echo file_get_contents( dirname( plugin_dir_url( __FILE__ ) ) . '/css/wordlift-amp-custom.min.css' );
233
+		echo file_get_contents(dirname(plugin_dir_url(__FILE__)).'/css/wordlift-amp-custom.min.css');
234 234
 	}
235 235
 
236 236
 }
Please login to merge, or discard this patch.
src/includes/class-wordlift.php 2 patches
Indentation   +1589 added lines, -1589 removed lines patch added patch discarded remove patch
@@ -28,1431 +28,1431 @@  discard block
 block discarded – undo
28 28
  */
29 29
 class Wordlift {
30 30
 
31
-	//<editor-fold desc="## FIELDS">
32
-
33
-	/**
34
-	 * The loader that's responsible for maintaining and registering all hooks that power
35
-	 * the plugin.
36
-	 *
37
-	 * @since    1.0.0
38
-	 * @access   protected
39
-	 * @var      Wordlift_Loader $loader Maintains and registers all hooks for the plugin.
40
-	 */
41
-	protected $loader;
42
-
43
-	/**
44
-	 * The unique identifier of this plugin.
45
-	 *
46
-	 * @since    1.0.0
47
-	 * @access   protected
48
-	 * @var      string $plugin_name The string used to uniquely identify this plugin.
49
-	 */
50
-	protected $plugin_name;
51
-
52
-	/**
53
-	 * The current version of the plugin.
54
-	 *
55
-	 * @since    1.0.0
56
-	 * @access   protected
57
-	 * @var      string $version The current version of the plugin.
58
-	 */
59
-	protected $version;
60
-
61
-	/**
62
-	 * The {@link Wordlift_Tinymce_Adapter} instance.
63
-	 *
64
-	 * @since  3.12.0
65
-	 * @access protected
66
-	 * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance.
67
-	 */
68
-	protected $tinymce_adapter;
69
-
70
-	/**
71
-	 * The Thumbnail service.
72
-	 *
73
-	 * @since  3.1.5
74
-	 * @access private
75
-	 * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
76
-	 */
77
-	private $thumbnail_service;
78
-
79
-	/**
80
-	 * The UI service.
81
-	 *
82
-	 * @since  3.2.0
83
-	 * @access private
84
-	 * @var \Wordlift_UI_Service $ui_service The UI service.
85
-	 */
86
-	private $ui_service;
87
-
88
-	/**
89
-	 * The Schema service.
90
-	 *
91
-	 * @since  3.3.0
92
-	 * @access protected
93
-	 * @var \Wordlift_Schema_Service $schema_service The Schema service.
94
-	 */
95
-	protected $schema_service;
96
-
97
-	/**
98
-	 * The Entity service.
99
-	 *
100
-	 * @since  3.1.0
101
-	 * @access protected
102
-	 * @var \Wordlift_Entity_Service $entity_service The Entity service.
103
-	 */
104
-	protected $entity_service;
105
-
106
-	/**
107
-	 * The Topic Taxonomy service.
108
-	 *
109
-	 * @since  3.5.0
110
-	 * @access private
111
-	 * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
112
-	 */
113
-	private $topic_taxonomy_service;
114
-
115
-	/**
116
-	 * The Entity Types Taxonomy service.
117
-	 *
118
-	 * @since  3.18.0
119
-	 * @access private
120
-	 * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service.
121
-	 */
122
-	private $entity_types_taxonomy_service;
123
-
124
-	/**
125
-	 * The User service.
126
-	 *
127
-	 * @since  3.1.7
128
-	 * @access protected
129
-	 * @var \Wordlift_User_Service $user_service The User service.
130
-	 */
131
-	protected $user_service;
132
-
133
-	/**
134
-	 * The Timeline service.
135
-	 *
136
-	 * @since  3.1.0
137
-	 * @access private
138
-	 * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
139
-	 */
140
-	private $timeline_service;
141
-
142
-	/**
143
-	 * The Redirect service.
144
-	 *
145
-	 * @since  3.2.0
146
-	 * @access private
147
-	 * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
148
-	 */
149
-	private $redirect_service;
150
-
151
-	/**
152
-	 * The Notice service.
153
-	 *
154
-	 * @since  3.3.0
155
-	 * @access private
156
-	 * @var \Wordlift_Notice_Service $notice_service The Notice service.
157
-	 */
158
-	private $notice_service;
159
-
160
-	/**
161
-	 * The Entity list customization.
162
-	 *
163
-	 * @since  3.3.0
164
-	 * @access protected
165
-	 * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service.
166
-	 */
167
-	protected $entity_list_service;
168
-
169
-	/**
170
-	 * The Entity Types Taxonomy Walker.
171
-	 *
172
-	 * @since  3.1.0
173
-	 * @access private
174
-	 * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
175
-	 */
176
-	private $entity_types_taxonomy_walker;
177
-
178
-	/**
179
-	 * The ShareThis service.
180
-	 *
181
-	 * @since  3.2.0
182
-	 * @access private
183
-	 * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
184
-	 */
185
-	private $sharethis_service;
186
-
187
-	/**
188
-	 * The PrimaShop adapter.
189
-	 *
190
-	 * @since  3.2.3
191
-	 * @access private
192
-	 * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
193
-	 */
194
-	private $primashop_adapter;
195
-
196
-	/**
197
-	 * The WordLift Dashboard adapter.
198
-	 *
199
-	 * @since  3.4.0
200
-	 * @access private
201
-	 * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
202
-	 */
203
-	private $dashboard_service;
204
-
205
-	/**
206
-	 * The entity type service.
207
-	 *
208
-	 * @since  3.6.0
209
-	 * @access private
210
-	 * @var \Wordlift_Entity_Post_Type_Service
211
-	 */
212
-	private $entity_post_type_service;
213
-
214
-	/**
215
-	 * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
216
-	 *
217
-	 * @since  3.6.0
218
-	 * @access private
219
-	 * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance.
220
-	 */
221
-	private $entity_link_service;
222
-
223
-	/**
224
-	 * A {@link Wordlift_Sparql_Service} instance.
225
-	 *
226
-	 * @since    3.6.0
227
-	 * @access   protected
228
-	 * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
229
-	 */
230
-	protected $sparql_service;
231
-
232
-	/**
233
-	 * A {@link Wordlift_Import_Service} instance.
234
-	 *
235
-	 * @since  3.6.0
236
-	 * @access private
237
-	 * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
238
-	 */
239
-	private $import_service;
240
-
241
-	/**
242
-	 * A {@link Wordlift_Rebuild_Service} instance.
243
-	 *
244
-	 * @since  3.6.0
245
-	 * @access private
246
-	 * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
247
-	 */
248
-	private $rebuild_service;
249
-
250
-	/**
251
-	 * A {@link Wordlift_Jsonld_Service} instance.
252
-	 *
253
-	 * @since  3.7.0
254
-	 * @access protected
255
-	 * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
256
-	 */
257
-	protected $jsonld_service;
258
-
259
-	/**
260
-	 * A {@link Wordlift_Website_Jsonld_Converter} instance.
261
-	 *
262
-	 * @since  3.14.0
263
-	 * @access protected
264
-	 * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance.
265
-	 */
266
-	protected $jsonld_website_converter;
267
-
268
-	/**
269
-	 * A {@link Wordlift_Property_Factory} instance.
270
-	 *
271
-	 * @since  3.7.0
272
-	 * @access private
273
-	 * @var \Wordlift_Property_Factory $property_factory
274
-	 */
275
-	private $property_factory;
276
-
277
-	/**
278
-	 * The 'Download Your Data' page.
279
-	 *
280
-	 * @since  3.6.0
281
-	 * @access private
282
-	 * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
283
-	 */
284
-	private $download_your_data_page;
285
-
286
-	/**
287
-	 * The 'WordLift Settings' page.
288
-	 *
289
-	 * @since  3.11.0
290
-	 * @access protected
291
-	 * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page.
292
-	 */
293
-	protected $settings_page;
294
-
295
-	/**
296
-	 * The 'WordLift Batch analysis' page.
297
-	 *
298
-	 * @since  3.14.0
299
-	 * @access protected
300
-	 * @var \Wordlift_Batch_Analysis_Page $sbatch_analysis_page The 'WordLift batcch analysis' page.
301
-	 */
302
-	protected $batch_analysis_page;
303
-
304
-	/**
305
-	 * The install wizard page.
306
-	 *
307
-	 * @since  3.9.0
308
-	 * @access private
309
-	 * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
310
-	 */
311
-	private $admin_setup;
312
-
313
-	/**
314
-	 * The Content Filter Service hooks up to the 'the_content' filter and provides
315
-	 * linking of entities to their pages.
316
-	 *
317
-	 * @since  3.8.0
318
-	 * @access private
319
-	 * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
320
-	 */
321
-	private $content_filter_service;
322
-
323
-	/**
324
-	 * A {@link Wordlift_Key_Validation_Service} instance.
325
-	 *
326
-	 * @since  3.9.0
327
-	 * @access private
328
-	 * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
329
-	 */
330
-	private $key_validation_service;
331
-
332
-	/**
333
-	 * A {@link Wordlift_Rating_Service} instance.
334
-	 *
335
-	 * @since  3.10.0
336
-	 * @access private
337
-	 * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance.
338
-	 */
339
-	private $rating_service;
340
-
341
-	/**
342
-	 * A {@link Wordlift_Post_To_Jsonld_Converter} instance.
343
-	 *
344
-	 * @since  3.10.0
345
-	 * @access protected
346
-	 * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance.
347
-	 */
348
-	protected $post_to_jsonld_converter;
349
-
350
-	/**
351
-	 * A {@link Wordlift_Configuration_Service} instance.
352
-	 *
353
-	 * @since  3.10.0
354
-	 * @access protected
355
-	 * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance.
356
-	 */
357
-	protected $configuration_service;
358
-
359
-	/**
360
-	 * A {@link Wordlift_Install_Service} instance.
361
-	 *
362
-	 * @since  3.18.0
363
-	 * @access protected
364
-	 * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance.
365
-	 */
366
-	protected $install_service;
367
-
368
-	/**
369
-	 * A {@link Wordlift_Entity_Type_Service} instance.
370
-	 *
371
-	 * @since  3.10.0
372
-	 * @access protected
373
-	 * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance.
374
-	 */
375
-	protected $entity_type_service;
376
-
377
-	/**
378
-	 * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
379
-	 *
380
-	 * @since  3.10.0
381
-	 * @access protected
382
-	 * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
383
-	 */
384
-	protected $entity_post_to_jsonld_converter;
385
-
386
-	/**
387
-	 * A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
388
-	 *
389
-	 * @since  3.10.0
390
-	 * @access protected
391
-	 * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
392
-	 */
393
-	protected $postid_to_jsonld_converter;
394
-
395
-	/**
396
-	 * The {@link Wordlift_Admin_Status_Page} class.
397
-	 *
398
-	 * @since  3.9.8
399
-	 * @access private
400
-	 * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class.
401
-	 */
402
-	private $status_page;
403
-
404
-	/**
405
-	 * The {@link Wordlift_Category_Taxonomy_Service} instance.
406
-	 *
407
-	 * @since  3.11.0
408
-	 * @access protected
409
-	 * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance.
410
-	 */
411
-	protected $category_taxonomy_service;
412
-
413
-	/**
414
-	 * The {@link Wordlift_Entity_Page_Service} instance.
415
-	 *
416
-	 * @since  3.11.0
417
-	 * @access protected
418
-	 * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance.
419
-	 */
420
-	protected $entity_page_service;
421
-
422
-	/**
423
-	 * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
424
-	 *
425
-	 * @since  3.11.0
426
-	 * @access protected
427
-	 * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
428
-	 */
429
-	protected $settings_page_action_link;
430
-
431
-	/**
432
-	 * The {@link Wordlift_Publisher_Ajax_Adapter} instance.
433
-	 *
434
-	 * @since  3.11.0
435
-	 * @access protected
436
-	 * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
437
-	 */
438
-	protected $publisher_ajax_adapter;
439
-
440
-	/**
441
-	 * The {@link Wordlift_Admin_Input_Element} element renderer.
442
-	 *
443
-	 * @since  3.11.0
444
-	 * @access protected
445
-	 * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
446
-	 */
447
-	protected $input_element;
448
-
449
-	/**
450
-	 * The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
451
-	 *
452
-	 * @since  3.13.0
453
-	 * @access protected
454
-	 * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
455
-	 */
456
-	protected $radio_input_element;
457
-
458
-	/**
459
-	 * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
460
-	 *
461
-	 * @since  3.11.0
462
-	 * @access protected
463
-	 * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
464
-	 */
465
-	protected $language_select_element;
466
-
467
-	/**
468
-	 * The {@link Wordlift_Admin_Country_Select_Element} element renderer.
469
-	 *
470
-	 * @since  3.18.0
471
-	 * @access protected
472
-	 * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer.
473
-	 */
474
-	protected $country_select_element;
475
-
476
-	/**
477
-	 * The {@link Wordlift_Admin_Publisher_Element} element renderer.
478
-	 *
479
-	 * @since  3.11.0
480
-	 * @access protected
481
-	 * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
482
-	 */
483
-	protected $publisher_element;
484
-
485
-	/**
486
-	 * The {@link Wordlift_Admin_Select2_Element} element renderer.
487
-	 *
488
-	 * @since  3.11.0
489
-	 * @access protected
490
-	 * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
491
-	 */
492
-	protected $select2_element;
493
-
494
-	/**
495
-	 * The controller for the entity type list admin page
496
-	 *
497
-	 * @since  3.11.0
498
-	 * @access private
499
-	 * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
500
-	 */
501
-	private $entity_type_admin_page;
502
-
503
-	/**
504
-	 * The controller for the entity type settings admin page
505
-	 *
506
-	 * @since  3.11.0
507
-	 * @access private
508
-	 * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
509
-	 */
510
-	private $entity_type_settings_admin_page;
511
-
512
-	/**
513
-	 * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
514
-	 *
515
-	 * @since  3.11.0
516
-	 * @access protected
517
-	 * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
518
-	 */
519
-	protected $related_entities_cloud_widget;
520
-
521
-	/**
522
-	 * The {@link Wordlift_Admin_Author_Element} instance.
523
-	 *
524
-	 * @since  3.14.0
525
-	 * @access protected
526
-	 * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance.
527
-	 */
528
-	protected $author_element;
529
-
530
-	/**
531
-	 * The {@link Wordlift_Batch_Analysis_Service} instance.
532
-	 *
533
-	 * @since  3.14.0
534
-	 * @access protected
535
-	 * @var \Wordlift_Batch_Analysis_Service $batch_analysis_service The {@link Wordlift_Batch_Analysis_Service} instance.
536
-	 */
537
-	protected $batch_analysis_service;
538
-
539
-	/**
540
-	 * The {@link Wordlift_Sample_Data_Service} instance.
541
-	 *
542
-	 * @since  3.12.0
543
-	 * @access protected
544
-	 * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance.
545
-	 */
546
-	protected $sample_data_service;
547
-
548
-	/**
549
-	 * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
550
-	 *
551
-	 * @since  3.12.0
552
-	 * @access protected
553
-	 * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
554
-	 */
555
-	protected $sample_data_ajax_adapter;
556
-
557
-	/**
558
-	 * The {@link Wordlift_Batch_Analysis_Adapter} instance.
559
-	 *
560
-	 * @since  3.14.2
561
-	 * @access protected
562
-	 * @var \Wordlift_Batch_Analysis_Adapter $batch_analysis_adapter The {@link Wordlift_Batch_Analysis_Adapter} instance.
563
-	 */
564
-	private $batch_analysis_adapter;
565
-
566
-	/**
567
-	 * The {@link Wordlift_Relation_Rebuild_Service} instance.
568
-	 *
569
-	 * @since  3.14.3
570
-	 * @access private
571
-	 * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance.
572
-	 */
573
-	private $relation_rebuild_service;
574
-
575
-	/**
576
-	 * The {@link Wordlift_Relation_Rebuild_Adapter} instance.
577
-	 *
578
-	 * @since  3.14.3
579
-	 * @access private
580
-	 * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance.
581
-	 */
582
-	private $relation_rebuild_adapter;
583
-
584
-	/**
585
-	 * The {@link Wordlift_Reference_Rebuild_Service} instance.
586
-	 *
587
-	 * @since  3.18.0
588
-	 * @access private
589
-	 * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance.
590
-	 */
591
-	private $reference_rebuild_service;
592
-
593
-	/**
594
-	 * The {@link Wordlift_Google_Analytics_Export_Service} instance.
595
-	 *
596
-	 * @since  3.16.0
597
-	 * @access protected
598
-	 * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance.
599
-	 */
600
-	protected $google_analytics_export_service;
601
-
602
-	/**
603
-	 * {@link Wordlift}'s singleton instance.
604
-	 *
605
-	 * @since  3.15.0
606
-	 * @access protected
607
-	 * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance.
608
-	 */
609
-	protected $entity_type_adapter;
610
-
611
-	/**
612
-	 * The {@link Wordlift_Linked_Data_Service} instance.
613
-	 *
614
-	 * @since  3.15.0
615
-	 * @access protected
616
-	 * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance.
617
-	 */
618
-	protected $linked_data_service;
619
-
620
-	/**
621
-	 * The {@link Wordlift_Storage_Factory} instance.
622
-	 *
623
-	 * @since  3.15.0
624
-	 * @access protected
625
-	 * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance.
626
-	 */
627
-	protected $storage_factory;
628
-
629
-	/**
630
-	 * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
631
-	 *
632
-	 * @since  3.15.0
633
-	 * @access protected
634
-	 * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
635
-	 */
636
-	protected $rendition_factory;
637
-
638
-	/**
639
-	 * The {@link Wordlift_Autocomplete_Service} instance.
640
-	 *
641
-	 * @since  3.15.0
642
-	 * @access private
643
-	 * @var \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance.
644
-	 */
645
-	private $autocomplete_service;
646
-
647
-	/**
648
-	 * The {@link Wordlift_Autocomplete_Adapter} instance.
649
-	 *
650
-	 * @since  3.15.0
651
-	 * @access private
652
-	 * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance.
653
-	 */
654
-	private $autocomplete_adapter;
655
-
656
-	/**
657
-	 * The {@link Wordlift_Relation_Service} instance.
658
-	 *
659
-	 * @since  3.15.0
660
-	 * @access protected
661
-	 * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance.
662
-	 */
663
-	protected $relation_service;
664
-
665
-	/**
666
-	 * The {@link Wordlift_Cached_Post_Converter} instance.
667
-	 *
668
-	 * @since  3.16.0
669
-	 * @access protected
670
-	 * @var  \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance.
671
-	 *
672
-	 */
673
-	protected $cached_postid_to_jsonld_converter;
674
-
675
-	/**
676
-	 * The {@link Wordlift_File_Cache_Service} instance.
677
-	 *
678
-	 * @since  3.16.0
679
-	 * @access protected
680
-	 * @var \Wordlift_File_Cache_Service $file_cache_service The {@link Wordlift_File_Cache_Service} instance.
681
-	 */
682
-	protected $file_cache_service;
683
-
684
-	/**
685
-	 * The {@link Wordlift_Entity_Uri_Service} instance.
686
-	 *
687
-	 * @since  3.16.3
688
-	 * @access protected
689
-	 * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance.
690
-	 */
691
-	protected $entity_uri_service;
692
-
693
-	/**
694
-	 * The {@link Wordlift_Publisher_Service} instance.
695
-	 *
696
-	 * @since  3.19.0
697
-	 * @access protected
698
-	 * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance.
699
-	 */
700
-	protected $publisher_service;
701
-
702
-	/**
703
-	 * {@link Wordlift}'s singleton instance.
704
-	 *
705
-	 * @since  3.11.2
706
-	 * @access private
707
-	 * @var Wordlift $instance {@link Wordlift}'s singleton instance.
708
-	 */
709
-	private static $instance;
710
-
711
-	//</editor-fold>
712
-
713
-	/**
714
-	 * Define the core functionality of the plugin.
715
-	 *
716
-	 * Set the plugin name and the plugin version that can be used throughout the plugin.
717
-	 * Load the dependencies, define the locale, and set the hooks for the admin area and
718
-	 * the public-facing side of the site.
719
-	 *
720
-	 * @since    1.0.0
721
-	 */
722
-	public function __construct() {
723
-
724
-		self::$instance = $this;
725
-
726
-		$this->plugin_name = 'wordlift';
727
-		$this->version     = '3.20.0';
728
-		$this->load_dependencies();
729
-		$this->set_locale();
730
-		$this->define_admin_hooks();
731
-		$this->define_public_hooks();
732
-
733
-		// If we're in `WP_CLI` load the related files.
734
-		if ( class_exists( 'WP_CLI' ) ) {
735
-			$this->load_cli_dependencies();
736
-		}
737
-
738
-	}
739
-
740
-	/**
741
-	 * Get the singleton instance.
742
-	 *
743
-	 * @since 3.11.2
744
-	 *
745
-	 * @return Wordlift The {@link Wordlift} singleton instance.
746
-	 */
747
-	public static function get_instance() {
748
-
749
-		return self::$instance;
750
-	}
751
-
752
-	/**
753
-	 * Load the required dependencies for this plugin.
754
-	 *
755
-	 * Include the following files that make up the plugin:
756
-	 *
757
-	 * - Wordlift_Loader. Orchestrates the hooks of the plugin.
758
-	 * - Wordlift_i18n. Defines internationalization functionality.
759
-	 * - Wordlift_Admin. Defines all hooks for the admin area.
760
-	 * - Wordlift_Public. Defines all hooks for the public side of the site.
761
-	 *
762
-	 * Create an instance of the loader which will be used to register the hooks
763
-	 * with WordPress.
764
-	 *
765
-	 * @since    1.0.0
766
-	 * @access   private
767
-	 */
768
-	private function load_dependencies() {
769
-
770
-		/**
771
-		 * The class responsible for orchestrating the actions and filters of the
772
-		 * core plugin.
773
-		 */
774
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
775
-
776
-		// The class responsible for plugin uninstall.
777
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
778
-
779
-		/**
780
-		 * The class responsible for defining internationalization functionality
781
-		 * of the plugin.
782
-		 */
783
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
784
-
785
-		/**
786
-		 * WordLift's supported languages.
787
-		 */
788
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
789
-
790
-		/**
791
-		 * WordLift's supported countries.
792
-		 */
793
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
794
-
795
-		/**
796
-		 * Provide support functions to sanitize data.
797
-		 */
798
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
799
-
800
-		/** Services. */
801
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
802
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
803
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
804
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
805
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
806
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
807
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
808
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
809
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
810
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
811
-
812
-		/**
813
-		 * The Query builder.
814
-		 */
815
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
816
-
817
-		/**
818
-		 * The Schema service.
819
-		 */
820
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
821
-
822
-		/**
823
-		 * The schema:url property service.
824
-		 */
825
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
826
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
827
-
828
-		/**
829
-		 * The UI service.
830
-		 */
831
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
832
-
833
-		/**
834
-		 * The Thumbnail service.
835
-		 */
836
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
837
-
838
-		/**
839
-		 * The Entity Types Taxonomy service.
840
-		 */
841
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
842
-
843
-		/**
844
-		 * The Entity service.
845
-		 */
846
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
847
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
848
-
849
-		// Add the entity rating service.
850
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
851
-
852
-		/**
853
-		 * The User service.
854
-		 */
855
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
856
-
857
-		/**
858
-		 * The Timeline service.
859
-		 */
860
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
861
-
862
-		/**
863
-		 * The Topic Taxonomy service.
864
-		 */
865
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
866
-
867
-		/**
868
-		 * The SPARQL service.
869
-		 */
870
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
871
-
872
-		/**
873
-		 * The WordLift import service.
874
-		 */
875
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
876
-
877
-		/**
878
-		 * The WordLift URI service.
879
-		 */
880
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
881
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
882
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
883
-
884
-		/**
885
-		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
886
-		 */
887
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
888
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
889
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
890
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
891
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
892
-
893
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
894
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
895
-
896
-		/**
897
-		 * Load the converters.
898
-		 */
899
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
900
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
901
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
902
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
903
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
904
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
905
-
906
-		/**
907
-		 * Load cache-related files.
908
-		 */
909
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
910
-
911
-		/**
912
-		 * Load the content filter.
913
-		 */
914
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
915
-
916
-		/*
31
+    //<editor-fold desc="## FIELDS">
32
+
33
+    /**
34
+     * The loader that's responsible for maintaining and registering all hooks that power
35
+     * the plugin.
36
+     *
37
+     * @since    1.0.0
38
+     * @access   protected
39
+     * @var      Wordlift_Loader $loader Maintains and registers all hooks for the plugin.
40
+     */
41
+    protected $loader;
42
+
43
+    /**
44
+     * The unique identifier of this plugin.
45
+     *
46
+     * @since    1.0.0
47
+     * @access   protected
48
+     * @var      string $plugin_name The string used to uniquely identify this plugin.
49
+     */
50
+    protected $plugin_name;
51
+
52
+    /**
53
+     * The current version of the plugin.
54
+     *
55
+     * @since    1.0.0
56
+     * @access   protected
57
+     * @var      string $version The current version of the plugin.
58
+     */
59
+    protected $version;
60
+
61
+    /**
62
+     * The {@link Wordlift_Tinymce_Adapter} instance.
63
+     *
64
+     * @since  3.12.0
65
+     * @access protected
66
+     * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance.
67
+     */
68
+    protected $tinymce_adapter;
69
+
70
+    /**
71
+     * The Thumbnail service.
72
+     *
73
+     * @since  3.1.5
74
+     * @access private
75
+     * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
76
+     */
77
+    private $thumbnail_service;
78
+
79
+    /**
80
+     * The UI service.
81
+     *
82
+     * @since  3.2.0
83
+     * @access private
84
+     * @var \Wordlift_UI_Service $ui_service The UI service.
85
+     */
86
+    private $ui_service;
87
+
88
+    /**
89
+     * The Schema service.
90
+     *
91
+     * @since  3.3.0
92
+     * @access protected
93
+     * @var \Wordlift_Schema_Service $schema_service The Schema service.
94
+     */
95
+    protected $schema_service;
96
+
97
+    /**
98
+     * The Entity service.
99
+     *
100
+     * @since  3.1.0
101
+     * @access protected
102
+     * @var \Wordlift_Entity_Service $entity_service The Entity service.
103
+     */
104
+    protected $entity_service;
105
+
106
+    /**
107
+     * The Topic Taxonomy service.
108
+     *
109
+     * @since  3.5.0
110
+     * @access private
111
+     * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
112
+     */
113
+    private $topic_taxonomy_service;
114
+
115
+    /**
116
+     * The Entity Types Taxonomy service.
117
+     *
118
+     * @since  3.18.0
119
+     * @access private
120
+     * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service.
121
+     */
122
+    private $entity_types_taxonomy_service;
123
+
124
+    /**
125
+     * The User service.
126
+     *
127
+     * @since  3.1.7
128
+     * @access protected
129
+     * @var \Wordlift_User_Service $user_service The User service.
130
+     */
131
+    protected $user_service;
132
+
133
+    /**
134
+     * The Timeline service.
135
+     *
136
+     * @since  3.1.0
137
+     * @access private
138
+     * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
139
+     */
140
+    private $timeline_service;
141
+
142
+    /**
143
+     * The Redirect service.
144
+     *
145
+     * @since  3.2.0
146
+     * @access private
147
+     * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
148
+     */
149
+    private $redirect_service;
150
+
151
+    /**
152
+     * The Notice service.
153
+     *
154
+     * @since  3.3.0
155
+     * @access private
156
+     * @var \Wordlift_Notice_Service $notice_service The Notice service.
157
+     */
158
+    private $notice_service;
159
+
160
+    /**
161
+     * The Entity list customization.
162
+     *
163
+     * @since  3.3.0
164
+     * @access protected
165
+     * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service.
166
+     */
167
+    protected $entity_list_service;
168
+
169
+    /**
170
+     * The Entity Types Taxonomy Walker.
171
+     *
172
+     * @since  3.1.0
173
+     * @access private
174
+     * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
175
+     */
176
+    private $entity_types_taxonomy_walker;
177
+
178
+    /**
179
+     * The ShareThis service.
180
+     *
181
+     * @since  3.2.0
182
+     * @access private
183
+     * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
184
+     */
185
+    private $sharethis_service;
186
+
187
+    /**
188
+     * The PrimaShop adapter.
189
+     *
190
+     * @since  3.2.3
191
+     * @access private
192
+     * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
193
+     */
194
+    private $primashop_adapter;
195
+
196
+    /**
197
+     * The WordLift Dashboard adapter.
198
+     *
199
+     * @since  3.4.0
200
+     * @access private
201
+     * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
202
+     */
203
+    private $dashboard_service;
204
+
205
+    /**
206
+     * The entity type service.
207
+     *
208
+     * @since  3.6.0
209
+     * @access private
210
+     * @var \Wordlift_Entity_Post_Type_Service
211
+     */
212
+    private $entity_post_type_service;
213
+
214
+    /**
215
+     * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
216
+     *
217
+     * @since  3.6.0
218
+     * @access private
219
+     * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance.
220
+     */
221
+    private $entity_link_service;
222
+
223
+    /**
224
+     * A {@link Wordlift_Sparql_Service} instance.
225
+     *
226
+     * @since    3.6.0
227
+     * @access   protected
228
+     * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
229
+     */
230
+    protected $sparql_service;
231
+
232
+    /**
233
+     * A {@link Wordlift_Import_Service} instance.
234
+     *
235
+     * @since  3.6.0
236
+     * @access private
237
+     * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
238
+     */
239
+    private $import_service;
240
+
241
+    /**
242
+     * A {@link Wordlift_Rebuild_Service} instance.
243
+     *
244
+     * @since  3.6.0
245
+     * @access private
246
+     * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
247
+     */
248
+    private $rebuild_service;
249
+
250
+    /**
251
+     * A {@link Wordlift_Jsonld_Service} instance.
252
+     *
253
+     * @since  3.7.0
254
+     * @access protected
255
+     * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
256
+     */
257
+    protected $jsonld_service;
258
+
259
+    /**
260
+     * A {@link Wordlift_Website_Jsonld_Converter} instance.
261
+     *
262
+     * @since  3.14.0
263
+     * @access protected
264
+     * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance.
265
+     */
266
+    protected $jsonld_website_converter;
267
+
268
+    /**
269
+     * A {@link Wordlift_Property_Factory} instance.
270
+     *
271
+     * @since  3.7.0
272
+     * @access private
273
+     * @var \Wordlift_Property_Factory $property_factory
274
+     */
275
+    private $property_factory;
276
+
277
+    /**
278
+     * The 'Download Your Data' page.
279
+     *
280
+     * @since  3.6.0
281
+     * @access private
282
+     * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
283
+     */
284
+    private $download_your_data_page;
285
+
286
+    /**
287
+     * The 'WordLift Settings' page.
288
+     *
289
+     * @since  3.11.0
290
+     * @access protected
291
+     * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page.
292
+     */
293
+    protected $settings_page;
294
+
295
+    /**
296
+     * The 'WordLift Batch analysis' page.
297
+     *
298
+     * @since  3.14.0
299
+     * @access protected
300
+     * @var \Wordlift_Batch_Analysis_Page $sbatch_analysis_page The 'WordLift batcch analysis' page.
301
+     */
302
+    protected $batch_analysis_page;
303
+
304
+    /**
305
+     * The install wizard page.
306
+     *
307
+     * @since  3.9.0
308
+     * @access private
309
+     * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
310
+     */
311
+    private $admin_setup;
312
+
313
+    /**
314
+     * The Content Filter Service hooks up to the 'the_content' filter and provides
315
+     * linking of entities to their pages.
316
+     *
317
+     * @since  3.8.0
318
+     * @access private
319
+     * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
320
+     */
321
+    private $content_filter_service;
322
+
323
+    /**
324
+     * A {@link Wordlift_Key_Validation_Service} instance.
325
+     *
326
+     * @since  3.9.0
327
+     * @access private
328
+     * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
329
+     */
330
+    private $key_validation_service;
331
+
332
+    /**
333
+     * A {@link Wordlift_Rating_Service} instance.
334
+     *
335
+     * @since  3.10.0
336
+     * @access private
337
+     * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance.
338
+     */
339
+    private $rating_service;
340
+
341
+    /**
342
+     * A {@link Wordlift_Post_To_Jsonld_Converter} instance.
343
+     *
344
+     * @since  3.10.0
345
+     * @access protected
346
+     * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance.
347
+     */
348
+    protected $post_to_jsonld_converter;
349
+
350
+    /**
351
+     * A {@link Wordlift_Configuration_Service} instance.
352
+     *
353
+     * @since  3.10.0
354
+     * @access protected
355
+     * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance.
356
+     */
357
+    protected $configuration_service;
358
+
359
+    /**
360
+     * A {@link Wordlift_Install_Service} instance.
361
+     *
362
+     * @since  3.18.0
363
+     * @access protected
364
+     * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance.
365
+     */
366
+    protected $install_service;
367
+
368
+    /**
369
+     * A {@link Wordlift_Entity_Type_Service} instance.
370
+     *
371
+     * @since  3.10.0
372
+     * @access protected
373
+     * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance.
374
+     */
375
+    protected $entity_type_service;
376
+
377
+    /**
378
+     * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
379
+     *
380
+     * @since  3.10.0
381
+     * @access protected
382
+     * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
383
+     */
384
+    protected $entity_post_to_jsonld_converter;
385
+
386
+    /**
387
+     * A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
388
+     *
389
+     * @since  3.10.0
390
+     * @access protected
391
+     * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
392
+     */
393
+    protected $postid_to_jsonld_converter;
394
+
395
+    /**
396
+     * The {@link Wordlift_Admin_Status_Page} class.
397
+     *
398
+     * @since  3.9.8
399
+     * @access private
400
+     * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class.
401
+     */
402
+    private $status_page;
403
+
404
+    /**
405
+     * The {@link Wordlift_Category_Taxonomy_Service} instance.
406
+     *
407
+     * @since  3.11.0
408
+     * @access protected
409
+     * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance.
410
+     */
411
+    protected $category_taxonomy_service;
412
+
413
+    /**
414
+     * The {@link Wordlift_Entity_Page_Service} instance.
415
+     *
416
+     * @since  3.11.0
417
+     * @access protected
418
+     * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance.
419
+     */
420
+    protected $entity_page_service;
421
+
422
+    /**
423
+     * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
424
+     *
425
+     * @since  3.11.0
426
+     * @access protected
427
+     * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
428
+     */
429
+    protected $settings_page_action_link;
430
+
431
+    /**
432
+     * The {@link Wordlift_Publisher_Ajax_Adapter} instance.
433
+     *
434
+     * @since  3.11.0
435
+     * @access protected
436
+     * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
437
+     */
438
+    protected $publisher_ajax_adapter;
439
+
440
+    /**
441
+     * The {@link Wordlift_Admin_Input_Element} element renderer.
442
+     *
443
+     * @since  3.11.0
444
+     * @access protected
445
+     * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
446
+     */
447
+    protected $input_element;
448
+
449
+    /**
450
+     * The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
451
+     *
452
+     * @since  3.13.0
453
+     * @access protected
454
+     * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
455
+     */
456
+    protected $radio_input_element;
457
+
458
+    /**
459
+     * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
460
+     *
461
+     * @since  3.11.0
462
+     * @access protected
463
+     * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
464
+     */
465
+    protected $language_select_element;
466
+
467
+    /**
468
+     * The {@link Wordlift_Admin_Country_Select_Element} element renderer.
469
+     *
470
+     * @since  3.18.0
471
+     * @access protected
472
+     * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer.
473
+     */
474
+    protected $country_select_element;
475
+
476
+    /**
477
+     * The {@link Wordlift_Admin_Publisher_Element} element renderer.
478
+     *
479
+     * @since  3.11.0
480
+     * @access protected
481
+     * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
482
+     */
483
+    protected $publisher_element;
484
+
485
+    /**
486
+     * The {@link Wordlift_Admin_Select2_Element} element renderer.
487
+     *
488
+     * @since  3.11.0
489
+     * @access protected
490
+     * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
491
+     */
492
+    protected $select2_element;
493
+
494
+    /**
495
+     * The controller for the entity type list admin page
496
+     *
497
+     * @since  3.11.0
498
+     * @access private
499
+     * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
500
+     */
501
+    private $entity_type_admin_page;
502
+
503
+    /**
504
+     * The controller for the entity type settings admin page
505
+     *
506
+     * @since  3.11.0
507
+     * @access private
508
+     * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
509
+     */
510
+    private $entity_type_settings_admin_page;
511
+
512
+    /**
513
+     * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
514
+     *
515
+     * @since  3.11.0
516
+     * @access protected
517
+     * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
518
+     */
519
+    protected $related_entities_cloud_widget;
520
+
521
+    /**
522
+     * The {@link Wordlift_Admin_Author_Element} instance.
523
+     *
524
+     * @since  3.14.0
525
+     * @access protected
526
+     * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance.
527
+     */
528
+    protected $author_element;
529
+
530
+    /**
531
+     * The {@link Wordlift_Batch_Analysis_Service} instance.
532
+     *
533
+     * @since  3.14.0
534
+     * @access protected
535
+     * @var \Wordlift_Batch_Analysis_Service $batch_analysis_service The {@link Wordlift_Batch_Analysis_Service} instance.
536
+     */
537
+    protected $batch_analysis_service;
538
+
539
+    /**
540
+     * The {@link Wordlift_Sample_Data_Service} instance.
541
+     *
542
+     * @since  3.12.0
543
+     * @access protected
544
+     * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance.
545
+     */
546
+    protected $sample_data_service;
547
+
548
+    /**
549
+     * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
550
+     *
551
+     * @since  3.12.0
552
+     * @access protected
553
+     * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
554
+     */
555
+    protected $sample_data_ajax_adapter;
556
+
557
+    /**
558
+     * The {@link Wordlift_Batch_Analysis_Adapter} instance.
559
+     *
560
+     * @since  3.14.2
561
+     * @access protected
562
+     * @var \Wordlift_Batch_Analysis_Adapter $batch_analysis_adapter The {@link Wordlift_Batch_Analysis_Adapter} instance.
563
+     */
564
+    private $batch_analysis_adapter;
565
+
566
+    /**
567
+     * The {@link Wordlift_Relation_Rebuild_Service} instance.
568
+     *
569
+     * @since  3.14.3
570
+     * @access private
571
+     * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance.
572
+     */
573
+    private $relation_rebuild_service;
574
+
575
+    /**
576
+     * The {@link Wordlift_Relation_Rebuild_Adapter} instance.
577
+     *
578
+     * @since  3.14.3
579
+     * @access private
580
+     * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance.
581
+     */
582
+    private $relation_rebuild_adapter;
583
+
584
+    /**
585
+     * The {@link Wordlift_Reference_Rebuild_Service} instance.
586
+     *
587
+     * @since  3.18.0
588
+     * @access private
589
+     * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance.
590
+     */
591
+    private $reference_rebuild_service;
592
+
593
+    /**
594
+     * The {@link Wordlift_Google_Analytics_Export_Service} instance.
595
+     *
596
+     * @since  3.16.0
597
+     * @access protected
598
+     * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance.
599
+     */
600
+    protected $google_analytics_export_service;
601
+
602
+    /**
603
+     * {@link Wordlift}'s singleton instance.
604
+     *
605
+     * @since  3.15.0
606
+     * @access protected
607
+     * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance.
608
+     */
609
+    protected $entity_type_adapter;
610
+
611
+    /**
612
+     * The {@link Wordlift_Linked_Data_Service} instance.
613
+     *
614
+     * @since  3.15.0
615
+     * @access protected
616
+     * @var \Wordlift_Linked_Data_Service $linked_data_service The {@link Wordlift_Linked_Data_Service} instance.
617
+     */
618
+    protected $linked_data_service;
619
+
620
+    /**
621
+     * The {@link Wordlift_Storage_Factory} instance.
622
+     *
623
+     * @since  3.15.0
624
+     * @access protected
625
+     * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance.
626
+     */
627
+    protected $storage_factory;
628
+
629
+    /**
630
+     * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
631
+     *
632
+     * @since  3.15.0
633
+     * @access protected
634
+     * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
635
+     */
636
+    protected $rendition_factory;
637
+
638
+    /**
639
+     * The {@link Wordlift_Autocomplete_Service} instance.
640
+     *
641
+     * @since  3.15.0
642
+     * @access private
643
+     * @var \Wordlift_Autocomplete_Service $autocomplete_service The {@link Wordlift_Autocomplete_Service} instance.
644
+     */
645
+    private $autocomplete_service;
646
+
647
+    /**
648
+     * The {@link Wordlift_Autocomplete_Adapter} instance.
649
+     *
650
+     * @since  3.15.0
651
+     * @access private
652
+     * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance.
653
+     */
654
+    private $autocomplete_adapter;
655
+
656
+    /**
657
+     * The {@link Wordlift_Relation_Service} instance.
658
+     *
659
+     * @since  3.15.0
660
+     * @access protected
661
+     * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance.
662
+     */
663
+    protected $relation_service;
664
+
665
+    /**
666
+     * The {@link Wordlift_Cached_Post_Converter} instance.
667
+     *
668
+     * @since  3.16.0
669
+     * @access protected
670
+     * @var  \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance.
671
+     *
672
+     */
673
+    protected $cached_postid_to_jsonld_converter;
674
+
675
+    /**
676
+     * The {@link Wordlift_File_Cache_Service} instance.
677
+     *
678
+     * @since  3.16.0
679
+     * @access protected
680
+     * @var \Wordlift_File_Cache_Service $file_cache_service The {@link Wordlift_File_Cache_Service} instance.
681
+     */
682
+    protected $file_cache_service;
683
+
684
+    /**
685
+     * The {@link Wordlift_Entity_Uri_Service} instance.
686
+     *
687
+     * @since  3.16.3
688
+     * @access protected
689
+     * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance.
690
+     */
691
+    protected $entity_uri_service;
692
+
693
+    /**
694
+     * The {@link Wordlift_Publisher_Service} instance.
695
+     *
696
+     * @since  3.19.0
697
+     * @access protected
698
+     * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance.
699
+     */
700
+    protected $publisher_service;
701
+
702
+    /**
703
+     * {@link Wordlift}'s singleton instance.
704
+     *
705
+     * @since  3.11.2
706
+     * @access private
707
+     * @var Wordlift $instance {@link Wordlift}'s singleton instance.
708
+     */
709
+    private static $instance;
710
+
711
+    //</editor-fold>
712
+
713
+    /**
714
+     * Define the core functionality of the plugin.
715
+     *
716
+     * Set the plugin name and the plugin version that can be used throughout the plugin.
717
+     * Load the dependencies, define the locale, and set the hooks for the admin area and
718
+     * the public-facing side of the site.
719
+     *
720
+     * @since    1.0.0
721
+     */
722
+    public function __construct() {
723
+
724
+        self::$instance = $this;
725
+
726
+        $this->plugin_name = 'wordlift';
727
+        $this->version     = '3.20.0';
728
+        $this->load_dependencies();
729
+        $this->set_locale();
730
+        $this->define_admin_hooks();
731
+        $this->define_public_hooks();
732
+
733
+        // If we're in `WP_CLI` load the related files.
734
+        if ( class_exists( 'WP_CLI' ) ) {
735
+            $this->load_cli_dependencies();
736
+        }
737
+
738
+    }
739
+
740
+    /**
741
+     * Get the singleton instance.
742
+     *
743
+     * @since 3.11.2
744
+     *
745
+     * @return Wordlift The {@link Wordlift} singleton instance.
746
+     */
747
+    public static function get_instance() {
748
+
749
+        return self::$instance;
750
+    }
751
+
752
+    /**
753
+     * Load the required dependencies for this plugin.
754
+     *
755
+     * Include the following files that make up the plugin:
756
+     *
757
+     * - Wordlift_Loader. Orchestrates the hooks of the plugin.
758
+     * - Wordlift_i18n. Defines internationalization functionality.
759
+     * - Wordlift_Admin. Defines all hooks for the admin area.
760
+     * - Wordlift_Public. Defines all hooks for the public side of the site.
761
+     *
762
+     * Create an instance of the loader which will be used to register the hooks
763
+     * with WordPress.
764
+     *
765
+     * @since    1.0.0
766
+     * @access   private
767
+     */
768
+    private function load_dependencies() {
769
+
770
+        /**
771
+         * The class responsible for orchestrating the actions and filters of the
772
+         * core plugin.
773
+         */
774
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
775
+
776
+        // The class responsible for plugin uninstall.
777
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
778
+
779
+        /**
780
+         * The class responsible for defining internationalization functionality
781
+         * of the plugin.
782
+         */
783
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
784
+
785
+        /**
786
+         * WordLift's supported languages.
787
+         */
788
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
789
+
790
+        /**
791
+         * WordLift's supported countries.
792
+         */
793
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
794
+
795
+        /**
796
+         * Provide support functions to sanitize data.
797
+         */
798
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
799
+
800
+        /** Services. */
801
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
802
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
803
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
804
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
805
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
806
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
807
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
808
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
809
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
810
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
811
+
812
+        /**
813
+         * The Query builder.
814
+         */
815
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
816
+
817
+        /**
818
+         * The Schema service.
819
+         */
820
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
821
+
822
+        /**
823
+         * The schema:url property service.
824
+         */
825
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
826
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
827
+
828
+        /**
829
+         * The UI service.
830
+         */
831
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
832
+
833
+        /**
834
+         * The Thumbnail service.
835
+         */
836
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
837
+
838
+        /**
839
+         * The Entity Types Taxonomy service.
840
+         */
841
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
842
+
843
+        /**
844
+         * The Entity service.
845
+         */
846
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
847
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
848
+
849
+        // Add the entity rating service.
850
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
851
+
852
+        /**
853
+         * The User service.
854
+         */
855
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
856
+
857
+        /**
858
+         * The Timeline service.
859
+         */
860
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
861
+
862
+        /**
863
+         * The Topic Taxonomy service.
864
+         */
865
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
866
+
867
+        /**
868
+         * The SPARQL service.
869
+         */
870
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
871
+
872
+        /**
873
+         * The WordLift import service.
874
+         */
875
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
876
+
877
+        /**
878
+         * The WordLift URI service.
879
+         */
880
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
881
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
882
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
883
+
884
+        /**
885
+         * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
886
+         */
887
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
888
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
889
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
890
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
891
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
892
+
893
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
894
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
895
+
896
+        /**
897
+         * Load the converters.
898
+         */
899
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
900
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
901
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
902
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
903
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
904
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
905
+
906
+        /**
907
+         * Load cache-related files.
908
+         */
909
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
910
+
911
+        /**
912
+         * Load the content filter.
913
+         */
914
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
915
+
916
+        /*
917 917
 		 * Load the excerpt helper.
918 918
 		 */
919
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
920
-
921
-		/**
922
-		 * Load the JSON-LD service to publish entities using JSON-LD.s
923
-		 *
924
-		 * @since 3.8.0
925
-		 */
926
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
927
-
928
-		// The Publisher Service and the AJAX adapter.
929
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
930
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
931
-
932
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
933
-
934
-		/**
935
-		 * Load the WordLift key validation service.
936
-		 */
937
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
938
-
939
-		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
940
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
941
-
942
-		// Load the `Wordlift_Entity_Page_Service` class definition.
943
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
944
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
945
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
946
-
947
-		/** Linked Data. */
948
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
949
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
950
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
951
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
952
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
953
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
954
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
955
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
956
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
957
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
958
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
959
-
960
-		/** Linked Data Rendition. */
961
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
962
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
963
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
964
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
965
-
966
-		/** Services. */
967
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
968
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
969
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
970
-
971
-		/** Adapters. */
972
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
973
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
974
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
975
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
976
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
977
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
978
-
979
-		/** Async Tasks. */
980
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
981
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
982
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
983
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
984
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
985
-
986
-		/** Autocomplete. */
987
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php';
988
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
989
-
990
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
991
-
992
-		/**
993
-		 * The class responsible for defining all actions that occur in the admin area.
994
-		 */
995
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
996
-
997
-		/**
998
-		 * The class to customize the entity list admin page.
999
-		 */
1000
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
1001
-
1002
-		/**
1003
-		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
1004
-		 */
1005
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
1006
-
1007
-		/**
1008
-		 * The Notice service.
1009
-		 */
1010
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1011
-
1012
-		/**
1013
-		 * The PrimaShop adapter.
1014
-		 */
1015
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1016
-
1017
-		/**
1018
-		 * The WordLift Dashboard service.
1019
-		 */
1020
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1021
-
1022
-		/**
1023
-		 * The admin 'Install wizard' page.
1024
-		 */
1025
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1026
-
1027
-		/**
1028
-		 * The WordLift entity type list admin page controller.
1029
-		 */
1030
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1031
-
1032
-		/**
1033
-		 * The WordLift entity type settings admin page controller.
1034
-		 */
1035
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1036
-
1037
-		/**
1038
-		 * The admin 'Download Your Data' page.
1039
-		 */
1040
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1041
-
1042
-		/**
1043
-		 * The admin 'WordLift Settings' page.
1044
-		 */
1045
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
1046
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
1047
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
1048
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
1049
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
1050
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
1051
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
1052
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
1053
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
1054
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
1055
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1056
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1057
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php';
1058
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1059
-
1060
-		/** Admin Pages */
1061
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1062
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1063
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1064
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php';
1065
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1066
-
1067
-		/**
1068
-		 * The class responsible for defining all actions that occur in the public-facing
1069
-		 * side of the site.
1070
-		 */
1071
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1072
-
1073
-		/**
1074
-		 * The shortcode abstract class.
1075
-		 */
1076
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1077
-
1078
-		/**
1079
-		 * The Timeline shortcode.
1080
-		 */
1081
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1082
-
1083
-		/**
1084
-		 * The Navigator shortcode.
1085
-		 */
1086
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1087
-
1088
-		/**
1089
-		 * The chord shortcode.
1090
-		 */
1091
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1092
-
1093
-		/**
1094
-		 * The geomap shortcode.
1095
-		 */
1096
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1097
-
1098
-		/**
1099
-		 * The entity cloud shortcode.
1100
-		 */
1101
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1102
-
1103
-		/**
1104
-		 * The entity glossary shortcode.
1105
-		 */
1106
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1107
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1108
-
1109
-		/**
1110
-		 * Faceted Search shortcode.
1111
-		 */
1112
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php';		
1113
-
1114
-		/**
1115
-		 * The ShareThis service.
1116
-		 */
1117
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1118
-
1119
-		/**
1120
-		 * The SEO service.
1121
-		 */
1122
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1123
-
1124
-		/**
1125
-		 * The AMP service.
1126
-		 */
1127
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1128
-
1129
-		/** Widgets */
1130
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1131
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1132
-
1133
-		/*
919
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
920
+
921
+        /**
922
+         * Load the JSON-LD service to publish entities using JSON-LD.s
923
+         *
924
+         * @since 3.8.0
925
+         */
926
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
927
+
928
+        // The Publisher Service and the AJAX adapter.
929
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
930
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
931
+
932
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
933
+
934
+        /**
935
+         * Load the WordLift key validation service.
936
+         */
937
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
938
+
939
+        // Load the `Wordlift_Category_Taxonomy_Service` class definition.
940
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
941
+
942
+        // Load the `Wordlift_Entity_Page_Service` class definition.
943
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
944
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
945
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
946
+
947
+        /** Linked Data. */
948
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
949
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
950
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
951
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
952
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
953
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
954
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
955
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
956
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
957
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
958
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
959
+
960
+        /** Linked Data Rendition. */
961
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
962
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
963
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
964
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
965
+
966
+        /** Services. */
967
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
968
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
969
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
970
+
971
+        /** Adapters. */
972
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
973
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
974
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
975
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
976
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
977
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
978
+
979
+        /** Async Tasks. */
980
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
981
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
982
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
983
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
984
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
985
+
986
+        /** Autocomplete. */
987
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php';
988
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
989
+
990
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
991
+
992
+        /**
993
+         * The class responsible for defining all actions that occur in the admin area.
994
+         */
995
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
996
+
997
+        /**
998
+         * The class to customize the entity list admin page.
999
+         */
1000
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
1001
+
1002
+        /**
1003
+         * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
1004
+         */
1005
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
1006
+
1007
+        /**
1008
+         * The Notice service.
1009
+         */
1010
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1011
+
1012
+        /**
1013
+         * The PrimaShop adapter.
1014
+         */
1015
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1016
+
1017
+        /**
1018
+         * The WordLift Dashboard service.
1019
+         */
1020
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1021
+
1022
+        /**
1023
+         * The admin 'Install wizard' page.
1024
+         */
1025
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1026
+
1027
+        /**
1028
+         * The WordLift entity type list admin page controller.
1029
+         */
1030
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1031
+
1032
+        /**
1033
+         * The WordLift entity type settings admin page controller.
1034
+         */
1035
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1036
+
1037
+        /**
1038
+         * The admin 'Download Your Data' page.
1039
+         */
1040
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1041
+
1042
+        /**
1043
+         * The admin 'WordLift Settings' page.
1044
+         */
1045
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
1046
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
1047
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
1048
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
1049
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
1050
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
1051
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
1052
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
1053
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
1054
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
1055
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1056
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1057
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php';
1058
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1059
+
1060
+        /** Admin Pages */
1061
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1062
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1063
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1064
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php';
1065
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1066
+
1067
+        /**
1068
+         * The class responsible for defining all actions that occur in the public-facing
1069
+         * side of the site.
1070
+         */
1071
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1072
+
1073
+        /**
1074
+         * The shortcode abstract class.
1075
+         */
1076
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1077
+
1078
+        /**
1079
+         * The Timeline shortcode.
1080
+         */
1081
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1082
+
1083
+        /**
1084
+         * The Navigator shortcode.
1085
+         */
1086
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1087
+
1088
+        /**
1089
+         * The chord shortcode.
1090
+         */
1091
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1092
+
1093
+        /**
1094
+         * The geomap shortcode.
1095
+         */
1096
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1097
+
1098
+        /**
1099
+         * The entity cloud shortcode.
1100
+         */
1101
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1102
+
1103
+        /**
1104
+         * The entity glossary shortcode.
1105
+         */
1106
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1107
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1108
+
1109
+        /**
1110
+         * Faceted Search shortcode.
1111
+         */
1112
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php';		
1113
+
1114
+        /**
1115
+         * The ShareThis service.
1116
+         */
1117
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1118
+
1119
+        /**
1120
+         * The SEO service.
1121
+         */
1122
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1123
+
1124
+        /**
1125
+         * The AMP service.
1126
+         */
1127
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1128
+
1129
+        /** Widgets */
1130
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1131
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1132
+
1133
+        /*
1134 1134
 		 * Schema.org Services.
1135 1135
 		 *
1136 1136
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1137 1137
 		 */
1138
-		if ( WL_ALL_ENTITY_TYPES ) {
1139
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1140
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1141
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1142
-			new Wordlift_Schemaorg_Sync_Service();
1143
-			$schemaorg_property_service = new Wordlift_Schemaorg_Property_Service();
1144
-			new Wordlift_Schemaorg_Class_Service();
1145
-		} else {
1146
-			$schemaorg_property_service = null;
1147
-		}
1138
+        if ( WL_ALL_ENTITY_TYPES ) {
1139
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1140
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1141
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1142
+            new Wordlift_Schemaorg_Sync_Service();
1143
+            $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service();
1144
+            new Wordlift_Schemaorg_Class_Service();
1145
+        } else {
1146
+            $schemaorg_property_service = null;
1147
+        }
1148 1148
 
1149
-		$this->loader = new Wordlift_Loader();
1149
+        $this->loader = new Wordlift_Loader();
1150 1150
 
1151
-		// Instantiate a global logger.
1152
-		global $wl_logger;
1153
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1151
+        // Instantiate a global logger.
1152
+        global $wl_logger;
1153
+        $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1154 1154
 
1155
-		// Load the `wl-api` end-point.
1156
-		new Wordlift_Http_Api();
1155
+        // Load the `wl-api` end-point.
1156
+        new Wordlift_Http_Api();
1157 1157
 
1158
-		// Load the Install Service.
1159
-		$this->install_service = new Wordlift_Install_Service();
1158
+        // Load the Install Service.
1159
+        $this->install_service = new Wordlift_Install_Service();
1160 1160
 
1161
-		/** Services. */
1162
-		// Create the configuration service.
1163
-		$this->configuration_service = new Wordlift_Configuration_Service();
1164
-		$api_service                 = new Wordlift_Api_Service( $this->configuration_service );
1161
+        /** Services. */
1162
+        // Create the configuration service.
1163
+        $this->configuration_service = new Wordlift_Configuration_Service();
1164
+        $api_service                 = new Wordlift_Api_Service( $this->configuration_service );
1165 1165
 
1166
-		// Create an entity type service instance. It'll be later bound to the init action.
1167
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1166
+        // Create an entity type service instance. It'll be later bound to the init action.
1167
+        $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1168 1168
 
1169
-		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1170
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1169
+        // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1170
+        $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1171 1171
 
1172
-		// Create an instance of the UI service.
1173
-		$this->ui_service = new Wordlift_UI_Service();
1172
+        // Create an instance of the UI service.
1173
+        $this->ui_service = new Wordlift_UI_Service();
1174 1174
 
1175
-		// Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
1176
-		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
1175
+        // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
1176
+        $this->thumbnail_service = new Wordlift_Thumbnail_Service();
1177 1177
 
1178
-		$this->sparql_service        = new Wordlift_Sparql_Service();
1179
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1180
-		$this->notice_service        = new Wordlift_Notice_Service();
1181
-		$this->relation_service      = new Wordlift_Relation_Service();
1178
+        $this->sparql_service        = new Wordlift_Sparql_Service();
1179
+        $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1180
+        $this->notice_service        = new Wordlift_Notice_Service();
1181
+        $this->relation_service      = new Wordlift_Relation_Service();
1182 1182
 
1183
-		$entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1184
-		$this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' );
1185
-		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1186
-		$this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1187
-		$this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1183
+        $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1184
+        $this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' );
1185
+        $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1186
+        $this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1187
+        $this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1188 1188
 
1189
-		// Instantiate the JSON-LD service.
1190
-		$property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1189
+        // Instantiate the JSON-LD service.
1190
+        $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1191 1191
 
1192
-		/** Linked Data. */
1193
-		$this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1194
-		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1192
+        /** Linked Data. */
1193
+        $this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1194
+        $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1195 1195
 
1196
-		$this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1196
+        $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1197 1197
 
1198
-		// Create a new instance of the Redirect service.
1199
-		$this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_service );
1200
-		$this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1201
-		$this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service );
1198
+        // Create a new instance of the Redirect service.
1199
+        $this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_service );
1200
+        $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1201
+        $this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service );
1202 1202
 
1203
-		// Create a new instance of the Timeline service and Timeline shortcode.
1204
-		$this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1203
+        // Create a new instance of the Timeline service and Timeline shortcode.
1204
+        $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1205 1205
 
1206
-		$this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service );
1206
+        $this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service );
1207 1207
 
1208
-		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1208
+        $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1209 1209
 
1210
-		$this->topic_taxonomy_service        = new Wordlift_Topic_Taxonomy_Service();
1211
-		$this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service();
1210
+        $this->topic_taxonomy_service        = new Wordlift_Topic_Taxonomy_Service();
1211
+        $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service();
1212 1212
 
1213
-		// Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
1214
-		$this->sharethis_service = new Wordlift_ShareThis_Service();
1213
+        // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
1214
+        $this->sharethis_service = new Wordlift_ShareThis_Service();
1215 1215
 
1216
-		// Create an instance of the PrimaShop adapter.
1217
-		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1216
+        // Create an instance of the PrimaShop adapter.
1217
+        $this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1218 1218
 
1219
-		// Create an import service instance to hook later to WP's import function.
1220
-		$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() );
1219
+        // Create an import service instance to hook later to WP's import function.
1220
+        $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() );
1221 1221
 
1222
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1222
+        $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1223 1223
 
1224
-		// Create the entity rating service.
1225
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1224
+        // Create the entity rating service.
1225
+        $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1226 1226
 
1227
-		// Create entity list customization (wp-admin/edit.php).
1228
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1227
+        // Create entity list customization (wp-admin/edit.php).
1228
+        $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1229 1229
 
1230
-		// Create a new instance of the Redirect service.
1231
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1230
+        // Create a new instance of the Redirect service.
1231
+        $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1232 1232
 
1233
-		// Create an instance of the Publisher Service and the AJAX Adapter.
1234
-		$this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1235
-		$this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1236
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1233
+        // Create an instance of the Publisher Service and the AJAX Adapter.
1234
+        $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1235
+        $this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1236
+        $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1237 1237
 
1238
-		$attachment_service = new Wordlift_Attachment_Service();
1238
+        $attachment_service = new Wordlift_Attachment_Service();
1239 1239
 
1240
-		// Instantiate the JSON-LD service.
1241
-		$property_getter                         = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1242
-		$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 );
1243
-		$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 );
1244
-		$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 );
1245
-		$this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1246
-		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service );
1247
-		$this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1240
+        // Instantiate the JSON-LD service.
1241
+        $property_getter                         = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1242
+        $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 );
1243
+        $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 );
1244
+        $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 );
1245
+        $this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1246
+        $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service );
1247
+        $this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1248 1248
 
1249 1249
 
1250
-		$this->key_validation_service    = new Wordlift_Key_Validation_Service( $this->configuration_service );
1251
-		$this->content_filter_service    = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1252
-		$this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1253
-		$this->sample_data_service       = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1254
-		$this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1255
-		$this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1250
+        $this->key_validation_service    = new Wordlift_Key_Validation_Service( $this->configuration_service );
1251
+        $this->content_filter_service    = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1252
+        $this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1253
+        $this->sample_data_service       = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1254
+        $this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1255
+        $this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1256 1256
 
1257
-		// Initialize the shortcodes.
1258
-		new Wordlift_Navigator_Shortcode();
1259
-		new Wordlift_Chord_Shortcode();
1260
-		new Wordlift_Geomap_Shortcode();
1261
-		new Wordlift_Timeline_Shortcode();
1262
-		new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1263
-		new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1264
-		new Wordlift_Faceted_Search_Shortcode();
1257
+        // Initialize the shortcodes.
1258
+        new Wordlift_Navigator_Shortcode();
1259
+        new Wordlift_Chord_Shortcode();
1260
+        new Wordlift_Geomap_Shortcode();
1261
+        new Wordlift_Timeline_Shortcode();
1262
+        new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1263
+        new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1264
+        new Wordlift_Faceted_Search_Shortcode();
1265 1265
 
1266
-		// Initialize the SEO service.
1267
-		new Wordlift_Seo_Service();
1266
+        // Initialize the SEO service.
1267
+        new Wordlift_Seo_Service();
1268 1268
 
1269
-		// Initialize the AMP service.
1270
-		new Wordlift_AMP_Service( $this->jsonld_service );
1269
+        // Initialize the AMP service.
1270
+        new Wordlift_AMP_Service( $this->jsonld_service );
1271 1271
 
1272
-		/** Services. */
1273
-		$this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1274
-		new Wordlift_Image_Service();
1272
+        /** Services. */
1273
+        $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1274
+        new Wordlift_Image_Service();
1275 1275
 
1276
-		/** Adapters. */
1277
-		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1278
-		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1279
-		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1280
-		$this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service );
1281
-		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1276
+        /** Adapters. */
1277
+        $this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1278
+        $this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1279
+        $this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1280
+        $this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service );
1281
+        $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1282 1282
 
1283
-		/*
1283
+        /*
1284 1284
 		 * Exclude our public js from WP-Rocket.
1285 1285
 		 *
1286 1286
 		 * @since 3.19.4
1287 1287
 		 *
1288 1288
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/842.
1289 1289
 		 */
1290
-		new Wordlift_WpRocket_Adapter();
1290
+        new Wordlift_WpRocket_Adapter();
1291 1291
 
1292
-		// Create a Rebuild Service instance, which we'll later bound to an ajax call.
1293
-		$this->rebuild_service = new Wordlift_Rebuild_Service(
1294
-			$this->sparql_service,
1295
-			$uri_service
1296
-		);
1292
+        // Create a Rebuild Service instance, which we'll later bound to an ajax call.
1293
+        $this->rebuild_service = new Wordlift_Rebuild_Service(
1294
+            $this->sparql_service,
1295
+            $uri_service
1296
+        );
1297 1297
 
1298
-		/** Async Tasks. */
1299
-		new Wordlift_Sparql_Query_Async_Task();
1300
-		new Wordlift_Batch_Analysis_Request_Async_Task();
1301
-		new Wordlift_Batch_Analysis_Complete_Async_Task();
1302
-		new Wordlift_Push_References_Async_Task();
1298
+        /** Async Tasks. */
1299
+        new Wordlift_Sparql_Query_Async_Task();
1300
+        new Wordlift_Batch_Analysis_Request_Async_Task();
1301
+        new Wordlift_Batch_Analysis_Complete_Async_Task();
1302
+        new Wordlift_Push_References_Async_Task();
1303 1303
 
1304
-		/** WL Autocomplete. */
1305
-		$this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service );
1306
-		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service );
1304
+        /** WL Autocomplete. */
1305
+        $this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service );
1306
+        $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service );
1307 1307
 
1308
-		/** WordPress Admin UI. */
1308
+        /** WordPress Admin UI. */
1309 1309
 
1310
-		// UI elements.
1311
-		$this->input_element           = new Wordlift_Admin_Input_Element();
1312
-		$this->radio_input_element     = new Wordlift_Admin_Radio_Input_Element();
1313
-		$this->select2_element         = new Wordlift_Admin_Select2_Element();
1314
-		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1315
-		$this->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1316
-		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1317
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1318
-		$this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1310
+        // UI elements.
1311
+        $this->input_element           = new Wordlift_Admin_Input_Element();
1312
+        $this->radio_input_element     = new Wordlift_Admin_Radio_Input_Element();
1313
+        $this->select2_element         = new Wordlift_Admin_Select2_Element();
1314
+        $this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1315
+        $this->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1316
+        $tabs_element                  = new Wordlift_Admin_Tabs_Element();
1317
+        $this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1318
+        $this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1319 1319
 
1320
-		$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 );
1321
-		$this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service );
1322
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1320
+        $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 );
1321
+        $this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service );
1322
+        $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1323 1323
 
1324
-		// Pages.
1325
-		new Wordlift_Admin_Post_Edit_Page( $this );
1326
-		new Wordlift_Entity_Type_Admin_Service();
1324
+        // Pages.
1325
+        new Wordlift_Admin_Post_Edit_Page( $this );
1326
+        new Wordlift_Entity_Type_Admin_Service();
1327 1327
 
1328
-		// create an instance of the entity type list admin page controller.
1329
-		$this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
1328
+        // create an instance of the entity type list admin page controller.
1329
+        $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
1330 1330
 
1331
-		// create an instance of the entity type setting admin page controller.
1332
-		$this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
1331
+        // create an instance of the entity type setting admin page controller.
1332
+        $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
1333 1333
 
1334
-		/** Widgets */
1335
-		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1334
+        /** Widgets */
1335
+        $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1336 1336
 
1337
-		/* WordPress Admin. */
1338
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1339
-		$this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1337
+        /* WordPress Admin. */
1338
+        $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1339
+        $this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1340 1340
 
1341
-		// Create an instance of the install wizard.
1342
-		$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 );
1341
+        // Create an instance of the install wizard.
1342
+        $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 );
1343 1343
 
1344
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1344
+        $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1345 1345
 
1346
-		// User Profile.
1347
-		new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1346
+        // User Profile.
1347
+        new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1348 1348
 
1349
-		$this->entity_page_service = new Wordlift_Entity_Page_Service();
1349
+        $this->entity_page_service = new Wordlift_Entity_Page_Service();
1350 1350
 
1351
-		// Load the debug service if WP is in debug mode.
1352
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1353
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1354
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1355
-		}
1351
+        // Load the debug service if WP is in debug mode.
1352
+        if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1353
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1354
+            new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1355
+        }
1356 1356
 
1357
-		// Remote Image Service.
1358
-		new Wordlift_Remote_Image_Service();
1357
+        // Remote Image Service.
1358
+        new Wordlift_Remote_Image_Service();
1359 1359
 
1360
-		/*
1360
+        /*
1361 1361
 		 * Provides mappings between post types and entity types.
1362 1362
 		 *
1363 1363
 		 * @since 3.20.0
1364 1364
 		 *
1365 1365
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/852.
1366 1366
 		 */
1367
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1368
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1369
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1367
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1368
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1369
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1370 1370
 
1371
-		// Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1372
-		new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1371
+        // Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1372
+        new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1373 1373
 
1374
-		/*
1374
+        /*
1375 1375
 		 * Batch Operations. They're similar to Batch Actions but do not require working on post types.
1376 1376
 		 *
1377 1377
 		 * Eventually Batch Actions will become Batch Operations.
1378 1378
 		 *
1379 1379
 		 * @since 3.20.0
1380 1380
 		 */
1381
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1382
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1381
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1382
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1383 1383
 
1384
-		/*
1384
+        /*
1385 1385
 		 * Add the Search Keywords taxonomy to manage the Search Keywords on WLS.
1386 1386
 		 *
1387 1387
 		 * @link https://github.com/insideout10/wordlift-plugin/issues/761
1388 1388
 		 *
1389 1389
 		 * @since 3.20.0
1390 1390
 		 */
1391
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php';
1392
-		new Wordlift_Search_Keyword_Taxonomy( $api_service );
1393
-
1394
-	}
1395
-
1396
-	/**
1397
-	 * Define the locale for this plugin for internationalization.
1398
-	 *
1399
-	 * Uses the Wordlift_i18n class in order to set the domain and to register the hook
1400
-	 * with WordPress.
1401
-	 *
1402
-	 * @since    1.0.0
1403
-	 * @access   private
1404
-	 */
1405
-	private function set_locale() {
1406
-
1407
-		$plugin_i18n = new Wordlift_i18n();
1408
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1409
-
1410
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1411
-
1412
-	}
1413
-
1414
-	/**
1415
-	 * Register all of the hooks related to the admin area functionality
1416
-	 * of the plugin.
1417
-	 *
1418
-	 * @since    1.0.0
1419
-	 * @access   private
1420
-	 */
1421
-	private function define_admin_hooks() {
1422
-
1423
-		$plugin_admin = new Wordlift_Admin(
1424
-			$this->get_plugin_name(),
1425
-			$this->get_version(),
1426
-			$this->configuration_service,
1427
-			$this->notice_service,
1428
-			$this->user_service
1429
-		);
1430
-
1431
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1432
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1433
-
1434
-		// Hook the init action to taxonomy services.
1435
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1436
-		$this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1437
-
1438
-		// Hook the deleted_post_meta action to the Thumbnail service.
1439
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1440
-
1441
-		// Hook the added_post_meta action to the Thumbnail service.
1442
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1443
-
1444
-		// Hook the updated_post_meta action to the Thumbnail service.
1445
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1446
-
1447
-		// Hook the AJAX wl_timeline action to the Timeline service.
1448
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1449
-
1450
-		// Register custom allowed redirect hosts.
1451
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1452
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1453
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1454
-
1455
-		/*
1391
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php';
1392
+        new Wordlift_Search_Keyword_Taxonomy( $api_service );
1393
+
1394
+    }
1395
+
1396
+    /**
1397
+     * Define the locale for this plugin for internationalization.
1398
+     *
1399
+     * Uses the Wordlift_i18n class in order to set the domain and to register the hook
1400
+     * with WordPress.
1401
+     *
1402
+     * @since    1.0.0
1403
+     * @access   private
1404
+     */
1405
+    private function set_locale() {
1406
+
1407
+        $plugin_i18n = new Wordlift_i18n();
1408
+        $plugin_i18n->set_domain( $this->get_plugin_name() );
1409
+
1410
+        $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1411
+
1412
+    }
1413
+
1414
+    /**
1415
+     * Register all of the hooks related to the admin area functionality
1416
+     * of the plugin.
1417
+     *
1418
+     * @since    1.0.0
1419
+     * @access   private
1420
+     */
1421
+    private function define_admin_hooks() {
1422
+
1423
+        $plugin_admin = new Wordlift_Admin(
1424
+            $this->get_plugin_name(),
1425
+            $this->get_version(),
1426
+            $this->configuration_service,
1427
+            $this->notice_service,
1428
+            $this->user_service
1429
+        );
1430
+
1431
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1432
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1433
+
1434
+        // Hook the init action to taxonomy services.
1435
+        $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1436
+        $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1437
+
1438
+        // Hook the deleted_post_meta action to the Thumbnail service.
1439
+        $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1440
+
1441
+        // Hook the added_post_meta action to the Thumbnail service.
1442
+        $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1443
+
1444
+        // Hook the updated_post_meta action to the Thumbnail service.
1445
+        $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1446
+
1447
+        // Hook the AJAX wl_timeline action to the Timeline service.
1448
+        $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1449
+
1450
+        // Register custom allowed redirect hosts.
1451
+        $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1452
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1453
+        $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1454
+
1455
+        /*
1456 1456
 		 * The old dashboard is replaced with dashboard v2.
1457 1457
 		 *
1458 1458
 		 * The old dashboard service is still loaded because its functions are used.
@@ -1461,285 +1461,285 @@  discard block
 block discarded – undo
1461 1461
 		 *
1462 1462
 		 * @since 3.20.0
1463 1463
 		 */
1464
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1465
-		// $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1466
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1467
-		// $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1468
-
1469
-		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1470
-		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1471
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1472
-		$this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1473
-
1474
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1475
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1476
-
1477
-		// Entity listing customization (wp-admin/edit.php)
1478
-		// Add custom columns.
1479
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1480
-		// no explicit entity as it prevents handling of other post types.
1481
-		$this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1482
-		// Add 4W selection.
1483
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1484
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1485
-		$this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1486
-		$this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1487
-
1488
-		/*
1464
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1465
+        // $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1466
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1467
+        // $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1468
+
1469
+        // Hook save_post to the entity service to update custom fields (such as alternate labels).
1470
+        // We have a priority of 9 because we want to be executed before data is sent to Redlink.
1471
+        $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1472
+        $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1473
+
1474
+        $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1475
+        $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1476
+
1477
+        // Entity listing customization (wp-admin/edit.php)
1478
+        // Add custom columns.
1479
+        $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1480
+        // no explicit entity as it prevents handling of other post types.
1481
+        $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1482
+        // Add 4W selection.
1483
+        $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1484
+        $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1485
+        $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1486
+        $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1487
+
1488
+        /*
1489 1489
 		 * If `All Entity Types` is disable, use the radio button Walker.
1490 1490
 		 *
1491 1491
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1492 1492
 		 */
1493
-		if ( ! WL_ALL_ENTITY_TYPES ) {
1494
-			$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1495
-		}
1493
+        if ( ! WL_ALL_ENTITY_TYPES ) {
1494
+            $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1495
+        }
1496 1496
 
1497
-		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1498
-		// entities.
1499
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1497
+        // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1498
+        // entities.
1499
+        $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1500 1500
 
1501
-		// Filter imported post meta.
1502
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1501
+        // Filter imported post meta.
1502
+        $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1503 1503
 
1504
-		// Notify the import service when an import starts and ends.
1505
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1506
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1504
+        // Notify the import service when an import starts and ends.
1505
+        $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1506
+        $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1507 1507
 
1508
-		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1509
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1510
-		$this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1508
+        // Hook the AJAX wl_rebuild action to the Rebuild Service.
1509
+        $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1510
+        $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1511 1511
 
1512
-		// Hook the menu to the Download Your Data page.
1513
-		$this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1514
-		$this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1515
-		$this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1512
+        // Hook the menu to the Download Your Data page.
1513
+        $this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1514
+        $this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1515
+        $this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1516 1516
 
1517
-		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1518
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1517
+        // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1518
+        $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1519 1519
 
1520
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1521
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1522
-		$this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1523
-		$this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1520
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1521
+        $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1522
+        $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1523
+        $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1524 1524
 
1525
-		// Hook the AJAX wl_validate_key action to the Key Validation service.
1526
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1525
+        // Hook the AJAX wl_validate_key action to the Key Validation service.
1526
+        $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1527 1527
 
1528
-		// Hook the AJAX wl_update_country_options action to the countries.
1529
-		$this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' );
1528
+        // Hook the AJAX wl_update_country_options action to the countries.
1529
+        $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' );
1530 1530
 
1531
-		// Hook the `admin_init` function to the Admin Setup.
1532
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1531
+        // Hook the `admin_init` function to the Admin Setup.
1532
+        $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1533 1533
 
1534
-		// Hook the admin_init to the settings page.
1535
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1534
+        // Hook the admin_init to the settings page.
1535
+        $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1536 1536
 
1537
-		$this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1537
+        $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1538 1538
 
1539
-		// Hook the menu creation on the general wordlift menu creation.
1540
-		$this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1541
-		if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) {
1542
-			// Add the functionality only if a flag is set in wp-config.php .
1543
-			$this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 );
1544
-		}
1539
+        // Hook the menu creation on the general wordlift menu creation.
1540
+        $this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1541
+        if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) {
1542
+            // Add the functionality only if a flag is set in wp-config.php .
1543
+            $this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 );
1544
+        }
1545 1545
 
1546
-		/*
1546
+        /*
1547 1547
 		 * Display the `Wordlift_Admin_Search_Rankings_Page` page.
1548 1548
 		 *
1549 1549
 		 * @link https://github.com/insideout10/wordlift-plugin/issues/761
1550 1550
 		 *
1551 1551
 		 * @since 3.20.0
1552 1552
 		 */
1553
-		if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) {
1554
-			$admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page();
1555
-			$this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' );
1556
-		}
1557
-
1558
-		// Hook key update.
1559
-		$this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1560
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1561
-
1562
-		// Add additional action links to the WordLift plugin in the plugins page.
1563
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1564
-
1565
-		// Hook the AJAX `wl_publisher` action name.
1566
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1567
-
1568
-		// Hook row actions for the entity type list admin.
1569
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1570
-
1571
-		/** Ajax actions. */
1572
-		$this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1573
-
1574
-		// Hook capabilities manipulation to allow access to entity type admin
1575
-		// page  on WordPress versions before 4.7.
1576
-		global $wp_version;
1577
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1578
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1579
-		}
1580
-
1581
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1582
-
1583
-		/** Adapters. */
1584
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1585
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit' );
1586
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts' );
1587
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel' );
1588
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning' );
1589
-		$this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1590
-
1591
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1592
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1593
-
1594
-
1595
-		$this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1596
-		$this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1597
-
1598
-		// Handle the autocomplete request.
1599
-		add_action( 'wp_ajax_wl_autocomplete', array(
1600
-			$this->autocomplete_adapter,
1601
-			'wl_autocomplete',
1602
-		) );
1603
-		add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1604
-			$this->autocomplete_adapter,
1605
-			'wl_autocomplete',
1606
-		) );
1607
-
1608
-		// Hooks to restrict multisite super admin from manipulating entity types.
1609
-		if ( is_multisite() ) {
1610
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1611
-		}
1612
-
1613
-		$deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1614
-
1615
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1616
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1617
-		add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1618
-	}
1619
-
1620
-	/**
1621
-	 * Register all of the hooks related to the public-facing functionality
1622
-	 * of the plugin.
1623
-	 *
1624
-	 * @since    1.0.0
1625
-	 * @access   private
1626
-	 */
1627
-	private function define_public_hooks() {
1628
-
1629
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1630
-
1631
-		// Register the entity post type.
1632
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1633
-		$this->loader->add_action( 'init', $this->install_service, 'install' );
1634
-
1635
-		// Bind the link generation and handling hooks to the entity link service.
1636
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1637
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1638
-		$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 );
1639
-		$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 );
1640
-
1641
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1642
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1643
-
1644
-		// Hook the content filter service to add entity links.
1645
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1646
-			$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1647
-		}
1648
-
1649
-		// Hook the AJAX wl_timeline action to the Timeline service.
1650
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1651
-
1652
-		// Hook the ShareThis service.
1653
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1654
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1655
-
1656
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1657
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1658
-
1659
-		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1660
-		// in order to tweak WP's `WP_Query` to include entities in queries related
1661
-		// to categories.
1662
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1663
-
1664
-		/*
1553
+        if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) {
1554
+            $admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page();
1555
+            $this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' );
1556
+        }
1557
+
1558
+        // Hook key update.
1559
+        $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1560
+        $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1561
+
1562
+        // Add additional action links to the WordLift plugin in the plugins page.
1563
+        $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1564
+
1565
+        // Hook the AJAX `wl_publisher` action name.
1566
+        $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1567
+
1568
+        // Hook row actions for the entity type list admin.
1569
+        $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1570
+
1571
+        /** Ajax actions. */
1572
+        $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1573
+
1574
+        // Hook capabilities manipulation to allow access to entity type admin
1575
+        // page  on WordPress versions before 4.7.
1576
+        global $wp_version;
1577
+        if ( version_compare( $wp_version, '4.7', '<' ) ) {
1578
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1579
+        }
1580
+
1581
+        $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1582
+
1583
+        /** Adapters. */
1584
+        $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1585
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit' );
1586
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts' );
1587
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel' );
1588
+        $this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning' );
1589
+        $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1590
+
1591
+        $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1592
+        $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1593
+
1594
+
1595
+        $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1596
+        $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1597
+
1598
+        // Handle the autocomplete request.
1599
+        add_action( 'wp_ajax_wl_autocomplete', array(
1600
+            $this->autocomplete_adapter,
1601
+            'wl_autocomplete',
1602
+        ) );
1603
+        add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1604
+            $this->autocomplete_adapter,
1605
+            'wl_autocomplete',
1606
+        ) );
1607
+
1608
+        // Hooks to restrict multisite super admin from manipulating entity types.
1609
+        if ( is_multisite() ) {
1610
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1611
+        }
1612
+
1613
+        $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1614
+
1615
+        add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1616
+        add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1617
+        add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1618
+    }
1619
+
1620
+    /**
1621
+     * Register all of the hooks related to the public-facing functionality
1622
+     * of the plugin.
1623
+     *
1624
+     * @since    1.0.0
1625
+     * @access   private
1626
+     */
1627
+    private function define_public_hooks() {
1628
+
1629
+        $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1630
+
1631
+        // Register the entity post type.
1632
+        $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1633
+        $this->loader->add_action( 'init', $this->install_service, 'install' );
1634
+
1635
+        // Bind the link generation and handling hooks to the entity link service.
1636
+        $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1637
+        $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1638
+        $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 );
1639
+        $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 );
1640
+
1641
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1642
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1643
+
1644
+        // Hook the content filter service to add entity links.
1645
+        if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1646
+            $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1647
+        }
1648
+
1649
+        // Hook the AJAX wl_timeline action to the Timeline service.
1650
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1651
+
1652
+        // Hook the ShareThis service.
1653
+        $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1654
+        $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1655
+
1656
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1657
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1658
+
1659
+        // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1660
+        // in order to tweak WP's `WP_Query` to include entities in queries related
1661
+        // to categories.
1662
+        $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1663
+
1664
+        /*
1665 1665
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
1666 1666
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
1667 1667
 		 * order of start time.
1668 1668
 		 */
1669
-		$this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1670
-
1671
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1672
-
1673
-		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1674
-		$this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1675
-
1676
-	}
1677
-
1678
-	/**
1679
-	 * Run the loader to execute all of the hooks with WordPress.
1680
-	 *
1681
-	 * @since    1.0.0
1682
-	 */
1683
-	public function run() {
1684
-		$this->loader->run();
1685
-	}
1686
-
1687
-	/**
1688
-	 * The name of the plugin used to uniquely identify it within the context of
1689
-	 * WordPress and to define internationalization functionality.
1690
-	 *
1691
-	 * @since     1.0.0
1692
-	 * @return    string    The name of the plugin.
1693
-	 */
1694
-	public function get_plugin_name() {
1695
-		return $this->plugin_name;
1696
-	}
1697
-
1698
-	/**
1699
-	 * The reference to the class that orchestrates the hooks with the plugin.
1700
-	 *
1701
-	 * @since     1.0.0
1702
-	 * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
1703
-	 */
1704
-	public function get_loader() {
1705
-		return $this->loader;
1706
-	}
1707
-
1708
-	/**
1709
-	 * Retrieve the version number of the plugin.
1710
-	 *
1711
-	 * @since     1.0.0
1712
-	 * @return    string    The version number of the plugin.
1713
-	 */
1714
-	public function get_version() {
1715
-		return $this->version;
1716
-	}
1717
-
1718
-	/**
1719
-	 * Load dependencies for WP-CLI.
1720
-	 *
1721
-	 * @since 3.18.0
1722
-	 * @throws Exception
1723
-	 */
1724
-	private function load_cli_dependencies() {
1725
-
1726
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1727
-
1728
-		$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 );
1729
-
1730
-		WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1731
-
1732
-	}
1733
-
1734
-	/**
1735
-	 * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions.
1736
-	 *
1737
-	 * @since 3.20.0
1738
-	 * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance.
1739
-	 */
1740
-	public function get_dashboard_service() {
1741
-
1742
-		return $this->dashboard_service;
1743
-	}
1669
+        $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1670
+
1671
+        $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1672
+
1673
+        // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1674
+        $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1675
+
1676
+    }
1677
+
1678
+    /**
1679
+     * Run the loader to execute all of the hooks with WordPress.
1680
+     *
1681
+     * @since    1.0.0
1682
+     */
1683
+    public function run() {
1684
+        $this->loader->run();
1685
+    }
1686
+
1687
+    /**
1688
+     * The name of the plugin used to uniquely identify it within the context of
1689
+     * WordPress and to define internationalization functionality.
1690
+     *
1691
+     * @since     1.0.0
1692
+     * @return    string    The name of the plugin.
1693
+     */
1694
+    public function get_plugin_name() {
1695
+        return $this->plugin_name;
1696
+    }
1697
+
1698
+    /**
1699
+     * The reference to the class that orchestrates the hooks with the plugin.
1700
+     *
1701
+     * @since     1.0.0
1702
+     * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
1703
+     */
1704
+    public function get_loader() {
1705
+        return $this->loader;
1706
+    }
1707
+
1708
+    /**
1709
+     * Retrieve the version number of the plugin.
1710
+     *
1711
+     * @since     1.0.0
1712
+     * @return    string    The version number of the plugin.
1713
+     */
1714
+    public function get_version() {
1715
+        return $this->version;
1716
+    }
1717
+
1718
+    /**
1719
+     * Load dependencies for WP-CLI.
1720
+     *
1721
+     * @since 3.18.0
1722
+     * @throws Exception
1723
+     */
1724
+    private function load_cli_dependencies() {
1725
+
1726
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1727
+
1728
+        $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 );
1729
+
1730
+        WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1731
+
1732
+    }
1733
+
1734
+    /**
1735
+     * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions.
1736
+     *
1737
+     * @since 3.20.0
1738
+     * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance.
1739
+     */
1740
+    public function get_dashboard_service() {
1741
+
1742
+        return $this->dashboard_service;
1743
+    }
1744 1744
 
1745 1745
 }
Please login to merge, or discard this patch.
Spacing   +312 added lines, -312 removed lines patch added patch discarded remove patch
@@ -731,7 +731,7 @@  discard block
 block discarded – undo
731 731
 		$this->define_public_hooks();
732 732
 
733 733
 		// If we're in `WP_CLI` load the related files.
734
-		if ( class_exists( 'WP_CLI' ) ) {
734
+		if (class_exists('WP_CLI')) {
735 735
 			$this->load_cli_dependencies();
736 736
 		}
737 737
 
@@ -771,374 +771,374 @@  discard block
 block discarded – undo
771 771
 		 * The class responsible for orchestrating the actions and filters of the
772 772
 		 * core plugin.
773 773
 		 */
774
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
774
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php';
775 775
 
776 776
 		// The class responsible for plugin uninstall.
777
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
777
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-deactivator-feedback.php';
778 778
 
779 779
 		/**
780 780
 		 * The class responsible for defining internationalization functionality
781 781
 		 * of the plugin.
782 782
 		 */
783
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
783
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php';
784 784
 
785 785
 		/**
786 786
 		 * WordLift's supported languages.
787 787
 		 */
788
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
788
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php';
789 789
 
790 790
 		/**
791 791
 		 * WordLift's supported countries.
792 792
 		 */
793
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
793
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-countries.php';
794 794
 
795 795
 		/**
796 796
 		 * Provide support functions to sanitize data.
797 797
 		 */
798
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
798
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php';
799 799
 
800 800
 		/** Services. */
801
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
802
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
803
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
804
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
805
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
806
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
807
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
808
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
809
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
810
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
801
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php';
802
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php';
803
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php';
804
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php';
805
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php';
806
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php';
807
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php';
808
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-linked-data-service.php';
809
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php';
810
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-image-service.php';
811 811
 
812 812
 		/**
813 813
 		 * The Query builder.
814 814
 		 */
815
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
815
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php';
816 816
 
817 817
 		/**
818 818
 		 * The Schema service.
819 819
 		 */
820
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
820
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php';
821 821
 
822 822
 		/**
823 823
 		 * The schema:url property service.
824 824
 		 */
825
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
826
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
825
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php';
826
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php';
827 827
 
828 828
 		/**
829 829
 		 * The UI service.
830 830
 		 */
831
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
831
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php';
832 832
 
833 833
 		/**
834 834
 		 * The Thumbnail service.
835 835
 		 */
836
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
836
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php';
837 837
 
838 838
 		/**
839 839
 		 * The Entity Types Taxonomy service.
840 840
 		 */
841
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
841
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-taxonomy-service.php';
842 842
 
843 843
 		/**
844 844
 		 * The Entity service.
845 845
 		 */
846
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
847
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
846
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php';
847
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php';
848 848
 
849 849
 		// Add the entity rating service.
850
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
850
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php';
851 851
 
852 852
 		/**
853 853
 		 * The User service.
854 854
 		 */
855
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
855
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php';
856 856
 
857 857
 		/**
858 858
 		 * The Timeline service.
859 859
 		 */
860
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
860
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php';
861 861
 
862 862
 		/**
863 863
 		 * The Topic Taxonomy service.
864 864
 		 */
865
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
865
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php';
866 866
 
867 867
 		/**
868 868
 		 * The SPARQL service.
869 869
 		 */
870
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
870
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php';
871 871
 
872 872
 		/**
873 873
 		 * The WordLift import service.
874 874
 		 */
875
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
875
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php';
876 876
 
877 877
 		/**
878 878
 		 * The WordLift URI service.
879 879
 		 */
880
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
881
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
882
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
880
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php';
881
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php';
882
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php';
883 883
 
884 884
 		/**
885 885
 		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
886 886
 		 */
887
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
888
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
889
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
890
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
891
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
887
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-listable.php';
888
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-rebuild-service.php';
889
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-reference-rebuild-service.php';
890
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-service.php';
891
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
892 892
 
893
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
894
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
893
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php';
894
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php';
895 895
 
896 896
 		/**
897 897
 		 * Load the converters.
898 898
 		 */
899
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
900
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
901
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
902
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
903
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
904
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
899
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php';
900
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
901
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php';
902
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php';
903
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php';
904
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php';
905 905
 
906 906
 		/**
907 907
 		 * Load cache-related files.
908 908
 		 */
909
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
909
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php';
910 910
 
911 911
 		/**
912 912
 		 * Load the content filter.
913 913
 		 */
914
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
914
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php';
915 915
 
916 916
 		/*
917 917
 		 * Load the excerpt helper.
918 918
 		 */
919
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
919
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php';
920 920
 
921 921
 		/**
922 922
 		 * Load the JSON-LD service to publish entities using JSON-LD.s
923 923
 		 *
924 924
 		 * @since 3.8.0
925 925
 		 */
926
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
926
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php';
927 927
 
928 928
 		// The Publisher Service and the AJAX adapter.
929
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
930
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
929
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php';
930
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php';
931 931
 
932
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
932
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php';
933 933
 
934 934
 		/**
935 935
 		 * Load the WordLift key validation service.
936 936
 		 */
937
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
937
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php';
938 938
 
939 939
 		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
940
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
940
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php';
941 941
 
942 942
 		// Load the `Wordlift_Entity_Page_Service` class definition.
943
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
944
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
945
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
943
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php';
944
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch-analysis/class-wordlift-batch-analysis-sql-helper.php';
945
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch-analysis/class-wordlift-batch-analysis-service.php';
946 946
 
947 947
 		/** Linked Data. */
948
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
949
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
950
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
951
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
952
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
953
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
954
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
955
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
956
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
957
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
958
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
948
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php';
949
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
950
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php';
951
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
952
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
953
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php';
954
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
955
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php';
956
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php';
957
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php';
958
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php';
959 959
 
960 960
 		/** Linked Data Rendition. */
961
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
962
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
963
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
964
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
961
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
962
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
963
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
964
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
965 965
 
966 966
 		/** Services. */
967
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
968
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
969
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
967
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php';
968
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-api-service.php';
969
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php';
970 970
 
971 971
 		/** Adapters. */
972
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
973
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
974
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
975
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
976
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
977
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
972
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php';
973
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php';
974
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php';
975
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php';
976
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch-analysis/class-wordlift-batch-analysis-adapter.php';
977
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-wprocket-adapter.php';
978 978
 
979 979
 		/** Async Tasks. */
980
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
981
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
982
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
983
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
984
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
980
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-async-task.php';
981
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
982
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-batch-analysis-request-async-task.php';
983
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-batch-analysis-complete-async-task.php';
984
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-push-references-async-task.php';
985 985
 
986 986
 		/** Autocomplete. */
987
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-service.php';
988
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
987
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-service.php';
988
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php';
989 989
 
990
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
990
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php';
991 991
 
992 992
 		/**
993 993
 		 * The class responsible for defining all actions that occur in the admin area.
994 994
 		 */
995
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
995
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php';
996 996
 
997 997
 		/**
998 998
 		 * The class to customize the entity list admin page.
999 999
 		 */
1000
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
1000
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php';
1001 1001
 
1002 1002
 		/**
1003 1003
 		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
1004 1004
 		 */
1005
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
1005
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php';
1006 1006
 
1007 1007
 		/**
1008 1008
 		 * The Notice service.
1009 1009
 		 */
1010
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1010
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php';
1011 1011
 
1012 1012
 		/**
1013 1013
 		 * The PrimaShop adapter.
1014 1014
 		 */
1015
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1015
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php';
1016 1016
 
1017 1017
 		/**
1018 1018
 		 * The WordLift Dashboard service.
1019 1019
 		 */
1020
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1020
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php';
1021 1021
 
1022 1022
 		/**
1023 1023
 		 * The admin 'Install wizard' page.
1024 1024
 		 */
1025
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1025
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php';
1026 1026
 
1027 1027
 		/**
1028 1028
 		 * The WordLift entity type list admin page controller.
1029 1029
 		 */
1030
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1030
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1031 1031
 
1032 1032
 		/**
1033 1033
 		 * The WordLift entity type settings admin page controller.
1034 1034
 		 */
1035
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1035
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php';
1036 1036
 
1037 1037
 		/**
1038 1038
 		 * The admin 'Download Your Data' page.
1039 1039
 		 */
1040
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1040
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php';
1041 1041
 
1042 1042
 		/**
1043 1043
 		 * The admin 'WordLift Settings' page.
1044 1044
 		 */
1045
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
1046
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
1047
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
1048
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
1049
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
1050
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
1051
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
1052
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
1053
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
1054
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
1055
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1056
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1057
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-batch-analysis-page.php';
1058
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1045
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/intf-wordlift-admin-element.php';
1046
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-element.php';
1047
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-radio-element.php';
1048
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select-element.php';
1049
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select2-element.php';
1050
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-language-select-element.php';
1051
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-country-select-element.php';
1052
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-tabs-element.php';
1053
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-author-element.php';
1054
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-publisher-element.php';
1055
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php';
1056
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php';
1057
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-batch-analysis-page.php';
1058
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php';
1059 1059
 
1060 1060
 		/** Admin Pages */
1061
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1062
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1063
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1064
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-search-rankings-page.php';
1065
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1061
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php';
1062
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php';
1063
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php';
1064
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-search-rankings-page.php';
1065
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php';
1066 1066
 
1067 1067
 		/**
1068 1068
 		 * The class responsible for defining all actions that occur in the public-facing
1069 1069
 		 * side of the site.
1070 1070
 		 */
1071
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1071
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php';
1072 1072
 
1073 1073
 		/**
1074 1074
 		 * The shortcode abstract class.
1075 1075
 		 */
1076
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1076
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php';
1077 1077
 
1078 1078
 		/**
1079 1079
 		 * The Timeline shortcode.
1080 1080
 		 */
1081
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1081
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php';
1082 1082
 
1083 1083
 		/**
1084 1084
 		 * The Navigator shortcode.
1085 1085
 		 */
1086
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1086
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php';
1087 1087
 
1088 1088
 		/**
1089 1089
 		 * The chord shortcode.
1090 1090
 		 */
1091
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1091
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php';
1092 1092
 
1093 1093
 		/**
1094 1094
 		 * The geomap shortcode.
1095 1095
 		 */
1096
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1096
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php';
1097 1097
 
1098 1098
 		/**
1099 1099
 		 * The entity cloud shortcode.
1100 1100
 		 */
1101
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1101
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php';
1102 1102
 
1103 1103
 		/**
1104 1104
 		 * The entity glossary shortcode.
1105 1105
 		 */
1106
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1107
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1106
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-alphabet-service.php';
1107
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-vocabulary-shortcode.php';
1108 1108
 
1109 1109
 		/**
1110 1110
 		 * Faceted Search shortcode.
1111 1111
 		 */
1112
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php';		
1112
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-faceted-search-shortcode.php';		
1113 1113
 
1114 1114
 		/**
1115 1115
 		 * The ShareThis service.
1116 1116
 		 */
1117
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1117
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php';
1118 1118
 
1119 1119
 		/**
1120 1120
 		 * The SEO service.
1121 1121
 		 */
1122
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1122
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php';
1123 1123
 
1124 1124
 		/**
1125 1125
 		 * The AMP service.
1126 1126
 		 */
1127
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1127
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php';
1128 1128
 
1129 1129
 		/** Widgets */
1130
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1131
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1130
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php';
1131
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php';
1132 1132
 
1133 1133
 		/*
1134 1134
 		 * Schema.org Services.
1135 1135
 		 *
1136 1136
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1137 1137
 		 */
1138
-		if ( WL_ALL_ENTITY_TYPES ) {
1139
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1140
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1141
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1138
+		if (WL_ALL_ENTITY_TYPES) {
1139
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1140
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1141
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1142 1142
 			new Wordlift_Schemaorg_Sync_Service();
1143 1143
 			$schemaorg_property_service = new Wordlift_Schemaorg_Property_Service();
1144 1144
 			new Wordlift_Schemaorg_Class_Service();
@@ -1150,7 +1150,7 @@  discard block
 block discarded – undo
1150 1150
 
1151 1151
 		// Instantiate a global logger.
1152 1152
 		global $wl_logger;
1153
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1153
+		$wl_logger = Wordlift_Log_Service::get_logger('WordLift');
1154 1154
 
1155 1155
 		// Load the `wl-api` end-point.
1156 1156
 		new Wordlift_Http_Api();
@@ -1161,13 +1161,13 @@  discard block
 block discarded – undo
1161 1161
 		/** Services. */
1162 1162
 		// Create the configuration service.
1163 1163
 		$this->configuration_service = new Wordlift_Configuration_Service();
1164
-		$api_service                 = new Wordlift_Api_Service( $this->configuration_service );
1164
+		$api_service                 = new Wordlift_Api_Service($this->configuration_service);
1165 1165
 
1166 1166
 		// Create an entity type service instance. It'll be later bound to the init action.
1167
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1167
+		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path());
1168 1168
 
1169 1169
 		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1170
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1170
+		$this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path());
1171 1171
 
1172 1172
 		// Create an instance of the UI service.
1173 1173
 		$this->ui_service = new Wordlift_UI_Service();
@@ -1176,34 +1176,34 @@  discard block
 block discarded – undo
1176 1176
 		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
1177 1177
 
1178 1178
 		$this->sparql_service        = new Wordlift_Sparql_Service();
1179
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1179
+		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service);
1180 1180
 		$this->notice_service        = new Wordlift_Notice_Service();
1181 1181
 		$this->relation_service      = new Wordlift_Relation_Service();
1182 1182
 
1183
-		$entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1184
-		$this->file_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'converter/' );
1185
-		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1186
-		$this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1187
-		$this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1183
+		$entity_uri_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'entity_uri/');
1184
+		$this->file_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'converter/');
1185
+		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service($this->configuration_service, $entity_uri_cache_service);
1186
+		$this->entity_service     = new Wordlift_Entity_Service($this->ui_service, $this->relation_service, $this->entity_uri_service);
1187
+		$this->user_service       = new Wordlift_User_Service($this->sparql_service, $this->entity_service);
1188 1188
 
1189 1189
 		// Instantiate the JSON-LD service.
1190
-		$property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1190
+		$property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service);
1191 1191
 
1192 1192
 		/** Linked Data. */
1193
-		$this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1194
-		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1193
+		$this->storage_factory   = new Wordlift_Storage_Factory($this->entity_service, $this->user_service, $property_getter);
1194
+		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory($this->entity_service);
1195 1195
 
1196
-		$this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1196
+		$this->schema_service = new Wordlift_Schema_Service($this->storage_factory, $this->rendition_factory, $this->configuration_service);
1197 1197
 
1198 1198
 		// Create a new instance of the Redirect service.
1199
-		$this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_service );
1200
-		$this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1201
-		$this->linked_data_service = new Wordlift_Linked_Data_Service( $this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service );
1199
+		$this->redirect_service    = new Wordlift_Redirect_Service($this->entity_service);
1200
+		$this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service);
1201
+		$this->linked_data_service = new Wordlift_Linked_Data_Service($this->entity_service, $this->entity_type_service, $this->schema_service, $this->sparql_service);
1202 1202
 
1203 1203
 		// Create a new instance of the Timeline service and Timeline shortcode.
1204
-		$this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1204
+		$this->timeline_service = new Wordlift_Timeline_Service($this->entity_service, $this->entity_type_service);
1205 1205
 
1206
-		$this->batch_analysis_service = new Wordlift_Batch_Analysis_Service( $this, $this->configuration_service, $this->file_cache_service );
1206
+		$this->batch_analysis_service = new Wordlift_Batch_Analysis_Service($this, $this->configuration_service, $this->file_cache_service);
1207 1207
 
1208 1208
 		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1209 1209
 
@@ -1217,68 +1217,68 @@  discard block
 block discarded – undo
1217 1217
 		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1218 1218
 
1219 1219
 		// Create an import service instance to hook later to WP's import function.
1220
-		$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() );
1220
+		$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());
1221 1221
 
1222
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1222
+		$uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']);
1223 1223
 
1224 1224
 		// Create the entity rating service.
1225
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1225
+		$this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service);
1226 1226
 
1227 1227
 		// Create entity list customization (wp-admin/edit.php).
1228
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1228
+		$this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service);
1229 1229
 
1230 1230
 		// Create a new instance of the Redirect service.
1231
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1231
+		$this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service, $this->entity_service);
1232 1232
 
1233 1233
 		// Create an instance of the Publisher Service and the AJAX Adapter.
1234
-		$this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1235
-		$this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1236
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1234
+		$this->publisher_service = new Wordlift_Publisher_Service($this->configuration_service);
1235
+		$this->property_factory  = new Wordlift_Property_Factory($schema_url_property_service);
1236
+		$this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service);
1237 1237
 
1238 1238
 		$attachment_service = new Wordlift_Attachment_Service();
1239 1239
 
1240 1240
 		// Instantiate the JSON-LD service.
1241
-		$property_getter                         = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1242
-		$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 );
1243
-		$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 );
1244
-		$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 );
1245
-		$this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1246
-		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service );
1247
-		$this->jsonld_service                    = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter );
1248
-
1249
-
1250
-		$this->key_validation_service    = new Wordlift_Key_Validation_Service( $this->configuration_service );
1251
-		$this->content_filter_service    = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1252
-		$this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1253
-		$this->sample_data_service       = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1254
-		$this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1255
-		$this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service( $this->linked_data_service, $this->entity_service, $this->relation_service );
1241
+		$property_getter                         = Wordlift_Property_Getter_Factory::create($this->entity_service);
1242
+		$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);
1243
+		$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);
1244
+		$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);
1245
+		$this->jsonld_website_converter          = new Wordlift_Website_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service);
1246
+		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($this->postid_to_jsonld_converter, $this->file_cache_service, $this->configuration_service);
1247
+		$this->jsonld_service                    = new Wordlift_Jsonld_Service($this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter);
1248
+
1249
+
1250
+		$this->key_validation_service    = new Wordlift_Key_Validation_Service($this->configuration_service);
1251
+		$this->content_filter_service    = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service, $this->entity_uri_service);
1252
+		$this->relation_rebuild_service  = new Wordlift_Relation_Rebuild_Service($this->content_filter_service, $this->entity_service);
1253
+		$this->sample_data_service       = new Wordlift_Sample_Data_Service($this->entity_type_service, $this->configuration_service, $this->user_service);
1254
+		$this->sample_data_ajax_adapter  = new Wordlift_Sample_Data_Ajax_Adapter($this->sample_data_service);
1255
+		$this->reference_rebuild_service = new Wordlift_Reference_Rebuild_Service($this->linked_data_service, $this->entity_service, $this->relation_service);
1256 1256
 
1257 1257
 		// Initialize the shortcodes.
1258 1258
 		new Wordlift_Navigator_Shortcode();
1259 1259
 		new Wordlift_Chord_Shortcode();
1260 1260
 		new Wordlift_Geomap_Shortcode();
1261 1261
 		new Wordlift_Timeline_Shortcode();
1262
-		new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service );
1263
-		new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1262
+		new Wordlift_Related_Entities_Cloud_Shortcode($this->relation_service);
1263
+		new Wordlift_Vocabulary_Shortcode($this->configuration_service);
1264 1264
 		new Wordlift_Faceted_Search_Shortcode();
1265 1265
 
1266 1266
 		// Initialize the SEO service.
1267 1267
 		new Wordlift_Seo_Service();
1268 1268
 
1269 1269
 		// Initialize the AMP service.
1270
-		new Wordlift_AMP_Service( $this->jsonld_service );
1270
+		new Wordlift_AMP_Service($this->jsonld_service);
1271 1271
 
1272 1272
 		/** Services. */
1273 1273
 		$this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1274 1274
 		new Wordlift_Image_Service();
1275 1275
 
1276 1276
 		/** Adapters. */
1277
-		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1278
-		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1279
-		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter( $this );
1280
-		$this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter( $this->batch_analysis_service );
1281
-		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1277
+		$this->entity_type_adapter      = new Wordlift_Entity_Type_Adapter($this->entity_type_service);
1278
+		$this->publisher_ajax_adapter   = new Wordlift_Publisher_Ajax_Adapter($this->publisher_service);
1279
+		$this->tinymce_adapter          = new Wordlift_Tinymce_Adapter($this);
1280
+		$this->batch_analysis_adapter   = new Wordlift_Batch_Analysis_Adapter($this->batch_analysis_service);
1281
+		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter($this->relation_rebuild_service);
1282 1282
 
1283 1283
 		/*
1284 1284
 		 * Exclude our public js from WP-Rocket.
@@ -1302,8 +1302,8 @@  discard block
 block discarded – undo
1302 1302
 		new Wordlift_Push_References_Async_Task();
1303 1303
 
1304 1304
 		/** WL Autocomplete. */
1305
-		$this->autocomplete_service = new Wordlift_Autocomplete_Service( $this->configuration_service );
1306
-		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $this->autocomplete_service );
1305
+		$this->autocomplete_service = new Wordlift_Autocomplete_Service($this->configuration_service);
1306
+		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($this->autocomplete_service);
1307 1307
 
1308 1308
 		/** WordPress Admin UI. */
1309 1309
 
@@ -1314,15 +1314,15 @@  discard block
 block discarded – undo
1314 1314
 		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1315 1315
 		$this->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1316 1316
 		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1317
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1318
-		$this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1317
+		$this->publisher_element       = new Wordlift_Admin_Publisher_Element($this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element);
1318
+		$this->author_element          = new Wordlift_Admin_Author_Element($this->publisher_service, $this->select2_element);
1319 1319
 
1320
-		$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 );
1321
-		$this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page( $this->batch_analysis_service );
1322
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1320
+		$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);
1321
+		$this->batch_analysis_page       = new Wordlift_Batch_Analysis_Page($this->batch_analysis_service);
1322
+		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page);
1323 1323
 
1324 1324
 		// Pages.
1325
-		new Wordlift_Admin_Post_Edit_Page( $this );
1325
+		new Wordlift_Admin_Post_Edit_Page($this);
1326 1326
 		new Wordlift_Entity_Type_Admin_Service();
1327 1327
 
1328 1328
 		// create an instance of the entity type list admin page controller.
@@ -1335,23 +1335,23 @@  discard block
 block discarded – undo
1335 1335
 		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1336 1336
 
1337 1337
 		/* WordPress Admin. */
1338
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1339
-		$this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1338
+		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service);
1339
+		$this->status_page             = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service);
1340 1340
 
1341 1341
 		// Create an instance of the install wizard.
1342
-		$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 );
1342
+		$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);
1343 1343
 
1344
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1344
+		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service);
1345 1345
 
1346 1346
 		// User Profile.
1347
-		new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1347
+		new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service);
1348 1348
 
1349 1349
 		$this->entity_page_service = new Wordlift_Entity_Page_Service();
1350 1350
 
1351 1351
 		// Load the debug service if WP is in debug mode.
1352
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1353
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1354
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1352
+		if (defined('WP_DEBUG') && WP_DEBUG) {
1353
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php';
1354
+			new Wordlift_Debug_Service($this->entity_service, $uri_service);
1355 1355
 		}
1356 1356
 
1357 1357
 		// Remote Image Service.
@@ -1364,12 +1364,12 @@  discard block
 block discarded – undo
1364 1364
 		 *
1365 1365
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/852.
1366 1366
 		 */
1367
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1368
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1369
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1367
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-action.php';
1368
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-service.php';
1369
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1370 1370
 
1371 1371
 		// Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1372
-		new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1372
+		new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance()));
1373 1373
 
1374 1374
 		/*
1375 1375
 		 * Batch Operations. They're similar to Batch Actions but do not require working on post types.
@@ -1378,8 +1378,8 @@  discard block
 block discarded – undo
1378 1378
 		 *
1379 1379
 		 * @since 3.20.0
1380 1380
 		 */
1381
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1382
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1381
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/intf-wordlift-batch-operation.php';
1382
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1383 1383
 
1384 1384
 		/*
1385 1385
 		 * Add the Search Keywords taxonomy to manage the Search Keywords on WLS.
@@ -1388,8 +1388,8 @@  discard block
 block discarded – undo
1388 1388
 		 *
1389 1389
 		 * @since 3.20.0
1390 1390
 		 */
1391
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php';
1392
-		new Wordlift_Search_Keyword_Taxonomy( $api_service );
1391
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/search-keywords/class-wordlift-search-keyword-taxonomy.php';
1392
+		new Wordlift_Search_Keyword_Taxonomy($api_service);
1393 1393
 
1394 1394
 	}
1395 1395
 
@@ -1405,9 +1405,9 @@  discard block
 block discarded – undo
1405 1405
 	private function set_locale() {
1406 1406
 
1407 1407
 		$plugin_i18n = new Wordlift_i18n();
1408
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1408
+		$plugin_i18n->set_domain($this->get_plugin_name());
1409 1409
 
1410
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1410
+		$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
1411 1411
 
1412 1412
 	}
1413 1413
 
@@ -1428,29 +1428,29 @@  discard block
 block discarded – undo
1428 1428
 			$this->user_service
1429 1429
 		);
1430 1430
 
1431
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1432
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1431
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
1432
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11);
1433 1433
 
1434 1434
 		// Hook the init action to taxonomy services.
1435
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1436
-		$this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1435
+		$this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0);
1436
+		$this->loader->add_action('init', $this->entity_types_taxonomy_service, 'init', 0);
1437 1437
 
1438 1438
 		// Hook the deleted_post_meta action to the Thumbnail service.
1439
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1439
+		$this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4);
1440 1440
 
1441 1441
 		// Hook the added_post_meta action to the Thumbnail service.
1442
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1442
+		$this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4);
1443 1443
 
1444 1444
 		// Hook the updated_post_meta action to the Thumbnail service.
1445
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1445
+		$this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4);
1446 1446
 
1447 1447
 		// Hook the AJAX wl_timeline action to the Timeline service.
1448
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1448
+		$this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline');
1449 1449
 
1450 1450
 		// Register custom allowed redirect hosts.
1451
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1451
+		$this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts');
1452 1452
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1453
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1453
+		$this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect');
1454 1454
 
1455 1455
 		/*
1456 1456
 		 * The old dashboard is replaced with dashboard v2.
@@ -1468,79 +1468,79 @@  discard block
 block discarded – undo
1468 1468
 
1469 1469
 		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1470 1470
 		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1471
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1472
-		$this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1471
+		$this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3);
1472
+		$this->loader->add_action('save_post', $this->rating_service, 'set_rating_for', 20, 1);
1473 1473
 
1474
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1475
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1474
+		$this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1);
1475
+		$this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header');
1476 1476
 
1477 1477
 		// Entity listing customization (wp-admin/edit.php)
1478 1478
 		// Add custom columns.
1479
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1479
+		$this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns');
1480 1480
 		// no explicit entity as it prevents handling of other post types.
1481
-		$this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1481
+		$this->loader->add_filter('manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2);
1482 1482
 		// Add 4W selection.
1483
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1484
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1485
-		$this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1486
-		$this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1483
+		$this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope');
1484
+		$this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope');
1485
+		$this->loader->add_action('pre_get_posts', $this->entity_list_service, 'pre_get_posts');
1486
+		$this->loader->add_action('load-edit.php', $this->entity_list_service, 'load_edit');
1487 1487
 
1488 1488
 		/*
1489 1489
 		 * If `All Entity Types` is disable, use the radio button Walker.
1490 1490
 		 *
1491 1491
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1492 1492
 		 */
1493
-		if ( ! WL_ALL_ENTITY_TYPES ) {
1494
-			$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1493
+		if ( ! WL_ALL_ENTITY_TYPES) {
1494
+			$this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args');
1495 1495
 		}
1496 1496
 
1497 1497
 		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1498 1498
 		// entities.
1499
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1499
+		$this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2);
1500 1500
 
1501 1501
 		// Filter imported post meta.
1502
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1502
+		$this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3);
1503 1503
 
1504 1504
 		// Notify the import service when an import starts and ends.
1505
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1506
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1505
+		$this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0);
1506
+		$this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0);
1507 1507
 
1508 1508
 		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1509
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1510
-		$this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1509
+		$this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild');
1510
+		$this->loader->add_action('wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild');
1511 1511
 
1512 1512
 		// Hook the menu to the Download Your Data page.
1513
-		$this->loader->add_action( 'admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0 );
1514
-		$this->loader->add_action( 'admin_menu', $this->status_page, 'admin_menu', 100, 0 );
1515
-		$this->loader->add_action( 'admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0 );
1513
+		$this->loader->add_action('admin_menu', $this->download_your_data_page, 'admin_menu', 100, 0);
1514
+		$this->loader->add_action('admin_menu', $this->status_page, 'admin_menu', 100, 0);
1515
+		$this->loader->add_action('admin_menu', $this->entity_type_settings_admin_page, 'admin_menu', 100, 0);
1516 1516
 
1517 1517
 		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1518
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1518
+		$this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10);
1519 1519
 
1520 1520
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1521
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1522
-		$this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1523
-		$this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1521
+		$this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get');
1522
+		$this->loader->add_action('admin_post_wl_jsonld', $this->jsonld_service, 'get');
1523
+		$this->loader->add_action('admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get');
1524 1524
 
1525 1525
 		// Hook the AJAX wl_validate_key action to the Key Validation service.
1526
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1526
+		$this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key');
1527 1527
 
1528 1528
 		// Hook the AJAX wl_update_country_options action to the countries.
1529
-		$this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' );
1529
+		$this->loader->add_action('wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html');
1530 1530
 
1531 1531
 		// Hook the `admin_init` function to the Admin Setup.
1532
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1532
+		$this->loader->add_action('admin_init', $this->admin_setup, 'admin_init');
1533 1533
 
1534 1534
 		// Hook the admin_init to the settings page.
1535
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1535
+		$this->loader->add_action('admin_init', $this->settings_page, 'admin_init');
1536 1536
 
1537
-		$this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1537
+		$this->loader->add_filter('admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction');
1538 1538
 
1539 1539
 		// Hook the menu creation on the general wordlift menu creation.
1540
-		$this->loader->add_action( 'wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2 );
1541
-		if ( defined( 'WORDLIFT_BATCH' ) && WORDLIFT_BATCH ) {
1540
+		$this->loader->add_action('wl_admin_menu', $this->settings_page, 'admin_menu', 10, 2);
1541
+		if (defined('WORDLIFT_BATCH') && WORDLIFT_BATCH) {
1542 1542
 			// Add the functionality only if a flag is set in wp-config.php .
1543
-			$this->loader->add_action( 'wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2 );
1543
+			$this->loader->add_action('wl_admin_menu', $this->batch_analysis_page, 'admin_menu', 10, 2);
1544 1544
 		}
1545 1545
 
1546 1546
 		/*
@@ -1550,71 +1550,71 @@  discard block
 block discarded – undo
1550 1550
 		 *
1551 1551
 		 * @since 3.20.0
1552 1552
 		 */
1553
-		if ( in_array( $this->configuration_service->get_package_type(), array( 'editorial', 'business' ) ) ) {
1553
+		if (in_array($this->configuration_service->get_package_type(), array('editorial', 'business'))) {
1554 1554
 			$admin_search_rankings_page = new Wordlift_Admin_Search_Rankings_Page();
1555
-			$this->loader->add_action( 'wl_admin_menu', $admin_search_rankings_page, 'admin_menu' );
1555
+			$this->loader->add_action('wl_admin_menu', $admin_search_rankings_page, 'admin_menu');
1556 1556
 		}
1557 1557
 
1558 1558
 		// Hook key update.
1559
-		$this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1560
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1559
+		$this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2);
1560
+		$this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2);
1561 1561
 
1562 1562
 		// Add additional action links to the WordLift plugin in the plugins page.
1563
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1563
+		$this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1);
1564 1564
 
1565 1565
 		// Hook the AJAX `wl_publisher` action name.
1566
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1566
+		$this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher');
1567 1567
 
1568 1568
 		// Hook row actions for the entity type list admin.
1569
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1569
+		$this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2);
1570 1570
 
1571 1571
 		/** Ajax actions. */
1572
-		$this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1572
+		$this->loader->add_action('wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export');
1573 1573
 
1574 1574
 		// Hook capabilities manipulation to allow access to entity type admin
1575 1575
 		// page  on WordPress versions before 4.7.
1576 1576
 		global $wp_version;
1577
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1578
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1577
+		if (version_compare($wp_version, '4.7', '<')) {
1578
+			$this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4);
1579 1579
 		}
1580 1580
 
1581
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1581
+		$this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1);
1582 1582
 
1583 1583
 		/** Adapters. */
1584
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1585
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit' );
1586
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts' );
1587
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel' );
1588
-		$this->loader->add_action( 'wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning' );
1589
-		$this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1584
+		$this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1);
1585
+		$this->loader->add_action('wp_ajax_wl_batch_analysis_submit', $this->batch_analysis_adapter, 'submit');
1586
+		$this->loader->add_action('wp_ajax_wl_batch_analysis_submit_posts', $this->batch_analysis_adapter, 'submit_posts');
1587
+		$this->loader->add_action('wp_ajax_wl_batch_analysis_cancel', $this->batch_analysis_adapter, 'cancel');
1588
+		$this->loader->add_action('wp_ajax_wl_batch_analysis_clear_warning', $this->batch_analysis_adapter, 'clear_warning');
1589
+		$this->loader->add_action('wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all');
1590 1590
 
1591
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1592
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1591
+		$this->loader->add_action('wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create');
1592
+		$this->loader->add_action('wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete');
1593 1593
 
1594 1594
 
1595
-		$this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1596
-		$this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1595
+		$this->loader->add_action('update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5);
1596
+		$this->loader->add_action('delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5);
1597 1597
 
1598 1598
 		// Handle the autocomplete request.
1599
-		add_action( 'wp_ajax_wl_autocomplete', array(
1599
+		add_action('wp_ajax_wl_autocomplete', array(
1600 1600
 			$this->autocomplete_adapter,
1601 1601
 			'wl_autocomplete',
1602
-		) );
1603
-		add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1602
+		));
1603
+		add_action('wp_ajax_nopriv_wl_autocomplete', array(
1604 1604
 			$this->autocomplete_adapter,
1605 1605
 			'wl_autocomplete',
1606
-		) );
1606
+		));
1607 1607
 
1608 1608
 		// Hooks to restrict multisite super admin from manipulating entity types.
1609
-		if ( is_multisite() ) {
1610
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1609
+		if (is_multisite()) {
1610
+			$this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4);
1611 1611
 		}
1612 1612
 
1613
-		$deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1613
+		$deactivator_feedback = new Wordlift_Deactivator_Feedback($this->configuration_service);
1614 1614
 
1615
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1616
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1617
-		add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1615
+		add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup'));
1616
+		add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts'));
1617
+		add_action('wp_ajax_wl_deactivation_feedback', array($deactivator_feedback, 'wl_deactivation_feedback'));
1618 1618
 	}
1619 1619
 
1620 1620
 	/**
@@ -1626,52 +1626,52 @@  discard block
 block discarded – undo
1626 1626
 	 */
1627 1627
 	private function define_public_hooks() {
1628 1628
 
1629
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1629
+		$plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version());
1630 1630
 
1631 1631
 		// Register the entity post type.
1632
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1633
-		$this->loader->add_action( 'init', $this->install_service, 'install' );
1632
+		$this->loader->add_action('init', $this->entity_post_type_service, 'register');
1633
+		$this->loader->add_action('init', $this->install_service, 'install');
1634 1634
 
1635 1635
 		// Bind the link generation and handling hooks to the entity link service.
1636
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1637
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1638
-		$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 );
1639
-		$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 );
1636
+		$this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4);
1637
+		$this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1);
1638
+		$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);
1639
+		$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);
1640 1640
 
1641
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1642
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1641
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
1642
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
1643 1643
 
1644 1644
 		// Hook the content filter service to add entity links.
1645
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1646
-			$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1645
+		if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) {
1646
+			$this->loader->add_filter('the_content', $this->content_filter_service, 'the_content');
1647 1647
 		}
1648 1648
 
1649 1649
 		// Hook the AJAX wl_timeline action to the Timeline service.
1650
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1650
+		$this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline');
1651 1651
 
1652 1652
 		// Hook the ShareThis service.
1653
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
1654
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1653
+		$this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99);
1654
+		$this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99);
1655 1655
 
1656 1656
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1657
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1657
+		$this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get');
1658 1658
 
1659 1659
 		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
1660 1660
 		// in order to tweak WP's `WP_Query` to include entities in queries related
1661 1661
 		// to categories.
1662
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
1662
+		$this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1);
1663 1663
 
1664 1664
 		/*
1665 1665
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
1666 1666
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
1667 1667
 		 * order of start time.
1668 1668
 		 */
1669
-		$this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
1669
+		$this->loader->add_action('pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1);
1670 1670
 
1671
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1671
+		$this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1);
1672 1672
 
1673 1673
 		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
1674
-		$this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
1674
+		$this->loader->add_action('save_post', $this->entity_type_adapter, 'save_post', 9, 3);
1675 1675
 
1676 1676
 	}
1677 1677
 
@@ -1723,11 +1723,11 @@  discard block
 block discarded – undo
1723 1723
 	 */
1724 1724
 	private function load_cli_dependencies() {
1725 1725
 
1726
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
1726
+		require_once plugin_dir_path(dirname(__FILE__)).'cli/class-wordlift-push-reference-data-command.php';
1727 1727
 
1728
-		$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 );
1728
+		$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);
1729 1729
 
1730
-		WP_CLI::add_command( 'wl references push', $push_reference_data_command );
1730
+		WP_CLI::add_command('wl references push', $push_reference_data_command);
1731 1731
 
1732 1732
 	}
1733 1733
 
Please login to merge, or discard this patch.
src/shortcodes/wordlift_shortcode_faceted_search.php 2 patches
Indentation   +300 added lines, -300 removed lines patch added patch discarded remove patch
@@ -16,114 +16,114 @@  discard block
 block discarded – undo
16 16
  */
17 17
 function wl_shortcode_faceted_search_data_ajax( $http_raw_data = null ) {
18 18
 
19
-	// Post ID must be defined.
20
-	if ( ! isset( $_GET['post_id'] ) ) { // WPCS: input var ok; CSRF ok.
21
-		wp_die( 'No post_id given' );
22
-
23
-		return;
24
-	}
25
-
26
-	// Extract filtering conditions.
27
-	$filtering_entity_uris = ( null == $http_raw_data ) ? file_get_contents( 'php://input' ) : $http_raw_data;
28
-	$filtering_entity_uris = json_decode( $filtering_entity_uris );
29
-
30
-	$current_post_id = $_GET['post_id']; // WPCS: input var ok; CSRF ok.
31
-	$current_post    = get_post( $current_post_id );
32
-
33
-	// Post ID has to match an existing item.
34
-	if ( null === $current_post ) {
35
-		wp_die( 'No valid post_id given' );
36
-
37
-		return;
38
-	}
39
-
40
-	// If the current post is an entity,
41
-	// the current post is used as main entity.
42
-	// Otherwise, current post related entities are used.
43
-	$entity_service = Wordlift_Entity_Service::get_instance();
44
-	$entity_ids     = $entity_service->is_entity( $current_post->ID ) ?
45
-		array( $current_post->ID ) :
46
-		wl_core_get_related_entity_ids( $current_post->ID );
47
-
48
-	// If there are no entities we cannot render the widget.
49
-	if ( 0 === count( $entity_ids ) ) {
50
-		wp_die( 'No entities available' );
51
-
52
-		return;
53
-	}
54
-
55
-	// Retrieve requested type
56
-	$required_type = ( isset( $_GET['type'] ) ) ? $_GET['type'] : null; // WPCS: input var ok; CSRF ok.
57
-
58
-	$limit = ( isset( $_GET['limit'] ) ) ? (int) $_GET['limit'] : 20;  // WPCS: input var ok; CSRF ok.
59
-
60
-	$referencing_posts = Wordlift_Relation_Service::get_instance()->get_article_subjects(
61
-		$entity_ids,
62
-		'*',
63
-		null,
64
-		'publish',
65
-		array( $current_post_id ),
66
-		$limit
67
-	);
68
-
69
-	$referencing_post_ids = array_map( function ( $p ) {
70
-		return $p->ID;
71
-	}, $referencing_posts );
72
-	$results              = array();
73
-
74
-	if ( 'posts' === $required_type ) {
75
-
76
-		// Required filtered posts.
77
-		wl_write_log( "Going to find related posts for the current post [ post ID :: $current_post_id ]" );
78
-
79
-		$filtered_posts = ( empty( $filtering_entity_uris ) ) ?
80
-			$referencing_posts :
81
-			Wordlift_Relation_Service::get_instance()->get_article_subjects(
82
-				wl_get_entity_post_ids_by_uris( $filtering_entity_uris ),
83
-				'*',
84
-				null,
85
-				null,
86
-				array(),
87
-				null,
88
-				$referencing_post_ids
89
-			);
90
-
91
-		if ( $filtered_posts ) {
92
-			foreach ( $filtered_posts as $post_obj ) {
93
-
94
-				/**
95
-				 * Use the thumbnail.
96
-				 *
97
-				 * @see https://github.com/insideout10/wordlift-plugin/issues/825 related issue.
98
-				 * @see https://github.com/insideout10/wordlift-plugin/issues/837
99
-				 *
100
-				 * @since 3.19.3 We're using the medium size image.
101
-				 */
102
-				$thumbnail           = get_the_post_thumbnail_url( $post_obj, 'medium' );
103
-				$post_obj->thumbnail = ( $thumbnail ) ?
104
-					$thumbnail : WL_DEFAULT_THUMBNAIL_PATH;
105
-				$post_obj->permalink = get_post_permalink( $post_obj->ID );
106
-
107
-				$results[] = $post_obj;
108
-			}
109
-		}
110
-	} else {
111
-
112
-		global $wpdb;
113
-
114
-		wl_write_log( "Going to find related entities for the current post [ post ID :: $current_post_id ]" );
115
-
116
-		// Retrieve Wordlift relation instances table name.
117
-		$table_name = wl_core_get_relation_instances_table_name();
118
-
119
-		/*
19
+    // Post ID must be defined.
20
+    if ( ! isset( $_GET['post_id'] ) ) { // WPCS: input var ok; CSRF ok.
21
+        wp_die( 'No post_id given' );
22
+
23
+        return;
24
+    }
25
+
26
+    // Extract filtering conditions.
27
+    $filtering_entity_uris = ( null == $http_raw_data ) ? file_get_contents( 'php://input' ) : $http_raw_data;
28
+    $filtering_entity_uris = json_decode( $filtering_entity_uris );
29
+
30
+    $current_post_id = $_GET['post_id']; // WPCS: input var ok; CSRF ok.
31
+    $current_post    = get_post( $current_post_id );
32
+
33
+    // Post ID has to match an existing item.
34
+    if ( null === $current_post ) {
35
+        wp_die( 'No valid post_id given' );
36
+
37
+        return;
38
+    }
39
+
40
+    // If the current post is an entity,
41
+    // the current post is used as main entity.
42
+    // Otherwise, current post related entities are used.
43
+    $entity_service = Wordlift_Entity_Service::get_instance();
44
+    $entity_ids     = $entity_service->is_entity( $current_post->ID ) ?
45
+        array( $current_post->ID ) :
46
+        wl_core_get_related_entity_ids( $current_post->ID );
47
+
48
+    // If there are no entities we cannot render the widget.
49
+    if ( 0 === count( $entity_ids ) ) {
50
+        wp_die( 'No entities available' );
51
+
52
+        return;
53
+    }
54
+
55
+    // Retrieve requested type
56
+    $required_type = ( isset( $_GET['type'] ) ) ? $_GET['type'] : null; // WPCS: input var ok; CSRF ok.
57
+
58
+    $limit = ( isset( $_GET['limit'] ) ) ? (int) $_GET['limit'] : 20;  // WPCS: input var ok; CSRF ok.
59
+
60
+    $referencing_posts = Wordlift_Relation_Service::get_instance()->get_article_subjects(
61
+        $entity_ids,
62
+        '*',
63
+        null,
64
+        'publish',
65
+        array( $current_post_id ),
66
+        $limit
67
+    );
68
+
69
+    $referencing_post_ids = array_map( function ( $p ) {
70
+        return $p->ID;
71
+    }, $referencing_posts );
72
+    $results              = array();
73
+
74
+    if ( 'posts' === $required_type ) {
75
+
76
+        // Required filtered posts.
77
+        wl_write_log( "Going to find related posts for the current post [ post ID :: $current_post_id ]" );
78
+
79
+        $filtered_posts = ( empty( $filtering_entity_uris ) ) ?
80
+            $referencing_posts :
81
+            Wordlift_Relation_Service::get_instance()->get_article_subjects(
82
+                wl_get_entity_post_ids_by_uris( $filtering_entity_uris ),
83
+                '*',
84
+                null,
85
+                null,
86
+                array(),
87
+                null,
88
+                $referencing_post_ids
89
+            );
90
+
91
+        if ( $filtered_posts ) {
92
+            foreach ( $filtered_posts as $post_obj ) {
93
+
94
+                /**
95
+                 * Use the thumbnail.
96
+                 *
97
+                 * @see https://github.com/insideout10/wordlift-plugin/issues/825 related issue.
98
+                 * @see https://github.com/insideout10/wordlift-plugin/issues/837
99
+                 *
100
+                 * @since 3.19.3 We're using the medium size image.
101
+                 */
102
+                $thumbnail           = get_the_post_thumbnail_url( $post_obj, 'medium' );
103
+                $post_obj->thumbnail = ( $thumbnail ) ?
104
+                    $thumbnail : WL_DEFAULT_THUMBNAIL_PATH;
105
+                $post_obj->permalink = get_post_permalink( $post_obj->ID );
106
+
107
+                $results[] = $post_obj;
108
+            }
109
+        }
110
+    } else {
111
+
112
+        global $wpdb;
113
+
114
+        wl_write_log( "Going to find related entities for the current post [ post ID :: $current_post_id ]" );
115
+
116
+        // Retrieve Wordlift relation instances table name.
117
+        $table_name = wl_core_get_relation_instances_table_name();
118
+
119
+        /*
120 120
 		 * Make sure we have some referenced post, otherwise the IN parts of
121 121
 		 * the SQL will produce an SQL error.
122 122
 		 */
123
-		if ( ! empty( $referencing_post_ids ) ) {
124
-			$subject_ids = implode( ',', $referencing_post_ids );
123
+        if ( ! empty( $referencing_post_ids ) ) {
124
+            $subject_ids = implode( ',', $referencing_post_ids );
125 125
 
126
-			$query = "
126
+            $query = "
127 127
 				SELECT
128 128
 					object_id AS ID,
129 129
 					count( object_id ) AS counter
@@ -135,30 +135,30 @@  discard block
 block discarded – undo
135 135
 				LIMIT $limit;
136 136
 			";
137 137
 
138
-			wl_write_log( "Going to find related entities for the current post [ post ID :: $current_post_id ] [ query :: $query ]" );
138
+            wl_write_log( "Going to find related entities for the current post [ post ID :: $current_post_id ] [ query :: $query ]" );
139 139
 
140
-			$entities = $wpdb->get_results( $query, OBJECT ); // No cache ok.
140
+            $entities = $wpdb->get_results( $query, OBJECT ); // No cache ok.
141 141
 
142
-			wl_write_log( 'Entities found ' . count( $entities ) );
142
+            wl_write_log( 'Entities found ' . count( $entities ) );
143 143
 
144
-			foreach ( $entities as $obj ) {
144
+            foreach ( $entities as $obj ) {
145 145
 
146
-				$entity = get_post( $obj->ID );
146
+                $entity = get_post( $obj->ID );
147 147
 
148
-				// Ensure only valid and published entities are returned.
149
-				if ( ( null !== $entity ) && ( 'publish' === $entity->post_status ) ) {
148
+                // Ensure only valid and published entities are returned.
149
+                if ( ( null !== $entity ) && ( 'publish' === $entity->post_status ) ) {
150 150
 
151
-					$serialized_entity              = wl_serialize_entity( $entity );
152
-					$serialized_entity['counter']   = $obj->counter;
153
-					$serialized_entity['createdAt'] = $entity->post_date;
151
+                    $serialized_entity              = wl_serialize_entity( $entity );
152
+                    $serialized_entity['counter']   = $obj->counter;
153
+                    $serialized_entity['createdAt'] = $entity->post_date;
154 154
 
155
-					$results[] = $serialized_entity;
156
-				}
157
-			}
158
-		}
159
-	}
155
+                    $results[] = $serialized_entity;
156
+                }
157
+            }
158
+        }
159
+    }
160 160
 
161
-	return $results;
161
+    return $results;
162 162
 
163 163
 }
164 164
 
@@ -170,148 +170,148 @@  discard block
 block discarded – undo
170 170
  */
171 171
 function wl_shortcode_faceted_search_data_wp_json( $http_raw_data = null ) {
172 172
 
173
-	// Post ID must be defined.
174
-	if ( ! isset( $_GET['post_id'] ) ) { // WPCS: input var ok; CSRF ok.
175
-		wp_die( 'No post_id given' );
176
-
177
-		return;
178
-	}
179
-
180
-	// Extract filtering conditions.
181
-	$filtering_entity_uris = ( null == $http_raw_data ) ? file_get_contents( 'php://input' ) : $http_raw_data;
182
-	$filtering_entity_uris = json_decode( $filtering_entity_uris );
183
-
184
-	$current_post_id = $_GET['post_id']; // WPCS: input var ok; CSRF ok.
185
-	$current_post    = get_post( $current_post_id );
186
-
187
-	// Post ID has to match an existing item.
188
-	if ( null === $current_post ) {
189
-		wp_die( 'No valid post_id given' );
190
-
191
-		return;
192
-	}
193
-
194
-	// If the current post is an entity,
195
-	// the current post is used as main entity.
196
-	// Otherwise, current post related entities are used.
197
-	$entity_service = Wordlift_Entity_Service::get_instance();
198
-	$entity_ids     = $entity_service->is_entity( $current_post->ID ) ?
199
-		array( $current_post->ID ) :
200
-		wl_core_get_related_entity_ids( $current_post->ID );
201
-
202
-	// If there are no entities we cannot render the widget.
203
-	if ( 0 === count( $entity_ids ) ) {
204
-		wp_die( 'No entities available' );
205
-
206
-		return;
207
-	}
208
-
209
-	// Retrieve requested type
210
-	$required_type = ( isset( $_GET['type'] ) ) ? $_GET['type'] : null; // WPCS: input var ok; CSRF ok.
211
-
212
-	$limit = ( isset( $_GET['limit'] ) ) ? (int) $_GET['limit'] : 20;  // WPCS: input var ok; CSRF ok.
213
-
214
-	$referencing_posts = Wordlift_Relation_Service::get_instance()->get_article_subjects(
215
-		$entity_ids,
216
-		'*',
217
-		null,
218
-		'publish',
219
-		array( $current_post_id ),
220
-		$limit
221
-	);
222
-
223
-	$referencing_post_ids = array_map( function ( $p ) {
224
-		return $p->ID;
225
-	}, $referencing_posts );
226
-	$results              = array();
227
-
228
-	if ( 'posts' === $required_type ) {
229
-
230
-		// Required filtered posts.
231
-		wl_write_log( "Going to find related posts for the current post [ post ID :: $current_post_id ]" );
232
-
233
-		$filtered_posts = ( empty( $filtering_entity_uris ) ) ?
234
-			$referencing_posts :
235
-			Wordlift_Relation_Service::get_instance()->get_article_subjects(
236
-				wl_get_entity_post_ids_by_uris( $filtering_entity_uris ),
237
-				'*',
238
-				null,
239
-				null,
240
-				array(),
241
-				null,
242
-				$referencing_post_ids
243
-			);
244
-
245
-		if ( $filtered_posts ) {
246
-			foreach ( $filtered_posts as $i => $post_obj ) {
247
-
248
-				/**
249
-				 * Use the thumbnail.
250
-				 *
251
-				 * @see https://github.com/insideout10/wordlift-plugin/issues/825 related issue.
252
-				 * @see https://github.com/insideout10/wordlift-plugin/issues/837
253
-				 *
254
-				 * @since 3.19.3 We're using the medium size image.
255
-				 */
256
-				$thumbnail           = get_the_post_thumbnail_url( $post_obj, 'medium' );
257
-				$post_obj->thumbnail = ( $thumbnail ) ?
258
-					$thumbnail : WL_DEFAULT_THUMBNAIL_PATH;
259
-				$post_obj->permalink = get_post_permalink( $post_obj->ID );
260
-
261
-				$results[$i] = $post_obj;
262
-
263
-				// Get Entity URLs needed for client side filtering in amp
264
-				foreach( Wordlift_Relation_Service::get_instance()->get_objects( $post_obj->ID, 'ids' ) as $entity_id ){
265
-					$results[$i]->entities[] = Wordlift_Entity_Service::get_instance()->get_uri( $entity_id );
266
-				}
267
-			}
268
-		}
269
-
270
-		return array( 
271
-			array('values' => $results)
272
-		);
273
-
274
-	} else {
275
-
276
-		global $wpdb;
277
-
278
-		wl_write_log( "Going to find related entities for the current post [ post ID :: $current_post_id ]" );
279
-
280
-		// Retrieve Wordlift relation instances table name.
281
-		$table_name = wl_core_get_relation_instances_table_name();
282
-
283
-		// Response interface with l10n strings, grouped entities and empty data array
284
-		$serialized_entity_groups = array(
285
-			array(
286
-				'l10n' => $_GET['l10n'] ? $_GET['l10n']['what'] : 'what',
287
-				'entities' => array('thing', 'creative-work', 'recipe'),
288
-				'data' => array()
289
-			),
290
-			array(
291
-				'l10n' => $_GET['l10n'] ? $_GET['l10n']['who'] : 'who',
292
-				'entities' => array('person', 'organization', 'local-business'),
293
-				'data' => array()
294
-			),
295
-			array(
296
-				'l10n' => $_GET['l10n'] ? $_GET['l10n']['where'] : 'where',
297
-				'entities' => array('place'),
298
-				'data' => array()
299
-			),
300
-			array(
301
-				'l10n' => $_GET['l10n'] ? $_GET['l10n']['when'] : 'when',
302
-				'entities' => array('event'),
303
-				'data' => array()
304
-			)
305
-		);
306
-
307
-		/*
173
+    // Post ID must be defined.
174
+    if ( ! isset( $_GET['post_id'] ) ) { // WPCS: input var ok; CSRF ok.
175
+        wp_die( 'No post_id given' );
176
+
177
+        return;
178
+    }
179
+
180
+    // Extract filtering conditions.
181
+    $filtering_entity_uris = ( null == $http_raw_data ) ? file_get_contents( 'php://input' ) : $http_raw_data;
182
+    $filtering_entity_uris = json_decode( $filtering_entity_uris );
183
+
184
+    $current_post_id = $_GET['post_id']; // WPCS: input var ok; CSRF ok.
185
+    $current_post    = get_post( $current_post_id );
186
+
187
+    // Post ID has to match an existing item.
188
+    if ( null === $current_post ) {
189
+        wp_die( 'No valid post_id given' );
190
+
191
+        return;
192
+    }
193
+
194
+    // If the current post is an entity,
195
+    // the current post is used as main entity.
196
+    // Otherwise, current post related entities are used.
197
+    $entity_service = Wordlift_Entity_Service::get_instance();
198
+    $entity_ids     = $entity_service->is_entity( $current_post->ID ) ?
199
+        array( $current_post->ID ) :
200
+        wl_core_get_related_entity_ids( $current_post->ID );
201
+
202
+    // If there are no entities we cannot render the widget.
203
+    if ( 0 === count( $entity_ids ) ) {
204
+        wp_die( 'No entities available' );
205
+
206
+        return;
207
+    }
208
+
209
+    // Retrieve requested type
210
+    $required_type = ( isset( $_GET['type'] ) ) ? $_GET['type'] : null; // WPCS: input var ok; CSRF ok.
211
+
212
+    $limit = ( isset( $_GET['limit'] ) ) ? (int) $_GET['limit'] : 20;  // WPCS: input var ok; CSRF ok.
213
+
214
+    $referencing_posts = Wordlift_Relation_Service::get_instance()->get_article_subjects(
215
+        $entity_ids,
216
+        '*',
217
+        null,
218
+        'publish',
219
+        array( $current_post_id ),
220
+        $limit
221
+    );
222
+
223
+    $referencing_post_ids = array_map( function ( $p ) {
224
+        return $p->ID;
225
+    }, $referencing_posts );
226
+    $results              = array();
227
+
228
+    if ( 'posts' === $required_type ) {
229
+
230
+        // Required filtered posts.
231
+        wl_write_log( "Going to find related posts for the current post [ post ID :: $current_post_id ]" );
232
+
233
+        $filtered_posts = ( empty( $filtering_entity_uris ) ) ?
234
+            $referencing_posts :
235
+            Wordlift_Relation_Service::get_instance()->get_article_subjects(
236
+                wl_get_entity_post_ids_by_uris( $filtering_entity_uris ),
237
+                '*',
238
+                null,
239
+                null,
240
+                array(),
241
+                null,
242
+                $referencing_post_ids
243
+            );
244
+
245
+        if ( $filtered_posts ) {
246
+            foreach ( $filtered_posts as $i => $post_obj ) {
247
+
248
+                /**
249
+                 * Use the thumbnail.
250
+                 *
251
+                 * @see https://github.com/insideout10/wordlift-plugin/issues/825 related issue.
252
+                 * @see https://github.com/insideout10/wordlift-plugin/issues/837
253
+                 *
254
+                 * @since 3.19.3 We're using the medium size image.
255
+                 */
256
+                $thumbnail           = get_the_post_thumbnail_url( $post_obj, 'medium' );
257
+                $post_obj->thumbnail = ( $thumbnail ) ?
258
+                    $thumbnail : WL_DEFAULT_THUMBNAIL_PATH;
259
+                $post_obj->permalink = get_post_permalink( $post_obj->ID );
260
+
261
+                $results[$i] = $post_obj;
262
+
263
+                // Get Entity URLs needed for client side filtering in amp
264
+                foreach( Wordlift_Relation_Service::get_instance()->get_objects( $post_obj->ID, 'ids' ) as $entity_id ){
265
+                    $results[$i]->entities[] = Wordlift_Entity_Service::get_instance()->get_uri( $entity_id );
266
+                }
267
+            }
268
+        }
269
+
270
+        return array( 
271
+            array('values' => $results)
272
+        );
273
+
274
+    } else {
275
+
276
+        global $wpdb;
277
+
278
+        wl_write_log( "Going to find related entities for the current post [ post ID :: $current_post_id ]" );
279
+
280
+        // Retrieve Wordlift relation instances table name.
281
+        $table_name = wl_core_get_relation_instances_table_name();
282
+
283
+        // Response interface with l10n strings, grouped entities and empty data array
284
+        $serialized_entity_groups = array(
285
+            array(
286
+                'l10n' => $_GET['l10n'] ? $_GET['l10n']['what'] : 'what',
287
+                'entities' => array('thing', 'creative-work', 'recipe'),
288
+                'data' => array()
289
+            ),
290
+            array(
291
+                'l10n' => $_GET['l10n'] ? $_GET['l10n']['who'] : 'who',
292
+                'entities' => array('person', 'organization', 'local-business'),
293
+                'data' => array()
294
+            ),
295
+            array(
296
+                'l10n' => $_GET['l10n'] ? $_GET['l10n']['where'] : 'where',
297
+                'entities' => array('place'),
298
+                'data' => array()
299
+            ),
300
+            array(
301
+                'l10n' => $_GET['l10n'] ? $_GET['l10n']['when'] : 'when',
302
+                'entities' => array('event'),
303
+                'data' => array()
304
+            )
305
+        );
306
+
307
+        /*
308 308
 		 * Make sure we have some referenced post, otherwise the IN parts of
309 309
 		 * the SQL will produce an SQL error.
310 310
 		 */
311
-		if ( ! empty( $referencing_post_ids ) ) {
312
-			$subject_ids = implode( ',', $referencing_post_ids );
311
+        if ( ! empty( $referencing_post_ids ) ) {
312
+            $subject_ids = implode( ',', $referencing_post_ids );
313 313
 
314
-			$query = "
314
+            $query = "
315 315
 				SELECT
316 316
 					object_id AS ID,
317 317
 					count( object_id ) AS counter
@@ -323,45 +323,45 @@  discard block
 block discarded – undo
323 323
 				LIMIT $limit;
324 324
 			";
325 325
 
326
-			wl_write_log( "Going to find related entities for the current post [ post ID :: $current_post_id ] [ query :: $query ]" );
326
+            wl_write_log( "Going to find related entities for the current post [ post ID :: $current_post_id ] [ query :: $query ]" );
327 327
 
328
-			$entities = $wpdb->get_results( $query, OBJECT ); // No cache ok.
328
+            $entities = $wpdb->get_results( $query, OBJECT ); // No cache ok.
329 329
 
330
-			wl_write_log( 'Entities found ' . count( $entities ) );
330
+            wl_write_log( 'Entities found ' . count( $entities ) );
331 331
 
332
-			foreach ( $entities as $obj ) {
332
+            foreach ( $entities as $obj ) {
333 333
 
334
-				$entity = get_post( $obj->ID );
334
+                $entity = get_post( $obj->ID );
335 335
 
336
-				// Ensure only valid and published entities are returned.
337
-				if ( ( null !== $entity ) && ( 'publish' === $entity->post_status ) ) {
336
+                // Ensure only valid and published entities are returned.
337
+                if ( ( null !== $entity ) && ( 'publish' === $entity->post_status ) ) {
338 338
 
339
-					$serialized_entity              = wl_serialize_entity( $entity );
340
-					$serialized_entity['counter']   = $obj->counter;
341
-					$serialized_entity['createdAt'] = $entity->post_date;
339
+                    $serialized_entity              = wl_serialize_entity( $entity );
340
+                    $serialized_entity['counter']   = $obj->counter;
341
+                    $serialized_entity['createdAt'] = $entity->post_date;
342 342
 
343
-					// Populate $serialized_entity_groups maintaining array sequence
344
-					foreach ( $serialized_entity_groups as $seg_key => $seg_value ) {
345
-						if ( in_array( $serialized_entity['mainType'], $seg_value['entities'] ) ) {
346
-							$serialized_entity_groups[$seg_key]['data'][] = $serialized_entity;
347
-						}
348
-					}
349
-				}
350
-			}
343
+                    // Populate $serialized_entity_groups maintaining array sequence
344
+                    foreach ( $serialized_entity_groups as $seg_key => $seg_value ) {
345
+                        if ( in_array( $serialized_entity['mainType'], $seg_value['entities'] ) ) {
346
+                            $serialized_entity_groups[$seg_key]['data'][] = $serialized_entity;
347
+                        }
348
+                    }
349
+                }
350
+            }
351 351
 
352
-			// Clean-up $serialized_entity_groups by removing empty items and entities
353
-			foreach ( $serialized_entity_groups as $seg_key => $seg_value ) {
354
-				if( empty($seg_value['data']) ) {
355
-					unset($serialized_entity_groups[$seg_key]);
356
-				}
357
-				unset($serialized_entity_groups[$seg_key]['entities']);
358
-			}
352
+            // Clean-up $serialized_entity_groups by removing empty items and entities
353
+            foreach ( $serialized_entity_groups as $seg_key => $seg_value ) {
354
+                if( empty($seg_value['data']) ) {
355
+                    unset($serialized_entity_groups[$seg_key]);
356
+                }
357
+                unset($serialized_entity_groups[$seg_key]['entities']);
358
+            }
359 359
 
360
-			$results = $serialized_entity_groups;
361
-		}
360
+            $results = $serialized_entity_groups;
361
+        }
362 362
 
363
-		return $results;
364
-	}
363
+        return $results;
364
+    }
365 365
 
366 366
 }
367 367
 
@@ -370,8 +370,8 @@  discard block
 block discarded – undo
370 370
  */
371 371
 function wl_shortcode_faceted_search_ajax( $http_raw_data = null ) {
372 372
 
373
-	$results = wl_shortcode_faceted_search_data_ajax( $http_raw_data );
374
-	wl_core_send_json( $results );
373
+    $results = wl_shortcode_faceted_search_data_ajax( $http_raw_data );
374
+    wl_core_send_json( $results );
375 375
 
376 376
 }
377 377
 
@@ -386,13 +386,13 @@  discard block
 block discarded – undo
386 386
  */
387 387
 function wl_shortcode_faceted_search_wp_json( $http_raw_data = null ) {
388 388
 
389
-	$results = wl_shortcode_faceted_search_data_wp_json( $http_raw_data );
390
-	if ( ob_get_contents() ) {
391
-		ob_clean();
392
-	}
393
-	return array(
394
-		'items' => $results
395
-	);
389
+    $results = wl_shortcode_faceted_search_data_wp_json( $http_raw_data );
390
+    if ( ob_get_contents() ) {
391
+        ob_clean();
392
+    }
393
+    return array(
394
+        'items' => $results
395
+    );
396 396
 
397 397
 }
398 398
 
@@ -400,8 +400,8 @@  discard block
 block discarded – undo
400 400
  * Adding `rest_api_init` action for amp backend of faceted-search
401 401
  */
402 402
 add_action( 'rest_api_init', function () {
403
-	register_rest_route( WL_REST_ROUTE_DEFAULT_NAMESPACE, '/faceted-search', array(
404
-	  'methods' => 'GET',
405
-	  'callback' => 'wl_shortcode_faceted_search_wp_json',
406
-	) );
403
+    register_rest_route( WL_REST_ROUTE_DEFAULT_NAMESPACE, '/faceted-search', array(
404
+        'methods' => 'GET',
405
+        'callback' => 'wl_shortcode_faceted_search_wp_json',
406
+    ) );
407 407
 } );
Please login to merge, or discard this patch.
Spacing   +91 added lines, -95 removed lines patch added patch discarded remove patch
@@ -14,25 +14,25 @@  discard block
 block discarded – undo
14 14
  * @since		3.20.0
15 15
  * @return array $results
16 16
  */
17
-function wl_shortcode_faceted_search_data_ajax( $http_raw_data = null ) {
17
+function wl_shortcode_faceted_search_data_ajax($http_raw_data = null) {
18 18
 
19 19
 	// Post ID must be defined.
20
-	if ( ! isset( $_GET['post_id'] ) ) { // WPCS: input var ok; CSRF ok.
21
-		wp_die( 'No post_id given' );
20
+	if ( ! isset($_GET['post_id'])) { // WPCS: input var ok; CSRF ok.
21
+		wp_die('No post_id given');
22 22
 
23 23
 		return;
24 24
 	}
25 25
 
26 26
 	// Extract filtering conditions.
27
-	$filtering_entity_uris = ( null == $http_raw_data ) ? file_get_contents( 'php://input' ) : $http_raw_data;
28
-	$filtering_entity_uris = json_decode( $filtering_entity_uris );
27
+	$filtering_entity_uris = (null == $http_raw_data) ? file_get_contents('php://input') : $http_raw_data;
28
+	$filtering_entity_uris = json_decode($filtering_entity_uris);
29 29
 
30 30
 	$current_post_id = $_GET['post_id']; // WPCS: input var ok; CSRF ok.
31
-	$current_post    = get_post( $current_post_id );
31
+	$current_post    = get_post($current_post_id);
32 32
 
33 33
 	// Post ID has to match an existing item.
34
-	if ( null === $current_post ) {
35
-		wp_die( 'No valid post_id given' );
34
+	if (null === $current_post) {
35
+		wp_die('No valid post_id given');
36 36
 
37 37
 		return;
38 38
 	}
@@ -41,45 +41,43 @@  discard block
 block discarded – undo
41 41
 	// the current post is used as main entity.
42 42
 	// Otherwise, current post related entities are used.
43 43
 	$entity_service = Wordlift_Entity_Service::get_instance();
44
-	$entity_ids     = $entity_service->is_entity( $current_post->ID ) ?
45
-		array( $current_post->ID ) :
46
-		wl_core_get_related_entity_ids( $current_post->ID );
44
+	$entity_ids     = $entity_service->is_entity($current_post->ID) ?
45
+		array($current_post->ID) : wl_core_get_related_entity_ids($current_post->ID);
47 46
 
48 47
 	// If there are no entities we cannot render the widget.
49
-	if ( 0 === count( $entity_ids ) ) {
50
-		wp_die( 'No entities available' );
48
+	if (0 === count($entity_ids)) {
49
+		wp_die('No entities available');
51 50
 
52 51
 		return;
53 52
 	}
54 53
 
55 54
 	// Retrieve requested type
56
-	$required_type = ( isset( $_GET['type'] ) ) ? $_GET['type'] : null; // WPCS: input var ok; CSRF ok.
55
+	$required_type = (isset($_GET['type'])) ? $_GET['type'] : null; // WPCS: input var ok; CSRF ok.
57 56
 
58
-	$limit = ( isset( $_GET['limit'] ) ) ? (int) $_GET['limit'] : 20;  // WPCS: input var ok; CSRF ok.
57
+	$limit = (isset($_GET['limit'])) ? (int) $_GET['limit'] : 20; // WPCS: input var ok; CSRF ok.
59 58
 
60 59
 	$referencing_posts = Wordlift_Relation_Service::get_instance()->get_article_subjects(
61 60
 		$entity_ids,
62 61
 		'*',
63 62
 		null,
64 63
 		'publish',
65
-		array( $current_post_id ),
64
+		array($current_post_id),
66 65
 		$limit
67 66
 	);
68 67
 
69
-	$referencing_post_ids = array_map( function ( $p ) {
68
+	$referencing_post_ids = array_map(function($p) {
70 69
 		return $p->ID;
71
-	}, $referencing_posts );
70
+	}, $referencing_posts);
72 71
 	$results              = array();
73 72
 
74
-	if ( 'posts' === $required_type ) {
73
+	if ('posts' === $required_type) {
75 74
 
76 75
 		// Required filtered posts.
77
-		wl_write_log( "Going to find related posts for the current post [ post ID :: $current_post_id ]" );
76
+		wl_write_log("Going to find related posts for the current post [ post ID :: $current_post_id ]");
78 77
 
79
-		$filtered_posts = ( empty( $filtering_entity_uris ) ) ?
80
-			$referencing_posts :
81
-			Wordlift_Relation_Service::get_instance()->get_article_subjects(
82
-				wl_get_entity_post_ids_by_uris( $filtering_entity_uris ),
78
+		$filtered_posts = (empty($filtering_entity_uris)) ?
79
+			$referencing_posts : Wordlift_Relation_Service::get_instance()->get_article_subjects(
80
+				wl_get_entity_post_ids_by_uris($filtering_entity_uris),
83 81
 				'*',
84 82
 				null,
85 83
 				null,
@@ -88,8 +86,8 @@  discard block
 block discarded – undo
88 86
 				$referencing_post_ids
89 87
 			);
90 88
 
91
-		if ( $filtered_posts ) {
92
-			foreach ( $filtered_posts as $post_obj ) {
89
+		if ($filtered_posts) {
90
+			foreach ($filtered_posts as $post_obj) {
93 91
 
94 92
 				/**
95 93
 				 * Use the thumbnail.
@@ -99,10 +97,10 @@  discard block
 block discarded – undo
99 97
 				 *
100 98
 				 * @since 3.19.3 We're using the medium size image.
101 99
 				 */
102
-				$thumbnail           = get_the_post_thumbnail_url( $post_obj, 'medium' );
103
-				$post_obj->thumbnail = ( $thumbnail ) ?
100
+				$thumbnail           = get_the_post_thumbnail_url($post_obj, 'medium');
101
+				$post_obj->thumbnail = ($thumbnail) ?
104 102
 					$thumbnail : WL_DEFAULT_THUMBNAIL_PATH;
105
-				$post_obj->permalink = get_post_permalink( $post_obj->ID );
103
+				$post_obj->permalink = get_post_permalink($post_obj->ID);
106 104
 
107 105
 				$results[] = $post_obj;
108 106
 			}
@@ -111,7 +109,7 @@  discard block
 block discarded – undo
111 109
 
112 110
 		global $wpdb;
113 111
 
114
-		wl_write_log( "Going to find related entities for the current post [ post ID :: $current_post_id ]" );
112
+		wl_write_log("Going to find related entities for the current post [ post ID :: $current_post_id ]");
115 113
 
116 114
 		// Retrieve Wordlift relation instances table name.
117 115
 		$table_name = wl_core_get_relation_instances_table_name();
@@ -120,8 +118,8 @@  discard block
 block discarded – undo
120 118
 		 * Make sure we have some referenced post, otherwise the IN parts of
121 119
 		 * the SQL will produce an SQL error.
122 120
 		 */
123
-		if ( ! empty( $referencing_post_ids ) ) {
124
-			$subject_ids = implode( ',', $referencing_post_ids );
121
+		if ( ! empty($referencing_post_ids)) {
122
+			$subject_ids = implode(',', $referencing_post_ids);
125 123
 
126 124
 			$query = "
127 125
 				SELECT
@@ -135,20 +133,20 @@  discard block
 block discarded – undo
135 133
 				LIMIT $limit;
136 134
 			";
137 135
 
138
-			wl_write_log( "Going to find related entities for the current post [ post ID :: $current_post_id ] [ query :: $query ]" );
136
+			wl_write_log("Going to find related entities for the current post [ post ID :: $current_post_id ] [ query :: $query ]");
139 137
 
140
-			$entities = $wpdb->get_results( $query, OBJECT ); // No cache ok.
138
+			$entities = $wpdb->get_results($query, OBJECT); // No cache ok.
141 139
 
142
-			wl_write_log( 'Entities found ' . count( $entities ) );
140
+			wl_write_log('Entities found '.count($entities));
143 141
 
144
-			foreach ( $entities as $obj ) {
142
+			foreach ($entities as $obj) {
145 143
 
146
-				$entity = get_post( $obj->ID );
144
+				$entity = get_post($obj->ID);
147 145
 
148 146
 				// Ensure only valid and published entities are returned.
149
-				if ( ( null !== $entity ) && ( 'publish' === $entity->post_status ) ) {
147
+				if ((null !== $entity) && ('publish' === $entity->post_status)) {
150 148
 
151
-					$serialized_entity              = wl_serialize_entity( $entity );
149
+					$serialized_entity              = wl_serialize_entity($entity);
152 150
 					$serialized_entity['counter']   = $obj->counter;
153 151
 					$serialized_entity['createdAt'] = $entity->post_date;
154 152
 
@@ -168,25 +166,25 @@  discard block
 block discarded – undo
168 166
  * @since		3.20.0
169 167
  * @return array $results
170 168
  */
171
-function wl_shortcode_faceted_search_data_wp_json( $http_raw_data = null ) {
169
+function wl_shortcode_faceted_search_data_wp_json($http_raw_data = null) {
172 170
 
173 171
 	// Post ID must be defined.
174
-	if ( ! isset( $_GET['post_id'] ) ) { // WPCS: input var ok; CSRF ok.
175
-		wp_die( 'No post_id given' );
172
+	if ( ! isset($_GET['post_id'])) { // WPCS: input var ok; CSRF ok.
173
+		wp_die('No post_id given');
176 174
 
177 175
 		return;
178 176
 	}
179 177
 
180 178
 	// Extract filtering conditions.
181
-	$filtering_entity_uris = ( null == $http_raw_data ) ? file_get_contents( 'php://input' ) : $http_raw_data;
182
-	$filtering_entity_uris = json_decode( $filtering_entity_uris );
179
+	$filtering_entity_uris = (null == $http_raw_data) ? file_get_contents('php://input') : $http_raw_data;
180
+	$filtering_entity_uris = json_decode($filtering_entity_uris);
183 181
 
184 182
 	$current_post_id = $_GET['post_id']; // WPCS: input var ok; CSRF ok.
185
-	$current_post    = get_post( $current_post_id );
183
+	$current_post    = get_post($current_post_id);
186 184
 
187 185
 	// Post ID has to match an existing item.
188
-	if ( null === $current_post ) {
189
-		wp_die( 'No valid post_id given' );
186
+	if (null === $current_post) {
187
+		wp_die('No valid post_id given');
190 188
 
191 189
 		return;
192 190
 	}
@@ -195,45 +193,43 @@  discard block
 block discarded – undo
195 193
 	// the current post is used as main entity.
196 194
 	// Otherwise, current post related entities are used.
197 195
 	$entity_service = Wordlift_Entity_Service::get_instance();
198
-	$entity_ids     = $entity_service->is_entity( $current_post->ID ) ?
199
-		array( $current_post->ID ) :
200
-		wl_core_get_related_entity_ids( $current_post->ID );
196
+	$entity_ids     = $entity_service->is_entity($current_post->ID) ?
197
+		array($current_post->ID) : wl_core_get_related_entity_ids($current_post->ID);
201 198
 
202 199
 	// If there are no entities we cannot render the widget.
203
-	if ( 0 === count( $entity_ids ) ) {
204
-		wp_die( 'No entities available' );
200
+	if (0 === count($entity_ids)) {
201
+		wp_die('No entities available');
205 202
 
206 203
 		return;
207 204
 	}
208 205
 
209 206
 	// Retrieve requested type
210
-	$required_type = ( isset( $_GET['type'] ) ) ? $_GET['type'] : null; // WPCS: input var ok; CSRF ok.
207
+	$required_type = (isset($_GET['type'])) ? $_GET['type'] : null; // WPCS: input var ok; CSRF ok.
211 208
 
212
-	$limit = ( isset( $_GET['limit'] ) ) ? (int) $_GET['limit'] : 20;  // WPCS: input var ok; CSRF ok.
209
+	$limit = (isset($_GET['limit'])) ? (int) $_GET['limit'] : 20; // WPCS: input var ok; CSRF ok.
213 210
 
214 211
 	$referencing_posts = Wordlift_Relation_Service::get_instance()->get_article_subjects(
215 212
 		$entity_ids,
216 213
 		'*',
217 214
 		null,
218 215
 		'publish',
219
-		array( $current_post_id ),
216
+		array($current_post_id),
220 217
 		$limit
221 218
 	);
222 219
 
223
-	$referencing_post_ids = array_map( function ( $p ) {
220
+	$referencing_post_ids = array_map(function($p) {
224 221
 		return $p->ID;
225
-	}, $referencing_posts );
222
+	}, $referencing_posts);
226 223
 	$results              = array();
227 224
 
228
-	if ( 'posts' === $required_type ) {
225
+	if ('posts' === $required_type) {
229 226
 
230 227
 		// Required filtered posts.
231
-		wl_write_log( "Going to find related posts for the current post [ post ID :: $current_post_id ]" );
228
+		wl_write_log("Going to find related posts for the current post [ post ID :: $current_post_id ]");
232 229
 
233
-		$filtered_posts = ( empty( $filtering_entity_uris ) ) ?
234
-			$referencing_posts :
235
-			Wordlift_Relation_Service::get_instance()->get_article_subjects(
236
-				wl_get_entity_post_ids_by_uris( $filtering_entity_uris ),
230
+		$filtered_posts = (empty($filtering_entity_uris)) ?
231
+			$referencing_posts : Wordlift_Relation_Service::get_instance()->get_article_subjects(
232
+				wl_get_entity_post_ids_by_uris($filtering_entity_uris),
237 233
 				'*',
238 234
 				null,
239 235
 				null,
@@ -242,8 +238,8 @@  discard block
 block discarded – undo
242 238
 				$referencing_post_ids
243 239
 			);
244 240
 
245
-		if ( $filtered_posts ) {
246
-			foreach ( $filtered_posts as $i => $post_obj ) {
241
+		if ($filtered_posts) {
242
+			foreach ($filtered_posts as $i => $post_obj) {
247 243
 
248 244
 				/**
249 245
 				 * Use the thumbnail.
@@ -253,16 +249,16 @@  discard block
 block discarded – undo
253 249
 				 *
254 250
 				 * @since 3.19.3 We're using the medium size image.
255 251
 				 */
256
-				$thumbnail           = get_the_post_thumbnail_url( $post_obj, 'medium' );
257
-				$post_obj->thumbnail = ( $thumbnail ) ?
252
+				$thumbnail           = get_the_post_thumbnail_url($post_obj, 'medium');
253
+				$post_obj->thumbnail = ($thumbnail) ?
258 254
 					$thumbnail : WL_DEFAULT_THUMBNAIL_PATH;
259
-				$post_obj->permalink = get_post_permalink( $post_obj->ID );
255
+				$post_obj->permalink = get_post_permalink($post_obj->ID);
260 256
 
261 257
 				$results[$i] = $post_obj;
262 258
 
263 259
 				// Get Entity URLs needed for client side filtering in amp
264
-				foreach( Wordlift_Relation_Service::get_instance()->get_objects( $post_obj->ID, 'ids' ) as $entity_id ){
265
-					$results[$i]->entities[] = Wordlift_Entity_Service::get_instance()->get_uri( $entity_id );
260
+				foreach (Wordlift_Relation_Service::get_instance()->get_objects($post_obj->ID, 'ids') as $entity_id) {
261
+					$results[$i]->entities[] = Wordlift_Entity_Service::get_instance()->get_uri($entity_id);
266 262
 				}
267 263
 			}
268 264
 		}
@@ -275,7 +271,7 @@  discard block
 block discarded – undo
275 271
 
276 272
 		global $wpdb;
277 273
 
278
-		wl_write_log( "Going to find related entities for the current post [ post ID :: $current_post_id ]" );
274
+		wl_write_log("Going to find related entities for the current post [ post ID :: $current_post_id ]");
279 275
 
280 276
 		// Retrieve Wordlift relation instances table name.
281 277
 		$table_name = wl_core_get_relation_instances_table_name();
@@ -308,8 +304,8 @@  discard block
 block discarded – undo
308 304
 		 * Make sure we have some referenced post, otherwise the IN parts of
309 305
 		 * the SQL will produce an SQL error.
310 306
 		 */
311
-		if ( ! empty( $referencing_post_ids ) ) {
312
-			$subject_ids = implode( ',', $referencing_post_ids );
307
+		if ( ! empty($referencing_post_ids)) {
308
+			$subject_ids = implode(',', $referencing_post_ids);
313 309
 
314 310
 			$query = "
315 311
 				SELECT
@@ -323,26 +319,26 @@  discard block
 block discarded – undo
323 319
 				LIMIT $limit;
324 320
 			";
325 321
 
326
-			wl_write_log( "Going to find related entities for the current post [ post ID :: $current_post_id ] [ query :: $query ]" );
322
+			wl_write_log("Going to find related entities for the current post [ post ID :: $current_post_id ] [ query :: $query ]");
327 323
 
328
-			$entities = $wpdb->get_results( $query, OBJECT ); // No cache ok.
324
+			$entities = $wpdb->get_results($query, OBJECT); // No cache ok.
329 325
 
330
-			wl_write_log( 'Entities found ' . count( $entities ) );
326
+			wl_write_log('Entities found '.count($entities));
331 327
 
332
-			foreach ( $entities as $obj ) {
328
+			foreach ($entities as $obj) {
333 329
 
334
-				$entity = get_post( $obj->ID );
330
+				$entity = get_post($obj->ID);
335 331
 
336 332
 				// Ensure only valid and published entities are returned.
337
-				if ( ( null !== $entity ) && ( 'publish' === $entity->post_status ) ) {
333
+				if ((null !== $entity) && ('publish' === $entity->post_status)) {
338 334
 
339
-					$serialized_entity              = wl_serialize_entity( $entity );
335
+					$serialized_entity              = wl_serialize_entity($entity);
340 336
 					$serialized_entity['counter']   = $obj->counter;
341 337
 					$serialized_entity['createdAt'] = $entity->post_date;
342 338
 
343 339
 					// Populate $serialized_entity_groups maintaining array sequence
344
-					foreach ( $serialized_entity_groups as $seg_key => $seg_value ) {
345
-						if ( in_array( $serialized_entity['mainType'], $seg_value['entities'] ) ) {
340
+					foreach ($serialized_entity_groups as $seg_key => $seg_value) {
341
+						if (in_array($serialized_entity['mainType'], $seg_value['entities'])) {
346 342
 							$serialized_entity_groups[$seg_key]['data'][] = $serialized_entity;
347 343
 						}
348 344
 					}
@@ -350,8 +346,8 @@  discard block
 block discarded – undo
350 346
 			}
351 347
 
352 348
 			// Clean-up $serialized_entity_groups by removing empty items and entities
353
-			foreach ( $serialized_entity_groups as $seg_key => $seg_value ) {
354
-				if( empty($seg_value['data']) ) {
349
+			foreach ($serialized_entity_groups as $seg_key => $seg_value) {
350
+				if (empty($seg_value['data'])) {
355 351
 					unset($serialized_entity_groups[$seg_key]);
356 352
 				}
357 353
 				unset($serialized_entity_groups[$seg_key]['entities']);
@@ -368,26 +364,26 @@  discard block
 block discarded – undo
368 364
 /**
369 365
  * Ajax call for the faceted search widget
370 366
  */
371
-function wl_shortcode_faceted_search_ajax( $http_raw_data = null ) {
367
+function wl_shortcode_faceted_search_ajax($http_raw_data = null) {
372 368
 
373
-	$results = wl_shortcode_faceted_search_data_ajax( $http_raw_data );
374
-	wl_core_send_json( $results );
369
+	$results = wl_shortcode_faceted_search_data_ajax($http_raw_data);
370
+	wl_core_send_json($results);
375 371
 
376 372
 }
377 373
 
378 374
 /**
379 375
  * Adding `wp_ajax` and `wp_ajax_nopriv` action for web backend of faceted-search
380 376
  */
381
-add_action( 'wp_ajax_wl_faceted_search', 'wl_shortcode_faceted_search_ajax' );
382
-add_action( 'wp_ajax_nopriv_wl_faceted_search', 'wl_shortcode_faceted_search_ajax' );
377
+add_action('wp_ajax_wl_faceted_search', 'wl_shortcode_faceted_search_ajax');
378
+add_action('wp_ajax_nopriv_wl_faceted_search', 'wl_shortcode_faceted_search_ajax');
383 379
 
384 380
 /**
385 381
  * wp-json call for the faceted search widget
386 382
  */
387
-function wl_shortcode_faceted_search_wp_json( $http_raw_data = null ) {
383
+function wl_shortcode_faceted_search_wp_json($http_raw_data = null) {
388 384
 
389
-	$results = wl_shortcode_faceted_search_data_wp_json( $http_raw_data );
390
-	if ( ob_get_contents() ) {
385
+	$results = wl_shortcode_faceted_search_data_wp_json($http_raw_data);
386
+	if (ob_get_contents()) {
391 387
 		ob_clean();
392 388
 	}
393 389
 	return array(
@@ -399,9 +395,9 @@  discard block
 block discarded – undo
399 395
 /**
400 396
  * Adding `rest_api_init` action for amp backend of faceted-search
401 397
  */
402
-add_action( 'rest_api_init', function () {
403
-	register_rest_route( WL_REST_ROUTE_DEFAULT_NAMESPACE, '/faceted-search', array(
398
+add_action('rest_api_init', function() {
399
+	register_rest_route(WL_REST_ROUTE_DEFAULT_NAMESPACE, '/faceted-search', array(
404 400
 	  'methods' => 'GET',
405 401
 	  'callback' => 'wl_shortcode_faceted_search_wp_json',
406
-	) );
402
+	));
407 403
 } );
Please login to merge, or discard this patch.
src/shortcodes/wordlift_shortcode_navigator.php 2 patches
Indentation   +96 added lines, -96 removed lines patch added patch discarded remove patch
@@ -14,100 +14,100 @@  discard block
 block discarded – undo
14 14
  */
15 15
 function wl_shortcode_navigator_data() {
16 16
 
17
-	// Post ID must be defined
18
-	if ( ! isset( $_GET['post_id'] ) ) {
19
-		wp_die( 'No post_id given' );
17
+    // Post ID must be defined
18
+    if ( ! isset( $_GET['post_id'] ) ) {
19
+        wp_die( 'No post_id given' );
20 20
 
21
-		return;
22
-	}
21
+        return;
22
+    }
23 23
 
24
-	$current_post_id = $_GET['post_id'];
25
-	$current_post    = get_post( $current_post_id );
24
+    $current_post_id = $_GET['post_id'];
25
+    $current_post    = get_post( $current_post_id );
26 26
 
27
-	// Post ID has to match an existing item
28
-	if ( null === $current_post ) {
29
-		wp_die( 'No valid post_id given' );
27
+    // Post ID has to match an existing item
28
+    if ( null === $current_post ) {
29
+        wp_die( 'No valid post_id given' );
30 30
 
31
-		return;
32
-	}
31
+        return;
32
+    }
33 33
 
34
-	// prepare structures to memorize other related posts
35
-	$results          = array();
36
-	$blacklist_ids    = array( $current_post_id );
37
-	$related_entities = array();
34
+    // prepare structures to memorize other related posts
35
+    $results          = array();
36
+    $blacklist_ids    = array( $current_post_id );
37
+    $related_entities = array();
38 38
 
39 39
 
40
-	$relation_service = Wordlift_Relation_Service::get_instance();
40
+    $relation_service = Wordlift_Relation_Service::get_instance();
41 41
 
42
-	// Get the related entities, ordering them by WHO, WHAT, WHERE, WHEN 
43
-	// TODO Replace with a single query if it is possible
44
-	// We select in inverse order to give priority to less used entities 
45
-	foreach (
46
-		array(
47
-			WL_WHEN_RELATION,
48
-			WL_WHERE_RELATION,
49
-			WL_WHAT_RELATION,
50
-			WL_WHO_RELATION,
51
-		) as $predicate
52
-	) {
42
+    // Get the related entities, ordering them by WHO, WHAT, WHERE, WHEN 
43
+    // TODO Replace with a single query if it is possible
44
+    // We select in inverse order to give priority to less used entities 
45
+    foreach (
46
+        array(
47
+            WL_WHEN_RELATION,
48
+            WL_WHERE_RELATION,
49
+            WL_WHAT_RELATION,
50
+            WL_WHO_RELATION,
51
+        ) as $predicate
52
+    ) {
53 53
 
54
-		$related_entities = array_merge( $related_entities,
55
-			$relation_service->get_objects( $current_post_id, '*', $predicate, 'publish' )
54
+        $related_entities = array_merge( $related_entities,
55
+            $relation_service->get_objects( $current_post_id, '*', $predicate, 'publish' )
56 56
 //			wl_core_get_related_entities( $current_post_id, array(
57 57
 //					'predicate' => $predicate,
58 58
 //					'status'    => 'publish',
59 59
 //				)
60
-		);
61
-
62
-	}
63
-
64
-	foreach ( $related_entities as $related_entity ) {
65
-
66
-		// take the id of posts referencing the entity
67
-		$referencing_posts = Wordlift_Relation_Service::get_instance()->get_article_subjects( $related_entity->ID, '*', null, 'publish' );
68
-
69
-		// loop over them and take the first one which is not already in the $related_posts
70
-		foreach ( $referencing_posts as $referencing_post ) {
71
-
72
-			if ( ! in_array( $referencing_post->ID, $blacklist_ids ) ) {
73
-
74
-				$blacklist_ids[]   = $referencing_post->ID;
75
-				$serialized_entity = wl_serialize_entity( $related_entity );
76
-
77
-				/**
78
-				 * Use the thumbnail.
79
-				 *
80
-				 * @see https://github.com/insideout10/wordlift-plugin/issues/825 related issue.
81
-				 * @see https://github.com/insideout10/wordlift-plugin/issues/837
82
-				 *
83
-				 * @since 3.19.3 We're using the medium size image.
84
-				 */
85
-				$thumbnail = get_the_post_thumbnail_url( $referencing_post, 'medium' );
86
-
87
-				if ( $thumbnail ) {
88
-
89
-					$results[] = array(
90
-						'post'   => array(
91
-							'permalink' => get_post_permalink( $referencing_post->ID ),
92
-							'title'     => $referencing_post->post_title,
93
-							'thumbnail' => $thumbnail,
94
-						),
95
-						'entity' => array(
96
-							'label'     => $serialized_entity['label'],
97
-							'mainType'  => $serialized_entity['mainType'],
98
-							'permalink' => get_post_permalink( $related_entity->ID ),
99
-						),
100
-					);
101
-
102
-					// Be sure no more than 1 post for entity is returned
103
-					break;
104
-				}
105
-			}
106
-		}
107
-	}
108
-
109
-	// Return first 4 results in json accordingly to 4 columns layout
110
-	return array_slice( array_reverse( $results ), 0, 4 );
60
+        );
61
+
62
+    }
63
+
64
+    foreach ( $related_entities as $related_entity ) {
65
+
66
+        // take the id of posts referencing the entity
67
+        $referencing_posts = Wordlift_Relation_Service::get_instance()->get_article_subjects( $related_entity->ID, '*', null, 'publish' );
68
+
69
+        // loop over them and take the first one which is not already in the $related_posts
70
+        foreach ( $referencing_posts as $referencing_post ) {
71
+
72
+            if ( ! in_array( $referencing_post->ID, $blacklist_ids ) ) {
73
+
74
+                $blacklist_ids[]   = $referencing_post->ID;
75
+                $serialized_entity = wl_serialize_entity( $related_entity );
76
+
77
+                /**
78
+                 * Use the thumbnail.
79
+                 *
80
+                 * @see https://github.com/insideout10/wordlift-plugin/issues/825 related issue.
81
+                 * @see https://github.com/insideout10/wordlift-plugin/issues/837
82
+                 *
83
+                 * @since 3.19.3 We're using the medium size image.
84
+                 */
85
+                $thumbnail = get_the_post_thumbnail_url( $referencing_post, 'medium' );
86
+
87
+                if ( $thumbnail ) {
88
+
89
+                    $results[] = array(
90
+                        'post'   => array(
91
+                            'permalink' => get_post_permalink( $referencing_post->ID ),
92
+                            'title'     => $referencing_post->post_title,
93
+                            'thumbnail' => $thumbnail,
94
+                        ),
95
+                        'entity' => array(
96
+                            'label'     => $serialized_entity['label'],
97
+                            'mainType'  => $serialized_entity['mainType'],
98
+                            'permalink' => get_post_permalink( $related_entity->ID ),
99
+                        ),
100
+                    );
101
+
102
+                    // Be sure no more than 1 post for entity is returned
103
+                    break;
104
+                }
105
+            }
106
+        }
107
+    }
108
+
109
+    // Return first 4 results in json accordingly to 4 columns layout
110
+    return array_slice( array_reverse( $results ), 0, 4 );
111 111
 
112 112
 }
113 113
 
@@ -118,8 +118,8 @@  discard block
 block discarded – undo
118 118
  */
119 119
 function wl_shortcode_navigator_ajax() {
120 120
 
121
-	$results = wl_shortcode_navigator_data();
122
-	wl_core_send_json($results);
121
+    $results = wl_shortcode_navigator_data();
122
+    wl_core_send_json($results);
123 123
 
124 124
 }
125 125
 
@@ -131,15 +131,15 @@  discard block
 block discarded – undo
131 131
  */
132 132
 function wl_shortcode_navigator_wp_json() {
133 133
 
134
-	$results = wl_shortcode_navigator_data();
135
-	if ( ob_get_contents() ) {
136
-		ob_clean();
137
-	}
138
-	return array(
139
-		'items' => array( 
140
-			array('values' => $results)
141
-		)
142
-	);
134
+    $results = wl_shortcode_navigator_data();
135
+    if ( ob_get_contents() ) {
136
+        ob_clean();
137
+    }
138
+    return array(
139
+        'items' => array( 
140
+            array('values' => $results)
141
+        )
142
+    );
143 143
 
144 144
 }
145 145
 
@@ -147,8 +147,8 @@  discard block
 block discarded – undo
147 147
  * Adding `rest_api_init` action for amp backend of navigator
148 148
  */
149 149
 add_action( 'rest_api_init', function () {
150
-	register_rest_route( WL_REST_ROUTE_DEFAULT_NAMESPACE, '/navigator', array(
151
-	  'methods' => 'GET',
152
-	  'callback' => 'wl_shortcode_navigator_wp_json',
153
-	) );
150
+    register_rest_route( WL_REST_ROUTE_DEFAULT_NAMESPACE, '/navigator', array(
151
+        'methods' => 'GET',
152
+        'callback' => 'wl_shortcode_navigator_wp_json',
153
+    ) );
154 154
 } );
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -15,25 +15,25 @@  discard block
 block discarded – undo
15 15
 function wl_shortcode_navigator_data() {
16 16
 
17 17
 	// Post ID must be defined
18
-	if ( ! isset( $_GET['post_id'] ) ) {
19
-		wp_die( 'No post_id given' );
18
+	if ( ! isset($_GET['post_id'])) {
19
+		wp_die('No post_id given');
20 20
 
21 21
 		return;
22 22
 	}
23 23
 
24 24
 	$current_post_id = $_GET['post_id'];
25
-	$current_post    = get_post( $current_post_id );
25
+	$current_post    = get_post($current_post_id);
26 26
 
27 27
 	// Post ID has to match an existing item
28
-	if ( null === $current_post ) {
29
-		wp_die( 'No valid post_id given' );
28
+	if (null === $current_post) {
29
+		wp_die('No valid post_id given');
30 30
 
31 31
 		return;
32 32
 	}
33 33
 
34 34
 	// prepare structures to memorize other related posts
35 35
 	$results          = array();
36
-	$blacklist_ids    = array( $current_post_id );
36
+	$blacklist_ids    = array($current_post_id);
37 37
 	$related_entities = array();
38 38
 
39 39
 
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
 		) as $predicate
52 52
 	) {
53 53
 
54
-		$related_entities = array_merge( $related_entities,
55
-			$relation_service->get_objects( $current_post_id, '*', $predicate, 'publish' )
54
+		$related_entities = array_merge($related_entities,
55
+			$relation_service->get_objects($current_post_id, '*', $predicate, 'publish')
56 56
 //			wl_core_get_related_entities( $current_post_id, array(
57 57
 //					'predicate' => $predicate,
58 58
 //					'status'    => 'publish',
@@ -61,18 +61,18 @@  discard block
 block discarded – undo
61 61
 
62 62
 	}
63 63
 
64
-	foreach ( $related_entities as $related_entity ) {
64
+	foreach ($related_entities as $related_entity) {
65 65
 
66 66
 		// take the id of posts referencing the entity
67
-		$referencing_posts = Wordlift_Relation_Service::get_instance()->get_article_subjects( $related_entity->ID, '*', null, 'publish' );
67
+		$referencing_posts = Wordlift_Relation_Service::get_instance()->get_article_subjects($related_entity->ID, '*', null, 'publish');
68 68
 
69 69
 		// loop over them and take the first one which is not already in the $related_posts
70
-		foreach ( $referencing_posts as $referencing_post ) {
70
+		foreach ($referencing_posts as $referencing_post) {
71 71
 
72
-			if ( ! in_array( $referencing_post->ID, $blacklist_ids ) ) {
72
+			if ( ! in_array($referencing_post->ID, $blacklist_ids)) {
73 73
 
74 74
 				$blacklist_ids[]   = $referencing_post->ID;
75
-				$serialized_entity = wl_serialize_entity( $related_entity );
75
+				$serialized_entity = wl_serialize_entity($related_entity);
76 76
 
77 77
 				/**
78 78
 				 * Use the thumbnail.
@@ -82,20 +82,20 @@  discard block
 block discarded – undo
82 82
 				 *
83 83
 				 * @since 3.19.3 We're using the medium size image.
84 84
 				 */
85
-				$thumbnail = get_the_post_thumbnail_url( $referencing_post, 'medium' );
85
+				$thumbnail = get_the_post_thumbnail_url($referencing_post, 'medium');
86 86
 
87
-				if ( $thumbnail ) {
87
+				if ($thumbnail) {
88 88
 
89 89
 					$results[] = array(
90 90
 						'post'   => array(
91
-							'permalink' => get_post_permalink( $referencing_post->ID ),
91
+							'permalink' => get_post_permalink($referencing_post->ID),
92 92
 							'title'     => $referencing_post->post_title,
93 93
 							'thumbnail' => $thumbnail,
94 94
 						),
95 95
 						'entity' => array(
96 96
 							'label'     => $serialized_entity['label'],
97 97
 							'mainType'  => $serialized_entity['mainType'],
98
-							'permalink' => get_post_permalink( $related_entity->ID ),
98
+							'permalink' => get_post_permalink($related_entity->ID),
99 99
 						),
100 100
 					);
101 101
 
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	}
108 108
 
109 109
 	// Return first 4 results in json accordingly to 4 columns layout
110
-	return array_slice( array_reverse( $results ), 0, 4 );
110
+	return array_slice(array_reverse($results), 0, 4);
111 111
 
112 112
 }
113 113
 
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 
124 124
 }
125 125
 
126
-add_action( 'wp_ajax_wl_navigator', 'wl_shortcode_navigator_ajax' );
127
-add_action( 'wp_ajax_nopriv_wl_navigator', 'wl_shortcode_navigator_ajax' );
126
+add_action('wp_ajax_wl_navigator', 'wl_shortcode_navigator_ajax');
127
+add_action('wp_ajax_nopriv_wl_navigator', 'wl_shortcode_navigator_ajax');
128 128
 
129 129
 /**
130 130
  * wp-json call for the navigator widget
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
 function wl_shortcode_navigator_wp_json() {
133 133
 
134 134
 	$results = wl_shortcode_navigator_data();
135
-	if ( ob_get_contents() ) {
135
+	if (ob_get_contents()) {
136 136
 		ob_clean();
137 137
 	}
138 138
 	return array(
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
 /**
147 147
  * Adding `rest_api_init` action for amp backend of navigator
148 148
  */
149
-add_action( 'rest_api_init', function () {
150
-	register_rest_route( WL_REST_ROUTE_DEFAULT_NAMESPACE, '/navigator', array(
149
+add_action('rest_api_init', function() {
150
+	register_rest_route(WL_REST_ROUTE_DEFAULT_NAMESPACE, '/navigator', array(
151 151
 	  'methods' => 'GET',
152 152
 	  'callback' => 'wl_shortcode_navigator_wp_json',
153
-	) );
153
+	));
154 154
 } );
Please login to merge, or discard this patch.