Completed
Push — develop ( 3cb184...8fdc4f )
by David
01:19
created
src/includes/class-wordlift-key-validation-service.php 2 patches
Indentation   +186 added lines, -186 removed lines patch added patch discarded remove patch
@@ -20,194 +20,194 @@
 block discarded – undo
20 20
  */
21 21
 class Wordlift_Key_Validation_Service {
22 22
 
23
-	/**
24
-	 * A {@link Wordlift_Log_Service} instance.
25
-	 *
26
-	 * @since  3.14.0
27
-	 * @access private
28
-	 * @var \Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance.
29
-	 */
30
-	private $log;
31
-
32
-	/**
33
-	 * The {@link Wordlift_Configuration_Service} instance.
34
-	 *
35
-	 * @since  3.14.0
36
-	 * @access private
37
-	 * @var \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance.
38
-	 */
39
-	private $configuration_service;
40
-
41
-	/**
42
-	 * @var Ttl_Cache
43
-	 */
44
-	private $ttl_cache_service;
45
-
46
-	/**
47
-	 * Create a {@link Wordlift_Key_Validation_Service} instance.
48
-	 *
49
-	 * @param \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance.
50
-	 *
51
-	 * @since 3.14.0
52
-	 */
53
-	public function __construct( $configuration_service ) {
54
-
55
-		$this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Key_Validation_Service' );
56
-
57
-		$this->configuration_service = $configuration_service;
58
-
59
-		add_action( 'admin_init', array( $this, 'wl_load_plugin' ) );
60
-		/**
61
-		 * Filter: wl_feature__enable__notices.
62
-		 *
63
-		 * @param bool whether notices need to be enabled or not.
64
-		 *
65
-		 * @return bool
66
-		 * @since 3.27.6
67
-		 */
68
-		if ( apply_filters( 'wl_feature__enable__notices', true ) ) {
69
-			add_action( 'admin_notices', array( $this, 'wl_key_update_notice' ) );
70
-		}
71
-
72
-		$this->ttl_cache_service = new Ttl_Cache( 'key-validation-notification' );
73
-
74
-	}
75
-
76
-	/**
77
-	 * Validate the provided key.
78
-	 *
79
-	 * @param string $key WordLift's key to validate.
80
-	 *
81
-	 * @return WP_Error|array The response or WP_Error on failure.
82
-	 * @since 3.9.0
83
-	 *
84
-	 */
85
-	public function get_account_info( $key ) {
86
-
87
-		$this->log->debug( 'Validating key...' );
88
-
89
-		return Default_Api_Service::get_instance()->get( '/accounts/info', array(
90
-			'Authorization' => "Key $key",
91
-		) )->get_response();
92
-	}
93
-
94
-	/**
95
-	 * Check if key is valid
96
-	 *
97
-	 * @param $key string
98
-	 *
99
-	 * @return bool
100
-	 */
101
-	public function is_key_valid( $key ) {
102
-
103
-		$response = $this->get_account_info( $key );
104
-
105
-		if ( is_wp_error( $response ) || 2 !== (int) $response['response']['code'] / 100 ) {
106
-			return false;
107
-		}
108
-		$res_body = json_decode( wp_remote_retrieve_body( $response ), true );
109
-
110
-		$url = $res_body['url'];
111
-
112
-		// Considering that production URL may be filtered.
113
-		$home_url = get_option( 'home' );
114
-		$site_url = apply_filters( 'wl_production_site_url', untrailingslashit( $home_url ) );
115
-		if ( is_null( $url ) || $url === $site_url ) {
116
-			return true;
117
-		}
118
-
119
-		return false;
120
-	}
121
-
122
-	/**
123
-	 * This function is hooked to the `wl_validate_key` AJAX call.
124
-	 *
125
-	 * @since 3.9.0
126
-	 */
127
-	public function validate_key() {
128
-
129
-		// Ensure we don't have garbage before us.
130
-		ob_clean();
131
-
132
-		// Check if we have a key.
133
-		if ( ! isset( $_POST['key'] ) ) {
134
-			wp_send_json_error( 'The key parameter is required.' );
135
-		}
136
-
137
-		$response = $this->get_account_info( (string) $_POST['key'] );
138
-
139
-		// If we got an error, return invalid.
140
-		if ( is_wp_error( $response ) || 2 !== (int) $response['response']['code'] / 100 ) {
141
-			wp_send_json_success( array(
142
-				'valid'    => false,
143
-				'message'  => '',
144
-				'response' => $response,
145
-				'api_url'  => Default_Api_Service::get_instance()->get_base_url()
146
-			) );
147
-		}
148
-
149
-		$res_body = json_decode( wp_remote_retrieve_body( $response ), true );
150
-
151
-		// The URL stored in WLS. If this is the initial install the URL may be null.
152
-		$url = $res_body['url'];
153
-
154
-		// Considering that production URL may be filtered.
155
-		$home_url = get_option( 'home' );
156
-		$site_url = apply_filters( 'wl_production_site_url', untrailingslashit( $home_url ) );
157
-
158
-		// If the URL isn't set or matches, then it's valid.
159
-		if ( is_null( $url ) || $url === $site_url ) {
160
-			// Invalidate the cache key
161
-			$this->ttl_cache_service->delete( 'is_key_valid' );
162
-			wp_send_json_success( array( 'valid' => true, 'message' => '' ) );
163
-		}
164
-
165
-		// If the URL doesn't match it means that this key has been configured elsewhere already.
166
-		if ( $url !== $site_url ) {
167
-			Wordlift_Configuration_Service::get_instance()->set_key( '' );
168
-			wp_send_json_success( array(
169
-				'valid'   => false,
170
-				'message' => __( 'The key is already used on another site, please contact us at [email protected] to move the key to another site.', 'wordlift' ),
171
-			) );
172
-		}
173
-
174
-		// Set a response with valid set to true or false according to the key validity with message.
175
-		wp_send_json_success( array(
176
-			'valid'   => false,
177
-			'message' => __( 'An error occurred, please contact us at [email protected]', 'wordlift' ),
178
-		) );
179
-	}
180
-
181
-	/**
182
-	 * This function is hooked `admin_init` to check _wl_blog_url.
183
-	 *
184
-	 */
185
-	public function wl_load_plugin() {
186
-
187
-		$wl_blog_url = get_option( '_wl_blog_url' );
188
-		$home_url    = get_option( 'home' );
189
-
190
-		if ( ! $wl_blog_url ) {
191
-			update_option( '_wl_blog_url', $home_url, true );
192
-		} else if ( $wl_blog_url !== $home_url ) {
193
-			update_option( '_wl_blog_url', $home_url, true );
194
-			Wordlift_Configuration_Service::get_instance()->set_key( '' );
195
-			set_transient( 'wl-key-error-msg', __( "Your web site URL has changed. To avoid data corruption, WordLift's key has been removed. Please provide a new key in WordLift Settings. If you believe this to be an error, please contact us at [email protected]", 'wordlift' ), 10 );
196
-		}
197
-
198
-	}
199
-
200
-	/**
201
-	 * This function is hooked to the `admin_notices` to show admin notification.
202
-	 *
203
-	 */
204
-	public function wl_key_update_notice() {
205
-		if ( get_transient( 'wl-key-error-msg' ) ) {
206
-			?>
23
+    /**
24
+     * A {@link Wordlift_Log_Service} instance.
25
+     *
26
+     * @since  3.14.0
27
+     * @access private
28
+     * @var \Wordlift_Log_Service $log A {@link Wordlift_Log_Service} instance.
29
+     */
30
+    private $log;
31
+
32
+    /**
33
+     * The {@link Wordlift_Configuration_Service} instance.
34
+     *
35
+     * @since  3.14.0
36
+     * @access private
37
+     * @var \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance.
38
+     */
39
+    private $configuration_service;
40
+
41
+    /**
42
+     * @var Ttl_Cache
43
+     */
44
+    private $ttl_cache_service;
45
+
46
+    /**
47
+     * Create a {@link Wordlift_Key_Validation_Service} instance.
48
+     *
49
+     * @param \Wordlift_Configuration_Service $configuration_service The {@link Wordlift_Configuration_Service} instance.
50
+     *
51
+     * @since 3.14.0
52
+     */
53
+    public function __construct( $configuration_service ) {
54
+
55
+        $this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Key_Validation_Service' );
56
+
57
+        $this->configuration_service = $configuration_service;
58
+
59
+        add_action( 'admin_init', array( $this, 'wl_load_plugin' ) );
60
+        /**
61
+         * Filter: wl_feature__enable__notices.
62
+         *
63
+         * @param bool whether notices need to be enabled or not.
64
+         *
65
+         * @return bool
66
+         * @since 3.27.6
67
+         */
68
+        if ( apply_filters( 'wl_feature__enable__notices', true ) ) {
69
+            add_action( 'admin_notices', array( $this, 'wl_key_update_notice' ) );
70
+        }
71
+
72
+        $this->ttl_cache_service = new Ttl_Cache( 'key-validation-notification' );
73
+
74
+    }
75
+
76
+    /**
77
+     * Validate the provided key.
78
+     *
79
+     * @param string $key WordLift's key to validate.
80
+     *
81
+     * @return WP_Error|array The response or WP_Error on failure.
82
+     * @since 3.9.0
83
+     *
84
+     */
85
+    public function get_account_info( $key ) {
86
+
87
+        $this->log->debug( 'Validating key...' );
88
+
89
+        return Default_Api_Service::get_instance()->get( '/accounts/info', array(
90
+            'Authorization' => "Key $key",
91
+        ) )->get_response();
92
+    }
93
+
94
+    /**
95
+     * Check if key is valid
96
+     *
97
+     * @param $key string
98
+     *
99
+     * @return bool
100
+     */
101
+    public function is_key_valid( $key ) {
102
+
103
+        $response = $this->get_account_info( $key );
104
+
105
+        if ( is_wp_error( $response ) || 2 !== (int) $response['response']['code'] / 100 ) {
106
+            return false;
107
+        }
108
+        $res_body = json_decode( wp_remote_retrieve_body( $response ), true );
109
+
110
+        $url = $res_body['url'];
111
+
112
+        // Considering that production URL may be filtered.
113
+        $home_url = get_option( 'home' );
114
+        $site_url = apply_filters( 'wl_production_site_url', untrailingslashit( $home_url ) );
115
+        if ( is_null( $url ) || $url === $site_url ) {
116
+            return true;
117
+        }
118
+
119
+        return false;
120
+    }
121
+
122
+    /**
123
+     * This function is hooked to the `wl_validate_key` AJAX call.
124
+     *
125
+     * @since 3.9.0
126
+     */
127
+    public function validate_key() {
128
+
129
+        // Ensure we don't have garbage before us.
130
+        ob_clean();
131
+
132
+        // Check if we have a key.
133
+        if ( ! isset( $_POST['key'] ) ) {
134
+            wp_send_json_error( 'The key parameter is required.' );
135
+        }
136
+
137
+        $response = $this->get_account_info( (string) $_POST['key'] );
138
+
139
+        // If we got an error, return invalid.
140
+        if ( is_wp_error( $response ) || 2 !== (int) $response['response']['code'] / 100 ) {
141
+            wp_send_json_success( array(
142
+                'valid'    => false,
143
+                'message'  => '',
144
+                'response' => $response,
145
+                'api_url'  => Default_Api_Service::get_instance()->get_base_url()
146
+            ) );
147
+        }
148
+
149
+        $res_body = json_decode( wp_remote_retrieve_body( $response ), true );
150
+
151
+        // The URL stored in WLS. If this is the initial install the URL may be null.
152
+        $url = $res_body['url'];
153
+
154
+        // Considering that production URL may be filtered.
155
+        $home_url = get_option( 'home' );
156
+        $site_url = apply_filters( 'wl_production_site_url', untrailingslashit( $home_url ) );
157
+
158
+        // If the URL isn't set or matches, then it's valid.
159
+        if ( is_null( $url ) || $url === $site_url ) {
160
+            // Invalidate the cache key
161
+            $this->ttl_cache_service->delete( 'is_key_valid' );
162
+            wp_send_json_success( array( 'valid' => true, 'message' => '' ) );
163
+        }
164
+
165
+        // If the URL doesn't match it means that this key has been configured elsewhere already.
166
+        if ( $url !== $site_url ) {
167
+            Wordlift_Configuration_Service::get_instance()->set_key( '' );
168
+            wp_send_json_success( array(
169
+                'valid'   => false,
170
+                'message' => __( 'The key is already used on another site, please contact us at [email protected] to move the key to another site.', 'wordlift' ),
171
+            ) );
172
+        }
173
+
174
+        // Set a response with valid set to true or false according to the key validity with message.
175
+        wp_send_json_success( array(
176
+            'valid'   => false,
177
+            'message' => __( 'An error occurred, please contact us at [email protected]', 'wordlift' ),
178
+        ) );
179
+    }
180
+
181
+    /**
182
+     * This function is hooked `admin_init` to check _wl_blog_url.
183
+     *
184
+     */
185
+    public function wl_load_plugin() {
186
+
187
+        $wl_blog_url = get_option( '_wl_blog_url' );
188
+        $home_url    = get_option( 'home' );
189
+
190
+        if ( ! $wl_blog_url ) {
191
+            update_option( '_wl_blog_url', $home_url, true );
192
+        } else if ( $wl_blog_url !== $home_url ) {
193
+            update_option( '_wl_blog_url', $home_url, true );
194
+            Wordlift_Configuration_Service::get_instance()->set_key( '' );
195
+            set_transient( 'wl-key-error-msg', __( "Your web site URL has changed. To avoid data corruption, WordLift's key has been removed. Please provide a new key in WordLift Settings. If you believe this to be an error, please contact us at [email protected]", 'wordlift' ), 10 );
196
+        }
197
+
198
+    }
199
+
200
+    /**
201
+     * This function is hooked to the `admin_notices` to show admin notification.
202
+     *
203
+     */
204
+    public function wl_key_update_notice() {
205
+        if ( get_transient( 'wl-key-error-msg' ) ) {
206
+            ?>
207 207
             <div class="updated notice is-dismissible error">
208 208
                 <p><?php esc_html_e( get_transient( 'wl-key-error-msg' ), 'wordlift' ); ?></p>
209 209
             </div>
210 210
 			<?php
211
-		}
212
-	}
211
+        }
212
+    }
213 213
 }
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -50,13 +50,13 @@  discard block
 block discarded – undo
50 50
 	 *
51 51
 	 * @since 3.14.0
52 52
 	 */
53
-	public function __construct( $configuration_service ) {
53
+	public function __construct($configuration_service) {
54 54
 
55
-		$this->log = Wordlift_Log_Service::get_logger( 'Wordlift_Key_Validation_Service' );
55
+		$this->log = Wordlift_Log_Service::get_logger('Wordlift_Key_Validation_Service');
56 56
 
57 57
 		$this->configuration_service = $configuration_service;
58 58
 
59
-		add_action( 'admin_init', array( $this, 'wl_load_plugin' ) );
59
+		add_action('admin_init', array($this, 'wl_load_plugin'));
60 60
 		/**
61 61
 		 * Filter: wl_feature__enable__notices.
62 62
 		 *
@@ -65,11 +65,11 @@  discard block
 block discarded – undo
65 65
 		 * @return bool
66 66
 		 * @since 3.27.6
67 67
 		 */
68
-		if ( apply_filters( 'wl_feature__enable__notices', true ) ) {
69
-			add_action( 'admin_notices', array( $this, 'wl_key_update_notice' ) );
68
+		if (apply_filters('wl_feature__enable__notices', true)) {
69
+			add_action('admin_notices', array($this, 'wl_key_update_notice'));
70 70
 		}
71 71
 
72
-		$this->ttl_cache_service = new Ttl_Cache( 'key-validation-notification' );
72
+		$this->ttl_cache_service = new Ttl_Cache('key-validation-notification');
73 73
 
74 74
 	}
75 75
 
@@ -82,13 +82,13 @@  discard block
 block discarded – undo
82 82
 	 * @since 3.9.0
83 83
 	 *
84 84
 	 */
85
-	public function get_account_info( $key ) {
85
+	public function get_account_info($key) {
86 86
 
87
-		$this->log->debug( 'Validating key...' );
87
+		$this->log->debug('Validating key...');
88 88
 
89
-		return Default_Api_Service::get_instance()->get( '/accounts/info', array(
89
+		return Default_Api_Service::get_instance()->get('/accounts/info', array(
90 90
 			'Authorization' => "Key $key",
91
-		) )->get_response();
91
+		))->get_response();
92 92
 	}
93 93
 
94 94
 	/**
@@ -98,21 +98,21 @@  discard block
 block discarded – undo
98 98
 	 *
99 99
 	 * @return bool
100 100
 	 */
101
-	public function is_key_valid( $key ) {
101
+	public function is_key_valid($key) {
102 102
 
103
-		$response = $this->get_account_info( $key );
103
+		$response = $this->get_account_info($key);
104 104
 
105
-		if ( is_wp_error( $response ) || 2 !== (int) $response['response']['code'] / 100 ) {
105
+		if (is_wp_error($response) || 2 !== (int) $response['response']['code'] / 100) {
106 106
 			return false;
107 107
 		}
108
-		$res_body = json_decode( wp_remote_retrieve_body( $response ), true );
108
+		$res_body = json_decode(wp_remote_retrieve_body($response), true);
109 109
 
110 110
 		$url = $res_body['url'];
111 111
 
112 112
 		// Considering that production URL may be filtered.
113
-		$home_url = get_option( 'home' );
114
-		$site_url = apply_filters( 'wl_production_site_url', untrailingslashit( $home_url ) );
115
-		if ( is_null( $url ) || $url === $site_url ) {
113
+		$home_url = get_option('home');
114
+		$site_url = apply_filters('wl_production_site_url', untrailingslashit($home_url));
115
+		if (is_null($url) || $url === $site_url) {
116 116
 			return true;
117 117
 		}
118 118
 
@@ -130,52 +130,52 @@  discard block
 block discarded – undo
130 130
 		ob_clean();
131 131
 
132 132
 		// Check if we have a key.
133
-		if ( ! isset( $_POST['key'] ) ) {
134
-			wp_send_json_error( 'The key parameter is required.' );
133
+		if ( ! isset($_POST['key'])) {
134
+			wp_send_json_error('The key parameter is required.');
135 135
 		}
136 136
 
137
-		$response = $this->get_account_info( (string) $_POST['key'] );
137
+		$response = $this->get_account_info((string) $_POST['key']);
138 138
 
139 139
 		// If we got an error, return invalid.
140
-		if ( is_wp_error( $response ) || 2 !== (int) $response['response']['code'] / 100 ) {
141
-			wp_send_json_success( array(
140
+		if (is_wp_error($response) || 2 !== (int) $response['response']['code'] / 100) {
141
+			wp_send_json_success(array(
142 142
 				'valid'    => false,
143 143
 				'message'  => '',
144 144
 				'response' => $response,
145 145
 				'api_url'  => Default_Api_Service::get_instance()->get_base_url()
146
-			) );
146
+			));
147 147
 		}
148 148
 
149
-		$res_body = json_decode( wp_remote_retrieve_body( $response ), true );
149
+		$res_body = json_decode(wp_remote_retrieve_body($response), true);
150 150
 
151 151
 		// The URL stored in WLS. If this is the initial install the URL may be null.
152 152
 		$url = $res_body['url'];
153 153
 
154 154
 		// Considering that production URL may be filtered.
155
-		$home_url = get_option( 'home' );
156
-		$site_url = apply_filters( 'wl_production_site_url', untrailingslashit( $home_url ) );
155
+		$home_url = get_option('home');
156
+		$site_url = apply_filters('wl_production_site_url', untrailingslashit($home_url));
157 157
 
158 158
 		// If the URL isn't set or matches, then it's valid.
159
-		if ( is_null( $url ) || $url === $site_url ) {
159
+		if (is_null($url) || $url === $site_url) {
160 160
 			// Invalidate the cache key
161
-			$this->ttl_cache_service->delete( 'is_key_valid' );
162
-			wp_send_json_success( array( 'valid' => true, 'message' => '' ) );
161
+			$this->ttl_cache_service->delete('is_key_valid');
162
+			wp_send_json_success(array('valid' => true, 'message' => ''));
163 163
 		}
164 164
 
165 165
 		// If the URL doesn't match it means that this key has been configured elsewhere already.
166
-		if ( $url !== $site_url ) {
167
-			Wordlift_Configuration_Service::get_instance()->set_key( '' );
168
-			wp_send_json_success( array(
166
+		if ($url !== $site_url) {
167
+			Wordlift_Configuration_Service::get_instance()->set_key('');
168
+			wp_send_json_success(array(
169 169
 				'valid'   => false,
170
-				'message' => __( 'The key is already used on another site, please contact us at [email protected] to move the key to another site.', 'wordlift' ),
171
-			) );
170
+				'message' => __('The key is already used on another site, please contact us at [email protected] to move the key to another site.', 'wordlift'),
171
+			));
172 172
 		}
173 173
 
174 174
 		// Set a response with valid set to true or false according to the key validity with message.
175
-		wp_send_json_success( array(
175
+		wp_send_json_success(array(
176 176
 			'valid'   => false,
177
-			'message' => __( 'An error occurred, please contact us at [email protected]', 'wordlift' ),
178
-		) );
177
+			'message' => __('An error occurred, please contact us at [email protected]', 'wordlift'),
178
+		));
179 179
 	}
180 180
 
181 181
 	/**
@@ -184,15 +184,15 @@  discard block
 block discarded – undo
184 184
 	 */
185 185
 	public function wl_load_plugin() {
186 186
 
187
-		$wl_blog_url = get_option( '_wl_blog_url' );
188
-		$home_url    = get_option( 'home' );
187
+		$wl_blog_url = get_option('_wl_blog_url');
188
+		$home_url    = get_option('home');
189 189
 
190
-		if ( ! $wl_blog_url ) {
191
-			update_option( '_wl_blog_url', $home_url, true );
192
-		} else if ( $wl_blog_url !== $home_url ) {
193
-			update_option( '_wl_blog_url', $home_url, true );
194
-			Wordlift_Configuration_Service::get_instance()->set_key( '' );
195
-			set_transient( 'wl-key-error-msg', __( "Your web site URL has changed. To avoid data corruption, WordLift's key has been removed. Please provide a new key in WordLift Settings. If you believe this to be an error, please contact us at [email protected]", 'wordlift' ), 10 );
190
+		if ( ! $wl_blog_url) {
191
+			update_option('_wl_blog_url', $home_url, true);
192
+		} else if ($wl_blog_url !== $home_url) {
193
+			update_option('_wl_blog_url', $home_url, true);
194
+			Wordlift_Configuration_Service::get_instance()->set_key('');
195
+			set_transient('wl-key-error-msg', __("Your web site URL has changed. To avoid data corruption, WordLift's key has been removed. Please provide a new key in WordLift Settings. If you believe this to be an error, please contact us at [email protected]", 'wordlift'), 10);
196 196
 		}
197 197
 
198 198
 	}
@@ -202,10 +202,10 @@  discard block
 block discarded – undo
202 202
 	 *
203 203
 	 */
204 204
 	public function wl_key_update_notice() {
205
-		if ( get_transient( 'wl-key-error-msg' ) ) {
205
+		if (get_transient('wl-key-error-msg')) {
206 206
 			?>
207 207
             <div class="updated notice is-dismissible error">
208
-                <p><?php esc_html_e( get_transient( 'wl-key-error-msg' ), 'wordlift' ); ?></p>
208
+                <p><?php esc_html_e(get_transient('wl-key-error-msg'), 'wordlift'); ?></p>
209 209
             </div>
210 210
 			<?php
211 211
 		}
Please login to merge, or discard this patch.
src/includes/class-wordlift.php 2 patches
Indentation   +1946 added lines, -1946 removed lines patch added patch discarded remove patch
@@ -86,1670 +86,1670 @@  discard block
 block discarded – undo
86 86
  */
87 87
 class Wordlift {
88 88
 
89
-	//<editor-fold desc="## FIELDS">
90
-
91
-	/**
92
-	 * The loader that's responsible for maintaining and registering all hooks that power
93
-	 * the plugin.
94
-	 *
95
-	 * @since    1.0.0
96
-	 * @access   protected
97
-	 * @var      Wordlift_Loader $loader Maintains and registers all hooks for the plugin.
98
-	 */
99
-	protected $loader;
100
-
101
-	/**
102
-	 * The unique identifier of this plugin.
103
-	 *
104
-	 * @since    1.0.0
105
-	 * @access   protected
106
-	 * @var      string $plugin_name The string used to uniquely identify this plugin.
107
-	 */
108
-	protected $plugin_name;
109
-
110
-	/**
111
-	 * The current version of the plugin.
112
-	 *
113
-	 * @since    1.0.0
114
-	 * @access   protected
115
-	 * @var      string $version The current version of the plugin.
116
-	 */
117
-	protected $version;
118
-
119
-	/**
120
-	 * The {@link Wordlift_Tinymce_Adapter} instance.
121
-	 *
122
-	 * @since  3.12.0
123
-	 * @access protected
124
-	 * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance.
125
-	 */
126
-	protected $tinymce_adapter;
127
-
128
-	/**
129
-	 * The {@link Faq_Tinymce_Adapter} instance
130
-	 * @since 3.26.0
131
-	 * @access protected
132
-	 * @var Faq_Tinymce_Adapter $faq_tinymce_adapter .
133
-	 */
134
-	//protected $faq_tinymce_adapter;
135
-
136
-	/**
137
-	 * The Thumbnail service.
138
-	 *
139
-	 * @since  3.1.5
140
-	 * @access private
141
-	 * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
142
-	 */
143
-	private $thumbnail_service;
144
-
145
-	/**
146
-	 * The UI service.
147
-	 *
148
-	 * @since  3.2.0
149
-	 * @access private
150
-	 * @var \Wordlift_UI_Service $ui_service The UI service.
151
-	 */
152
-	private $ui_service;
153
-
154
-	/**
155
-	 * The Schema service.
156
-	 *
157
-	 * @since  3.3.0
158
-	 * @access protected
159
-	 * @var \Wordlift_Schema_Service $schema_service The Schema service.
160
-	 */
161
-	protected $schema_service;
162
-
163
-	/**
164
-	 * The Entity service.
165
-	 *
166
-	 * @since  3.1.0
167
-	 * @access protected
168
-	 * @var \Wordlift_Entity_Service $entity_service The Entity service.
169
-	 */
170
-	protected $entity_service;
171
-
172
-	/**
173
-	 * The Topic Taxonomy service.
174
-	 *
175
-	 * @since  3.5.0
176
-	 * @access private
177
-	 * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
178
-	 */
179
-	private $topic_taxonomy_service;
180
-
181
-	/**
182
-	 * The Entity Types Taxonomy service.
183
-	 *
184
-	 * @since  3.18.0
185
-	 * @access private
186
-	 * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service.
187
-	 */
188
-	private $entity_types_taxonomy_service;
189
-
190
-	/**
191
-	 * The User service.
192
-	 *
193
-	 * @since  3.1.7
194
-	 * @access protected
195
-	 * @var \Wordlift_User_Service $user_service The User service.
196
-	 */
197
-	protected $user_service;
198
-
199
-	/**
200
-	 * The Timeline service.
201
-	 *
202
-	 * @since  3.1.0
203
-	 * @access private
204
-	 * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
205
-	 */
206
-	private $timeline_service;
207
-
208
-	/**
209
-	 * The Redirect service.
210
-	 *
211
-	 * @since  3.2.0
212
-	 * @access private
213
-	 * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
214
-	 */
215
-	private $redirect_service;
216
-
217
-	/**
218
-	 * The Notice service.
219
-	 *
220
-	 * @since  3.3.0
221
-	 * @access private
222
-	 * @var \Wordlift_Notice_Service $notice_service The Notice service.
223
-	 */
224
-	private $notice_service;
225
-
226
-	/**
227
-	 * The Entity list customization.
228
-	 *
229
-	 * @since  3.3.0
230
-	 * @access protected
231
-	 * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service.
232
-	 */
233
-	protected $entity_list_service;
234
-
235
-	/**
236
-	 * The Entity Types Taxonomy Walker.
237
-	 *
238
-	 * @since  3.1.0
239
-	 * @access private
240
-	 * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
241
-	 */
242
-	private $entity_types_taxonomy_walker;
243
-
244
-	/**
245
-	 * The ShareThis service.
246
-	 *
247
-	 * @since  3.2.0
248
-	 * @access private
249
-	 * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
250
-	 */
251
-	private $sharethis_service;
252
-
253
-	/**
254
-	 * The PrimaShop adapter.
255
-	 *
256
-	 * @since  3.2.3
257
-	 * @access private
258
-	 * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
259
-	 */
260
-	private $primashop_adapter;
261
-
262
-	/**
263
-	 * The WordLift Dashboard adapter.
264
-	 *
265
-	 * @since  3.4.0
266
-	 * @access private
267
-	 * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
268
-	 */
269
-	private $dashboard_service;
270
-
271
-	/**
272
-	 * The entity type service.
273
-	 *
274
-	 * @since  3.6.0
275
-	 * @access private
276
-	 * @var \Wordlift_Entity_Post_Type_Service
277
-	 */
278
-	private $entity_post_type_service;
279
-
280
-	/**
281
-	 * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
282
-	 *
283
-	 * @since  3.6.0
284
-	 * @access private
285
-	 * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance.
286
-	 */
287
-	private $entity_link_service;
288
-
289
-	/**
290
-	 * A {@link Wordlift_Sparql_Service} instance.
291
-	 *
292
-	 * @since    3.6.0
293
-	 * @access   protected
294
-	 * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
295
-	 */
296
-	protected $sparql_service;
297
-
298
-	/**
299
-	 * A {@link Wordlift_Import_Service} instance.
300
-	 *
301
-	 * @since  3.6.0
302
-	 * @access private
303
-	 * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
304
-	 */
305
-	private $import_service;
306
-
307
-	/**
308
-	 * A {@link Wordlift_Rebuild_Service} instance.
309
-	 *
310
-	 * @since  3.6.0
311
-	 * @access private
312
-	 * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
313
-	 */
314
-	private $rebuild_service;
315
-
316
-	/**
317
-	 * A {@link Wordlift_Jsonld_Service} instance.
318
-	 *
319
-	 * @since  3.7.0
320
-	 * @access protected
321
-	 * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
322
-	 */
323
-	protected $jsonld_service;
324
-
325
-	/**
326
-	 * A {@link Wordlift_Website_Jsonld_Converter} instance.
327
-	 *
328
-	 * @since  3.14.0
329
-	 * @access protected
330
-	 * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance.
331
-	 */
332
-	protected $jsonld_website_converter;
333
-
334
-	/**
335
-	 * A {@link Wordlift_Property_Factory} instance.
336
-	 *
337
-	 * @since  3.7.0
338
-	 * @access private
339
-	 * @var \Wordlift_Property_Factory $property_factory
340
-	 */
341
-	private $property_factory;
342
-
343
-	/**
344
-	 * The 'Download Your Data' page.
345
-	 *
346
-	 * @since  3.6.0
347
-	 * @access private
348
-	 * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
349
-	 */
350
-	private $download_your_data_page;
351
-
352
-	/**
353
-	 * The 'WordLift Settings' page.
354
-	 *
355
-	 * @since  3.11.0
356
-	 * @access protected
357
-	 * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page.
358
-	 */
359
-	protected $settings_page;
360
-
361
-	/**
362
-	 * The install wizard page.
363
-	 *
364
-	 * @since  3.9.0
365
-	 * @access private
366
-	 * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
367
-	 */
368
-	public $admin_setup;
369
-
370
-	/**
371
-	 * The Content Filter Service hooks up to the 'the_content' filter and provides
372
-	 * linking of entities to their pages.
373
-	 *
374
-	 * @since  3.8.0
375
-	 * @access private
376
-	 * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
377
-	 */
378
-	private $content_filter_service;
379
-
380
-	/**
381
-	 * The Faq Content filter service
382
-	 * @since  3.26.0
383
-	 * @access private
384
-	 * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance.
385
-	 */
386
-	private $faq_content_filter_service;
387
-
388
-	/**
389
-	 * A {@link Wordlift_Key_Validation_Service} instance.
390
-	 *
391
-	 * @since  3.9.0
392
-	 * @access private
393
-	 * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
394
-	 */
395
-	private $key_validation_service;
396
-
397
-	/**
398
-	 * A {@link Wordlift_Rating_Service} instance.
399
-	 *
400
-	 * @since  3.10.0
401
-	 * @access private
402
-	 * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance.
403
-	 */
404
-	private $rating_service;
405
-
406
-	/**
407
-	 * A {@link Wordlift_Post_To_Jsonld_Converter} instance.
408
-	 *
409
-	 * @since  3.10.0
410
-	 * @access protected
411
-	 * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance.
412
-	 */
413
-	protected $post_to_jsonld_converter;
414
-
415
-	/**
416
-	 * A {@link Wordlift_Configuration_Service} instance.
417
-	 *
418
-	 * @since  3.10.0
419
-	 * @access protected
420
-	 * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance.
421
-	 */
422
-	protected $configuration_service;
423
-
424
-	/**
425
-	 * A {@link Wordlift_Install_Service} instance.
426
-	 *
427
-	 * @since  3.18.0
428
-	 * @access protected
429
-	 * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance.
430
-	 */
431
-	protected $install_service;
432
-
433
-	/**
434
-	 * A {@link Wordlift_Entity_Type_Service} instance.
435
-	 *
436
-	 * @since  3.10.0
437
-	 * @access protected
438
-	 * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance.
439
-	 */
440
-	protected $entity_type_service;
441
-
442
-	/**
443
-	 * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
444
-	 *
445
-	 * @since  3.10.0
446
-	 * @access protected
447
-	 * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
448
-	 */
449
-	protected $entity_post_to_jsonld_converter;
450
-
451
-	/**
452
-	 * A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
453
-	 *
454
-	 * @since  3.10.0
455
-	 * @access protected
456
-	 * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
457
-	 */
458
-	protected $postid_to_jsonld_converter;
459
-
460
-	/**
461
-	 * The {@link Wordlift_Admin_Status_Page} class.
462
-	 *
463
-	 * @since  3.9.8
464
-	 * @access private
465
-	 * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class.
466
-	 */
467
-	private $status_page;
468
-
469
-	/**
470
-	 * The {@link Wordlift_Category_Taxonomy_Service} instance.
471
-	 *
472
-	 * @since  3.11.0
473
-	 * @access protected
474
-	 * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance.
475
-	 */
476
-	protected $category_taxonomy_service;
477
-
478
-	/**
479
-	 * The {@link Wordlift_Entity_Page_Service} instance.
480
-	 *
481
-	 * @since  3.11.0
482
-	 * @access protected
483
-	 * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance.
484
-	 */
485
-	protected $entity_page_service;
486
-
487
-	/**
488
-	 * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
489
-	 *
490
-	 * @since  3.11.0
491
-	 * @access protected
492
-	 * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
493
-	 */
494
-	protected $settings_page_action_link;
495
-
496
-	/**
497
-	 * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
498
-	 *
499
-	 * @since  3.11.0
500
-	 * @access protected
501
-	 * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
502
-	 */
503
-	protected $analytics_settings_page_action_link;
504
-
505
-	/**
506
-	 * The {@link Wordlift_Analytics_Connect} class.
507
-	 *
508
-	 * @since  3.11.0
509
-	 * @access protected
510
-	 * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class.
511
-	 */
512
-	protected $analytics_connect;
513
-
514
-	/**
515
-	 * The {@link Wordlift_Publisher_Ajax_Adapter} instance.
516
-	 *
517
-	 * @since  3.11.0
518
-	 * @access protected
519
-	 * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
520
-	 */
521
-	protected $publisher_ajax_adapter;
522
-
523
-	/**
524
-	 * The {@link Wordlift_Admin_Input_Element} element renderer.
525
-	 *
526
-	 * @since  3.11.0
527
-	 * @access protected
528
-	 * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
529
-	 */
530
-	protected $input_element;
531
-
532
-	/**
533
-	 * The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
534
-	 *
535
-	 * @since  3.13.0
536
-	 * @access protected
537
-	 * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
538
-	 */
539
-	protected $radio_input_element;
540
-
541
-	/**
542
-	 * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
543
-	 *
544
-	 * @since  3.11.0
545
-	 * @access protected
546
-	 * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
547
-	 */
548
-	protected $language_select_element;
549
-
550
-	/**
551
-	 * The {@link Wordlift_Admin_Country_Select_Element} element renderer.
552
-	 *
553
-	 * @since  3.18.0
554
-	 * @access protected
555
-	 * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer.
556
-	 */
557
-	protected $country_select_element;
558
-
559
-	/**
560
-	 * The {@link Wordlift_Admin_Publisher_Element} element renderer.
561
-	 *
562
-	 * @since  3.11.0
563
-	 * @access protected
564
-	 * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
565
-	 */
566
-	protected $publisher_element;
567
-
568
-	/**
569
-	 * The {@link Wordlift_Admin_Select2_Element} element renderer.
570
-	 *
571
-	 * @since  3.11.0
572
-	 * @access protected
573
-	 * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
574
-	 */
575
-	protected $select2_element;
576
-
577
-	/**
578
-	 * The controller for the entity type list admin page
579
-	 *
580
-	 * @since  3.11.0
581
-	 * @access private
582
-	 * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
583
-	 */
584
-	private $entity_type_admin_page;
585
-
586
-	/**
587
-	 * The controller for the entity type settings admin page
588
-	 *
589
-	 * @since  3.11.0
590
-	 * @access private
591
-	 * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
592
-	 */
593
-	private $entity_type_settings_admin_page;
594
-
595
-	/**
596
-	 * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
597
-	 *
598
-	 * @since  3.11.0
599
-	 * @access protected
600
-	 * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
601
-	 */
602
-	protected $related_entities_cloud_widget;
603
-
604
-	/**
605
-	 * The {@link Wordlift_Admin_Author_Element} instance.
606
-	 *
607
-	 * @since  3.14.0
608
-	 * @access protected
609
-	 * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance.
610
-	 */
611
-	protected $author_element;
612
-
613
-	/**
614
-	 * The {@link Wordlift_Sample_Data_Service} instance.
615
-	 *
616
-	 * @since  3.12.0
617
-	 * @access protected
618
-	 * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance.
619
-	 */
620
-	protected $sample_data_service;
621
-
622
-	/**
623
-	 * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
624
-	 *
625
-	 * @since  3.12.0
626
-	 * @access protected
627
-	 * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
628
-	 */
629
-	protected $sample_data_ajax_adapter;
630
-
631
-	/**
632
-	 * The {@link Wordlift_Relation_Rebuild_Service} instance.
633
-	 *
634
-	 * @since  3.14.3
635
-	 * @access private
636
-	 * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance.
637
-	 */
638
-	private $relation_rebuild_service;
639
-
640
-	/**
641
-	 * The {@link Wordlift_Relation_Rebuild_Adapter} instance.
642
-	 *
643
-	 * @since  3.14.3
644
-	 * @access private
645
-	 * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance.
646
-	 */
647
-	private $relation_rebuild_adapter;
648
-
649
-	/**
650
-	 * The {@link Wordlift_Reference_Rebuild_Service} instance.
651
-	 *
652
-	 * @since  3.18.0
653
-	 * @access private
654
-	 * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance.
655
-	 */
656
-	private $reference_rebuild_service;
657
-
658
-	/**
659
-	 * The {@link Wordlift_Google_Analytics_Export_Service} instance.
660
-	 *
661
-	 * @since  3.16.0
662
-	 * @access protected
663
-	 * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance.
664
-	 */
665
-	protected $google_analytics_export_service;
666
-
667
-	/**
668
-	 * {@link Wordlift}'s singleton instance.
669
-	 *
670
-	 * @since  3.15.0
671
-	 * @access protected
672
-	 * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance.
673
-	 */
674
-	protected $entity_type_adapter;
675
-
676
-	/**
677
-	 * The {@link Wordlift_Storage_Factory} instance.
678
-	 *
679
-	 * @since  3.15.0
680
-	 * @access protected
681
-	 * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance.
682
-	 */
683
-	protected $storage_factory;
684
-
685
-	/**
686
-	 * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
687
-	 *
688
-	 * @since  3.15.0
689
-	 * @access protected
690
-	 * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
691
-	 */
692
-	protected $rendition_factory;
693
-
694
-	/**
695
-	 * The {@link Wordlift_Autocomplete_Adapter} instance.
696
-	 *
697
-	 * @since  3.15.0
698
-	 * @access private
699
-	 * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance.
700
-	 */
701
-	private $autocomplete_adapter;
702
-
703
-	/**
704
-	 * The {@link Wordlift_Relation_Service} instance.
705
-	 *
706
-	 * @since  3.15.0
707
-	 * @access protected
708
-	 * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance.
709
-	 */
710
-	protected $relation_service;
711
-
712
-	/**
713
-	 * The {@link Wordlift_Cached_Post_Converter} instance.
714
-	 *
715
-	 * @since  3.16.0
716
-	 * @access protected
717
-	 * @var  \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance.
718
-	 *
719
-	 */
720
-	protected $cached_postid_to_jsonld_converter;
721
-
722
-	/**
723
-	 * The {@link Wordlift_Entity_Uri_Service} instance.
724
-	 *
725
-	 * @since  3.16.3
726
-	 * @access protected
727
-	 * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance.
728
-	 */
729
-	protected $entity_uri_service;
730
-
731
-	/**
732
-	 * The {@link Wordlift_Publisher_Service} instance.
733
-	 *
734
-	 * @since  3.19.0
735
-	 * @access protected
736
-	 * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance.
737
-	 */
738
-	protected $publisher_service;
739
-
740
-	/**
741
-	 * The {@link Wordlift_Context_Cards_Service} instance.
742
-	 *
743
-	 * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance.
744
-	 */
745
-	protected $context_cards_service;
746
-
747
-	/**
748
-	 * {@link Wordlift}'s singleton instance.
749
-	 *
750
-	 * @since  3.11.2
751
-	 * @access private
752
-	 * @var Wordlift $instance {@link Wordlift}'s singleton instance.
753
-	 */
754
-	private static $instance;
755
-
756
-	/**
757
-	 * A singleton instance of features registry.
758
-	 * @since 3.30.0
759
-	 * @var Features_Registry
760
-	 */
761
-	private $features_registry;
762
-
763
-	//</editor-fold>
764
-
765
-	// Experimental code added by Nishit for feature request 1496
766
-	private $webhook_loader;
767
-	// Experimental code ents here
768
-
769
-	/**
770
-	 * Define the core functionality of the plugin.
771
-	 *
772
-	 * Set the plugin name and the plugin version that can be used throughout the plugin.
773
-	 * Load the dependencies, define the locale, and set the hooks for the admin area and
774
-	 * the public-facing side of the site.
775
-	 *
776
-	 * @since    1.0.0
777
-	 */
778
-	public function __construct() {
779
-
780
-		self::$instance = $this;
781
-
782
-		$this->plugin_name = 'wordlift';
783
-		$this->version     = '3.33.5';
784
-		$this->load_dependencies();
785
-		$this->set_locale();
786
-		$this->define_admin_hooks();
787
-		$this->define_public_hooks();
788
-
789
-		// If we're in `WP_CLI` load the related files.
790
-		if ( class_exists( 'WP_CLI' ) ) {
791
-			$this->load_cli_dependencies();
792
-		}
793
-
794
-	}
795
-
796
-	/**
797
-	 * Get the singleton instance.
798
-	 *
799
-	 * @return Wordlift The {@link Wordlift} singleton instance.
800
-	 * @since 3.11.2
801
-	 *
802
-	 */
803
-	public static function get_instance() {
804
-
805
-		return self::$instance;
806
-	}
807
-
808
-	/**
809
-	 * Load the required dependencies for this plugin.
810
-	 *
811
-	 * Include the following files that make up the plugin:
812
-	 *
813
-	 * - Wordlift_Loader. Orchestrates the hooks of the plugin.
814
-	 * - Wordlift_i18n. Defines internationalization functionality.
815
-	 * - Wordlift_Admin. Defines all hooks for the admin area.
816
-	 * - Wordlift_Public. Defines all hooks for the public side of the site.
817
-	 *
818
-	 * Create an instance of the loader which will be used to register the hooks
819
-	 * with WordPress.
820
-	 *
821
-	 * @throws Exception
822
-	 * @since    1.0.0
823
-	 * @access   private
824
-	 */
825
-	private function load_dependencies() {
826
-
827
-		/**
828
-		 * The class responsible for orchestrating the actions and filters of the
829
-		 * core plugin.
830
-		 */
831
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
832
-
833
-		// The class responsible for plugin uninstall.
834
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
835
-
836
-		/**
837
-		 * The class responsible for defining internationalization functionality
838
-		 * of the plugin.
839
-		 */
840
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
841
-
842
-		/**
843
-		 * WordLift's supported languages.
844
-		 */
845
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
846
-
847
-		/**
848
-		 * WordLift's supported countries.
849
-		 */
850
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
851
-
852
-		/**
853
-		 * Provide support functions to sanitize data.
854
-		 */
855
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
856
-
857
-		/** Services. */
858
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
859
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
860
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
861
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
862
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
863
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
864
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
865
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
866
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
867
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
868
-
869
-		/**
870
-		 * The Query builder.
871
-		 */
872
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
873
-
874
-		/**
875
-		 * The Schema service.
876
-		 */
877
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
878
-
879
-		/**
880
-		 * The schema:url property service.
881
-		 */
882
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
883
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
884
-
885
-		/**
886
-		 * The UI service.
887
-		 */
888
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
889
-
890
-		/**
891
-		 * The Thumbnail service.
892
-		 */
893
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
894
-
895
-		/**
896
-		 * The Entity Types Taxonomy service.
897
-		 */
898
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
899
-
900
-		/**
901
-		 * The Entity service.
902
-		 */
903
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
904
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
905
-
906
-		// Add the entity rating service.
907
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
908
-
909
-		/**
910
-		 * The User service.
911
-		 */
912
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
913
-
914
-		/**
915
-		 * The Timeline service.
916
-		 */
917
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
918
-
919
-		/**
920
-		 * The Topic Taxonomy service.
921
-		 */
922
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
923
-
924
-		/**
925
-		 * The SPARQL service.
926
-		 */
927
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
928
-
929
-		/**
930
-		 * The WordLift import service.
931
-		 */
932
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
933
-
934
-		/**
935
-		 * The WordLift URI service.
936
-		 */
937
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
938
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
939
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
940
-
941
-		/**
942
-		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
943
-		 */
944
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
945
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
946
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
947
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
948
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
949
-
950
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
951
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
952
-
953
-		/**
954
-		 * Load the converters.
955
-		 */
956
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
957
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
958
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
959
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
960
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
961
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
962
-
963
-		/**
964
-		 * Load cache-related files.
965
-		 */
966
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
967
-
968
-		/**
969
-		 * Load the content filter.
970
-		 */
971
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
972
-
973
-		/*
89
+    //<editor-fold desc="## FIELDS">
90
+
91
+    /**
92
+     * The loader that's responsible for maintaining and registering all hooks that power
93
+     * the plugin.
94
+     *
95
+     * @since    1.0.0
96
+     * @access   protected
97
+     * @var      Wordlift_Loader $loader Maintains and registers all hooks for the plugin.
98
+     */
99
+    protected $loader;
100
+
101
+    /**
102
+     * The unique identifier of this plugin.
103
+     *
104
+     * @since    1.0.0
105
+     * @access   protected
106
+     * @var      string $plugin_name The string used to uniquely identify this plugin.
107
+     */
108
+    protected $plugin_name;
109
+
110
+    /**
111
+     * The current version of the plugin.
112
+     *
113
+     * @since    1.0.0
114
+     * @access   protected
115
+     * @var      string $version The current version of the plugin.
116
+     */
117
+    protected $version;
118
+
119
+    /**
120
+     * The {@link Wordlift_Tinymce_Adapter} instance.
121
+     *
122
+     * @since  3.12.0
123
+     * @access protected
124
+     * @var \Wordlift_Tinymce_Adapter $tinymce_adapter The {@link Wordlift_Tinymce_Adapter} instance.
125
+     */
126
+    protected $tinymce_adapter;
127
+
128
+    /**
129
+     * The {@link Faq_Tinymce_Adapter} instance
130
+     * @since 3.26.0
131
+     * @access protected
132
+     * @var Faq_Tinymce_Adapter $faq_tinymce_adapter .
133
+     */
134
+    //protected $faq_tinymce_adapter;
135
+
136
+    /**
137
+     * The Thumbnail service.
138
+     *
139
+     * @since  3.1.5
140
+     * @access private
141
+     * @var \Wordlift_Thumbnail_Service $thumbnail_service The Thumbnail service.
142
+     */
143
+    private $thumbnail_service;
144
+
145
+    /**
146
+     * The UI service.
147
+     *
148
+     * @since  3.2.0
149
+     * @access private
150
+     * @var \Wordlift_UI_Service $ui_service The UI service.
151
+     */
152
+    private $ui_service;
153
+
154
+    /**
155
+     * The Schema service.
156
+     *
157
+     * @since  3.3.0
158
+     * @access protected
159
+     * @var \Wordlift_Schema_Service $schema_service The Schema service.
160
+     */
161
+    protected $schema_service;
162
+
163
+    /**
164
+     * The Entity service.
165
+     *
166
+     * @since  3.1.0
167
+     * @access protected
168
+     * @var \Wordlift_Entity_Service $entity_service The Entity service.
169
+     */
170
+    protected $entity_service;
171
+
172
+    /**
173
+     * The Topic Taxonomy service.
174
+     *
175
+     * @since  3.5.0
176
+     * @access private
177
+     * @var \Wordlift_Topic_Taxonomy_Service The Topic Taxonomy service.
178
+     */
179
+    private $topic_taxonomy_service;
180
+
181
+    /**
182
+     * The Entity Types Taxonomy service.
183
+     *
184
+     * @since  3.18.0
185
+     * @access private
186
+     * @var \Wordlift_Entity_Type_Taxonomy_Service The Entity Types Taxonomy service.
187
+     */
188
+    private $entity_types_taxonomy_service;
189
+
190
+    /**
191
+     * The User service.
192
+     *
193
+     * @since  3.1.7
194
+     * @access protected
195
+     * @var \Wordlift_User_Service $user_service The User service.
196
+     */
197
+    protected $user_service;
198
+
199
+    /**
200
+     * The Timeline service.
201
+     *
202
+     * @since  3.1.0
203
+     * @access private
204
+     * @var \Wordlift_Timeline_Service $timeline_service The Timeline service.
205
+     */
206
+    private $timeline_service;
207
+
208
+    /**
209
+     * The Redirect service.
210
+     *
211
+     * @since  3.2.0
212
+     * @access private
213
+     * @var \Wordlift_Redirect_Service $redirect_service The Redirect service.
214
+     */
215
+    private $redirect_service;
216
+
217
+    /**
218
+     * The Notice service.
219
+     *
220
+     * @since  3.3.0
221
+     * @access private
222
+     * @var \Wordlift_Notice_Service $notice_service The Notice service.
223
+     */
224
+    private $notice_service;
225
+
226
+    /**
227
+     * The Entity list customization.
228
+     *
229
+     * @since  3.3.0
230
+     * @access protected
231
+     * @var \Wordlift_Entity_List_Service $entity_list_service The Entity list service.
232
+     */
233
+    protected $entity_list_service;
234
+
235
+    /**
236
+     * The Entity Types Taxonomy Walker.
237
+     *
238
+     * @since  3.1.0
239
+     * @access private
240
+     * @var \Wordlift_Entity_Types_Taxonomy_Walker $entity_types_taxonomy_walker The Entity Types Taxonomy Walker
241
+     */
242
+    private $entity_types_taxonomy_walker;
243
+
244
+    /**
245
+     * The ShareThis service.
246
+     *
247
+     * @since  3.2.0
248
+     * @access private
249
+     * @var \Wordlift_ShareThis_Service $sharethis_service The ShareThis service.
250
+     */
251
+    private $sharethis_service;
252
+
253
+    /**
254
+     * The PrimaShop adapter.
255
+     *
256
+     * @since  3.2.3
257
+     * @access private
258
+     * @var \Wordlift_PrimaShop_Adapter $primashop_adapter The PrimaShop adapter.
259
+     */
260
+    private $primashop_adapter;
261
+
262
+    /**
263
+     * The WordLift Dashboard adapter.
264
+     *
265
+     * @since  3.4.0
266
+     * @access private
267
+     * @var \Wordlift_Dashboard_Service $dashboard_service The WordLift Dashboard service;
268
+     */
269
+    private $dashboard_service;
270
+
271
+    /**
272
+     * The entity type service.
273
+     *
274
+     * @since  3.6.0
275
+     * @access private
276
+     * @var \Wordlift_Entity_Post_Type_Service
277
+     */
278
+    private $entity_post_type_service;
279
+
280
+    /**
281
+     * The entity link service used to mangle links to entities with a custom slug or even w/o a slug.
282
+     *
283
+     * @since  3.6.0
284
+     * @access private
285
+     * @var \Wordlift_Entity_Link_Service $entity_link_service The {@link Wordlift_Entity_Link_Service} instance.
286
+     */
287
+    private $entity_link_service;
288
+
289
+    /**
290
+     * A {@link Wordlift_Sparql_Service} instance.
291
+     *
292
+     * @since    3.6.0
293
+     * @access   protected
294
+     * @var \Wordlift_Sparql_Service $sparql_service A {@link Wordlift_Sparql_Service} instance.
295
+     */
296
+    protected $sparql_service;
297
+
298
+    /**
299
+     * A {@link Wordlift_Import_Service} instance.
300
+     *
301
+     * @since  3.6.0
302
+     * @access private
303
+     * @var \Wordlift_Import_Service $import_service A {@link Wordlift_Import_Service} instance.
304
+     */
305
+    private $import_service;
306
+
307
+    /**
308
+     * A {@link Wordlift_Rebuild_Service} instance.
309
+     *
310
+     * @since  3.6.0
311
+     * @access private
312
+     * @var \Wordlift_Rebuild_Service $rebuild_service A {@link Wordlift_Rebuild_Service} instance.
313
+     */
314
+    private $rebuild_service;
315
+
316
+    /**
317
+     * A {@link Wordlift_Jsonld_Service} instance.
318
+     *
319
+     * @since  3.7.0
320
+     * @access protected
321
+     * @var \Wordlift_Jsonld_Service $jsonld_service A {@link Wordlift_Jsonld_Service} instance.
322
+     */
323
+    protected $jsonld_service;
324
+
325
+    /**
326
+     * A {@link Wordlift_Website_Jsonld_Converter} instance.
327
+     *
328
+     * @since  3.14.0
329
+     * @access protected
330
+     * @var \Wordlift_Website_Jsonld_Converter $jsonld_website_converter A {@link Wordlift_Website_Jsonld_Converter} instance.
331
+     */
332
+    protected $jsonld_website_converter;
333
+
334
+    /**
335
+     * A {@link Wordlift_Property_Factory} instance.
336
+     *
337
+     * @since  3.7.0
338
+     * @access private
339
+     * @var \Wordlift_Property_Factory $property_factory
340
+     */
341
+    private $property_factory;
342
+
343
+    /**
344
+     * The 'Download Your Data' page.
345
+     *
346
+     * @since  3.6.0
347
+     * @access private
348
+     * @var \Wordlift_Admin_Download_Your_Data_Page $download_your_data_page The 'Download Your Data' page.
349
+     */
350
+    private $download_your_data_page;
351
+
352
+    /**
353
+     * The 'WordLift Settings' page.
354
+     *
355
+     * @since  3.11.0
356
+     * @access protected
357
+     * @var \Wordlift_Admin_Settings_Page $settings_page The 'WordLift Settings' page.
358
+     */
359
+    protected $settings_page;
360
+
361
+    /**
362
+     * The install wizard page.
363
+     *
364
+     * @since  3.9.0
365
+     * @access private
366
+     * @var \Wordlift_Admin_Setup $admin_setup The Install wizard.
367
+     */
368
+    public $admin_setup;
369
+
370
+    /**
371
+     * The Content Filter Service hooks up to the 'the_content' filter and provides
372
+     * linking of entities to their pages.
373
+     *
374
+     * @since  3.8.0
375
+     * @access private
376
+     * @var \Wordlift_Content_Filter_Service $content_filter_service A {@link Wordlift_Content_Filter_Service} instance.
377
+     */
378
+    private $content_filter_service;
379
+
380
+    /**
381
+     * The Faq Content filter service
382
+     * @since  3.26.0
383
+     * @access private
384
+     * @var Faq_Content_Filter $faq_content_filter_service A {@link Faq_Content_Filter} instance.
385
+     */
386
+    private $faq_content_filter_service;
387
+
388
+    /**
389
+     * A {@link Wordlift_Key_Validation_Service} instance.
390
+     *
391
+     * @since  3.9.0
392
+     * @access private
393
+     * @var Wordlift_Key_Validation_Service $key_validation_service A {@link Wordlift_Key_Validation_Service} instance.
394
+     */
395
+    private $key_validation_service;
396
+
397
+    /**
398
+     * A {@link Wordlift_Rating_Service} instance.
399
+     *
400
+     * @since  3.10.0
401
+     * @access private
402
+     * @var \Wordlift_Rating_Service $rating_service A {@link Wordlift_Rating_Service} instance.
403
+     */
404
+    private $rating_service;
405
+
406
+    /**
407
+     * A {@link Wordlift_Post_To_Jsonld_Converter} instance.
408
+     *
409
+     * @since  3.10.0
410
+     * @access protected
411
+     * @var \Wordlift_Post_To_Jsonld_Converter $post_to_jsonld_converter A {@link Wordlift_Post_To_Jsonld_Converter} instance.
412
+     */
413
+    protected $post_to_jsonld_converter;
414
+
415
+    /**
416
+     * A {@link Wordlift_Configuration_Service} instance.
417
+     *
418
+     * @since  3.10.0
419
+     * @access protected
420
+     * @var \Wordlift_Configuration_Service $configuration_service A {@link Wordlift_Configuration_Service} instance.
421
+     */
422
+    protected $configuration_service;
423
+
424
+    /**
425
+     * A {@link Wordlift_Install_Service} instance.
426
+     *
427
+     * @since  3.18.0
428
+     * @access protected
429
+     * @var \Wordlift_Install_Service $install_service A {@link Wordlift_Install_Service} instance.
430
+     */
431
+    protected $install_service;
432
+
433
+    /**
434
+     * A {@link Wordlift_Entity_Type_Service} instance.
435
+     *
436
+     * @since  3.10.0
437
+     * @access protected
438
+     * @var \Wordlift_Entity_Type_Service $entity_type_service A {@link Wordlift_Entity_Type_Service} instance.
439
+     */
440
+    protected $entity_type_service;
441
+
442
+    /**
443
+     * A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
444
+     *
445
+     * @since  3.10.0
446
+     * @access protected
447
+     * @var \Wordlift_Entity_Post_To_Jsonld_Converter $entity_post_to_jsonld_converter A {@link Wordlift_Entity_Post_To_Jsonld_Converter} instance.
448
+     */
449
+    protected $entity_post_to_jsonld_converter;
450
+
451
+    /**
452
+     * A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
453
+     *
454
+     * @since  3.10.0
455
+     * @access protected
456
+     * @var \Wordlift_Postid_To_Jsonld_Converter $postid_to_jsonld_converter A {@link Wordlift_Postid_To_Jsonld_Converter} instance.
457
+     */
458
+    protected $postid_to_jsonld_converter;
459
+
460
+    /**
461
+     * The {@link Wordlift_Admin_Status_Page} class.
462
+     *
463
+     * @since  3.9.8
464
+     * @access private
465
+     * @var \Wordlift_Admin_Status_Page $status_page The {@link Wordlift_Admin_Status_Page} class.
466
+     */
467
+    private $status_page;
468
+
469
+    /**
470
+     * The {@link Wordlift_Category_Taxonomy_Service} instance.
471
+     *
472
+     * @since  3.11.0
473
+     * @access protected
474
+     * @var \Wordlift_Category_Taxonomy_Service $category_taxonomy_service The {@link Wordlift_Category_Taxonomy_Service} instance.
475
+     */
476
+    protected $category_taxonomy_service;
477
+
478
+    /**
479
+     * The {@link Wordlift_Entity_Page_Service} instance.
480
+     *
481
+     * @since  3.11.0
482
+     * @access protected
483
+     * @var \Wordlift_Entity_Page_Service $entity_page_service The {@link Wordlift_Entity_Page_Service} instance.
484
+     */
485
+    protected $entity_page_service;
486
+
487
+    /**
488
+     * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
489
+     *
490
+     * @since  3.11.0
491
+     * @access protected
492
+     * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
493
+     */
494
+    protected $settings_page_action_link;
495
+
496
+    /**
497
+     * The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
498
+     *
499
+     * @since  3.11.0
500
+     * @access protected
501
+     * @var \Wordlift_Admin_Settings_Page_Action_Link $settings_page_action_link The {@link Wordlift_Admin_Settings_Page_Action_Link} class.
502
+     */
503
+    protected $analytics_settings_page_action_link;
504
+
505
+    /**
506
+     * The {@link Wordlift_Analytics_Connect} class.
507
+     *
508
+     * @since  3.11.0
509
+     * @access protected
510
+     * @var \Wordlift_Analytics_Connect $analytics_connect The {@link Wordlift_Analytics_Connect} class.
511
+     */
512
+    protected $analytics_connect;
513
+
514
+    /**
515
+     * The {@link Wordlift_Publisher_Ajax_Adapter} instance.
516
+     *
517
+     * @since  3.11.0
518
+     * @access protected
519
+     * @var \Wordlift_Publisher_Ajax_Adapter $publisher_ajax_adapter The {@link Wordlift_Publisher_Ajax_Adapter} instance.
520
+     */
521
+    protected $publisher_ajax_adapter;
522
+
523
+    /**
524
+     * The {@link Wordlift_Admin_Input_Element} element renderer.
525
+     *
526
+     * @since  3.11.0
527
+     * @access protected
528
+     * @var \Wordlift_Admin_Input_Element $input_element The {@link Wordlift_Admin_Input_Element} element renderer.
529
+     */
530
+    protected $input_element;
531
+
532
+    /**
533
+     * The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
534
+     *
535
+     * @since  3.13.0
536
+     * @access protected
537
+     * @var \Wordlift_Admin_Radio_Input_Element $radio_input_element The {@link Wordlift_Admin_Radio_Input_Element} element renderer.
538
+     */
539
+    protected $radio_input_element;
540
+
541
+    /**
542
+     * The {@link Wordlift_Admin_Language_Select_Element} element renderer.
543
+     *
544
+     * @since  3.11.0
545
+     * @access protected
546
+     * @var \Wordlift_Admin_Language_Select_Element $language_select_element The {@link Wordlift_Admin_Language_Select_Element} element renderer.
547
+     */
548
+    protected $language_select_element;
549
+
550
+    /**
551
+     * The {@link Wordlift_Admin_Country_Select_Element} element renderer.
552
+     *
553
+     * @since  3.18.0
554
+     * @access protected
555
+     * @var \Wordlift_Admin_Country_Select_Element $country_select_element The {@link Wordlift_Admin_Country_Select_Element} element renderer.
556
+     */
557
+    protected $country_select_element;
558
+
559
+    /**
560
+     * The {@link Wordlift_Admin_Publisher_Element} element renderer.
561
+     *
562
+     * @since  3.11.0
563
+     * @access protected
564
+     * @var \Wordlift_Admin_Publisher_Element $publisher_element The {@link Wordlift_Admin_Publisher_Element} element renderer.
565
+     */
566
+    protected $publisher_element;
567
+
568
+    /**
569
+     * The {@link Wordlift_Admin_Select2_Element} element renderer.
570
+     *
571
+     * @since  3.11.0
572
+     * @access protected
573
+     * @var \Wordlift_Admin_Select2_Element $select2_element The {@link Wordlift_Admin_Select2_Element} element renderer.
574
+     */
575
+    protected $select2_element;
576
+
577
+    /**
578
+     * The controller for the entity type list admin page
579
+     *
580
+     * @since  3.11.0
581
+     * @access private
582
+     * @var \Wordlift_Admin_Entity_Taxonomy_List_Page $entity_type_admin_page The {@link Wordlift_Admin_Entity_Taxonomy_List_Page} class.
583
+     */
584
+    private $entity_type_admin_page;
585
+
586
+    /**
587
+     * The controller for the entity type settings admin page
588
+     *
589
+     * @since  3.11.0
590
+     * @access private
591
+     * @var \Wordlift_Admin_Entity_Type_Settings $entity_type_settings_admin_page The {@link Wordlift_Admin_Entity_Type_Settings} class.
592
+     */
593
+    private $entity_type_settings_admin_page;
594
+
595
+    /**
596
+     * The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
597
+     *
598
+     * @since  3.11.0
599
+     * @access protected
600
+     * @var \Wordlift_Related_Entities_Cloud_Widget $related_entities_cloud_widget The {@link Wordlift_Related_Entities_Cloud_Widget} instance.
601
+     */
602
+    protected $related_entities_cloud_widget;
603
+
604
+    /**
605
+     * The {@link Wordlift_Admin_Author_Element} instance.
606
+     *
607
+     * @since  3.14.0
608
+     * @access protected
609
+     * @var \Wordlift_Admin_Author_Element $author_element The {@link Wordlift_Admin_Author_Element} instance.
610
+     */
611
+    protected $author_element;
612
+
613
+    /**
614
+     * The {@link Wordlift_Sample_Data_Service} instance.
615
+     *
616
+     * @since  3.12.0
617
+     * @access protected
618
+     * @var \Wordlift_Sample_Data_Service $sample_data_service The {@link Wordlift_Sample_Data_Service} instance.
619
+     */
620
+    protected $sample_data_service;
621
+
622
+    /**
623
+     * The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
624
+     *
625
+     * @since  3.12.0
626
+     * @access protected
627
+     * @var \Wordlift_Sample_Data_Ajax_Adapter $sample_data_ajax_adapter The {@link Wordlift_Sample_Data_Ajax_Adapter} instance.
628
+     */
629
+    protected $sample_data_ajax_adapter;
630
+
631
+    /**
632
+     * The {@link Wordlift_Relation_Rebuild_Service} instance.
633
+     *
634
+     * @since  3.14.3
635
+     * @access private
636
+     * @var \Wordlift_Relation_Rebuild_Service $relation_rebuild_service The {@link Wordlift_Relation_Rebuild_Service} instance.
637
+     */
638
+    private $relation_rebuild_service;
639
+
640
+    /**
641
+     * The {@link Wordlift_Relation_Rebuild_Adapter} instance.
642
+     *
643
+     * @since  3.14.3
644
+     * @access private
645
+     * @var \Wordlift_Relation_Rebuild_Adapter $relation_rebuild_adapter The {@link Wordlift_Relation_Rebuild_Adapter} instance.
646
+     */
647
+    private $relation_rebuild_adapter;
648
+
649
+    /**
650
+     * The {@link Wordlift_Reference_Rebuild_Service} instance.
651
+     *
652
+     * @since  3.18.0
653
+     * @access private
654
+     * @var \Wordlift_Reference_Rebuild_Service $reference_rebuild_service The {@link Wordlift_Reference_Rebuild_Service} instance.
655
+     */
656
+    private $reference_rebuild_service;
657
+
658
+    /**
659
+     * The {@link Wordlift_Google_Analytics_Export_Service} instance.
660
+     *
661
+     * @since  3.16.0
662
+     * @access protected
663
+     * @var \Wordlift_Google_Analytics_Export_Service $google_analytics_export_service The {@link Wordlift_Google_Analytics_Export_Service} instance.
664
+     */
665
+    protected $google_analytics_export_service;
666
+
667
+    /**
668
+     * {@link Wordlift}'s singleton instance.
669
+     *
670
+     * @since  3.15.0
671
+     * @access protected
672
+     * @var \Wordlift_Entity_Type_Adapter $entity_type_adapter The {@link Wordlift_Entity_Type_Adapter} instance.
673
+     */
674
+    protected $entity_type_adapter;
675
+
676
+    /**
677
+     * The {@link Wordlift_Storage_Factory} instance.
678
+     *
679
+     * @since  3.15.0
680
+     * @access protected
681
+     * @var \Wordlift_Storage_Factory $storage_factory The {@link Wordlift_Storage_Factory} instance.
682
+     */
683
+    protected $storage_factory;
684
+
685
+    /**
686
+     * The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
687
+     *
688
+     * @since  3.15.0
689
+     * @access protected
690
+     * @var \Wordlift_Sparql_Tuple_Rendition_Factory $rendition_factory The {@link Wordlift_Sparql_Tuple_Rendition_Factory} instance.
691
+     */
692
+    protected $rendition_factory;
693
+
694
+    /**
695
+     * The {@link Wordlift_Autocomplete_Adapter} instance.
696
+     *
697
+     * @since  3.15.0
698
+     * @access private
699
+     * @var \Wordlift_Autocomplete_Adapter $autocomplete_adapter The {@link Wordlift_Autocomplete_Adapter} instance.
700
+     */
701
+    private $autocomplete_adapter;
702
+
703
+    /**
704
+     * The {@link Wordlift_Relation_Service} instance.
705
+     *
706
+     * @since  3.15.0
707
+     * @access protected
708
+     * @var \Wordlift_Relation_Service $relation_service The {@link Wordlift_Relation_Service} instance.
709
+     */
710
+    protected $relation_service;
711
+
712
+    /**
713
+     * The {@link Wordlift_Cached_Post_Converter} instance.
714
+     *
715
+     * @since  3.16.0
716
+     * @access protected
717
+     * @var  \Wordlift_Cached_Post_Converter $cached_postid_to_jsonld_converter The {@link Wordlift_Cached_Post_Converter} instance.
718
+     *
719
+     */
720
+    protected $cached_postid_to_jsonld_converter;
721
+
722
+    /**
723
+     * The {@link Wordlift_Entity_Uri_Service} instance.
724
+     *
725
+     * @since  3.16.3
726
+     * @access protected
727
+     * @var \Wordlift_Entity_Uri_Service $entity_uri_service The {@link Wordlift_Entity_Uri_Service} instance.
728
+     */
729
+    protected $entity_uri_service;
730
+
731
+    /**
732
+     * The {@link Wordlift_Publisher_Service} instance.
733
+     *
734
+     * @since  3.19.0
735
+     * @access protected
736
+     * @var \Wordlift_Publisher_Service $publisher_service The {@link Wordlift_Publisher_Service} instance.
737
+     */
738
+    protected $publisher_service;
739
+
740
+    /**
741
+     * The {@link Wordlift_Context_Cards_Service} instance.
742
+     *
743
+     * @var \Wordlift_Context_Cards_Service The {@link Wordlift_Context_Cards_Service} instance.
744
+     */
745
+    protected $context_cards_service;
746
+
747
+    /**
748
+     * {@link Wordlift}'s singleton instance.
749
+     *
750
+     * @since  3.11.2
751
+     * @access private
752
+     * @var Wordlift $instance {@link Wordlift}'s singleton instance.
753
+     */
754
+    private static $instance;
755
+
756
+    /**
757
+     * A singleton instance of features registry.
758
+     * @since 3.30.0
759
+     * @var Features_Registry
760
+     */
761
+    private $features_registry;
762
+
763
+    //</editor-fold>
764
+
765
+    // Experimental code added by Nishit for feature request 1496
766
+    private $webhook_loader;
767
+    // Experimental code ents here
768
+
769
+    /**
770
+     * Define the core functionality of the plugin.
771
+     *
772
+     * Set the plugin name and the plugin version that can be used throughout the plugin.
773
+     * Load the dependencies, define the locale, and set the hooks for the admin area and
774
+     * the public-facing side of the site.
775
+     *
776
+     * @since    1.0.0
777
+     */
778
+    public function __construct() {
779
+
780
+        self::$instance = $this;
781
+
782
+        $this->plugin_name = 'wordlift';
783
+        $this->version     = '3.33.5';
784
+        $this->load_dependencies();
785
+        $this->set_locale();
786
+        $this->define_admin_hooks();
787
+        $this->define_public_hooks();
788
+
789
+        // If we're in `WP_CLI` load the related files.
790
+        if ( class_exists( 'WP_CLI' ) ) {
791
+            $this->load_cli_dependencies();
792
+        }
793
+
794
+    }
795
+
796
+    /**
797
+     * Get the singleton instance.
798
+     *
799
+     * @return Wordlift The {@link Wordlift} singleton instance.
800
+     * @since 3.11.2
801
+     *
802
+     */
803
+    public static function get_instance() {
804
+
805
+        return self::$instance;
806
+    }
807
+
808
+    /**
809
+     * Load the required dependencies for this plugin.
810
+     *
811
+     * Include the following files that make up the plugin:
812
+     *
813
+     * - Wordlift_Loader. Orchestrates the hooks of the plugin.
814
+     * - Wordlift_i18n. Defines internationalization functionality.
815
+     * - Wordlift_Admin. Defines all hooks for the admin area.
816
+     * - Wordlift_Public. Defines all hooks for the public side of the site.
817
+     *
818
+     * Create an instance of the loader which will be used to register the hooks
819
+     * with WordPress.
820
+     *
821
+     * @throws Exception
822
+     * @since    1.0.0
823
+     * @access   private
824
+     */
825
+    private function load_dependencies() {
826
+
827
+        /**
828
+         * The class responsible for orchestrating the actions and filters of the
829
+         * core plugin.
830
+         */
831
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
832
+
833
+        // The class responsible for plugin uninstall.
834
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
835
+
836
+        /**
837
+         * The class responsible for defining internationalization functionality
838
+         * of the plugin.
839
+         */
840
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
841
+
842
+        /**
843
+         * WordLift's supported languages.
844
+         */
845
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
846
+
847
+        /**
848
+         * WordLift's supported countries.
849
+         */
850
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
851
+
852
+        /**
853
+         * Provide support functions to sanitize data.
854
+         */
855
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
856
+
857
+        /** Services. */
858
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
859
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
860
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
861
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
862
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
863
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
864
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
865
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
866
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
867
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
868
+
869
+        /**
870
+         * The Query builder.
871
+         */
872
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
873
+
874
+        /**
875
+         * The Schema service.
876
+         */
877
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
878
+
879
+        /**
880
+         * The schema:url property service.
881
+         */
882
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
883
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
884
+
885
+        /**
886
+         * The UI service.
887
+         */
888
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
889
+
890
+        /**
891
+         * The Thumbnail service.
892
+         */
893
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
894
+
895
+        /**
896
+         * The Entity Types Taxonomy service.
897
+         */
898
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
899
+
900
+        /**
901
+         * The Entity service.
902
+         */
903
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
904
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
905
+
906
+        // Add the entity rating service.
907
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
908
+
909
+        /**
910
+         * The User service.
911
+         */
912
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
913
+
914
+        /**
915
+         * The Timeline service.
916
+         */
917
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
918
+
919
+        /**
920
+         * The Topic Taxonomy service.
921
+         */
922
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
923
+
924
+        /**
925
+         * The SPARQL service.
926
+         */
927
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
928
+
929
+        /**
930
+         * The WordLift import service.
931
+         */
932
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
933
+
934
+        /**
935
+         * The WordLift URI service.
936
+         */
937
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
938
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
939
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
940
+
941
+        /**
942
+         * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
943
+         */
944
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
945
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
946
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
947
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
948
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
949
+
950
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
951
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
952
+
953
+        /**
954
+         * Load the converters.
955
+         */
956
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
957
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
958
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
959
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
960
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
961
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
962
+
963
+        /**
964
+         * Load cache-related files.
965
+         */
966
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
967
+
968
+        /**
969
+         * Load the content filter.
970
+         */
971
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
972
+
973
+        /*
974 974
 		 * Load the excerpt helper.
975 975
 		 */
976
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
977
-
978
-		/**
979
-		 * Load the JSON-LD service to publish entities using JSON-LD.s
980
-		 *
981
-		 * @since 3.8.0
982
-		 */
983
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
984
-
985
-		// The Publisher Service and the AJAX adapter.
986
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
987
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
988
-
989
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
990
-
991
-		/**
992
-		 * Load the WordLift key validation service.
993
-		 */
994
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
995
-
996
-		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
997
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
998
-
999
-		// Load the `Wordlift_Entity_Page_Service` class definition.
1000
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
1001
-
1002
-		/** Linked Data. */
1003
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
1004
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
1005
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
1006
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
1007
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
1008
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
1009
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
1010
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
1011
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
1012
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
1013
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
1014
-
1015
-		/** Linked Data Rendition. */
1016
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
1017
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
1018
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
1019
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
1020
-
1021
-		/** Services. */
1022
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
1023
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
1024
-
1025
-		/** Adapters. */
1026
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
1027
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
1028
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
1029
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
1030
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
1031
-
1032
-		/** Async Tasks. */
1033
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
1034
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
1035
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
1036
-
1037
-		/** Autocomplete. */
1038
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
1039
-
1040
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
1041
-
1042
-		/** Analytics */
1043
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php';
1044
-
1045
-		/**
1046
-		 * The class responsible for defining all actions that occur in the admin area.
1047
-		 */
1048
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
1049
-
1050
-		/**
1051
-		 * The class to customize the entity list admin page.
1052
-		 */
1053
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
1054
-
1055
-		/**
1056
-		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
1057
-		 */
1058
-		global $wp_version;
1059
-		if ( version_compare( $wp_version, '5.3', '<' ) ) {
1060
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
1061
-		} else {
1062
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
1063
-		}
1064
-
1065
-		/**
1066
-		 * The Notice service.
1067
-		 */
1068
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1069
-
1070
-		/**
1071
-		 * The PrimaShop adapter.
1072
-		 */
1073
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1074
-
1075
-		/**
1076
-		 * The WordLift Dashboard service.
1077
-		 */
1078
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1079
-
1080
-		/**
1081
-		 * The admin 'Install wizard' page.
1082
-		 */
1083
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1084
-
1085
-		/**
1086
-		 * The WordLift entity type list admin page controller.
1087
-		 */
1088
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1089
-
1090
-		/**
1091
-		 * The WordLift entity type settings admin page controller.
1092
-		 */
1093
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1094
-
1095
-		/**
1096
-		 * The admin 'Download Your Data' page.
1097
-		 */
1098
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1099
-
1100
-		/**
1101
-		 * The admin 'WordLift Settings' page.
1102
-		 */
1103
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
1104
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
1105
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
1106
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
1107
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
1108
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
1109
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
1110
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
1111
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
1112
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
1113
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1114
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1115
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php';
1116
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1117
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
1118
-
1119
-		/** Admin Pages */
1120
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1121
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1122
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1123
-
1124
-		/**
1125
-		 * The class responsible for defining all actions that occur in the public-facing
1126
-		 * side of the site.
1127
-		 */
1128
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1129
-
1130
-		/**
1131
-		 * The shortcode abstract class.
1132
-		 */
1133
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1134
-
1135
-		/**
1136
-		 * The Timeline shortcode.
1137
-		 */
1138
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1139
-
1140
-		/**
1141
-		 * The Navigator shortcode.
1142
-		 */
1143
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1144
-
1145
-		/**
1146
-		 * The Products Navigator shortcode.
1147
-		 */
1148
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php';
1149
-
1150
-		/**
1151
-		 * The chord shortcode.
1152
-		 */
1153
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1154
-
1155
-		/**
1156
-		 * The geomap shortcode.
1157
-		 */
1158
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1159
-
1160
-		/**
1161
-		 * The entity cloud shortcode.
1162
-		 */
1163
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1164
-
1165
-		/**
1166
-		 * The entity glossary shortcode.
1167
-		 */
1168
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1169
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1170
-
1171
-		/**
1172
-		 * Faceted Search shortcode.
1173
-		 */
1174
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php';
1175
-
1176
-		/**
1177
-		 * The ShareThis service.
1178
-		 */
1179
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1180
-
1181
-		/**
1182
-		 * The SEO service.
1183
-		 */
1184
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1185
-
1186
-		/**
1187
-		 * The AMP service.
1188
-		 */
1189
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1190
-
1191
-		/** Widgets */
1192
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1193
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1194
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php';
1195
-
1196
-		/*
976
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
977
+
978
+        /**
979
+         * Load the JSON-LD service to publish entities using JSON-LD.s
980
+         *
981
+         * @since 3.8.0
982
+         */
983
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
984
+
985
+        // The Publisher Service and the AJAX adapter.
986
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
987
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
988
+
989
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
990
+
991
+        /**
992
+         * Load the WordLift key validation service.
993
+         */
994
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
995
+
996
+        // Load the `Wordlift_Category_Taxonomy_Service` class definition.
997
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
998
+
999
+        // Load the `Wordlift_Entity_Page_Service` class definition.
1000
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
1001
+
1002
+        /** Linked Data. */
1003
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
1004
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
1005
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
1006
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
1007
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
1008
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
1009
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
1010
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
1011
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
1012
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
1013
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
1014
+
1015
+        /** Linked Data Rendition. */
1016
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
1017
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
1018
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
1019
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
1020
+
1021
+        /** Services. */
1022
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
1023
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
1024
+
1025
+        /** Adapters. */
1026
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
1027
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
1028
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
1029
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
1030
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
1031
+
1032
+        /** Async Tasks. */
1033
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
1034
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
1035
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
1036
+
1037
+        /** Autocomplete. */
1038
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
1039
+
1040
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
1041
+
1042
+        /** Analytics */
1043
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php';
1044
+
1045
+        /**
1046
+         * The class responsible for defining all actions that occur in the admin area.
1047
+         */
1048
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
1049
+
1050
+        /**
1051
+         * The class to customize the entity list admin page.
1052
+         */
1053
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
1054
+
1055
+        /**
1056
+         * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
1057
+         */
1058
+        global $wp_version;
1059
+        if ( version_compare( $wp_version, '5.3', '<' ) ) {
1060
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
1061
+        } else {
1062
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
1063
+        }
1064
+
1065
+        /**
1066
+         * The Notice service.
1067
+         */
1068
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1069
+
1070
+        /**
1071
+         * The PrimaShop adapter.
1072
+         */
1073
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1074
+
1075
+        /**
1076
+         * The WordLift Dashboard service.
1077
+         */
1078
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1079
+
1080
+        /**
1081
+         * The admin 'Install wizard' page.
1082
+         */
1083
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1084
+
1085
+        /**
1086
+         * The WordLift entity type list admin page controller.
1087
+         */
1088
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1089
+
1090
+        /**
1091
+         * The WordLift entity type settings admin page controller.
1092
+         */
1093
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1094
+
1095
+        /**
1096
+         * The admin 'Download Your Data' page.
1097
+         */
1098
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1099
+
1100
+        /**
1101
+         * The admin 'WordLift Settings' page.
1102
+         */
1103
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
1104
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
1105
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
1106
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
1107
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
1108
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
1109
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
1110
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
1111
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
1112
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
1113
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1114
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1115
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php';
1116
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1117
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
1118
+
1119
+        /** Admin Pages */
1120
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1121
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1122
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1123
+
1124
+        /**
1125
+         * The class responsible for defining all actions that occur in the public-facing
1126
+         * side of the site.
1127
+         */
1128
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1129
+
1130
+        /**
1131
+         * The shortcode abstract class.
1132
+         */
1133
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1134
+
1135
+        /**
1136
+         * The Timeline shortcode.
1137
+         */
1138
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1139
+
1140
+        /**
1141
+         * The Navigator shortcode.
1142
+         */
1143
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1144
+
1145
+        /**
1146
+         * The Products Navigator shortcode.
1147
+         */
1148
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php';
1149
+
1150
+        /**
1151
+         * The chord shortcode.
1152
+         */
1153
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1154
+
1155
+        /**
1156
+         * The geomap shortcode.
1157
+         */
1158
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1159
+
1160
+        /**
1161
+         * The entity cloud shortcode.
1162
+         */
1163
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1164
+
1165
+        /**
1166
+         * The entity glossary shortcode.
1167
+         */
1168
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1169
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1170
+
1171
+        /**
1172
+         * Faceted Search shortcode.
1173
+         */
1174
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php';
1175
+
1176
+        /**
1177
+         * The ShareThis service.
1178
+         */
1179
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1180
+
1181
+        /**
1182
+         * The SEO service.
1183
+         */
1184
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1185
+
1186
+        /**
1187
+         * The AMP service.
1188
+         */
1189
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1190
+
1191
+        /** Widgets */
1192
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1193
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1194
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php';
1195
+
1196
+        /*
1197 1197
 		 * Schema.org Services.
1198 1198
 		 *
1199 1199
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1200 1200
 		 */
1201
-		if ( WL_ALL_ENTITY_TYPES ) {
1202
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1203
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1204
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1205
-			new Wordlift_Schemaorg_Sync_Service();
1206
-			$schemaorg_property_service = new Wordlift_Schemaorg_Property_Service();
1207
-			new Wordlift_Schemaorg_Class_Service();
1208
-		} else {
1209
-			$schemaorg_property_service = null;
1210
-		}
1211
-
1212
-		$this->loader = new Wordlift_Loader();
1213
-		/**
1214
-		 * @since 3.30.0
1215
-		 */
1216
-		$this->features_registry = Features_Registry::get_instance();
1201
+        if ( WL_ALL_ENTITY_TYPES ) {
1202
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1203
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1204
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1205
+            new Wordlift_Schemaorg_Sync_Service();
1206
+            $schemaorg_property_service = new Wordlift_Schemaorg_Property_Service();
1207
+            new Wordlift_Schemaorg_Class_Service();
1208
+        } else {
1209
+            $schemaorg_property_service = null;
1210
+        }
1217 1211
 
1218
-		// Instantiate a global logger.
1219
-		global $wl_logger;
1220
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1212
+        $this->loader = new Wordlift_Loader();
1213
+        /**
1214
+         * @since 3.30.0
1215
+         */
1216
+        $this->features_registry = Features_Registry::get_instance();
1221 1217
 
1222
-		// Load the `wl-api` end-point.
1223
-		new Wordlift_Http_Api();
1218
+        // Instantiate a global logger.
1219
+        global $wl_logger;
1220
+        $wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1224 1221
 
1225
-		// Load the Install Service.
1226
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
1227
-		$this->install_service = new Wordlift_Install_Service();
1222
+        // Load the `wl-api` end-point.
1223
+        new Wordlift_Http_Api();
1228 1224
 
1229
-		/** Services. */
1230
-		// Create the configuration service.
1231
-		$this->configuration_service = new Wordlift_Configuration_Service();
1232
-		$api_service                 = new Wordlift_Api_Service( $this->configuration_service );
1225
+        // Load the Install Service.
1226
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
1227
+        $this->install_service = new Wordlift_Install_Service();
1233 1228
 
1234
-		// Create an entity type service instance. It'll be later bound to the init action.
1235
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1229
+        /** Services. */
1230
+        // Create the configuration service.
1231
+        $this->configuration_service = new Wordlift_Configuration_Service();
1232
+        $api_service                 = new Wordlift_Api_Service( $this->configuration_service );
1236 1233
 
1237
-		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1238
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1234
+        // Create an entity type service instance. It'll be later bound to the init action.
1235
+        $this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1239 1236
 
1240
-		// Create an instance of the UI service.
1241
-		$this->ui_service = new Wordlift_UI_Service();
1237
+        // Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1238
+        $this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1242 1239
 
1243
-		// Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
1244
-		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
1240
+        // Create an instance of the UI service.
1241
+        $this->ui_service = new Wordlift_UI_Service();
1245 1242
 
1246
-		$this->sparql_service        = new Wordlift_Sparql_Service();
1247
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1248
-		$this->notice_service        = new Wordlift_Notice_Service();
1249
-		$this->relation_service      = new Wordlift_Relation_Service();
1243
+        // Create an instance of the Thumbnail service. Later it'll be hooked to post meta events.
1244
+        $this->thumbnail_service = new Wordlift_Thumbnail_Service();
1250 1245
 
1251
-		$entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1252
-		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1253
-		$this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1254
-		$this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1246
+        $this->sparql_service        = new Wordlift_Sparql_Service();
1247
+        $schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1248
+        $this->notice_service        = new Wordlift_Notice_Service();
1249
+        $this->relation_service      = new Wordlift_Relation_Service();
1255 1250
 
1256
-		// Instantiate the JSON-LD service.
1257
-		$property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1251
+        $entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1252
+        $this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1253
+        $this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1254
+        $this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1258 1255
 
1259
-		/** Linked Data. */
1260
-		$this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1261
-		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1256
+        // Instantiate the JSON-LD service.
1257
+        $property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1262 1258
 
1263
-		$this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1259
+        /** Linked Data. */
1260
+        $this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1261
+        $this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1264 1262
 
1265
-		// Create a new instance of the Redirect service.
1266
-		$this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_uri_service );
1267
-		$this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1263
+        $this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1268 1264
 
1269
-		// Create a new instance of the Timeline service and Timeline shortcode.
1270
-		$this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1265
+        // Create a new instance of the Redirect service.
1266
+        $this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_uri_service );
1267
+        $this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1271 1268
 
1272
-		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1269
+        // Create a new instance of the Timeline service and Timeline shortcode.
1270
+        $this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1273 1271
 
1274
-		$this->topic_taxonomy_service        = new Wordlift_Topic_Taxonomy_Service();
1275
-		$this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service();
1272
+        $this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1276 1273
 
1277
-		// Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
1278
-		$this->sharethis_service = new Wordlift_ShareThis_Service();
1274
+        $this->topic_taxonomy_service        = new Wordlift_Topic_Taxonomy_Service();
1275
+        $this->entity_types_taxonomy_service = new Wordlift_Entity_Type_Taxonomy_Service();
1279 1276
 
1280
-		// Create an instance of the PrimaShop adapter.
1281
-		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1277
+        // Create an instance of the ShareThis service, later we hook it to the_content and the_excerpt filters.
1278
+        $this->sharethis_service = new Wordlift_ShareThis_Service();
1282 1279
 
1283
-		// Create an import service instance to hook later to WP's import function.
1284
-		$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() );
1280
+        // Create an instance of the PrimaShop adapter.
1281
+        $this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1285 1282
 
1286
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1283
+        // Create an import service instance to hook later to WP's import function.
1284
+        $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() );
1287 1285
 
1288
-		// Create the entity rating service.
1289
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1286
+        $uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1290 1287
 
1291
-		// Create entity list customization (wp-admin/edit.php).
1292
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1288
+        // Create the entity rating service.
1289
+        $this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1293 1290
 
1294
-		// Create a new instance of the Redirect service.
1295
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1291
+        // Create entity list customization (wp-admin/edit.php).
1292
+        $this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1296 1293
 
1297
-		// Create an instance of the Publisher Service and the AJAX Adapter.
1298
-		$this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1299
-		$this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1300
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1294
+        // Create a new instance of the Redirect service.
1295
+        $this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1301 1296
 
1302
-		$attachment_service = new Wordlift_Attachment_Service();
1297
+        // Create an instance of the Publisher Service and the AJAX Adapter.
1298
+        $this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1299
+        $this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1300
+        $this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1303 1301
 
1304
-		// Instantiate the JSON-LD service.
1305
-		$property_getter                       = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1306
-		$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 );
1307
-		$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, $this->post_to_jsonld_converter );
1308
-		$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 );
1309
-		$this->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1302
+        $attachment_service = new Wordlift_Attachment_Service();
1310 1303
 
1311
-		$jsonld_cache                            = new Ttl_Cache( 'jsonld', 86400 );
1312
-		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache );
1313
-		/*
1304
+        // Instantiate the JSON-LD service.
1305
+        $property_getter                       = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1306
+        $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 );
1307
+        $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, $this->post_to_jsonld_converter );
1308
+        $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 );
1309
+        $this->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1310
+
1311
+        $jsonld_cache                            = new Ttl_Cache( 'jsonld', 86400 );
1312
+        $this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache );
1313
+        /*
1314 1314
 		 * Load the `Wordlift_Term_JsonLd_Adapter`.
1315 1315
 		 *
1316 1316
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/892
1317 1317
 		 *
1318 1318
 		 * @since 3.20.0
1319 1319
 		 */
1320
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php';
1321
-
1322
-		$term_jsonld_adapter  = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->cached_postid_to_jsonld_converter );
1323
-		$this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter, $term_jsonld_adapter );
1324
-
1325
-		$jsonld_service = new Jsonld_Service(
1326
-			$this->jsonld_service,
1327
-			$term_jsonld_adapter,
1328
-			new Jsonld_User_Service( $this->user_service ) );
1329
-		new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service );
1330
-
1331
-		// Prints the JSON-LD in the head.
1332
-		new Jsonld_Adapter( $this->jsonld_service );
1333
-
1334
-		new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service );
1335
-
1336
-		$this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service );
1337
-		$this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1338
-		// Creating Faq Content filter service.
1339
-		$this->faq_content_filter_service = new Faq_Content_Filter();
1340
-		$this->relation_rebuild_service   = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1341
-		$this->sample_data_service        = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1342
-		$this->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1343
-		$this->reference_rebuild_service  = new Wordlift_Reference_Rebuild_Service( $this->entity_service );
1344
-
1345
-		$this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' );
1346
-		$this->loader->add_action( 'admin_enqueue_scripts', $this, 'add_wl_enabled_blocks' );
1347
-
1348
-		/**
1349
-		 * Filter: wl_feature__enable__blocks.
1350
-		 *
1351
-		 * @param bool whether the blocks needed to be registered, defaults to true.
1352
-		 *
1353
-		 * @return bool
1354
-		 * @since 3.27.6
1355
-		 */
1356
-		if ( apply_filters( 'wl_feature__enable__blocks', true ) ) {
1357
-			// Initialize the short-codes.
1358
-			new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() );
1359
-			new Wordlift_Chord_Shortcode();
1360
-			new Wordlift_Geomap_Shortcode();
1361
-			new Wordlift_Timeline_Shortcode();
1362
-			new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service, $this->entity_service );
1363
-			new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1364
-			new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() );
1365
-		}
1366
-
1367
-		new Wordlift_Products_Navigator_Shortcode();
1368
-
1369
-
1370
-		// Initialize the Context Cards Service
1371
-		$this->context_cards_service = new Wordlift_Context_Cards_Service();
1372
-
1373
-		// Initialize the SEO service.
1374
-		new Wordlift_Seo_Service();
1375
-
1376
-		// Initialize the AMP service.
1377
-		new Wordlift_AMP_Service( $this->jsonld_service );
1378
-
1379
-		/** Services. */
1380
-		$this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1381
-		new Wordlift_Image_Service();
1382
-
1383
-		/** Adapters. */
1384
-		$this->entity_type_adapter    = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1385
-		$this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1386
-		$this->tinymce_adapter        = new Wordlift_Tinymce_Adapter( $this );
1387
-		//$this->faq_tinymce_adapter      = new Faq_Tinymce_Adapter();
1388
-		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1389
-
1390
-		/*
1320
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php';
1321
+
1322
+        $term_jsonld_adapter  = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->cached_postid_to_jsonld_converter );
1323
+        $this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter, $term_jsonld_adapter );
1324
+
1325
+        $jsonld_service = new Jsonld_Service(
1326
+            $this->jsonld_service,
1327
+            $term_jsonld_adapter,
1328
+            new Jsonld_User_Service( $this->user_service ) );
1329
+        new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service );
1330
+
1331
+        // Prints the JSON-LD in the head.
1332
+        new Jsonld_Adapter( $this->jsonld_service );
1333
+
1334
+        new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service );
1335
+
1336
+        $this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service );
1337
+        $this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1338
+        // Creating Faq Content filter service.
1339
+        $this->faq_content_filter_service = new Faq_Content_Filter();
1340
+        $this->relation_rebuild_service   = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1341
+        $this->sample_data_service        = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1342
+        $this->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1343
+        $this->reference_rebuild_service  = new Wordlift_Reference_Rebuild_Service( $this->entity_service );
1344
+
1345
+        $this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' );
1346
+        $this->loader->add_action( 'admin_enqueue_scripts', $this, 'add_wl_enabled_blocks' );
1347
+
1348
+        /**
1349
+         * Filter: wl_feature__enable__blocks.
1350
+         *
1351
+         * @param bool whether the blocks needed to be registered, defaults to true.
1352
+         *
1353
+         * @return bool
1354
+         * @since 3.27.6
1355
+         */
1356
+        if ( apply_filters( 'wl_feature__enable__blocks', true ) ) {
1357
+            // Initialize the short-codes.
1358
+            new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() );
1359
+            new Wordlift_Chord_Shortcode();
1360
+            new Wordlift_Geomap_Shortcode();
1361
+            new Wordlift_Timeline_Shortcode();
1362
+            new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service, $this->entity_service );
1363
+            new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1364
+            new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() );
1365
+        }
1366
+
1367
+        new Wordlift_Products_Navigator_Shortcode();
1368
+
1369
+
1370
+        // Initialize the Context Cards Service
1371
+        $this->context_cards_service = new Wordlift_Context_Cards_Service();
1372
+
1373
+        // Initialize the SEO service.
1374
+        new Wordlift_Seo_Service();
1375
+
1376
+        // Initialize the AMP service.
1377
+        new Wordlift_AMP_Service( $this->jsonld_service );
1378
+
1379
+        /** Services. */
1380
+        $this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1381
+        new Wordlift_Image_Service();
1382
+
1383
+        /** Adapters. */
1384
+        $this->entity_type_adapter    = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1385
+        $this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1386
+        $this->tinymce_adapter        = new Wordlift_Tinymce_Adapter( $this );
1387
+        //$this->faq_tinymce_adapter      = new Faq_Tinymce_Adapter();
1388
+        $this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1389
+
1390
+        /*
1391 1391
 		 * Exclude our public js from WP-Rocket.
1392 1392
 		 *
1393 1393
 		 * @since 3.19.4
1394 1394
 		 *
1395 1395
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/842.
1396 1396
 		 */
1397
-		new Wordlift_WpRocket_Adapter();
1398
-
1399
-		// Create a Rebuild Service instance, which we'll later bound to an ajax call.
1400
-		$this->rebuild_service = new Wordlift_Rebuild_Service(
1401
-			$this->sparql_service,
1402
-			$uri_service
1403
-		);
1404
-
1405
-		$that = $this;
1406
-		add_action( 'plugins_loaded', function () use ( $that ) {
1407
-			if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) {
1408
-				new Wordlift_Linked_Data_Service( $that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service );
1409
-				new Wordlift_Sparql_Query_Async_Task();
1410
-				new Wordlift_Push_References_Async_Task();
1411
-			}
1412
-		} );
1413
-
1414
-		/** WordPress Admin UI. */
1415
-
1416
-		// UI elements.
1417
-		$this->input_element           = new Wordlift_Admin_Input_Element();
1418
-		$this->radio_input_element     = new Wordlift_Admin_Radio_Input_Element();
1419
-		$this->select2_element         = new Wordlift_Admin_Select2_Element();
1420
-		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1421
-		$this->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1422
-		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1423
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1424
-		$this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1425
-
1426
-		$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 );
1427
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1428
-
1429
-		$this->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element );
1430
-		$this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page );
1431
-		$this->analytics_connect                   = new Wordlift_Analytics_Connect();
1432
-
1433
-		// Pages.
1434
-		/*
1397
+        new Wordlift_WpRocket_Adapter();
1398
+
1399
+        // Create a Rebuild Service instance, which we'll later bound to an ajax call.
1400
+        $this->rebuild_service = new Wordlift_Rebuild_Service(
1401
+            $this->sparql_service,
1402
+            $uri_service
1403
+        );
1404
+
1405
+        $that = $this;
1406
+        add_action( 'plugins_loaded', function () use ( $that ) {
1407
+            if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) {
1408
+                new Wordlift_Linked_Data_Service( $that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service );
1409
+                new Wordlift_Sparql_Query_Async_Task();
1410
+                new Wordlift_Push_References_Async_Task();
1411
+            }
1412
+        } );
1413
+
1414
+        /** WordPress Admin UI. */
1415
+
1416
+        // UI elements.
1417
+        $this->input_element           = new Wordlift_Admin_Input_Element();
1418
+        $this->radio_input_element     = new Wordlift_Admin_Radio_Input_Element();
1419
+        $this->select2_element         = new Wordlift_Admin_Select2_Element();
1420
+        $this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1421
+        $this->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1422
+        $tabs_element                  = new Wordlift_Admin_Tabs_Element();
1423
+        $this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1424
+        $this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1425
+
1426
+        $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 );
1427
+        $this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1428
+
1429
+        $this->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element );
1430
+        $this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page );
1431
+        $this->analytics_connect                   = new Wordlift_Analytics_Connect();
1432
+
1433
+        // Pages.
1434
+        /*
1435 1435
 		 * Call the `wl_can_see_classification_box` filter to determine whether we can display the classification box.
1436 1436
 		 *
1437 1437
 		 * @since 3.20.3
1438 1438
 		 *
1439 1439
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/914
1440 1440
 		 */
1441
-		if ( apply_filters( 'wl_can_see_classification_box', true ) ) {
1442
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1443
-			new Wordlift_Admin_Post_Edit_Page( $this );
1444
-		}
1445
-		new Wordlift_Entity_Type_Admin_Service();
1441
+        if ( apply_filters( 'wl_can_see_classification_box', true ) ) {
1442
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1443
+            new Wordlift_Admin_Post_Edit_Page( $this );
1444
+        }
1445
+        new Wordlift_Entity_Type_Admin_Service();
1446 1446
 
1447
-		// create an instance of the entity type list admin page controller.
1448
-		$this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
1447
+        // create an instance of the entity type list admin page controller.
1448
+        $this->entity_type_admin_page = new Wordlift_Admin_Entity_Taxonomy_List_Page();
1449 1449
 
1450
-		// create an instance of the entity type setting admin page controller.
1451
-		$this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
1450
+        // create an instance of the entity type setting admin page controller.
1451
+        $this->entity_type_settings_admin_page = new Wordlift_Admin_Entity_Type_Settings();
1452 1452
 
1453
-		/** Widgets */
1454
-		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1453
+        /** Widgets */
1454
+        $this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1455 1455
 
1456
-		/* WordPress Admin. */
1457
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1458
-		$this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1456
+        /* WordPress Admin. */
1457
+        $this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1458
+        $this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1459 1459
 
1460
-		// Create an instance of the install wizard.
1461
-		$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 );
1460
+        // Create an instance of the install wizard.
1461
+        $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 );
1462 1462
 
1463
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1463
+        $this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1464 1464
 
1465
-		// User Profile.
1466
-		new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1465
+        // User Profile.
1466
+        new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1467 1467
 
1468
-		$this->entity_page_service = new Wordlift_Entity_Page_Service();
1468
+        $this->entity_page_service = new Wordlift_Entity_Page_Service();
1469 1469
 
1470
-		// Load the debug service if WP is in debug mode.
1471
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1472
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1473
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1474
-		}
1470
+        // Load the debug service if WP is in debug mode.
1471
+        if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1472
+            require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1473
+            new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1474
+        }
1475 1475
 
1476
-		// Remote Image Service.
1477
-		new Wordlift_Remote_Image_Service();
1476
+        // Remote Image Service.
1477
+        new Wordlift_Remote_Image_Service();
1478 1478
 
1479
-		/*
1479
+        /*
1480 1480
 		 * Provides mappings between post types and entity types.
1481 1481
 		 *
1482 1482
 		 * @since 3.20.0
1483 1483
 		 *
1484 1484
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/852.
1485 1485
 		 */
1486
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1487
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1488
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1486
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1487
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1488
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1489 1489
 
1490
-		// Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1491
-		new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1490
+        // Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1491
+        new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1492 1492
 
1493
-		/*
1493
+        /*
1494 1494
 		 * Batch Operations. They're similar to Batch Actions but do not require working on post types.
1495 1495
 		 *
1496 1496
 		 * Eventually Batch Actions will become Batch Operations.
1497 1497
 		 *
1498 1498
 		 * @since 3.20.0
1499 1499
 		 */
1500
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1501
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1502
-		/*
1500
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1501
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1502
+        /*
1503 1503
 		 * Load the Mappings JSON-LD post processing.
1504 1504
 		 *
1505 1505
 		 * @since 3.25.0
1506 1506
 		 */
1507 1507
 
1508
-		$mappings_dbo           = new Mappings_DBO();
1509
-		$default_rule_validator = new Taxonomy_Rule_Validator();
1510
-		new Post_Type_Rule_Validator();
1511
-		// Taxonomy term rule validator for validating rules for term pages.
1512
-		new Taxonomy_Term_Rule_Validator();
1513
-		new Post_Taxonomy_Term_Rule_Validator();
1514
-		$rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator );
1515
-		$rule_groups_validator    = new Rule_Groups_Validator( $rule_validators_registry );
1516
-		$mappings_validator       = new Mappings_Validator( $mappings_dbo, $rule_groups_validator );
1517
-
1518
-		new Url_To_Entity_Transform_Function( $this->entity_uri_service );
1519
-		new Taxonomy_To_Terms_Transform_Function();
1520
-		new Post_Id_To_Entity_Transform_Function();
1521
-		$mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry();
1522
-
1523
-		/**
1524
-		 * @since 3.27.1
1525
-		 * Intiailize the acf group data formatter.
1526
-		 */
1527
-		new Acf_Group_Formatter();
1528
-		new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry );
1529
-
1530
-		/**
1531
-		 * @since 3.26.0
1532
-		 * Initialize the Faq JSON LD converter here - disabled.
1533
-		 */
1534
-		// new Faq_To_Jsonld_Converter();
1535
-		/*
1508
+        $mappings_dbo           = new Mappings_DBO();
1509
+        $default_rule_validator = new Taxonomy_Rule_Validator();
1510
+        new Post_Type_Rule_Validator();
1511
+        // Taxonomy term rule validator for validating rules for term pages.
1512
+        new Taxonomy_Term_Rule_Validator();
1513
+        new Post_Taxonomy_Term_Rule_Validator();
1514
+        $rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator );
1515
+        $rule_groups_validator    = new Rule_Groups_Validator( $rule_validators_registry );
1516
+        $mappings_validator       = new Mappings_Validator( $mappings_dbo, $rule_groups_validator );
1517
+
1518
+        new Url_To_Entity_Transform_Function( $this->entity_uri_service );
1519
+        new Taxonomy_To_Terms_Transform_Function();
1520
+        new Post_Id_To_Entity_Transform_Function();
1521
+        $mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry();
1522
+
1523
+        /**
1524
+         * @since 3.27.1
1525
+         * Intiailize the acf group data formatter.
1526
+         */
1527
+        new Acf_Group_Formatter();
1528
+        new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry );
1529
+
1530
+        /**
1531
+         * @since 3.26.0
1532
+         * Initialize the Faq JSON LD converter here - disabled.
1533
+         */
1534
+        // new Faq_To_Jsonld_Converter();
1535
+        /*
1536 1536
 		 * Use the Templates Ajax Endpoint to load HTML templates for the legacy Angular app via admin-ajax.php
1537 1537
 		 * end-point.
1538 1538
 		 *
1539 1539
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/834
1540 1540
 		 * @since 3.24.4
1541 1541
 		 */
1542
-		new Templates_Ajax_Endpoint();
1543
-		// Call this static method to register FAQ routes to rest api - disabled
1544
-		//Faq_Rest_Controller::register_routes();
1542
+        new Templates_Ajax_Endpoint();
1543
+        // Call this static method to register FAQ routes to rest api - disabled
1544
+        //Faq_Rest_Controller::register_routes();
1545 1545
 
1546
-		/*
1546
+        /*
1547 1547
 		 * Create a singleton for the Analysis_Response_Ops_Factory.
1548 1548
 		 */
1549
-		$entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service );
1550
-		/**
1551
-		 * @since 3.32.0
1552
-		 * Initialize a local entity provider which acts as an abstraction layer
1553
-		 * between the different types of objects in wordpress.
1554
-		 */
1555
-		$entity_provider_registry = new Entity_Provider_Registry();
1556
-
1557
-		/**
1558
-		 * @since 3.32.0
1559
-		 * The post entity provider has the legacy code which provides the entity
1560
-		 * if the object is post {@link \Wordlift\Object_Type_Enum::POST}
1561
-		 */
1562
-		new Post_Entity_Provider( $this->entity_uri_service,
1563
-			$this->entity_type_service, $this->storage_factory->post_images() );
1564
-		/**
1565
-		 * @since 3.32.0
1566
-		 * The term entity provider provides the entity
1567
-		 * if the object is term {@link \Wordlift\Object_Type_Enum::POST}
1568
-		 */
1569
-		new Term_Entity_Provider();
1570
-
1571
-		new Analysis_Response_Ops_Factory(
1572
-			$this->entity_uri_service,
1573
-			$entity_helper,
1574
-			$entity_provider_registry
1575
-		);
1576
-
1577
-		/** WL Autocomplete. */
1578
-		$autocomplete_service       = new All_Autocomplete_Service( array(
1579
-			new Local_Autocomplete_Service(),
1580
-			new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ),
1581
-		) );
1582
-		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service );
1583
-
1584
-		/**
1585
-		 * @since 3.27.2
1586
-		 * Integrate the recipe maker jsonld & set recipe
1587
-		 * as default entity type to the wprm_recipe CPT.
1588
-		 */
1589
-		new Recipe_Maker_Post_Type_Hook();
1590
-		$recipe_maker_validation_service = new Recipe_Maker_Validation_Service();
1591
-		new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service );
1592
-		new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service );
1593
-		new Recipe_Maker_Warning( $recipe_maker_validation_service );
1594
-		new Yoast_Jsonld( $recipe_maker_validation_service );
1595
-
1596
-		/**
1597
-		 * @since 3.27.4
1598
-		 * Add the faq duplicate markup hook.
1599
-		 */
1600
-		new Faq_Duplicate_Markup_Remover();
1601
-		/**
1602
-		 * @since 3.33.1
1603
-		 * Remove the duplicate HowTo Markup.
1604
-		 */
1605
-		new How_To_Duplicate_Markup_Remover();
1606
-
1607
-		/**
1608
-		 * @since 3.27.8
1609
-		 * @see https://github.com/insideout10/wordlift-plugin/issues/1248
1610
-		 */
1611
-		new Key_Validation_Notice( $this->key_validation_service, $this->configuration_service );
1612
-		/**
1613
-		 * @since 3.28.0
1614
-		 * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen
1615
-		 */
1616
-		new Entity_No_Index_Flag();
1617
-
1618
-		/**
1619
-		 * @since 3.29.0
1620
-		 * @see https://github.com/insideout10/wordlift-plugin/issues/1304
1621
-		 */
1622
-		new Entity_Rest_Service( $this->entity_type_service );
1623
-
1624
-		/**
1625
-		 * Expand author in to references.
1626
-		 * @since 3.30.0
1627
-		 * @see https://github.com/insideout10/wordlift-plugin/issues/1318
1628
-		 */
1629
-
1630
-		add_action( 'plugins_loaded', function () use ( $that ) {
1631
-
1632
-			if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) {
1633
-				new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter );
1634
-			}
1635
-
1636
-			if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) {
1637
-				$vocabulary_loader = new Vocabulary_Loader();
1638
-				$vocabulary_loader->init_vocabulary();
1639
-			}
1640
-
1641
-			/**
1642
-			 *Added for feature request 1496 (Webhooks)
1643
-			 */
1644
-			if ( apply_filters( 'wl_feature__enable__webhooks', false ) ) {
1645
-				$this->webhook_loader = new Webhooks_Loader();
1646
-				$this->webhook_loader->init();
1647
-			}
1648
-
1649
-		} );
1650
-
1651
-		/**
1652
-		 * @since 3.30.0
1653
-		 * Add a checkbox to user option screen for wordlift admin.
1654
-		 */
1655
-		$wordlift_admin_checkbox = new Admin_User_Option();
1656
-		$wordlift_admin_checkbox->connect_hook();
1657
-
1658
-		/**
1659
-		 * @since 3.31.0
1660
-		 * Init loader class for videoobject.
1661
-		 */
1662
-		$videoobject_loader = new Loader();
1663
-		$videoobject_loader->init_feature();
1664
-		/**
1665
-		 * @since 3.31.5
1666
-		 * Create configuration endpoint for webapp to configure.
1667
-		 */
1668
-		new Config( $this->admin_setup, $this->key_validation_service, $this->configuration_service );
1669
-		/**
1670
-		 * @since 3.31.7
1671
-		 * Remove duplicate videoobject.
1672
-		 */
1673
-		new Videoobject_Duplicate_Remover();
1674
-		$synonym_loader = new \Wordlift\Synonym\Loader();
1675
-		$synonym_loader->init_feature();
1676
-		/**
1677
-		 * @since 3.32.0
1678
-		 * Create loader for vocabulary terms.
1679
-		 */
1680
-		$vocabulary_terms_loader = new Vocabulary_Terms_Loader( $this->entity_type_service, $property_getter );
1681
-		$vocabulary_terms_loader->init_feature();
1682
-
1683
-		new Entity_Type_Change_Handler(
1684
-			$this->entity_service,
1685
-			$this->entity_type_service
1686
-		);
1687
-
1688
-		new Entity_Type_Setter();
1689
-		$no_editor_analysis_loader = new \Wordlift\No_Editor_Analysis\Loader();
1690
-		$no_editor_analysis_loader->init_feature();
1691
-	}
1692
-
1693
-	/**
1694
-	 * Define the locale for this plugin for internationalization.
1695
-	 *
1696
-	 * Uses the Wordlift_i18n class in order to set the domain and to register the hook
1697
-	 * with WordPress.
1698
-	 *
1699
-	 * @since    1.0.0
1700
-	 * @access   private
1701
-	 */
1702
-	private function set_locale() {
1703
-
1704
-		$plugin_i18n = new Wordlift_i18n();
1705
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1706
-
1707
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1708
-
1709
-	}
1710
-
1711
-	/**
1712
-	 * Register all of the hooks related to the admin area functionality
1713
-	 * of the plugin.
1714
-	 *
1715
-	 * @since    1.0.0
1716
-	 * @access   private
1717
-	 */
1718
-	private function define_admin_hooks() {
1719
-		$that         = $this;
1720
-		$plugin_admin = new Wordlift_Admin(
1721
-			$this->get_plugin_name(),
1722
-			$this->get_version(),
1723
-			$this->configuration_service,
1724
-			$this->notice_service,
1725
-			$this->user_service
1726
-		);
1727
-
1728
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1729
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1730
-
1731
-		// Hook the init action to taxonomy services.
1732
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1733
-		$this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1734
-
1735
-		// Hook the deleted_post_meta action to the Thumbnail service.
1736
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1737
-
1738
-		// Hook the added_post_meta action to the Thumbnail service.
1739
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1740
-
1741
-		// Hook the updated_post_meta action to the Thumbnail service.
1742
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1743
-
1744
-		// Hook the AJAX wl_timeline action to the Timeline service.
1745
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1746
-
1747
-		// Register custom allowed redirect hosts.
1748
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1749
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1750
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1751
-
1752
-		/*
1549
+        $entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service );
1550
+        /**
1551
+         * @since 3.32.0
1552
+         * Initialize a local entity provider which acts as an abstraction layer
1553
+         * between the different types of objects in wordpress.
1554
+         */
1555
+        $entity_provider_registry = new Entity_Provider_Registry();
1556
+
1557
+        /**
1558
+         * @since 3.32.0
1559
+         * The post entity provider has the legacy code which provides the entity
1560
+         * if the object is post {@link \Wordlift\Object_Type_Enum::POST}
1561
+         */
1562
+        new Post_Entity_Provider( $this->entity_uri_service,
1563
+            $this->entity_type_service, $this->storage_factory->post_images() );
1564
+        /**
1565
+         * @since 3.32.0
1566
+         * The term entity provider provides the entity
1567
+         * if the object is term {@link \Wordlift\Object_Type_Enum::POST}
1568
+         */
1569
+        new Term_Entity_Provider();
1570
+
1571
+        new Analysis_Response_Ops_Factory(
1572
+            $this->entity_uri_service,
1573
+            $entity_helper,
1574
+            $entity_provider_registry
1575
+        );
1576
+
1577
+        /** WL Autocomplete. */
1578
+        $autocomplete_service       = new All_Autocomplete_Service( array(
1579
+            new Local_Autocomplete_Service(),
1580
+            new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ),
1581
+        ) );
1582
+        $this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service );
1583
+
1584
+        /**
1585
+         * @since 3.27.2
1586
+         * Integrate the recipe maker jsonld & set recipe
1587
+         * as default entity type to the wprm_recipe CPT.
1588
+         */
1589
+        new Recipe_Maker_Post_Type_Hook();
1590
+        $recipe_maker_validation_service = new Recipe_Maker_Validation_Service();
1591
+        new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service );
1592
+        new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service );
1593
+        new Recipe_Maker_Warning( $recipe_maker_validation_service );
1594
+        new Yoast_Jsonld( $recipe_maker_validation_service );
1595
+
1596
+        /**
1597
+         * @since 3.27.4
1598
+         * Add the faq duplicate markup hook.
1599
+         */
1600
+        new Faq_Duplicate_Markup_Remover();
1601
+        /**
1602
+         * @since 3.33.1
1603
+         * Remove the duplicate HowTo Markup.
1604
+         */
1605
+        new How_To_Duplicate_Markup_Remover();
1606
+
1607
+        /**
1608
+         * @since 3.27.8
1609
+         * @see https://github.com/insideout10/wordlift-plugin/issues/1248
1610
+         */
1611
+        new Key_Validation_Notice( $this->key_validation_service, $this->configuration_service );
1612
+        /**
1613
+         * @since 3.28.0
1614
+         * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen
1615
+         */
1616
+        new Entity_No_Index_Flag();
1617
+
1618
+        /**
1619
+         * @since 3.29.0
1620
+         * @see https://github.com/insideout10/wordlift-plugin/issues/1304
1621
+         */
1622
+        new Entity_Rest_Service( $this->entity_type_service );
1623
+
1624
+        /**
1625
+         * Expand author in to references.
1626
+         * @since 3.30.0
1627
+         * @see https://github.com/insideout10/wordlift-plugin/issues/1318
1628
+         */
1629
+
1630
+        add_action( 'plugins_loaded', function () use ( $that ) {
1631
+
1632
+            if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) {
1633
+                new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter );
1634
+            }
1635
+
1636
+            if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) {
1637
+                $vocabulary_loader = new Vocabulary_Loader();
1638
+                $vocabulary_loader->init_vocabulary();
1639
+            }
1640
+
1641
+            /**
1642
+             *Added for feature request 1496 (Webhooks)
1643
+             */
1644
+            if ( apply_filters( 'wl_feature__enable__webhooks', false ) ) {
1645
+                $this->webhook_loader = new Webhooks_Loader();
1646
+                $this->webhook_loader->init();
1647
+            }
1648
+
1649
+        } );
1650
+
1651
+        /**
1652
+         * @since 3.30.0
1653
+         * Add a checkbox to user option screen for wordlift admin.
1654
+         */
1655
+        $wordlift_admin_checkbox = new Admin_User_Option();
1656
+        $wordlift_admin_checkbox->connect_hook();
1657
+
1658
+        /**
1659
+         * @since 3.31.0
1660
+         * Init loader class for videoobject.
1661
+         */
1662
+        $videoobject_loader = new Loader();
1663
+        $videoobject_loader->init_feature();
1664
+        /**
1665
+         * @since 3.31.5
1666
+         * Create configuration endpoint for webapp to configure.
1667
+         */
1668
+        new Config( $this->admin_setup, $this->key_validation_service, $this->configuration_service );
1669
+        /**
1670
+         * @since 3.31.7
1671
+         * Remove duplicate videoobject.
1672
+         */
1673
+        new Videoobject_Duplicate_Remover();
1674
+        $synonym_loader = new \Wordlift\Synonym\Loader();
1675
+        $synonym_loader->init_feature();
1676
+        /**
1677
+         * @since 3.32.0
1678
+         * Create loader for vocabulary terms.
1679
+         */
1680
+        $vocabulary_terms_loader = new Vocabulary_Terms_Loader( $this->entity_type_service, $property_getter );
1681
+        $vocabulary_terms_loader->init_feature();
1682
+
1683
+        new Entity_Type_Change_Handler(
1684
+            $this->entity_service,
1685
+            $this->entity_type_service
1686
+        );
1687
+
1688
+        new Entity_Type_Setter();
1689
+        $no_editor_analysis_loader = new \Wordlift\No_Editor_Analysis\Loader();
1690
+        $no_editor_analysis_loader->init_feature();
1691
+    }
1692
+
1693
+    /**
1694
+     * Define the locale for this plugin for internationalization.
1695
+     *
1696
+     * Uses the Wordlift_i18n class in order to set the domain and to register the hook
1697
+     * with WordPress.
1698
+     *
1699
+     * @since    1.0.0
1700
+     * @access   private
1701
+     */
1702
+    private function set_locale() {
1703
+
1704
+        $plugin_i18n = new Wordlift_i18n();
1705
+        $plugin_i18n->set_domain( $this->get_plugin_name() );
1706
+
1707
+        $this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1708
+
1709
+    }
1710
+
1711
+    /**
1712
+     * Register all of the hooks related to the admin area functionality
1713
+     * of the plugin.
1714
+     *
1715
+     * @since    1.0.0
1716
+     * @access   private
1717
+     */
1718
+    private function define_admin_hooks() {
1719
+        $that         = $this;
1720
+        $plugin_admin = new Wordlift_Admin(
1721
+            $this->get_plugin_name(),
1722
+            $this->get_version(),
1723
+            $this->configuration_service,
1724
+            $this->notice_service,
1725
+            $this->user_service
1726
+        );
1727
+
1728
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1729
+        $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1730
+
1731
+        // Hook the init action to taxonomy services.
1732
+        $this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1733
+        $this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1734
+
1735
+        // Hook the deleted_post_meta action to the Thumbnail service.
1736
+        $this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1737
+
1738
+        // Hook the added_post_meta action to the Thumbnail service.
1739
+        $this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1740
+
1741
+        // Hook the updated_post_meta action to the Thumbnail service.
1742
+        $this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1743
+
1744
+        // Hook the AJAX wl_timeline action to the Timeline service.
1745
+        $this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1746
+
1747
+        // Register custom allowed redirect hosts.
1748
+        $this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1749
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1750
+        $this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1751
+
1752
+        /*
1753 1753
 		 * The old dashboard is replaced with dashboard v2.
1754 1754
 		 *
1755 1755
 		 * The old dashboard service is still loaded because its functions are used.
@@ -1758,391 +1758,391 @@  discard block
 block discarded – undo
1758 1758
 		 *
1759 1759
 		 * @since 3.20.0
1760 1760
 		 */
1761
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1762
-		// $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1763
-		// Hook the AJAX wordlift_redirect action to the Redirect service.
1764
-		// $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1765
-
1766
-		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1767
-		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1768
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1769
-		$this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1770
-
1771
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1772
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1773
-
1774
-		// Entity listing customization (wp-admin/edit.php)
1775
-		// Add custom columns.
1776
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1777
-		// no explicit entity as it prevents handling of other post types.
1778
-		$this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1779
-		// Add 4W selection.
1780
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1781
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1782
-		$this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1783
-		$this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1784
-
1785
-		/*
1761
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1762
+        // $this->loader->add_action( 'wp_ajax_wordlift_get_stats', $this->dashboard_service, 'ajax_get_stats' );
1763
+        // Hook the AJAX wordlift_redirect action to the Redirect service.
1764
+        // $this->loader->add_action( 'wp_dashboard_setup', $this->dashboard_service, 'add_dashboard_widgets' );
1765
+
1766
+        // Hook save_post to the entity service to update custom fields (such as alternate labels).
1767
+        // We have a priority of 9 because we want to be executed before data is sent to Redlink.
1768
+        $this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1769
+        $this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1770
+
1771
+        $this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1772
+        $this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1773
+
1774
+        // Entity listing customization (wp-admin/edit.php)
1775
+        // Add custom columns.
1776
+        $this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1777
+        // no explicit entity as it prevents handling of other post types.
1778
+        $this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1779
+        // Add 4W selection.
1780
+        $this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1781
+        $this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1782
+        $this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1783
+        $this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1784
+
1785
+        /*
1786 1786
 		 * If `All Entity Types` is disable, use the radio button Walker.
1787 1787
 		 *
1788 1788
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1789 1789
 		 */
1790
-		if ( ! WL_ALL_ENTITY_TYPES ) {
1791
-			$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1792
-		}
1793
-
1794
-		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1795
-		// entities.
1796
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1797
-
1798
-		// Filter imported post meta.
1799
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1800
-
1801
-		// Notify the import service when an import starts and ends.
1802
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1803
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1804
-
1805
-		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1806
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1807
-		$this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1808
-
1809
-		/**
1810
-		 * Filter: wl_feature__enable__settings-download.
1811
-		 *
1812
-		 * @param bool whether the screens needed to be registered, defaults to true.
1813
-		 *
1814
-		 * @return bool
1815
-		 * @since 3.27.6
1816
-		 */
1817
-		$this->features_registry->register_feature_from_slug( 'settings-download', true, array(
1818
-			$this,
1819
-			'register_screens'
1820
-		) );
1821
-
1822
-
1823
-		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1824
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1825
-
1826
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1827
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1828
-		$this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1829
-		$this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1830
-
1831
-		// Hook the AJAX wl_validate_key action to the Key Validation service.
1832
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1833
-
1834
-		// Hook the AJAX wl_update_country_options action to the countries.
1835
-		$this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' );
1836
-
1837
-		// Hook the `admin_init` function to the Admin Setup.
1838
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1839
-
1840
-		// Hook the admin_init to the settings page.
1841
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1842
-		$this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' );
1843
-
1844
-		$this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1845
-
1846
-		// Hook the menu creation on the general wordlift menu creation.
1847
-		/**
1848
-		 * Filter: wl_feature__enable__screens.
1849
-		 *
1850
-		 * @param bool whether the screens needed to be registered, defaults to true.
1851
-		 *
1852
-		 * @return bool
1853
-		 * @since 3.27.6
1854
-		 *
1855
-		 * Since 3.30.0 this feature is registered using registry.
1856
-		 */
1857
-		add_action( 'plugins_loaded', function () use ( $that ) {
1858
-			if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) {
1859
-				add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 );
1860
-			}
1861
-		} );
1862
-
1863
-		// Hook key update.
1864
-		$this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1865
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1866
-
1867
-		// Add additional action links to the WordLift plugin in the plugins page.
1868
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1869
-
1870
-		/*
1790
+        if ( ! WL_ALL_ENTITY_TYPES ) {
1791
+            $this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1792
+        }
1793
+
1794
+        // Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1795
+        // entities.
1796
+        $this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1797
+
1798
+        // Filter imported post meta.
1799
+        $this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1800
+
1801
+        // Notify the import service when an import starts and ends.
1802
+        $this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1803
+        $this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1804
+
1805
+        // Hook the AJAX wl_rebuild action to the Rebuild Service.
1806
+        $this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1807
+        $this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1808
+
1809
+        /**
1810
+         * Filter: wl_feature__enable__settings-download.
1811
+         *
1812
+         * @param bool whether the screens needed to be registered, defaults to true.
1813
+         *
1814
+         * @return bool
1815
+         * @since 3.27.6
1816
+         */
1817
+        $this->features_registry->register_feature_from_slug( 'settings-download', true, array(
1818
+            $this,
1819
+            'register_screens'
1820
+        ) );
1821
+
1822
+
1823
+        // Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1824
+        $this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1825
+
1826
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
1827
+        $this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1828
+        $this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1829
+        $this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1830
+
1831
+        // Hook the AJAX wl_validate_key action to the Key Validation service.
1832
+        $this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1833
+
1834
+        // Hook the AJAX wl_update_country_options action to the countries.
1835
+        $this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' );
1836
+
1837
+        // Hook the `admin_init` function to the Admin Setup.
1838
+        $this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1839
+
1840
+        // Hook the admin_init to the settings page.
1841
+        $this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1842
+        $this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' );
1843
+
1844
+        $this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1845
+
1846
+        // Hook the menu creation on the general wordlift menu creation.
1847
+        /**
1848
+         * Filter: wl_feature__enable__screens.
1849
+         *
1850
+         * @param bool whether the screens needed to be registered, defaults to true.
1851
+         *
1852
+         * @return bool
1853
+         * @since 3.27.6
1854
+         *
1855
+         * Since 3.30.0 this feature is registered using registry.
1856
+         */
1857
+        add_action( 'plugins_loaded', function () use ( $that ) {
1858
+            if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) {
1859
+                add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 );
1860
+            }
1861
+        } );
1862
+
1863
+        // Hook key update.
1864
+        $this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1865
+        $this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1866
+
1867
+        // Add additional action links to the WordLift plugin in the plugins page.
1868
+        $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1869
+
1870
+        /*
1871 1871
 		 * Remove the Analytics Settings link from the plugin page.
1872 1872
 		 *
1873 1873
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/932
1874 1874
 		 * @since 3.21.1
1875 1875
 		 */
1876
-		// $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 );
1877
-
1878
-		// Hook the AJAX `wl_publisher` action name.
1879
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1880
-
1881
-		// Hook row actions for the entity type list admin.
1882
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1883
-
1884
-		/** Ajax actions. */
1885
-		$this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1886
-
1887
-		// Hook capabilities manipulation to allow access to entity type admin
1888
-		// page  on WordPress versions before 4.7.
1889
-		global $wp_version;
1890
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1891
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1892
-		}
1893
-
1894
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1895
-
1896
-		/** Adapters. */
1897
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1898
-		/**
1899
-		 * Disabling Faq temporarily.
1900
-		 * Load the tinymce editor button on the tool bar.
1901
-		 * @since 3.26.0
1902
-		 */
1903
-		//$this->loader->add_filter( 'tiny_mce_before_init', $this->faq_tinymce_adapter, 'register_custom_tags' );
1904
-		//$this->loader->add_filter( 'mce_buttons', $this->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 );
1905
-		//$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 );
1906
-
1907
-
1908
-		$this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1909
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1910
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1911
-		/**
1912
-		 * @since 3.26.0
1913
-		 */
1914
-		$excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter();
1915
-		$this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' );
1916
-		// Adding Rest route for the post excerpt
1917
-		Post_Excerpt_Rest_Controller::register_routes();
1918
-
1919
-		$this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1920
-		$this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1921
-
1922
-		// Handle the autocomplete request.
1923
-		add_action( 'wp_ajax_wl_autocomplete', array(
1924
-			$this->autocomplete_adapter,
1925
-			'wl_autocomplete',
1926
-		) );
1927
-		add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1928
-			$this->autocomplete_adapter,
1929
-			'wl_autocomplete',
1930
-		) );
1931
-
1932
-		// Hooks to restrict multisite super admin from manipulating entity types.
1933
-		if ( is_multisite() ) {
1934
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1935
-		}
1936
-
1937
-		$deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1938
-
1939
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1940
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1941
-		add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1942
-
1943
-		/**
1944
-		 * Always allow the `wordlift/classification` block.
1945
-		 *
1946
-		 * @since 3.23.0
1947
-		 */
1948
-		add_filter( 'allowed_block_types', function ( $value ) {
1949
-
1950
-			if ( true === $value ) {
1951
-				return $value;
1952
-			}
1953
-
1954
-			return array_merge( (array) $value, array( 'wordlift/classification' ) );
1955
-		}, PHP_INT_MAX );
1956
-
1957
-		/**
1958
-		 * @since 3.27.7
1959
-		 * @see https://github.com/insideout10/wordlift-plugin/issues/1214
1960
-		 */
1961
-		new Top_Entities();
1962
-	}
1963
-
1964
-	/**
1965
-	 * Register all of the hooks related to the public-facing functionality
1966
-	 * of the plugin.
1967
-	 *
1968
-	 * @since    1.0.0
1969
-	 * @access   private
1970
-	 */
1971
-	private function define_public_hooks() {
1972
-
1973
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1974
-
1975
-		// Register the entity post type.
1976
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1977
-
1978
-		// Bind the link generation and handling hooks to the entity link service.
1979
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1980
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1981
-		// $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 );
1982
-		// $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 );
1983
-
1984
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1985
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1986
-		$this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' );
1987
-
1988
-		// Registering Faq_Content_Filter service used for removing faq question and answer tags from the html.
1989
-		$this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' );
1990
-		// Hook the content filter service to add entity links.
1991
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1992
-			$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1993
-		}
1994
-
1995
-		// Hook the AJAX wl_timeline action to the Timeline service.
1996
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1997
-
1998
-		// Hook the ShareThis service.
1999
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
2000
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
2001
-
2002
-		// Hook the AJAX wl_jsonld action to the JSON-LD service.
2003
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
2004
-
2005
-		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
2006
-		// in order to tweak WP's `WP_Query` to include entities in queries related
2007
-		// to categories.
2008
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
2009
-
2010
-		/*
1876
+        // $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 );
1877
+
1878
+        // Hook the AJAX `wl_publisher` action name.
1879
+        $this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1880
+
1881
+        // Hook row actions for the entity type list admin.
1882
+        $this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1883
+
1884
+        /** Ajax actions. */
1885
+        $this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1886
+
1887
+        // Hook capabilities manipulation to allow access to entity type admin
1888
+        // page  on WordPress versions before 4.7.
1889
+        global $wp_version;
1890
+        if ( version_compare( $wp_version, '4.7', '<' ) ) {
1891
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1892
+        }
1893
+
1894
+        $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1895
+
1896
+        /** Adapters. */
1897
+        $this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1898
+        /**
1899
+         * Disabling Faq temporarily.
1900
+         * Load the tinymce editor button on the tool bar.
1901
+         * @since 3.26.0
1902
+         */
1903
+        //$this->loader->add_filter( 'tiny_mce_before_init', $this->faq_tinymce_adapter, 'register_custom_tags' );
1904
+        //$this->loader->add_filter( 'mce_buttons', $this->faq_tinymce_adapter, 'register_faq_toolbar_button', 10, 1 );
1905
+        //$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 );
1906
+
1907
+
1908
+        $this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1909
+        $this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1910
+        $this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1911
+        /**
1912
+         * @since 3.26.0
1913
+         */
1914
+        $excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter();
1915
+        $this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' );
1916
+        // Adding Rest route for the post excerpt
1917
+        Post_Excerpt_Rest_Controller::register_routes();
1918
+
1919
+        $this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1920
+        $this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1921
+
1922
+        // Handle the autocomplete request.
1923
+        add_action( 'wp_ajax_wl_autocomplete', array(
1924
+            $this->autocomplete_adapter,
1925
+            'wl_autocomplete',
1926
+        ) );
1927
+        add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1928
+            $this->autocomplete_adapter,
1929
+            'wl_autocomplete',
1930
+        ) );
1931
+
1932
+        // Hooks to restrict multisite super admin from manipulating entity types.
1933
+        if ( is_multisite() ) {
1934
+            $this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1935
+        }
1936
+
1937
+        $deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1938
+
1939
+        add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1940
+        add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1941
+        add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1942
+
1943
+        /**
1944
+         * Always allow the `wordlift/classification` block.
1945
+         *
1946
+         * @since 3.23.0
1947
+         */
1948
+        add_filter( 'allowed_block_types', function ( $value ) {
1949
+
1950
+            if ( true === $value ) {
1951
+                return $value;
1952
+            }
1953
+
1954
+            return array_merge( (array) $value, array( 'wordlift/classification' ) );
1955
+        }, PHP_INT_MAX );
1956
+
1957
+        /**
1958
+         * @since 3.27.7
1959
+         * @see https://github.com/insideout10/wordlift-plugin/issues/1214
1960
+         */
1961
+        new Top_Entities();
1962
+    }
1963
+
1964
+    /**
1965
+     * Register all of the hooks related to the public-facing functionality
1966
+     * of the plugin.
1967
+     *
1968
+     * @since    1.0.0
1969
+     * @access   private
1970
+     */
1971
+    private function define_public_hooks() {
1972
+
1973
+        $plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1974
+
1975
+        // Register the entity post type.
1976
+        $this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1977
+
1978
+        // Bind the link generation and handling hooks to the entity link service.
1979
+        $this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1980
+        $this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1981
+        // $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 );
1982
+        // $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 );
1983
+
1984
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1985
+        $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1986
+        $this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' );
1987
+
1988
+        // Registering Faq_Content_Filter service used for removing faq question and answer tags from the html.
1989
+        $this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' );
1990
+        // Hook the content filter service to add entity links.
1991
+        if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1992
+            $this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1993
+        }
1994
+
1995
+        // Hook the AJAX wl_timeline action to the Timeline service.
1996
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1997
+
1998
+        // Hook the ShareThis service.
1999
+        $this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
2000
+        $this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
2001
+
2002
+        // Hook the AJAX wl_jsonld action to the JSON-LD service.
2003
+        $this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
2004
+
2005
+        // Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
2006
+        // in order to tweak WP's `WP_Query` to include entities in queries related
2007
+        // to categories.
2008
+        $this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
2009
+
2010
+        /*
2011 2011
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
2012 2012
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
2013 2013
 		 * order of start time.
2014 2014
 		 */
2015
-		$this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
2016
-
2017
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
2018
-
2019
-		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
2020
-		$this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
2021
-
2022
-		// Analytics Script Frontend.
2023
-		if ( apply_filters( 'wl_feature__enable__analytics', true ) && $this->configuration_service->is_analytics_enable() ) {
2024
-			$this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 );
2025
-		}
2026
-
2027
-	}
2028
-
2029
-	/**
2030
-	 * Run the loader to execute all of the hooks with WordPress.
2031
-	 *
2032
-	 * @since    1.0.0
2033
-	 */
2034
-	public function run() {
2035
-		$this->loader->run();
2036
-	}
2037
-
2038
-	/**
2039
-	 * The name of the plugin used to uniquely identify it within the context of
2040
-	 * WordPress and to define internationalization functionality.
2041
-	 *
2042
-	 * @return    string    The name of the plugin.
2043
-	 * @since     1.0.0
2044
-	 */
2045
-	public function get_plugin_name() {
2046
-		return $this->plugin_name;
2047
-	}
2048
-
2049
-	/**
2050
-	 * The reference to the class that orchestrates the hooks with the plugin.
2051
-	 *
2052
-	 * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
2053
-	 * @since     1.0.0
2054
-	 */
2055
-	public function get_loader() {
2056
-		return $this->loader;
2057
-	}
2058
-
2059
-	/**
2060
-	 * Retrieve the version number of the plugin.
2061
-	 *
2062
-	 * @return    string    The version number of the plugin.
2063
-	 * @since     1.0.0
2064
-	 */
2065
-	public function get_version() {
2066
-		return $this->version;
2067
-	}
2068
-
2069
-	/**
2070
-	 * Load dependencies for WP-CLI.
2071
-	 *
2072
-	 * @throws Exception
2073
-	 * @since 3.18.0
2074
-	 */
2075
-	private function load_cli_dependencies() {
2076
-
2077
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
2078
-
2079
-		$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 );
2080
-
2081
-		WP_CLI::add_command( 'wl references push', $push_reference_data_command );
2082
-
2083
-	}
2084
-
2085
-	/**
2086
-	 * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions.
2087
-	 *
2088
-	 * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance.
2089
-	 * @since 3.20.0
2090
-	 */
2091
-	public function get_dashboard_service() {
2092
-
2093
-		return $this->dashboard_service;
2094
-	}
2095
-
2096
-	public function add_wl_enabled_blocks() {
2097
-		/**
2098
-		 * Filter: wl_feature__enable__blocks.
2099
-		 *
2100
-		 * @param bool whether the blocks needed to be registered, defaults to true.
2101
-		 *
2102
-		 * @return bool
2103
-		 * @since 3.27.6
2104
-		 */
2105
-
2106
-		wp_register_script( 'wl_enabled_blocks', false );
2107
-
2108
-		$enabled_blocks = array();
2109
-
2110
-		/**
2111
-		 * Filter name: wl_feature__enable__product-navigator
2112
-		 * @since 3.32.3
2113
-		 */
2114
-		if ( apply_filters( 'wl_feature__enable__product-navigator', true ) ) {
2115
-			$enabled_blocks[] = 'wordlift/products-navigator';
2116
-		}
2117
-
2118
-		if ( apply_filters( 'wl_feature__enable__blocks', true ) ) {
2119
-			// To intimate JS
2120
-			$enabled_blocks = array_merge( $enabled_blocks, array(
2121
-				'wordlift/navigator',
2122
-				'wordlift/chord',
2123
-				'wordlift/geomap',
2124
-				'wordlift/timeline',
2125
-				'wordlift/cloud',
2126
-				'wordlift/vocabulary',
2127
-				'wordlift/faceted-search'
2128
-			) );
2129
-		}
2130
-
2131
-		wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks );
2132
-		wp_enqueue_script( 'wl_enabled_blocks' );
2133
-	}
2134
-
2135
-	/**
2136
-	 * Register screens based on the filter.
2137
-	 */
2138
-	public function register_screens() {
2139
-		// Hook the menu to the Download Your Data page.
2140
-		if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) {
2141
-			add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 );
2142
-		}
2143
-		add_action( 'admin_menu', array( $this->status_page, 'admin_menu' ), 100, 0 );
2144
-		add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 );
2145
-
2146
-	}
2015
+        $this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
2016
+
2017
+        $this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
2018
+
2019
+        // This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
2020
+        $this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
2021
+
2022
+        // Analytics Script Frontend.
2023
+        if ( apply_filters( 'wl_feature__enable__analytics', true ) && $this->configuration_service->is_analytics_enable() ) {
2024
+            $this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 );
2025
+        }
2026
+
2027
+    }
2028
+
2029
+    /**
2030
+     * Run the loader to execute all of the hooks with WordPress.
2031
+     *
2032
+     * @since    1.0.0
2033
+     */
2034
+    public function run() {
2035
+        $this->loader->run();
2036
+    }
2037
+
2038
+    /**
2039
+     * The name of the plugin used to uniquely identify it within the context of
2040
+     * WordPress and to define internationalization functionality.
2041
+     *
2042
+     * @return    string    The name of the plugin.
2043
+     * @since     1.0.0
2044
+     */
2045
+    public function get_plugin_name() {
2046
+        return $this->plugin_name;
2047
+    }
2048
+
2049
+    /**
2050
+     * The reference to the class that orchestrates the hooks with the plugin.
2051
+     *
2052
+     * @return    Wordlift_Loader    Orchestrates the hooks of the plugin.
2053
+     * @since     1.0.0
2054
+     */
2055
+    public function get_loader() {
2056
+        return $this->loader;
2057
+    }
2058
+
2059
+    /**
2060
+     * Retrieve the version number of the plugin.
2061
+     *
2062
+     * @return    string    The version number of the plugin.
2063
+     * @since     1.0.0
2064
+     */
2065
+    public function get_version() {
2066
+        return $this->version;
2067
+    }
2068
+
2069
+    /**
2070
+     * Load dependencies for WP-CLI.
2071
+     *
2072
+     * @throws Exception
2073
+     * @since 3.18.0
2074
+     */
2075
+    private function load_cli_dependencies() {
2076
+
2077
+        require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
2078
+
2079
+        $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 );
2080
+
2081
+        WP_CLI::add_command( 'wl references push', $push_reference_data_command );
2082
+
2083
+    }
2084
+
2085
+    /**
2086
+     * Get the {@link \Wordlift_Dashboard_Service} to allow others to use its functions.
2087
+     *
2088
+     * @return \Wordlift_Dashboard_Service The {@link \Wordlift_Dashboard_Service} instance.
2089
+     * @since 3.20.0
2090
+     */
2091
+    public function get_dashboard_service() {
2092
+
2093
+        return $this->dashboard_service;
2094
+    }
2095
+
2096
+    public function add_wl_enabled_blocks() {
2097
+        /**
2098
+         * Filter: wl_feature__enable__blocks.
2099
+         *
2100
+         * @param bool whether the blocks needed to be registered, defaults to true.
2101
+         *
2102
+         * @return bool
2103
+         * @since 3.27.6
2104
+         */
2105
+
2106
+        wp_register_script( 'wl_enabled_blocks', false );
2107
+
2108
+        $enabled_blocks = array();
2109
+
2110
+        /**
2111
+         * Filter name: wl_feature__enable__product-navigator
2112
+         * @since 3.32.3
2113
+         */
2114
+        if ( apply_filters( 'wl_feature__enable__product-navigator', true ) ) {
2115
+            $enabled_blocks[] = 'wordlift/products-navigator';
2116
+        }
2117
+
2118
+        if ( apply_filters( 'wl_feature__enable__blocks', true ) ) {
2119
+            // To intimate JS
2120
+            $enabled_blocks = array_merge( $enabled_blocks, array(
2121
+                'wordlift/navigator',
2122
+                'wordlift/chord',
2123
+                'wordlift/geomap',
2124
+                'wordlift/timeline',
2125
+                'wordlift/cloud',
2126
+                'wordlift/vocabulary',
2127
+                'wordlift/faceted-search'
2128
+            ) );
2129
+        }
2130
+
2131
+        wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks );
2132
+        wp_enqueue_script( 'wl_enabled_blocks' );
2133
+    }
2134
+
2135
+    /**
2136
+     * Register screens based on the filter.
2137
+     */
2138
+    public function register_screens() {
2139
+        // Hook the menu to the Download Your Data page.
2140
+        if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) {
2141
+            add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 );
2142
+        }
2143
+        add_action( 'admin_menu', array( $this->status_page, 'admin_menu' ), 100, 0 );
2144
+        add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 );
2145
+
2146
+    }
2147 2147
 
2148 2148
 }
Please login to merge, or discard this patch.
Spacing   +355 added lines, -355 removed lines patch added patch discarded remove patch
@@ -787,7 +787,7 @@  discard block
 block discarded – undo
787 787
 		$this->define_public_hooks();
788 788
 
789 789
 		// If we're in `WP_CLI` load the related files.
790
-		if ( class_exists( 'WP_CLI' ) ) {
790
+		if (class_exists('WP_CLI')) {
791 791
 			$this->load_cli_dependencies();
792 792
 		}
793 793
 
@@ -828,380 +828,380 @@  discard block
 block discarded – undo
828 828
 		 * The class responsible for orchestrating the actions and filters of the
829 829
 		 * core plugin.
830 830
 		 */
831
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-loader.php';
831
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-loader.php';
832 832
 
833 833
 		// The class responsible for plugin uninstall.
834
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-deactivator-feedback.php';
834
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-deactivator-feedback.php';
835 835
 
836 836
 		/**
837 837
 		 * The class responsible for defining internationalization functionality
838 838
 		 * of the plugin.
839 839
 		 */
840
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-i18n.php';
840
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-i18n.php';
841 841
 
842 842
 		/**
843 843
 		 * WordLift's supported languages.
844 844
 		 */
845
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-languages.php';
845
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-languages.php';
846 846
 
847 847
 		/**
848 848
 		 * WordLift's supported countries.
849 849
 		 */
850
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-countries.php';
850
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-countries.php';
851 851
 
852 852
 		/**
853 853
 		 * Provide support functions to sanitize data.
854 854
 		 */
855
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sanitizer.php';
855
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sanitizer.php';
856 856
 
857 857
 		/** Services. */
858
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-log-service.php';
859
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-http-api.php';
860
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-redirect-service.php';
861
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-configuration-service.php';
862
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-type-service.php';
863
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-service.php';
864
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-link-service.php';
865
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-linked-data-service.php';
866
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-relation-service.php';
867
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-image-service.php';
858
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-log-service.php';
859
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-http-api.php';
860
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-redirect-service.php';
861
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-configuration-service.php';
862
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-type-service.php';
863
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-service.php';
864
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-link-service.php';
865
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-linked-data-service.php';
866
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-relation-service.php';
867
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-image-service.php';
868 868
 
869 869
 		/**
870 870
 		 * The Query builder.
871 871
 		 */
872
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-query-builder.php';
872
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-query-builder.php';
873 873
 
874 874
 		/**
875 875
 		 * The Schema service.
876 876
 		 */
877
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-service.php';
877
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-service.php';
878 878
 
879 879
 		/**
880 880
 		 * The schema:url property service.
881 881
 		 */
882
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-service.php';
883
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-schema-url-property-service.php';
882
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-service.php';
883
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-schema-url-property-service.php';
884 884
 
885 885
 		/**
886 886
 		 * The UI service.
887 887
 		 */
888
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-ui-service.php';
888
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-ui-service.php';
889 889
 
890 890
 		/**
891 891
 		 * The Thumbnail service.
892 892
 		 */
893
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-thumbnail-service.php';
893
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-thumbnail-service.php';
894 894
 
895 895
 		/**
896 896
 		 * The Entity Types Taxonomy service.
897 897
 		 */
898
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-taxonomy-service.php';
898
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-taxonomy-service.php';
899 899
 
900 900
 		/**
901 901
 		 * The Entity service.
902 902
 		 */
903
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-uri-service.php';
904
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-service.php';
903
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-uri-service.php';
904
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-service.php';
905 905
 
906 906
 		// Add the entity rating service.
907
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-rating-service.php';
907
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-rating-service.php';
908 908
 
909 909
 		/**
910 910
 		 * The User service.
911 911
 		 */
912
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-user-service.php';
912
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-user-service.php';
913 913
 
914 914
 		/**
915 915
 		 * The Timeline service.
916 916
 		 */
917
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-timeline-service.php';
917
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-timeline-service.php';
918 918
 
919 919
 		/**
920 920
 		 * The Topic Taxonomy service.
921 921
 		 */
922
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-topic-taxonomy-service.php';
922
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-topic-taxonomy-service.php';
923 923
 
924 924
 		/**
925 925
 		 * The SPARQL service.
926 926
 		 */
927
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sparql-service.php';
927
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sparql-service.php';
928 928
 
929 929
 		/**
930 930
 		 * The WordLift import service.
931 931
 		 */
932
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-import-service.php';
932
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-import-service.php';
933 933
 
934 934
 		/**
935 935
 		 * The WordLift URI service.
936 936
 		 */
937
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-uri-service.php';
938
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-property-factory.php';
939
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-service.php';
937
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-uri-service.php';
938
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-property-factory.php';
939
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-service.php';
940 940
 
941 941
 		/**
942 942
 		 * The WordLift rebuild service, used to rebuild the remote dataset using the local data.
943 943
 		 */
944
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-listable.php';
945
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-rebuild-service.php';
946
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-reference-rebuild-service.php';
947
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-service.php';
948
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
944
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-listable.php';
945
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-rebuild-service.php';
946
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-reference-rebuild-service.php';
947
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-service.php';
948
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/rebuild/class-wordlift-relation-rebuild-adapter.php';
949 949
 
950
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/properties/class-wordlift-property-getter-factory.php';
951
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-attachment-service.php';
950
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/properties/class-wordlift-property-getter-factory.php';
951
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-attachment-service.php';
952 952
 
953 953
 		/**
954 954
 		 * Load the converters.
955 955
 		 */
956
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/intf-wordlift-post-converter.php';
957
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
958
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-postid-to-jsonld-converter.php';
959
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-post-to-jsonld-converter.php';
960
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-to-jsonld-converter.php';
961
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-website-converter.php';
956
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/intf-wordlift-post-converter.php';
957
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-abstract-post-to-jsonld-converter.php';
958
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-postid-to-jsonld-converter.php';
959
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-post-to-jsonld-converter.php';
960
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-to-jsonld-converter.php';
961
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-website-converter.php';
962 962
 
963 963
 		/**
964 964
 		 * Load cache-related files.
965 965
 		 */
966
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/cache/require.php';
966
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/cache/require.php';
967 967
 
968 968
 		/**
969 969
 		 * Load the content filter.
970 970
 		 */
971
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-content-filter-service.php';
971
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-content-filter-service.php';
972 972
 
973 973
 		/*
974 974
 		 * Load the excerpt helper.
975 975
 		 */
976
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-excerpt-helper.php';
976
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-excerpt-helper.php';
977 977
 
978 978
 		/**
979 979
 		 * Load the JSON-LD service to publish entities using JSON-LD.s
980 980
 		 *
981 981
 		 * @since 3.8.0
982 982
 		 */
983
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-jsonld-service.php';
983
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-jsonld-service.php';
984 984
 
985 985
 		// The Publisher Service and the AJAX adapter.
986
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-service.php';
987
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-publisher-ajax-adapter.php';
986
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-service.php';
987
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-publisher-ajax-adapter.php';
988 988
 
989
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-post-adapter.php';
989
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-post-adapter.php';
990 990
 
991 991
 		/**
992 992
 		 * Load the WordLift key validation service.
993 993
 		 */
994
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-key-validation-service.php';
994
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-key-validation-service.php';
995 995
 
996 996
 		// Load the `Wordlift_Category_Taxonomy_Service` class definition.
997
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-category-taxonomy-service.php';
997
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-category-taxonomy-service.php';
998 998
 
999 999
 		// Load the `Wordlift_Entity_Page_Service` class definition.
1000
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-page-service.php';
1000
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-page-service.php';
1001 1001
 
1002 1002
 		/** Linked Data. */
1003
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage.php';
1004
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
1005
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-property-storage.php';
1006
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
1007
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
1008
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-author-storage.php';
1009
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
1010
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-image-storage.php';
1011
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-post-related-storage.php';
1012
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-url-property-storage.php';
1013
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/storage/class-wordlift-storage-factory.php';
1003
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage.php';
1004
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-storage.php';
1005
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-property-storage.php';
1006
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-taxonomy-storage.php';
1007
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-schema-class-storage.php';
1008
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-author-storage.php';
1009
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-meta-uri-storage.php';
1010
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-image-storage.php';
1011
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-post-related-storage.php';
1012
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-url-property-storage.php';
1013
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/storage/class-wordlift-storage-factory.php';
1014 1014
 
1015 1015
 		/** Linked Data Rendition. */
1016
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
1017
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
1018
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
1019
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
1016
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/intf-wordlift-sparql-tuple-rendition.php';
1017
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-default-sparql-tuple-rendition.php';
1018
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-address-sparql-tuple-rendition.php';
1019
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/linked-data/rendition/class-wordlift-sparql-tuple-rendition-factory.php';
1020 1020
 
1021 1021
 		/** Services. */
1022
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-google-analytics-export-service.php';
1023
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-api-service.php';
1022
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-google-analytics-export-service.php';
1023
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-api-service.php';
1024 1024
 
1025 1025
 		/** Adapters. */
1026
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-tinymce-adapter.php';
1027
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-newrelic-adapter.php';
1028
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-sample-data-ajax-adapter.php';
1029
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-entity-type-adapter.php';
1030
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-wprocket-adapter.php';
1026
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-tinymce-adapter.php';
1027
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-newrelic-adapter.php';
1028
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-sample-data-ajax-adapter.php';
1029
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-entity-type-adapter.php';
1030
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-wprocket-adapter.php';
1031 1031
 
1032 1032
 		/** Async Tasks. */
1033
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-async-task.php';
1034
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
1035
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/wp-async-task/class-wordlift-push-references-async-task.php';
1033
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-async-task.php';
1034
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-sparql-query-async-task.php';
1035
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/wp-async-task/class-wordlift-push-references-async-task.php';
1036 1036
 
1037 1037
 		/** Autocomplete. */
1038
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-autocomplete-adapter.php';
1038
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-autocomplete-adapter.php';
1039 1039
 
1040
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-remote-image-service.php';
1040
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-remote-image-service.php';
1041 1041
 
1042 1042
 		/** Analytics */
1043
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/analytics/class-wordlift-analytics-connect.php';
1043
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/analytics/class-wordlift-analytics-connect.php';
1044 1044
 
1045 1045
 		/**
1046 1046
 		 * The class responsible for defining all actions that occur in the admin area.
1047 1047
 		 */
1048
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin.php';
1048
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin.php';
1049 1049
 
1050 1050
 		/**
1051 1051
 		 * The class to customize the entity list admin page.
1052 1052
 		 */
1053
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-list.php';
1053
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-list.php';
1054 1054
 
1055 1055
 		/**
1056 1056
 		 * The Entity Types Taxonomy Walker (transforms checkboxes into radios).
1057 1057
 		 */
1058 1058
 		global $wp_version;
1059
-		if ( version_compare( $wp_version, '5.3', '<' ) ) {
1060
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker.php';
1059
+		if (version_compare($wp_version, '5.3', '<')) {
1060
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker.php';
1061 1061
 		} else {
1062
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
1062
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-types-taxonomy-walker-5-3.php';
1063 1063
 		}
1064 1064
 
1065 1065
 		/**
1066 1066
 		 * The Notice service.
1067 1067
 		 */
1068
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-notice-service.php';
1068
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-notice-service.php';
1069 1069
 
1070 1070
 		/**
1071 1071
 		 * The PrimaShop adapter.
1072 1072
 		 */
1073
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-primashop-adapter.php';
1073
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-primashop-adapter.php';
1074 1074
 
1075 1075
 		/**
1076 1076
 		 * The WordLift Dashboard service.
1077 1077
 		 */
1078
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-dashboard.php';
1078
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-dashboard.php';
1079 1079
 
1080 1080
 		/**
1081 1081
 		 * The admin 'Install wizard' page.
1082 1082
 		 */
1083
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-setup.php';
1083
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-setup.php';
1084 1084
 
1085 1085
 		/**
1086 1086
 		 * The WordLift entity type list admin page controller.
1087 1087
 		 */
1088
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1088
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-entity-taxonomy-list-page.php';
1089 1089
 
1090 1090
 		/**
1091 1091
 		 * The WordLift entity type settings admin page controller.
1092 1092
 		 */
1093
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-settings.php';
1093
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-settings.php';
1094 1094
 
1095 1095
 		/**
1096 1096
 		 * The admin 'Download Your Data' page.
1097 1097
 		 */
1098
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-download-your-data-page.php';
1098
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-download-your-data-page.php';
1099 1099
 
1100 1100
 		/**
1101 1101
 		 * The admin 'WordLift Settings' page.
1102 1102
 		 */
1103
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/intf-wordlift-admin-element.php';
1104
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-element.php';
1105
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-input-radio-element.php';
1106
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select-element.php';
1107
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-select2-element.php';
1108
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-language-select-element.php';
1109
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-country-select-element.php';
1110
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-tabs-element.php';
1111
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-author-element.php';
1112
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/elements/class-wordlift-admin-publisher-element.php';
1113
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-page.php';
1114
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page.php';
1115
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page.php';
1116
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-page-action-link.php';
1117
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
1103
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/intf-wordlift-admin-element.php';
1104
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-element.php';
1105
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-input-radio-element.php';
1106
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select-element.php';
1107
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-select2-element.php';
1108
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-language-select-element.php';
1109
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-country-select-element.php';
1110
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-tabs-element.php';
1111
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-author-element.php';
1112
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/elements/class-wordlift-admin-publisher-element.php';
1113
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-page.php';
1114
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page.php';
1115
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page.php';
1116
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-page-action-link.php';
1117
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-settings-analytics-page-action-link.php';
1118 1118
 
1119 1119
 		/** Admin Pages */
1120
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-user-profile-page.php';
1121
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-status-page.php';
1122
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-entity-type-admin-service.php';
1120
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-user-profile-page.php';
1121
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-status-page.php';
1122
+		require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-entity-type-admin-service.php';
1123 1123
 
1124 1124
 		/**
1125 1125
 		 * The class responsible for defining all actions that occur in the public-facing
1126 1126
 		 * side of the site.
1127 1127
 		 */
1128
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-public.php';
1128
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-public.php';
1129 1129
 
1130 1130
 		/**
1131 1131
 		 * The shortcode abstract class.
1132 1132
 		 */
1133
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-shortcode.php';
1133
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-shortcode.php';
1134 1134
 
1135 1135
 		/**
1136 1136
 		 * The Timeline shortcode.
1137 1137
 		 */
1138
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-timeline-shortcode.php';
1138
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-timeline-shortcode.php';
1139 1139
 
1140 1140
 		/**
1141 1141
 		 * The Navigator shortcode.
1142 1142
 		 */
1143
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-navigator-shortcode.php';
1143
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-navigator-shortcode.php';
1144 1144
 
1145 1145
 		/**
1146 1146
 		 * The Products Navigator shortcode.
1147 1147
 		 */
1148
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-products-navigator-shortcode.php';
1148
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-products-navigator-shortcode.php';
1149 1149
 
1150 1150
 		/**
1151 1151
 		 * The chord shortcode.
1152 1152
 		 */
1153
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-chord-shortcode.php';
1153
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-chord-shortcode.php';
1154 1154
 
1155 1155
 		/**
1156 1156
 		 * The geomap shortcode.
1157 1157
 		 */
1158
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-geomap-shortcode.php';
1158
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-geomap-shortcode.php';
1159 1159
 
1160 1160
 		/**
1161 1161
 		 * The entity cloud shortcode.
1162 1162
 		 */
1163
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-shortcode.php';
1163
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-shortcode.php';
1164 1164
 
1165 1165
 		/**
1166 1166
 		 * The entity glossary shortcode.
1167 1167
 		 */
1168
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-alphabet-service.php';
1169
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-vocabulary-shortcode.php';
1168
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-alphabet-service.php';
1169
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-vocabulary-shortcode.php';
1170 1170
 
1171 1171
 		/**
1172 1172
 		 * Faceted Search shortcode.
1173 1173
 		 */
1174
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-faceted-search-shortcode.php';
1174
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-faceted-search-shortcode.php';
1175 1175
 
1176 1176
 		/**
1177 1177
 		 * The ShareThis service.
1178 1178
 		 */
1179
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-sharethis-service.php';
1179
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-sharethis-service.php';
1180 1180
 
1181 1181
 		/**
1182 1182
 		 * The SEO service.
1183 1183
 		 */
1184
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-seo-service.php';
1184
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-seo-service.php';
1185 1185
 
1186 1186
 		/**
1187 1187
 		 * The AMP service.
1188 1188
 		 */
1189
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-amp-service.php';
1189
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-amp-service.php';
1190 1190
 
1191 1191
 		/** Widgets */
1192
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-widget.php';
1193
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-related-entities-cloud-widget.php';
1194
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-context-cards.php';
1192
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-widget.php';
1193
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-related-entities-cloud-widget.php';
1194
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-context-cards.php';
1195 1195
 
1196 1196
 		/*
1197 1197
 		 * Schema.org Services.
1198 1198
 		 *
1199 1199
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1200 1200
 		 */
1201
-		if ( WL_ALL_ENTITY_TYPES ) {
1202
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1203
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1204
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1201
+		if (WL_ALL_ENTITY_TYPES) {
1202
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-sync-service.php';
1203
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-property-service.php';
1204
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/schemaorg/class-wordlift-schemaorg-class-service.php';
1205 1205
 			new Wordlift_Schemaorg_Sync_Service();
1206 1206
 			$schemaorg_property_service = new Wordlift_Schemaorg_Property_Service();
1207 1207
 			new Wordlift_Schemaorg_Class_Service();
@@ -1217,25 +1217,25 @@  discard block
 block discarded – undo
1217 1217
 
1218 1218
 		// Instantiate a global logger.
1219 1219
 		global $wl_logger;
1220
-		$wl_logger = Wordlift_Log_Service::get_logger( 'WordLift' );
1220
+		$wl_logger = Wordlift_Log_Service::get_logger('WordLift');
1221 1221
 
1222 1222
 		// Load the `wl-api` end-point.
1223 1223
 		new Wordlift_Http_Api();
1224 1224
 
1225 1225
 		// Load the Install Service.
1226
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'install/class-wordlift-install-service.php';
1226
+		require_once plugin_dir_path(dirname(__FILE__)).'install/class-wordlift-install-service.php';
1227 1227
 		$this->install_service = new Wordlift_Install_Service();
1228 1228
 
1229 1229
 		/** Services. */
1230 1230
 		// Create the configuration service.
1231 1231
 		$this->configuration_service = new Wordlift_Configuration_Service();
1232
-		$api_service                 = new Wordlift_Api_Service( $this->configuration_service );
1232
+		$api_service                 = new Wordlift_Api_Service($this->configuration_service);
1233 1233
 
1234 1234
 		// Create an entity type service instance. It'll be later bound to the init action.
1235
-		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service( Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path() );
1235
+		$this->entity_post_type_service = new Wordlift_Entity_Post_Type_Service(Wordlift_Entity_Service::TYPE_NAME, $this->configuration_service->get_entity_base_path());
1236 1236
 
1237 1237
 		// Create an entity link service instance. It'll be later bound to the post_type_link and pre_get_posts actions.
1238
-		$this->entity_link_service = new Wordlift_Entity_Link_Service( $this->entity_post_type_service, $this->configuration_service->get_entity_base_path() );
1238
+		$this->entity_link_service = new Wordlift_Entity_Link_Service($this->entity_post_type_service, $this->configuration_service->get_entity_base_path());
1239 1239
 
1240 1240
 		// Create an instance of the UI service.
1241 1241
 		$this->ui_service = new Wordlift_UI_Service();
@@ -1244,30 +1244,30 @@  discard block
 block discarded – undo
1244 1244
 		$this->thumbnail_service = new Wordlift_Thumbnail_Service();
1245 1245
 
1246 1246
 		$this->sparql_service        = new Wordlift_Sparql_Service();
1247
-		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service( $this->sparql_service );
1247
+		$schema_url_property_service = new Wordlift_Schema_Url_Property_Service($this->sparql_service);
1248 1248
 		$this->notice_service        = new Wordlift_Notice_Service();
1249 1249
 		$this->relation_service      = new Wordlift_Relation_Service();
1250 1250
 
1251
-		$entity_uri_cache_service = new Wordlift_File_Cache_Service( WL_TEMP_DIR . 'entity_uri/' );
1252
-		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service( $this->configuration_service, $entity_uri_cache_service );
1253
-		$this->entity_service     = new Wordlift_Entity_Service( $this->ui_service, $this->relation_service, $this->entity_uri_service );
1254
-		$this->user_service       = new Wordlift_User_Service( $this->sparql_service, $this->entity_service );
1251
+		$entity_uri_cache_service = new Wordlift_File_Cache_Service(WL_TEMP_DIR.'entity_uri/');
1252
+		$this->entity_uri_service = new Wordlift_Cached_Entity_Uri_Service($this->configuration_service, $entity_uri_cache_service);
1253
+		$this->entity_service     = new Wordlift_Entity_Service($this->ui_service, $this->relation_service, $this->entity_uri_service);
1254
+		$this->user_service       = new Wordlift_User_Service($this->sparql_service, $this->entity_service);
1255 1255
 
1256 1256
 		// Instantiate the JSON-LD service.
1257
-		$property_getter = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1257
+		$property_getter = Wordlift_Property_Getter_Factory::create($this->entity_service);
1258 1258
 
1259 1259
 		/** Linked Data. */
1260
-		$this->storage_factory   = new Wordlift_Storage_Factory( $this->entity_service, $this->user_service, $property_getter );
1261
-		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory( $this->entity_service );
1260
+		$this->storage_factory   = new Wordlift_Storage_Factory($this->entity_service, $this->user_service, $property_getter);
1261
+		$this->rendition_factory = new Wordlift_Sparql_Tuple_Rendition_Factory($this->entity_service);
1262 1262
 
1263
-		$this->schema_service = new Wordlift_Schema_Service( $this->storage_factory, $this->rendition_factory, $this->configuration_service );
1263
+		$this->schema_service = new Wordlift_Schema_Service($this->storage_factory, $this->rendition_factory, $this->configuration_service);
1264 1264
 
1265 1265
 		// Create a new instance of the Redirect service.
1266
-		$this->redirect_service    = new Wordlift_Redirect_Service( $this->entity_uri_service );
1267
-		$this->entity_type_service = new Wordlift_Entity_Type_Service( $this->schema_service );
1266
+		$this->redirect_service    = new Wordlift_Redirect_Service($this->entity_uri_service);
1267
+		$this->entity_type_service = new Wordlift_Entity_Type_Service($this->schema_service);
1268 1268
 
1269 1269
 		// Create a new instance of the Timeline service and Timeline shortcode.
1270
-		$this->timeline_service = new Wordlift_Timeline_Service( $this->entity_service, $this->entity_type_service );
1270
+		$this->timeline_service = new Wordlift_Timeline_Service($this->entity_service, $this->entity_type_service);
1271 1271
 
1272 1272
 		$this->entity_types_taxonomy_walker = new Wordlift_Entity_Types_Taxonomy_Walker();
1273 1273
 
@@ -1281,35 +1281,35 @@  discard block
 block discarded – undo
1281 1281
 		$this->primashop_adapter = new Wordlift_PrimaShop_Adapter();
1282 1282
 
1283 1283
 		// Create an import service instance to hook later to WP's import function.
1284
-		$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() );
1284
+		$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());
1285 1285
 
1286
-		$uri_service = new Wordlift_Uri_Service( $GLOBALS['wpdb'] );
1286
+		$uri_service = new Wordlift_Uri_Service($GLOBALS['wpdb']);
1287 1287
 
1288 1288
 		// Create the entity rating service.
1289
-		$this->rating_service = new Wordlift_Rating_Service( $this->entity_service, $this->entity_type_service, $this->notice_service );
1289
+		$this->rating_service = new Wordlift_Rating_Service($this->entity_service, $this->entity_type_service, $this->notice_service);
1290 1290
 
1291 1291
 		// Create entity list customization (wp-admin/edit.php).
1292
-		$this->entity_list_service = new Wordlift_Entity_List_Service( $this->rating_service );
1292
+		$this->entity_list_service = new Wordlift_Entity_List_Service($this->rating_service);
1293 1293
 
1294 1294
 		// Create a new instance of the Redirect service.
1295
-		$this->dashboard_service = new Wordlift_Dashboard_Service( $this->rating_service, $this->entity_service );
1295
+		$this->dashboard_service = new Wordlift_Dashboard_Service($this->rating_service, $this->entity_service);
1296 1296
 
1297 1297
 		// Create an instance of the Publisher Service and the AJAX Adapter.
1298
-		$this->publisher_service = new Wordlift_Publisher_Service( $this->configuration_service );
1299
-		$this->property_factory  = new Wordlift_Property_Factory( $schema_url_property_service );
1300
-		$this->property_factory->register( Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service );
1298
+		$this->publisher_service = new Wordlift_Publisher_Service($this->configuration_service);
1299
+		$this->property_factory  = new Wordlift_Property_Factory($schema_url_property_service);
1300
+		$this->property_factory->register(Wordlift_Schema_Url_Property_Service::META_KEY, $schema_url_property_service);
1301 1301
 
1302 1302
 		$attachment_service = new Wordlift_Attachment_Service();
1303 1303
 
1304 1304
 		// Instantiate the JSON-LD service.
1305
-		$property_getter                       = Wordlift_Property_Getter_Factory::create( $this->entity_service );
1306
-		$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 );
1307
-		$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, $this->post_to_jsonld_converter );
1308
-		$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 );
1309
-		$this->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter( $this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service );
1310
-
1311
-		$jsonld_cache                            = new Ttl_Cache( 'jsonld', 86400 );
1312
-		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter( $this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache );
1305
+		$property_getter                       = Wordlift_Property_Getter_Factory::create($this->entity_service);
1306
+		$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);
1307
+		$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, $this->post_to_jsonld_converter);
1308
+		$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);
1309
+		$this->jsonld_website_converter        = new Wordlift_Website_Jsonld_Converter($this->entity_type_service, $this->entity_service, $this->user_service, $attachment_service, $this->configuration_service);
1310
+
1311
+		$jsonld_cache                            = new Ttl_Cache('jsonld', 86400);
1312
+		$this->cached_postid_to_jsonld_converter = new Wordlift_Cached_Post_Converter($this->postid_to_jsonld_converter, $this->configuration_service, $jsonld_cache);
1313 1313
 		/*
1314 1314
 		 * Load the `Wordlift_Term_JsonLd_Adapter`.
1315 1315
 		 *
@@ -1317,33 +1317,33 @@  discard block
 block discarded – undo
1317 1317
 		 *
1318 1318
 		 * @since 3.20.0
1319 1319
 		 */
1320
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-wordlift-term-jsonld-adapter.php';
1320
+		require_once plugin_dir_path(dirname(__FILE__)).'public/class-wordlift-term-jsonld-adapter.php';
1321 1321
 
1322
-		$term_jsonld_adapter  = new Wordlift_Term_JsonLd_Adapter( $this->entity_uri_service, $this->cached_postid_to_jsonld_converter );
1323
-		$this->jsonld_service = new Wordlift_Jsonld_Service( $this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter, $term_jsonld_adapter );
1322
+		$term_jsonld_adapter  = new Wordlift_Term_JsonLd_Adapter($this->entity_uri_service, $this->cached_postid_to_jsonld_converter);
1323
+		$this->jsonld_service = new Wordlift_Jsonld_Service($this->entity_service, $this->cached_postid_to_jsonld_converter, $this->jsonld_website_converter, $term_jsonld_adapter);
1324 1324
 
1325 1325
 		$jsonld_service = new Jsonld_Service(
1326 1326
 			$this->jsonld_service,
1327 1327
 			$term_jsonld_adapter,
1328
-			new Jsonld_User_Service( $this->user_service ) );
1329
-		new Jsonld_Endpoint( $jsonld_service, $this->entity_uri_service );
1328
+			new Jsonld_User_Service($this->user_service) );
1329
+		new Jsonld_Endpoint($jsonld_service, $this->entity_uri_service);
1330 1330
 
1331 1331
 		// Prints the JSON-LD in the head.
1332
-		new Jsonld_Adapter( $this->jsonld_service );
1332
+		new Jsonld_Adapter($this->jsonld_service);
1333 1333
 
1334
-		new Jsonld_By_Id_Endpoint( $this->jsonld_service, $this->entity_uri_service );
1334
+		new Jsonld_By_Id_Endpoint($this->jsonld_service, $this->entity_uri_service);
1335 1335
 
1336
-		$this->key_validation_service = new Wordlift_Key_Validation_Service( $this->configuration_service );
1337
-		$this->content_filter_service = new Wordlift_Content_Filter_Service( $this->entity_service, $this->configuration_service, $this->entity_uri_service );
1336
+		$this->key_validation_service = new Wordlift_Key_Validation_Service($this->configuration_service);
1337
+		$this->content_filter_service = new Wordlift_Content_Filter_Service($this->entity_service, $this->configuration_service, $this->entity_uri_service);
1338 1338
 		// Creating Faq Content filter service.
1339 1339
 		$this->faq_content_filter_service = new Faq_Content_Filter();
1340
-		$this->relation_rebuild_service   = new Wordlift_Relation_Rebuild_Service( $this->content_filter_service, $this->entity_service );
1341
-		$this->sample_data_service        = new Wordlift_Sample_Data_Service( $this->entity_type_service, $this->configuration_service, $this->user_service );
1342
-		$this->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter( $this->sample_data_service );
1343
-		$this->reference_rebuild_service  = new Wordlift_Reference_Rebuild_Service( $this->entity_service );
1340
+		$this->relation_rebuild_service   = new Wordlift_Relation_Rebuild_Service($this->content_filter_service, $this->entity_service);
1341
+		$this->sample_data_service        = new Wordlift_Sample_Data_Service($this->entity_type_service, $this->configuration_service, $this->user_service);
1342
+		$this->sample_data_ajax_adapter   = new Wordlift_Sample_Data_Ajax_Adapter($this->sample_data_service);
1343
+		$this->reference_rebuild_service  = new Wordlift_Reference_Rebuild_Service($this->entity_service);
1344 1344
 
1345
-		$this->loader->add_action( 'enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks' );
1346
-		$this->loader->add_action( 'admin_enqueue_scripts', $this, 'add_wl_enabled_blocks' );
1345
+		$this->loader->add_action('enqueue_block_editor_assets', $this, 'add_wl_enabled_blocks');
1346
+		$this->loader->add_action('admin_enqueue_scripts', $this, 'add_wl_enabled_blocks');
1347 1347
 
1348 1348
 		/**
1349 1349
 		 * Filter: wl_feature__enable__blocks.
@@ -1353,15 +1353,15 @@  discard block
 block discarded – undo
1353 1353
 		 * @return bool
1354 1354
 		 * @since 3.27.6
1355 1355
 		 */
1356
-		if ( apply_filters( 'wl_feature__enable__blocks', true ) ) {
1356
+		if (apply_filters('wl_feature__enable__blocks', true)) {
1357 1357
 			// Initialize the short-codes.
1358
-			new Async_Template_Decorator( new Wordlift_Navigator_Shortcode() );
1358
+			new Async_Template_Decorator(new Wordlift_Navigator_Shortcode());
1359 1359
 			new Wordlift_Chord_Shortcode();
1360 1360
 			new Wordlift_Geomap_Shortcode();
1361 1361
 			new Wordlift_Timeline_Shortcode();
1362
-			new Wordlift_Related_Entities_Cloud_Shortcode( $this->relation_service, $this->entity_service );
1363
-			new Wordlift_Vocabulary_Shortcode( $this->configuration_service );
1364
-			new Async_Template_Decorator( new Wordlift_Faceted_Search_Shortcode() );
1362
+			new Wordlift_Related_Entities_Cloud_Shortcode($this->relation_service, $this->entity_service);
1363
+			new Wordlift_Vocabulary_Shortcode($this->configuration_service);
1364
+			new Async_Template_Decorator(new Wordlift_Faceted_Search_Shortcode());
1365 1365
 		}
1366 1366
 
1367 1367
 		new Wordlift_Products_Navigator_Shortcode();
@@ -1374,18 +1374,18 @@  discard block
 block discarded – undo
1374 1374
 		new Wordlift_Seo_Service();
1375 1375
 
1376 1376
 		// Initialize the AMP service.
1377
-		new Wordlift_AMP_Service( $this->jsonld_service );
1377
+		new Wordlift_AMP_Service($this->jsonld_service);
1378 1378
 
1379 1379
 		/** Services. */
1380 1380
 		$this->google_analytics_export_service = new Wordlift_Google_Analytics_Export_Service();
1381 1381
 		new Wordlift_Image_Service();
1382 1382
 
1383 1383
 		/** Adapters. */
1384
-		$this->entity_type_adapter    = new Wordlift_Entity_Type_Adapter( $this->entity_type_service );
1385
-		$this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter( $this->publisher_service );
1386
-		$this->tinymce_adapter        = new Wordlift_Tinymce_Adapter( $this );
1384
+		$this->entity_type_adapter    = new Wordlift_Entity_Type_Adapter($this->entity_type_service);
1385
+		$this->publisher_ajax_adapter = new Wordlift_Publisher_Ajax_Adapter($this->publisher_service);
1386
+		$this->tinymce_adapter        = new Wordlift_Tinymce_Adapter($this);
1387 1387
 		//$this->faq_tinymce_adapter      = new Faq_Tinymce_Adapter();
1388
-		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter( $this->relation_rebuild_service );
1388
+		$this->relation_rebuild_adapter = new Wordlift_Relation_Rebuild_Adapter($this->relation_rebuild_service);
1389 1389
 
1390 1390
 		/*
1391 1391
 		 * Exclude our public js from WP-Rocket.
@@ -1403,9 +1403,9 @@  discard block
 block discarded – undo
1403 1403
 		);
1404 1404
 
1405 1405
 		$that = $this;
1406
-		add_action( 'plugins_loaded', function () use ( $that ) {
1407
-			if ( ! apply_filters( 'wl_feature__enable__dataset-ng', false ) ) {
1408
-				new Wordlift_Linked_Data_Service( $that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service );
1406
+		add_action('plugins_loaded', function() use ($that) {
1407
+			if ( ! apply_filters('wl_feature__enable__dataset-ng', false)) {
1408
+				new Wordlift_Linked_Data_Service($that->entity_service, $that->entity_type_service, $that->schema_service, $that->sparql_service);
1409 1409
 				new Wordlift_Sparql_Query_Async_Task();
1410 1410
 				new Wordlift_Push_References_Async_Task();
1411 1411
 			}
@@ -1420,14 +1420,14 @@  discard block
 block discarded – undo
1420 1420
 		$this->language_select_element = new Wordlift_Admin_Language_Select_Element();
1421 1421
 		$this->country_select_element  = new Wordlift_Admin_Country_Select_Element();
1422 1422
 		$tabs_element                  = new Wordlift_Admin_Tabs_Element();
1423
-		$this->publisher_element       = new Wordlift_Admin_Publisher_Element( $this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element );
1424
-		$this->author_element          = new Wordlift_Admin_Author_Element( $this->publisher_service, $this->select2_element );
1423
+		$this->publisher_element       = new Wordlift_Admin_Publisher_Element($this->configuration_service, $this->publisher_service, $tabs_element, $this->select2_element);
1424
+		$this->author_element          = new Wordlift_Admin_Author_Element($this->publisher_service, $this->select2_element);
1425 1425
 
1426
-		$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 );
1427
-		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link( $this->settings_page );
1426
+		$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);
1427
+		$this->settings_page_action_link = new Wordlift_Admin_Settings_Page_Action_Link($this->settings_page);
1428 1428
 
1429
-		$this->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page( $this->configuration_service, $this->input_element, $this->radio_input_element );
1430
-		$this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link( $this->analytics_settings_page );
1429
+		$this->analytics_settings_page             = new Wordlift_Admin_Settings_Analytics_Page($this->configuration_service, $this->input_element, $this->radio_input_element);
1430
+		$this->analytics_settings_page_action_link = new Wordlift_Admin_Settings_Analytics_Page_Action_Link($this->analytics_settings_page);
1431 1431
 		$this->analytics_connect                   = new Wordlift_Analytics_Connect();
1432 1432
 
1433 1433
 		// Pages.
@@ -1438,9 +1438,9 @@  discard block
 block discarded – undo
1438 1438
 		 *
1439 1439
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/914
1440 1440
 		 */
1441
-		if ( apply_filters( 'wl_can_see_classification_box', true ) ) {
1442
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-wordlift-admin-post-edit-page.php';
1443
-			new Wordlift_Admin_Post_Edit_Page( $this );
1441
+		if (apply_filters('wl_can_see_classification_box', true)) {
1442
+			require_once plugin_dir_path(dirname(__FILE__)).'admin/class-wordlift-admin-post-edit-page.php';
1443
+			new Wordlift_Admin_Post_Edit_Page($this);
1444 1444
 		}
1445 1445
 		new Wordlift_Entity_Type_Admin_Service();
1446 1446
 
@@ -1454,23 +1454,23 @@  discard block
 block discarded – undo
1454 1454
 		$this->related_entities_cloud_widget = new Wordlift_Related_Entities_Cloud_Widget();
1455 1455
 
1456 1456
 		/* WordPress Admin. */
1457
-		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page( $this->configuration_service );
1458
-		$this->status_page             = new Wordlift_Admin_Status_Page( $this->entity_service, $this->sparql_service );
1457
+		$this->download_your_data_page = new Wordlift_Admin_Download_Your_Data_Page($this->configuration_service);
1458
+		$this->status_page             = new Wordlift_Admin_Status_Page($this->entity_service, $this->sparql_service);
1459 1459
 
1460 1460
 		// Create an instance of the install wizard.
1461
-		$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 );
1461
+		$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);
1462 1462
 
1463
-		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service( $this->entity_post_type_service );
1463
+		$this->category_taxonomy_service = new Wordlift_Category_Taxonomy_Service($this->entity_post_type_service);
1464 1464
 
1465 1465
 		// User Profile.
1466
-		new Wordlift_Admin_User_Profile_Page( $this->author_element, $this->user_service );
1466
+		new Wordlift_Admin_User_Profile_Page($this->author_element, $this->user_service);
1467 1467
 
1468 1468
 		$this->entity_page_service = new Wordlift_Entity_Page_Service();
1469 1469
 
1470 1470
 		// Load the debug service if WP is in debug mode.
1471
-		if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
1472
-			require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-debug-service.php';
1473
-			new Wordlift_Debug_Service( $this->entity_service, $uri_service );
1471
+		if (defined('WP_DEBUG') && WP_DEBUG) {
1472
+			require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-debug-service.php';
1473
+			new Wordlift_Debug_Service($this->entity_service, $uri_service);
1474 1474
 		}
1475 1475
 
1476 1476
 		// Remote Image Service.
@@ -1483,12 +1483,12 @@  discard block
 block discarded – undo
1483 1483
 		 *
1484 1484
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/852.
1485 1485
 		 */
1486
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-wordlift-batch-action.php';
1487
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-service.php';
1488
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1486
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/class-wordlift-batch-action.php';
1487
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-service.php';
1488
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/mapping/class-wordlift-mapping-ajax-adapter.php';
1489 1489
 
1490 1490
 		// Create an instance of the Mapping Service and assign it to the Ajax Adapter.
1491
-		new Wordlift_Mapping_Ajax_Adapter( new Wordlift_Mapping_Service( Wordlift_Entity_Type_Service::get_instance() ) );
1491
+		new Wordlift_Mapping_Ajax_Adapter(new Wordlift_Mapping_Service(Wordlift_Entity_Type_Service::get_instance()));
1492 1492
 
1493 1493
 		/*
1494 1494
 		 * Batch Operations. They're similar to Batch Actions but do not require working on post types.
@@ -1497,8 +1497,8 @@  discard block
 block discarded – undo
1497 1497
 		 *
1498 1498
 		 * @since 3.20.0
1499 1499
 		 */
1500
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/intf-wordlift-batch-operation.php';
1501
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1500
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/intf-wordlift-batch-operation.php';
1501
+		require_once plugin_dir_path(dirname(__FILE__)).'includes/batch/class-wordlift-batch-operation-ajax-adapter.php';
1502 1502
 		/*
1503 1503
 		 * Load the Mappings JSON-LD post processing.
1504 1504
 		 *
@@ -1511,11 +1511,11 @@  discard block
 block discarded – undo
1511 1511
 		// Taxonomy term rule validator for validating rules for term pages.
1512 1512
 		new Taxonomy_Term_Rule_Validator();
1513 1513
 		new Post_Taxonomy_Term_Rule_Validator();
1514
-		$rule_validators_registry = new Rule_Validators_Registry( $default_rule_validator );
1515
-		$rule_groups_validator    = new Rule_Groups_Validator( $rule_validators_registry );
1516
-		$mappings_validator       = new Mappings_Validator( $mappings_dbo, $rule_groups_validator );
1514
+		$rule_validators_registry = new Rule_Validators_Registry($default_rule_validator);
1515
+		$rule_groups_validator    = new Rule_Groups_Validator($rule_validators_registry);
1516
+		$mappings_validator       = new Mappings_Validator($mappings_dbo, $rule_groups_validator);
1517 1517
 
1518
-		new Url_To_Entity_Transform_Function( $this->entity_uri_service );
1518
+		new Url_To_Entity_Transform_Function($this->entity_uri_service);
1519 1519
 		new Taxonomy_To_Terms_Transform_Function();
1520 1520
 		new Post_Id_To_Entity_Transform_Function();
1521 1521
 		$mappings_transform_functions_registry = new Mappings_Transform_Functions_Registry();
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
 		 * Intiailize the acf group data formatter.
1526 1526
 		 */
1527 1527
 		new Acf_Group_Formatter();
1528
-		new Jsonld_Converter( $mappings_validator, $mappings_transform_functions_registry );
1528
+		new Jsonld_Converter($mappings_validator, $mappings_transform_functions_registry);
1529 1529
 
1530 1530
 		/**
1531 1531
 		 * @since 3.26.0
@@ -1546,7 +1546,7 @@  discard block
 block discarded – undo
1546 1546
 		/*
1547 1547
 		 * Create a singleton for the Analysis_Response_Ops_Factory.
1548 1548
 		 */
1549
-		$entity_helper = new Entity_Helper( $this->entity_uri_service, $this->entity_service );
1549
+		$entity_helper = new Entity_Helper($this->entity_uri_service, $this->entity_service);
1550 1550
 		/**
1551 1551
 		 * @since 3.32.0
1552 1552
 		 * Initialize a local entity provider which acts as an abstraction layer
@@ -1559,8 +1559,8 @@  discard block
 block discarded – undo
1559 1559
 		 * The post entity provider has the legacy code which provides the entity
1560 1560
 		 * if the object is post {@link \Wordlift\Object_Type_Enum::POST}
1561 1561
 		 */
1562
-		new Post_Entity_Provider( $this->entity_uri_service,
1563
-			$this->entity_type_service, $this->storage_factory->post_images() );
1562
+		new Post_Entity_Provider($this->entity_uri_service,
1563
+			$this->entity_type_service, $this->storage_factory->post_images());
1564 1564
 		/**
1565 1565
 		 * @since 3.32.0
1566 1566
 		 * The term entity provider provides the entity
@@ -1575,11 +1575,11 @@  discard block
 block discarded – undo
1575 1575
 		);
1576 1576
 
1577 1577
 		/** WL Autocomplete. */
1578
-		$autocomplete_service       = new All_Autocomplete_Service( array(
1578
+		$autocomplete_service = new All_Autocomplete_Service(array(
1579 1579
 			new Local_Autocomplete_Service(),
1580
-			new Linked_Data_Autocomplete_Service( $this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service ),
1581
-		) );
1582
-		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter( $autocomplete_service );
1580
+			new Linked_Data_Autocomplete_Service($this->configuration_service, $entity_helper, $this->entity_uri_service, $this->entity_service),
1581
+		));
1582
+		$this->autocomplete_adapter = new Wordlift_Autocomplete_Adapter($autocomplete_service);
1583 1583
 
1584 1584
 		/**
1585 1585
 		 * @since 3.27.2
@@ -1588,10 +1588,10 @@  discard block
 block discarded – undo
1588 1588
 		 */
1589 1589
 		new Recipe_Maker_Post_Type_Hook();
1590 1590
 		$recipe_maker_validation_service = new Recipe_Maker_Validation_Service();
1591
-		new Recipe_Maker_Jsonld_Hook( $attachment_service, $recipe_maker_validation_service );
1592
-		new Recipe_Maker_After_Get_Jsonld_Hook( $recipe_maker_validation_service );
1593
-		new Recipe_Maker_Warning( $recipe_maker_validation_service );
1594
-		new Yoast_Jsonld( $recipe_maker_validation_service );
1591
+		new Recipe_Maker_Jsonld_Hook($attachment_service, $recipe_maker_validation_service);
1592
+		new Recipe_Maker_After_Get_Jsonld_Hook($recipe_maker_validation_service);
1593
+		new Recipe_Maker_Warning($recipe_maker_validation_service);
1594
+		new Yoast_Jsonld($recipe_maker_validation_service);
1595 1595
 
1596 1596
 		/**
1597 1597
 		 * @since 3.27.4
@@ -1608,7 +1608,7 @@  discard block
 block discarded – undo
1608 1608
 		 * @since 3.27.8
1609 1609
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/1248
1610 1610
 		 */
1611
-		new Key_Validation_Notice( $this->key_validation_service, $this->configuration_service );
1611
+		new Key_Validation_Notice($this->key_validation_service, $this->configuration_service);
1612 1612
 		/**
1613 1613
 		 * @since 3.28.0
1614 1614
 		 * @see https://github.com/insideout10/wordlift-plugin/issues?q=assignee%3Anaveen17797+is%3Aopen
@@ -1619,7 +1619,7 @@  discard block
 block discarded – undo
1619 1619
 		 * @since 3.29.0
1620 1620
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/1304
1621 1621
 		 */
1622
-		new Entity_Rest_Service( $this->entity_type_service );
1622
+		new Entity_Rest_Service($this->entity_type_service);
1623 1623
 
1624 1624
 		/**
1625 1625
 		 * Expand author in to references.
@@ -1627,13 +1627,13 @@  discard block
 block discarded – undo
1627 1627
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/1318
1628 1628
 		 */
1629 1629
 
1630
-		add_action( 'plugins_loaded', function () use ( $that ) {
1630
+		add_action('plugins_loaded', function() use ($that) {
1631 1631
 
1632
-			if ( apply_filters( 'wl_feature__enable__article-wrapper', false ) ) {
1633
-				new Jsonld_Article_Wrapper( Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter );
1632
+			if (apply_filters('wl_feature__enable__article-wrapper', false)) {
1633
+				new Jsonld_Article_Wrapper(Wordlift_Post_To_Jsonld_Converter::get_instance(), $that->cached_postid_to_jsonld_converter);
1634 1634
 			}
1635 1635
 
1636
-			if ( apply_filters( 'wl_feature__enable__match-terms', false ) ) {
1636
+			if (apply_filters('wl_feature__enable__match-terms', false)) {
1637 1637
 				$vocabulary_loader = new Vocabulary_Loader();
1638 1638
 				$vocabulary_loader->init_vocabulary();
1639 1639
 			}
@@ -1641,7 +1641,7 @@  discard block
 block discarded – undo
1641 1641
 			/**
1642 1642
 			 *Added for feature request 1496 (Webhooks)
1643 1643
 			 */
1644
-			if ( apply_filters( 'wl_feature__enable__webhooks', false ) ) {
1644
+			if (apply_filters('wl_feature__enable__webhooks', false)) {
1645 1645
 				$this->webhook_loader = new Webhooks_Loader();
1646 1646
 				$this->webhook_loader->init();
1647 1647
 			}
@@ -1665,7 +1665,7 @@  discard block
 block discarded – undo
1665 1665
 		 * @since 3.31.5
1666 1666
 		 * Create configuration endpoint for webapp to configure.
1667 1667
 		 */
1668
-		new Config( $this->admin_setup, $this->key_validation_service, $this->configuration_service );
1668
+		new Config($this->admin_setup, $this->key_validation_service, $this->configuration_service);
1669 1669
 		/**
1670 1670
 		 * @since 3.31.7
1671 1671
 		 * Remove duplicate videoobject.
@@ -1677,7 +1677,7 @@  discard block
 block discarded – undo
1677 1677
 		 * @since 3.32.0
1678 1678
 		 * Create loader for vocabulary terms.
1679 1679
 		 */
1680
-		$vocabulary_terms_loader = new Vocabulary_Terms_Loader( $this->entity_type_service, $property_getter );
1680
+		$vocabulary_terms_loader = new Vocabulary_Terms_Loader($this->entity_type_service, $property_getter);
1681 1681
 		$vocabulary_terms_loader->init_feature();
1682 1682
 
1683 1683
 		new Entity_Type_Change_Handler(
@@ -1702,9 +1702,9 @@  discard block
 block discarded – undo
1702 1702
 	private function set_locale() {
1703 1703
 
1704 1704
 		$plugin_i18n = new Wordlift_i18n();
1705
-		$plugin_i18n->set_domain( $this->get_plugin_name() );
1705
+		$plugin_i18n->set_domain($this->get_plugin_name());
1706 1706
 
1707
-		$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' );
1707
+		$this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain');
1708 1708
 
1709 1709
 	}
1710 1710
 
@@ -1725,29 +1725,29 @@  discard block
 block discarded – undo
1725 1725
 			$this->user_service
1726 1726
 		);
1727 1727
 
1728
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
1729
-		$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11 );
1728
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles');
1729
+		$this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts', 11);
1730 1730
 
1731 1731
 		// Hook the init action to taxonomy services.
1732
-		$this->loader->add_action( 'init', $this->topic_taxonomy_service, 'init', 0 );
1733
-		$this->loader->add_action( 'init', $this->entity_types_taxonomy_service, 'init', 0 );
1732
+		$this->loader->add_action('init', $this->topic_taxonomy_service, 'init', 0);
1733
+		$this->loader->add_action('init', $this->entity_types_taxonomy_service, 'init', 0);
1734 1734
 
1735 1735
 		// Hook the deleted_post_meta action to the Thumbnail service.
1736
-		$this->loader->add_action( 'deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4 );
1736
+		$this->loader->add_action('deleted_post_meta', $this->thumbnail_service, 'deleted_post_meta', 10, 4);
1737 1737
 
1738 1738
 		// Hook the added_post_meta action to the Thumbnail service.
1739
-		$this->loader->add_action( 'added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1739
+		$this->loader->add_action('added_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4);
1740 1740
 
1741 1741
 		// Hook the updated_post_meta action to the Thumbnail service.
1742
-		$this->loader->add_action( 'updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4 );
1742
+		$this->loader->add_action('updated_post_meta', $this->thumbnail_service, 'added_or_updated_post_meta', 10, 4);
1743 1743
 
1744 1744
 		// Hook the AJAX wl_timeline action to the Timeline service.
1745
-		$this->loader->add_action( 'wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1745
+		$this->loader->add_action('wp_ajax_wl_timeline', $this->timeline_service, 'ajax_timeline');
1746 1746
 
1747 1747
 		// Register custom allowed redirect hosts.
1748
-		$this->loader->add_filter( 'allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts' );
1748
+		$this->loader->add_filter('allowed_redirect_hosts', $this->redirect_service, 'allowed_redirect_hosts');
1749 1749
 		// Hook the AJAX wordlift_redirect action to the Redirect service.
1750
-		$this->loader->add_action( 'wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect' );
1750
+		$this->loader->add_action('wp_ajax_wordlift_redirect', $this->redirect_service, 'ajax_redirect');
1751 1751
 
1752 1752
 		/*
1753 1753
 		 * The old dashboard is replaced with dashboard v2.
@@ -1765,46 +1765,46 @@  discard block
 block discarded – undo
1765 1765
 
1766 1766
 		// Hook save_post to the entity service to update custom fields (such as alternate labels).
1767 1767
 		// We have a priority of 9 because we want to be executed before data is sent to Redlink.
1768
-		$this->loader->add_action( 'save_post', $this->entity_service, 'save_post', 9, 3 );
1769
-		$this->loader->add_action( 'save_post', $this->rating_service, 'set_rating_for', 20, 1 );
1768
+		$this->loader->add_action('save_post', $this->entity_service, 'save_post', 9, 3);
1769
+		$this->loader->add_action('save_post', $this->rating_service, 'set_rating_for', 20, 1);
1770 1770
 
1771
-		$this->loader->add_action( 'edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1 );
1772
-		$this->loader->add_action( 'in_admin_header', $this->rating_service, 'in_admin_header' );
1771
+		$this->loader->add_action('edit_form_before_permalink', $this->entity_service, 'edit_form_before_permalink', 10, 1);
1772
+		$this->loader->add_action('in_admin_header', $this->rating_service, 'in_admin_header');
1773 1773
 
1774 1774
 		// Entity listing customization (wp-admin/edit.php)
1775 1775
 		// Add custom columns.
1776
-		$this->loader->add_filter( 'manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns' );
1776
+		$this->loader->add_filter('manage_entity_posts_columns', $this->entity_list_service, 'register_custom_columns');
1777 1777
 		// no explicit entity as it prevents handling of other post types.
1778
-		$this->loader->add_filter( 'manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2 );
1778
+		$this->loader->add_filter('manage_posts_custom_column', $this->entity_list_service, 'render_custom_columns', 10, 2);
1779 1779
 		// Add 4W selection.
1780
-		$this->loader->add_action( 'restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope' );
1781
-		$this->loader->add_filter( 'posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope' );
1782
-		$this->loader->add_action( 'pre_get_posts', $this->entity_list_service, 'pre_get_posts' );
1783
-		$this->loader->add_action( 'load-edit.php', $this->entity_list_service, 'load_edit' );
1780
+		$this->loader->add_action('restrict_manage_posts', $this->entity_list_service, 'restrict_manage_posts_classification_scope');
1781
+		$this->loader->add_filter('posts_clauses', $this->entity_list_service, 'posts_clauses_classification_scope');
1782
+		$this->loader->add_action('pre_get_posts', $this->entity_list_service, 'pre_get_posts');
1783
+		$this->loader->add_action('load-edit.php', $this->entity_list_service, 'load_edit');
1784 1784
 
1785 1785
 		/*
1786 1786
 		 * If `All Entity Types` is disable, use the radio button Walker.
1787 1787
 		 *
1788 1788
 		 * @see https://github.com/insideout10/wordlift-plugin/issues/835
1789 1789
 		 */
1790
-		if ( ! WL_ALL_ENTITY_TYPES ) {
1791
-			$this->loader->add_filter( 'wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args' );
1790
+		if ( ! WL_ALL_ENTITY_TYPES) {
1791
+			$this->loader->add_filter('wp_terms_checklist_args', $this->entity_types_taxonomy_walker, 'terms_checklist_args');
1792 1792
 		}
1793 1793
 
1794 1794
 		// Hook the PrimaShop adapter to <em>prima_metabox_entity_header_args</em> in order to add header support for
1795 1795
 		// entities.
1796
-		$this->loader->add_filter( 'prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2 );
1796
+		$this->loader->add_filter('prima_metabox_entity_header_args', $this->primashop_adapter, 'prima_metabox_entity_header_args', 10, 2);
1797 1797
 
1798 1798
 		// Filter imported post meta.
1799
-		$this->loader->add_filter( 'wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3 );
1799
+		$this->loader->add_filter('wp_import_post_meta', $this->import_service, 'wp_import_post_meta', 10, 3);
1800 1800
 
1801 1801
 		// Notify the import service when an import starts and ends.
1802
-		$this->loader->add_action( 'import_start', $this->import_service, 'import_start', 10, 0 );
1803
-		$this->loader->add_action( 'import_end', $this->import_service, 'import_end', 10, 0 );
1802
+		$this->loader->add_action('import_start', $this->import_service, 'import_start', 10, 0);
1803
+		$this->loader->add_action('import_end', $this->import_service, 'import_end', 10, 0);
1804 1804
 
1805 1805
 		// Hook the AJAX wl_rebuild action to the Rebuild Service.
1806
-		$this->loader->add_action( 'wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild' );
1807
-		$this->loader->add_action( 'wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild' );
1806
+		$this->loader->add_action('wp_ajax_wl_rebuild', $this->rebuild_service, 'rebuild');
1807
+		$this->loader->add_action('wp_ajax_wl_rebuild_references', $this->reference_rebuild_service, 'rebuild');
1808 1808
 
1809 1809
 		/**
1810 1810
 		 * Filter: wl_feature__enable__settings-download.
@@ -1814,34 +1814,34 @@  discard block
 block discarded – undo
1814 1814
 		 * @return bool
1815 1815
 		 * @since 3.27.6
1816 1816
 		 */
1817
-		$this->features_registry->register_feature_from_slug( 'settings-download', true, array(
1817
+		$this->features_registry->register_feature_from_slug('settings-download', true, array(
1818 1818
 			$this,
1819 1819
 			'register_screens'
1820
-		) );
1820
+		));
1821 1821
 
1822 1822
 
1823 1823
 		// Hook the admin-ajax.php?action=wl_download_your_data&out=xyz links.
1824
-		$this->loader->add_action( 'wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10 );
1824
+		$this->loader->add_action('wp_ajax_wl_download_your_data', $this->download_your_data_page, 'download_your_data', 10);
1825 1825
 
1826 1826
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
1827
-		$this->loader->add_action( 'wp_ajax_wl_jsonld', $this->jsonld_service, 'get' );
1828
-		$this->loader->add_action( 'admin_post_wl_jsonld', $this->jsonld_service, 'get' );
1829
-		$this->loader->add_action( 'admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
1827
+		$this->loader->add_action('wp_ajax_wl_jsonld', $this->jsonld_service, 'get');
1828
+		$this->loader->add_action('admin_post_wl_jsonld', $this->jsonld_service, 'get');
1829
+		$this->loader->add_action('admin_post_nopriv_wl_jsonld', $this->jsonld_service, 'get');
1830 1830
 
1831 1831
 		// Hook the AJAX wl_validate_key action to the Key Validation service.
1832
-		$this->loader->add_action( 'wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key' );
1832
+		$this->loader->add_action('wp_ajax_wl_validate_key', $this->key_validation_service, 'validate_key');
1833 1833
 
1834 1834
 		// Hook the AJAX wl_update_country_options action to the countries.
1835
-		$this->loader->add_action( 'wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html' );
1835
+		$this->loader->add_action('wp_ajax_wl_update_country_options', $this->country_select_element, 'get_options_html');
1836 1836
 
1837 1837
 		// Hook the `admin_init` function to the Admin Setup.
1838
-		$this->loader->add_action( 'admin_init', $this->admin_setup, 'admin_init' );
1838
+		$this->loader->add_action('admin_init', $this->admin_setup, 'admin_init');
1839 1839
 
1840 1840
 		// Hook the admin_init to the settings page.
1841
-		$this->loader->add_action( 'admin_init', $this->settings_page, 'admin_init' );
1842
-		$this->loader->add_action( 'admin_init', $this->analytics_settings_page, 'admin_init' );
1841
+		$this->loader->add_action('admin_init', $this->settings_page, 'admin_init');
1842
+		$this->loader->add_action('admin_init', $this->analytics_settings_page, 'admin_init');
1843 1843
 
1844
-		$this->loader->add_filter( 'admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction' );
1844
+		$this->loader->add_filter('admin_post_thumbnail_html', $this->publisher_service, 'add_featured_image_instruction');
1845 1845
 
1846 1846
 		// Hook the menu creation on the general wordlift menu creation.
1847 1847
 		/**
@@ -1854,18 +1854,18 @@  discard block
 block discarded – undo
1854 1854
 		 *
1855 1855
 		 * Since 3.30.0 this feature is registered using registry.
1856 1856
 		 */
1857
-		add_action( 'plugins_loaded', function () use ( $that ) {
1858
-			if ( apply_filters( 'wl_feature__enable__settings-screen', true ) || Admin_User_Option::is_wordlift_admin() ) {
1859
-				add_action( 'wl_admin_menu', array( $that->settings_page, 'admin_menu' ), 10, 2 );
1857
+		add_action('plugins_loaded', function() use ($that) {
1858
+			if (apply_filters('wl_feature__enable__settings-screen', true) || Admin_User_Option::is_wordlift_admin()) {
1859
+				add_action('wl_admin_menu', array($that->settings_page, 'admin_menu'), 10, 2);
1860 1860
 			}
1861 1861
 		} );
1862 1862
 
1863 1863
 		// Hook key update.
1864
-		$this->loader->add_action( 'pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2 );
1865
-		$this->loader->add_action( 'update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2 );
1864
+		$this->loader->add_action('pre_update_option_wl_general_settings', $this->configuration_service, 'maybe_update_dataset_uri', 10, 2);
1865
+		$this->loader->add_action('update_option_wl_general_settings', $this->configuration_service, 'update_key', 10, 2);
1866 1866
 
1867 1867
 		// Add additional action links to the WordLift plugin in the plugins page.
1868
-		$this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1 );
1868
+		$this->loader->add_filter('plugin_action_links_wordlift/wordlift.php', $this->settings_page_action_link, 'action_links', 10, 1);
1869 1869
 
1870 1870
 		/*
1871 1871
 		 * Remove the Analytics Settings link from the plugin page.
@@ -1876,25 +1876,25 @@  discard block
 block discarded – undo
1876 1876
 		// $this->loader->add_filter( 'plugin_action_links_wordlift/wordlift.php', $this->analytics_settings_page_action_link, 'action_links', 10, 1 );
1877 1877
 
1878 1878
 		// Hook the AJAX `wl_publisher` action name.
1879
-		$this->loader->add_action( 'wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher' );
1879
+		$this->loader->add_action('wp_ajax_wl_publisher', $this->publisher_ajax_adapter, 'publisher');
1880 1880
 
1881 1881
 		// Hook row actions for the entity type list admin.
1882
-		$this->loader->add_filter( 'wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2 );
1882
+		$this->loader->add_filter('wl_entity_type_row_actions', $this->entity_type_admin_page, 'wl_entity_type_row_actions', 10, 2);
1883 1883
 
1884 1884
 		/** Ajax actions. */
1885
-		$this->loader->add_action( 'wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export' );
1885
+		$this->loader->add_action('wp_ajax_wl_google_analytics_export', $this->google_analytics_export_service, 'export');
1886 1886
 
1887 1887
 		// Hook capabilities manipulation to allow access to entity type admin
1888 1888
 		// page  on WordPress versions before 4.7.
1889 1889
 		global $wp_version;
1890
-		if ( version_compare( $wp_version, '4.7', '<' ) ) {
1891
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4 );
1890
+		if (version_compare($wp_version, '4.7', '<')) {
1891
+			$this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'enable_admin_access_pre_47', 10, 4);
1892 1892
 		}
1893 1893
 
1894
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
1894
+		$this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1);
1895 1895
 
1896 1896
 		/** Adapters. */
1897
-		$this->loader->add_filter( 'mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1 );
1897
+		$this->loader->add_filter('mce_external_plugins', $this->tinymce_adapter, 'mce_external_plugins', 10, 1);
1898 1898
 		/**
1899 1899
 		 * Disabling Faq temporarily.
1900 1900
 		 * Load the tinymce editor button on the tool bar.
@@ -1905,54 +1905,54 @@  discard block
 block discarded – undo
1905 1905
 		//$this->loader->add_filter( 'mce_external_plugins', $this->faq_tinymce_adapter, 'register_faq_tinymce_plugin', 10, 1 );
1906 1906
 
1907 1907
 
1908
-		$this->loader->add_action( 'wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all' );
1909
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create' );
1910
-		$this->loader->add_action( 'wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete' );
1908
+		$this->loader->add_action('wp_ajax_wl_relation_rebuild_process_all', $this->relation_rebuild_adapter, 'process_all');
1909
+		$this->loader->add_action('wp_ajax_wl_sample_data_create', $this->sample_data_ajax_adapter, 'create');
1910
+		$this->loader->add_action('wp_ajax_wl_sample_data_delete', $this->sample_data_ajax_adapter, 'delete');
1911 1911
 		/**
1912 1912
 		 * @since 3.26.0
1913 1913
 		 */
1914 1914
 		$excerpt_adapter = new Post_Excerpt_Meta_Box_Adapter();
1915
-		$this->loader->add_action( 'do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box' );
1915
+		$this->loader->add_action('do_meta_boxes', $excerpt_adapter, 'replace_post_excerpt_meta_box');
1916 1916
 		// Adding Rest route for the post excerpt
1917 1917
 		Post_Excerpt_Rest_Controller::register_routes();
1918 1918
 
1919
-		$this->loader->add_action( 'update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5 );
1920
-		$this->loader->add_action( 'delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5 );
1919
+		$this->loader->add_action('update_user_metadata', $this->user_service, 'update_user_metadata', 10, 5);
1920
+		$this->loader->add_action('delete_user_metadata', $this->user_service, 'delete_user_metadata', 10, 5);
1921 1921
 
1922 1922
 		// Handle the autocomplete request.
1923
-		add_action( 'wp_ajax_wl_autocomplete', array(
1923
+		add_action('wp_ajax_wl_autocomplete', array(
1924 1924
 			$this->autocomplete_adapter,
1925 1925
 			'wl_autocomplete',
1926
-		) );
1927
-		add_action( 'wp_ajax_nopriv_wl_autocomplete', array(
1926
+		));
1927
+		add_action('wp_ajax_nopriv_wl_autocomplete', array(
1928 1928
 			$this->autocomplete_adapter,
1929 1929
 			'wl_autocomplete',
1930
-		) );
1930
+		));
1931 1931
 
1932 1932
 		// Hooks to restrict multisite super admin from manipulating entity types.
1933
-		if ( is_multisite() ) {
1934
-			$this->loader->add_filter( 'map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4 );
1933
+		if (is_multisite()) {
1934
+			$this->loader->add_filter('map_meta_cap', $this->entity_type_admin_page, 'restrict_super_admin', 10, 4);
1935 1935
 		}
1936 1936
 
1937
-		$deactivator_feedback = new Wordlift_Deactivator_Feedback( $this->configuration_service );
1937
+		$deactivator_feedback = new Wordlift_Deactivator_Feedback($this->configuration_service);
1938 1938
 
1939
-		add_action( 'admin_footer', array( $deactivator_feedback, 'render_feedback_popup' ) );
1940
-		add_action( 'admin_enqueue_scripts', array( $deactivator_feedback, 'enqueue_popup_scripts' ) );
1941
-		add_action( 'wp_ajax_wl_deactivation_feedback', array( $deactivator_feedback, 'wl_deactivation_feedback' ) );
1939
+		add_action('admin_footer', array($deactivator_feedback, 'render_feedback_popup'));
1940
+		add_action('admin_enqueue_scripts', array($deactivator_feedback, 'enqueue_popup_scripts'));
1941
+		add_action('wp_ajax_wl_deactivation_feedback', array($deactivator_feedback, 'wl_deactivation_feedback'));
1942 1942
 
1943 1943
 		/**
1944 1944
 		 * Always allow the `wordlift/classification` block.
1945 1945
 		 *
1946 1946
 		 * @since 3.23.0
1947 1947
 		 */
1948
-		add_filter( 'allowed_block_types', function ( $value ) {
1948
+		add_filter('allowed_block_types', function($value) {
1949 1949
 
1950
-			if ( true === $value ) {
1950
+			if (true === $value) {
1951 1951
 				return $value;
1952 1952
 			}
1953 1953
 
1954
-			return array_merge( (array) $value, array( 'wordlift/classification' ) );
1955
-		}, PHP_INT_MAX );
1954
+			return array_merge((array) $value, array('wordlift/classification'));
1955
+		}, PHP_INT_MAX);
1956 1956
 
1957 1957
 		/**
1958 1958
 		 * @since 3.27.7
@@ -1970,58 +1970,58 @@  discard block
 block discarded – undo
1970 1970
 	 */
1971 1971
 	private function define_public_hooks() {
1972 1972
 
1973
-		$plugin_public = new Wordlift_Public( $this->get_plugin_name(), $this->get_version() );
1973
+		$plugin_public = new Wordlift_Public($this->get_plugin_name(), $this->get_version());
1974 1974
 
1975 1975
 		// Register the entity post type.
1976
-		$this->loader->add_action( 'init', $this->entity_post_type_service, 'register' );
1976
+		$this->loader->add_action('init', $this->entity_post_type_service, 'register');
1977 1977
 
1978 1978
 		// Bind the link generation and handling hooks to the entity link service.
1979
-		$this->loader->add_filter( 'post_type_link', $this->entity_link_service, 'post_type_link', 10, 4 );
1980
-		$this->loader->add_action( 'pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1 );
1979
+		$this->loader->add_filter('post_type_link', $this->entity_link_service, 'post_type_link', 10, 4);
1980
+		$this->loader->add_action('pre_get_posts', $this->entity_link_service, 'pre_get_posts', PHP_INT_MAX, 1);
1981 1981
 		// $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 );
1982 1982
 		// $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 );
1983 1983
 
1984
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' );
1985
-		$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' );
1986
-		$this->loader->add_action( 'wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts' );
1984
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles');
1985
+		$this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_scripts');
1986
+		$this->loader->add_action('wp_enqueue_scripts', $this->context_cards_service, 'enqueue_scripts');
1987 1987
 
1988 1988
 		// Registering Faq_Content_Filter service used for removing faq question and answer tags from the html.
1989
-		$this->loader->add_filter( 'the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags' );
1989
+		$this->loader->add_filter('the_content', $this->faq_content_filter_service, 'remove_all_faq_question_and_answer_tags');
1990 1990
 		// Hook the content filter service to add entity links.
1991
-		if ( ! defined( 'WL_DISABLE_CONTENT_FILTER' ) || ! WL_DISABLE_CONTENT_FILTER ) {
1992
-			$this->loader->add_filter( 'the_content', $this->content_filter_service, 'the_content' );
1991
+		if ( ! defined('WL_DISABLE_CONTENT_FILTER') || ! WL_DISABLE_CONTENT_FILTER) {
1992
+			$this->loader->add_filter('the_content', $this->content_filter_service, 'the_content');
1993 1993
 		}
1994 1994
 
1995 1995
 		// Hook the AJAX wl_timeline action to the Timeline service.
1996
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline' );
1996
+		$this->loader->add_action('wp_ajax_nopriv_wl_timeline', $this->timeline_service, 'ajax_timeline');
1997 1997
 
1998 1998
 		// Hook the ShareThis service.
1999
-		$this->loader->add_filter( 'the_content', $this->sharethis_service, 'the_content', 99 );
2000
-		$this->loader->add_filter( 'the_excerpt', $this->sharethis_service, 'the_excerpt', 99 );
1999
+		$this->loader->add_filter('the_content', $this->sharethis_service, 'the_content', 99);
2000
+		$this->loader->add_filter('the_excerpt', $this->sharethis_service, 'the_excerpt', 99);
2001 2001
 
2002 2002
 		// Hook the AJAX wl_jsonld action to the JSON-LD service.
2003
-		$this->loader->add_action( 'wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get' );
2003
+		$this->loader->add_action('wp_ajax_nopriv_wl_jsonld', $this->jsonld_service, 'get');
2004 2004
 
2005 2005
 		// Hook the `pre_get_posts` action to the `Wordlift_Category_Taxonomy_Service`
2006 2006
 		// in order to tweak WP's `WP_Query` to include entities in queries related
2007 2007
 		// to categories.
2008
-		$this->loader->add_action( 'pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1 );
2008
+		$this->loader->add_action('pre_get_posts', $this->category_taxonomy_service, 'pre_get_posts', 10, 1);
2009 2009
 
2010 2010
 		/*
2011 2011
 		 * Hook the `pre_get_posts` action to the `Wordlift_Entity_Page_Service`
2012 2012
 		 * in order to tweak WP's `WP_Query` to show event related entities in reverse
2013 2013
 		 * order of start time.
2014 2014
 		 */
2015
-		$this->loader->add_action( 'pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1 );
2015
+		$this->loader->add_action('pre_get_posts', $this->entity_page_service, 'pre_get_posts', 10, 1);
2016 2016
 
2017
-		$this->loader->add_action( 'wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1 );
2017
+		$this->loader->add_action('wl_async_wl_run_sparql_query', $this->sparql_service, 'run_sparql_query', 10, 1);
2018 2018
 
2019 2019
 		// This hook have to run before the rating service, as otherwise the post might not be a proper entity when rating is done.
2020
-		$this->loader->add_action( 'save_post', $this->entity_type_adapter, 'save_post', 9, 3 );
2020
+		$this->loader->add_action('save_post', $this->entity_type_adapter, 'save_post', 9, 3);
2021 2021
 
2022 2022
 		// Analytics Script Frontend.
2023
-		if ( apply_filters( 'wl_feature__enable__analytics', true ) && $this->configuration_service->is_analytics_enable() ) {
2024
-			$this->loader->add_action( 'wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10 );
2023
+		if (apply_filters('wl_feature__enable__analytics', true) && $this->configuration_service->is_analytics_enable()) {
2024
+			$this->loader->add_action('wp_enqueue_scripts', $this->analytics_connect, 'enqueue_scripts', 10);
2025 2025
 		}
2026 2026
 
2027 2027
 	}
@@ -2074,11 +2074,11 @@  discard block
 block discarded – undo
2074 2074
 	 */
2075 2075
 	private function load_cli_dependencies() {
2076 2076
 
2077
-		require_once plugin_dir_path( dirname( __FILE__ ) ) . 'cli/class-wordlift-push-reference-data-command.php';
2077
+		require_once plugin_dir_path(dirname(__FILE__)).'cli/class-wordlift-push-reference-data-command.php';
2078 2078
 
2079
-		$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 );
2079
+		$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);
2080 2080
 
2081
-		WP_CLI::add_command( 'wl references push', $push_reference_data_command );
2081
+		WP_CLI::add_command('wl references push', $push_reference_data_command);
2082 2082
 
2083 2083
 	}
2084 2084
 
@@ -2103,7 +2103,7 @@  discard block
 block discarded – undo
2103 2103
 		 * @since 3.27.6
2104 2104
 		 */
2105 2105
 
2106
-		wp_register_script( 'wl_enabled_blocks', false );
2106
+		wp_register_script('wl_enabled_blocks', false);
2107 2107
 
2108 2108
 		$enabled_blocks = array();
2109 2109
 
@@ -2111,13 +2111,13 @@  discard block
 block discarded – undo
2111 2111
 		 * Filter name: wl_feature__enable__product-navigator
2112 2112
 		 * @since 3.32.3
2113 2113
 		 */
2114
-		if ( apply_filters( 'wl_feature__enable__product-navigator', true ) ) {
2114
+		if (apply_filters('wl_feature__enable__product-navigator', true)) {
2115 2115
 			$enabled_blocks[] = 'wordlift/products-navigator';
2116 2116
 		}
2117 2117
 
2118
-		if ( apply_filters( 'wl_feature__enable__blocks', true ) ) {
2118
+		if (apply_filters('wl_feature__enable__blocks', true)) {
2119 2119
 			// To intimate JS
2120
-			$enabled_blocks = array_merge( $enabled_blocks, array(
2120
+			$enabled_blocks = array_merge($enabled_blocks, array(
2121 2121
 				'wordlift/navigator',
2122 2122
 				'wordlift/chord',
2123 2123
 				'wordlift/geomap',
@@ -2125,11 +2125,11 @@  discard block
 block discarded – undo
2125 2125
 				'wordlift/cloud',
2126 2126
 				'wordlift/vocabulary',
2127 2127
 				'wordlift/faceted-search'
2128
-			) );
2128
+			));
2129 2129
 		}
2130 2130
 
2131
-		wp_localize_script( 'wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks );
2132
-		wp_enqueue_script( 'wl_enabled_blocks' );
2131
+		wp_localize_script('wl_enabled_blocks', 'wlEnabledBlocks', $enabled_blocks);
2132
+		wp_enqueue_script('wl_enabled_blocks');
2133 2133
 	}
2134 2134
 
2135 2135
 	/**
@@ -2137,11 +2137,11 @@  discard block
 block discarded – undo
2137 2137
 	 */
2138 2138
 	public function register_screens() {
2139 2139
 		// Hook the menu to the Download Your Data page.
2140
-		if ( apply_filters( 'wl_feature__enable__settings-download', true ) ) {
2141
-			add_action( 'admin_menu', array( $this->download_your_data_page, 'admin_menu' ), 100, 0 );
2140
+		if (apply_filters('wl_feature__enable__settings-download', true)) {
2141
+			add_action('admin_menu', array($this->download_your_data_page, 'admin_menu'), 100, 0);
2142 2142
 		}
2143
-		add_action( 'admin_menu', array( $this->status_page, 'admin_menu' ), 100, 0 );
2144
-		add_action( 'admin_menu', array( $this->entity_type_settings_admin_page, 'admin_menu' ), 100, 0 );
2143
+		add_action('admin_menu', array($this->status_page, 'admin_menu'), 100, 0);
2144
+		add_action('admin_menu', array($this->entity_type_settings_admin_page, 'admin_menu'), 100, 0);
2145 2145
 
2146 2146
 	}
2147 2147
 
Please login to merge, or discard this patch.
src/install/class-wordlift-install-3-24-2.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -11,38 +11,38 @@
 block discarded – undo
11 11
 
12 12
 class Wordlift_Install_3_24_2 extends Wordlift_Install {
13 13
 
14
-	/**
15
-	 * {@inheritdoc}
16
-	 */
17
-	protected static $version = '3.24.2';
14
+    /**
15
+     * {@inheritdoc}
16
+     */
17
+    protected static $version = '3.24.2';
18 18
 
19
-	/**
20
-	 * @inheritDoc
21
-	 */
22
-	public function install() {
19
+    /**
20
+     * @inheritDoc
21
+     */
22
+    public function install() {
23 23
 
24
-		global $wpdb;
24
+        global $wpdb;
25 25
 
26
-		if ( false === get_option( 'wl_mappings' ) ) {
27
-			add_option( 'wl_mappings', array(), '', true );
28
-		}
26
+        if ( false === get_option( 'wl_mappings' ) ) {
27
+            add_option( 'wl_mappings', array(), '', true );
28
+        }
29 29
 
30
-		if ( false === get_option( 'wl_analytics_settings' ) ) {
31
-			add_option( 'wl_analytics_settings', false, '', true );
32
-		}
30
+        if ( false === get_option( 'wl_analytics_settings' ) ) {
31
+            add_option( 'wl_analytics_settings', false, '', true );
32
+        }
33 33
 
34
-		if ( false === get_option( 'wl_entity_type_settings' ) ) {
35
-			add_option( 'wl_entity_type_settings', array(), '', true );
36
-		}
34
+        if ( false === get_option( 'wl_entity_type_settings' ) ) {
35
+            add_option( 'wl_entity_type_settings', array(), '', true );
36
+        }
37 37
 
38
-		// Added for feature request 1496 (Webhooks)
39
-		if ( false === get_option( 'wl_webhooks_settings' ) ) {
40
-			add_option( 'wl_webhooks_settings', array(), '', false );
41
-		}
38
+        // Added for feature request 1496 (Webhooks)
39
+        if ( false === get_option( 'wl_webhooks_settings' ) ) {
40
+            add_option( 'wl_webhooks_settings', array(), '', false );
41
+        }
42 42
 
43
-		$wpdb->query( "UPDATE {$wpdb->options} SET autoload = 'yes'"
44
-		              . " WHERE option_name IN ( 'wl_mappings', 'wl_analytics_settings', 'wl_entity_type_settings', 'WPLANG' )" );
43
+        $wpdb->query( "UPDATE {$wpdb->options} SET autoload = 'yes'"
44
+                        . " WHERE option_name IN ( 'wl_mappings', 'wl_analytics_settings', 'wl_entity_type_settings', 'WPLANG' )" );
45 45
 
46
-	}
46
+    }
47 47
 
48 48
 }
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -23,25 +23,25 @@
 block discarded – undo
23 23
 
24 24
 		global $wpdb;
25 25
 
26
-		if ( false === get_option( 'wl_mappings' ) ) {
27
-			add_option( 'wl_mappings', array(), '', true );
26
+		if (false === get_option('wl_mappings')) {
27
+			add_option('wl_mappings', array(), '', true);
28 28
 		}
29 29
 
30
-		if ( false === get_option( 'wl_analytics_settings' ) ) {
31
-			add_option( 'wl_analytics_settings', false, '', true );
30
+		if (false === get_option('wl_analytics_settings')) {
31
+			add_option('wl_analytics_settings', false, '', true);
32 32
 		}
33 33
 
34
-		if ( false === get_option( 'wl_entity_type_settings' ) ) {
35
-			add_option( 'wl_entity_type_settings', array(), '', true );
34
+		if (false === get_option('wl_entity_type_settings')) {
35
+			add_option('wl_entity_type_settings', array(), '', true);
36 36
 		}
37 37
 
38 38
 		// Added for feature request 1496 (Webhooks)
39
-		if ( false === get_option( 'wl_webhooks_settings' ) ) {
40
-			add_option( 'wl_webhooks_settings', array(), '', false );
39
+		if (false === get_option('wl_webhooks_settings')) {
40
+			add_option('wl_webhooks_settings', array(), '', false);
41 41
 		}
42 42
 
43
-		$wpdb->query( "UPDATE {$wpdb->options} SET autoload = 'yes'"
44
-		              . " WHERE option_name IN ( 'wl_mappings', 'wl_analytics_settings', 'wl_entity_type_settings', 'WPLANG' )" );
43
+		$wpdb->query("UPDATE {$wpdb->options} SET autoload = 'yes'"
44
+		              . " WHERE option_name IN ( 'wl_mappings', 'wl_analytics_settings', 'wl_entity_type_settings', 'WPLANG' )");
45 45
 
46 46
 	}
47 47
 
Please login to merge, or discard this patch.
src/admin/partials/wordlift-admin-settings-webhooksobject-settings-page.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -8,8 +8,8 @@
 block discarded – undo
8 8
 ?>
9 9
 <form method="post" action="options.php">
10 10
 	<?php
11
-	settings_fields( 'wl_settings__webhooks' );
12
-	do_settings_sections( 'wl_settings__webhooks' );
13
-	submit_button( 'Save Settings' );
14
-	?>
11
+    settings_fields( 'wl_settings__webhooks' );
12
+    do_settings_sections( 'wl_settings__webhooks' );
13
+    submit_button( 'Save Settings' );
14
+    ?>
15 15
 </form>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@
 block discarded – undo
4 4
  * Added for feature request 1496
5 5
  *
6 6
  */
7
-settings_errors( 'wl_webhook_error' );
7
+settings_errors('wl_webhook_error');
8 8
 ?>
9 9
 <form method="post" action="options.php">
10 10
 	<?php
11
-	settings_fields( 'wl_settings__webhooks' );
12
-	do_settings_sections( 'wl_settings__webhooks' );
13
-	submit_button( 'Save Settings' );
11
+	settings_fields('wl_settings__webhooks');
12
+	do_settings_sections('wl_settings__webhooks');
13
+	submit_button('Save Settings');
14 14
 	?>
15 15
 </form>
Please login to merge, or discard this patch.
src/wordlift/dataset/class-sync-term-hooks.php 2 patches
Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -5,113 +5,113 @@
 block discarded – undo
5 5
 use Wordlift\Object_Type_Enum;
6 6
 
7 7
 class Sync_Term_Hooks extends Abstract_Sync_Hooks {
8
-	/**
9
-	 * @var \Wordlift_Log_Service
10
-	 */
11
-	private $log;
12
-
13
-	/**
14
-	 * @var Sync_Service
15
-	 */
16
-	private $sync_service;
17
-
18
-	/**
19
-	 * @var Sync_Object_Adapter_Factory
20
-	 */
21
-	private $sync_object_factory;
22
-
23
-	/**
24
-	 * Sync_Term_Hooks constructor.
25
-	 *
26
-	 * @param Sync_Service $sync_service
27
-	 * @param Sync_Object_Adapter_Factory $sync_object_factory
28
-	 */
29
-	function __construct( $sync_service, $sync_object_factory ) {
30
-		parent::__construct();
31
-
32
-		$this->log = \Wordlift_Log_Service::get_logger( get_class() );
33
-
34
-		$this->sync_service        = $sync_service;
35
-		$this->sync_object_factory = $sync_object_factory;
36
-
37
-		$this->register_hooks();
38
-	}
39
-
40
-	private function register_hooks() {
41
-		/**
42
-		 * Register hooks for post and meta.
43
-		 */
44
-		add_action( 'create_term', array( $this, 'do_sync' ) );
45
-		add_action( 'edit_term', array( $this, 'do_sync' ) );
46
-		add_action( 'added_term_meta', array( $this, 'changed_term_meta' ), 10, 4 );
47
-		add_action( 'updated_term_meta', array( $this, 'changed_term_meta' ), 10, 4 );
48
-		add_action( 'deleted_term_meta', array( $this, 'changed_term_meta' ), 10, 4 );
49
-		add_action( 'pre_delete_term', array( $this, 'delete_term' ) );
50
-
51
-	}
52
-
53
-	public function saved_term( $term_id ) {
54
-
55
-		// Sync all the terms without filtering.
56
-		$this->sync( $term_id );
57
-	}
58
-
59
-	public function changed_term_meta( $meta_id, $term_id, $meta_key, $_meta_value ) {
60
-
61
-		if ( in_array( $meta_key,
62
-			apply_filters( 'wl_dataset__sync_post_hooks__ignored_meta_keys',
63
-				apply_filters( 'wl_dataset__sync_hooks__ignored_meta_keys',
64
-					array(
65
-						'_pingme',
66
-						'_encloseme',
67
-						'entity_url',
68
-					) ) ) )
69
-		) {
70
-			return;
71
-		}
72
-
73
-		$this->sync( $term_id );
74
-
75
-	}
76
-
77
-	private function sync( $term_id ) {
78
-
79
-		$this->enqueue( array( 'do_sync', $term_id ) );
80
-	}
81
-
82
-	public function do_sync( $term_id ) {
83
-
84
-		try {
85
-			$term = get_term( $term_id );
86
-			if ( ! isset( $term ) ) {
87
-				return;
88
-			}
89
-			$this->sync_service->sync_many( array(
90
-				$this->sync_object_factory->create( Object_Type_Enum::TERM, $term_id ),
91
-			) );
92
-		} catch ( \Exception $e ) {
93
-			$this->log->error( "An error occurred while trying to sync post $term_id: " . $e->getMessage(), $e );
94
-		}
95
-	}
96
-
97
-	/**
98
-	 * @param $term \WP_Term
99
-	 */
100
-	public function delete_term( $term_id ) {
101
-		$args = array( $term_id, get_term_meta( $term_id, 'entity_url', true ) );
102
-		// We can't postpone the execution for a delete because we would miss the actual data.
103
-		$this->do_delete( $args );
104
-		// $this->enqueue( array( 'do_delete', $args ) );
105
-	}
106
-
107
-	public function do_delete( $args ) {
108
-		$term_id         = $args[0];
109
-		$term_entity_uri = $args[1];
110
-
111
-		try {
112
-			$this->sync_service->delete_one( Object_Type_Enum::TERM, $term_id, $term_entity_uri );
113
-		} catch ( \Exception $e ) {
114
-			$this->log->error( "An error occurred while trying to delete term $term_id: " . $e->getMessage(), $e );
115
-		}
116
-	}
8
+    /**
9
+     * @var \Wordlift_Log_Service
10
+     */
11
+    private $log;
12
+
13
+    /**
14
+     * @var Sync_Service
15
+     */
16
+    private $sync_service;
17
+
18
+    /**
19
+     * @var Sync_Object_Adapter_Factory
20
+     */
21
+    private $sync_object_factory;
22
+
23
+    /**
24
+     * Sync_Term_Hooks constructor.
25
+     *
26
+     * @param Sync_Service $sync_service
27
+     * @param Sync_Object_Adapter_Factory $sync_object_factory
28
+     */
29
+    function __construct( $sync_service, $sync_object_factory ) {
30
+        parent::__construct();
31
+
32
+        $this->log = \Wordlift_Log_Service::get_logger( get_class() );
33
+
34
+        $this->sync_service        = $sync_service;
35
+        $this->sync_object_factory = $sync_object_factory;
36
+
37
+        $this->register_hooks();
38
+    }
39
+
40
+    private function register_hooks() {
41
+        /**
42
+         * Register hooks for post and meta.
43
+         */
44
+        add_action( 'create_term', array( $this, 'do_sync' ) );
45
+        add_action( 'edit_term', array( $this, 'do_sync' ) );
46
+        add_action( 'added_term_meta', array( $this, 'changed_term_meta' ), 10, 4 );
47
+        add_action( 'updated_term_meta', array( $this, 'changed_term_meta' ), 10, 4 );
48
+        add_action( 'deleted_term_meta', array( $this, 'changed_term_meta' ), 10, 4 );
49
+        add_action( 'pre_delete_term', array( $this, 'delete_term' ) );
50
+
51
+    }
52
+
53
+    public function saved_term( $term_id ) {
54
+
55
+        // Sync all the terms without filtering.
56
+        $this->sync( $term_id );
57
+    }
58
+
59
+    public function changed_term_meta( $meta_id, $term_id, $meta_key, $_meta_value ) {
60
+
61
+        if ( in_array( $meta_key,
62
+            apply_filters( 'wl_dataset__sync_post_hooks__ignored_meta_keys',
63
+                apply_filters( 'wl_dataset__sync_hooks__ignored_meta_keys',
64
+                    array(
65
+                        '_pingme',
66
+                        '_encloseme',
67
+                        'entity_url',
68
+                    ) ) ) )
69
+        ) {
70
+            return;
71
+        }
72
+
73
+        $this->sync( $term_id );
74
+
75
+    }
76
+
77
+    private function sync( $term_id ) {
78
+
79
+        $this->enqueue( array( 'do_sync', $term_id ) );
80
+    }
81
+
82
+    public function do_sync( $term_id ) {
83
+
84
+        try {
85
+            $term = get_term( $term_id );
86
+            if ( ! isset( $term ) ) {
87
+                return;
88
+            }
89
+            $this->sync_service->sync_many( array(
90
+                $this->sync_object_factory->create( Object_Type_Enum::TERM, $term_id ),
91
+            ) );
92
+        } catch ( \Exception $e ) {
93
+            $this->log->error( "An error occurred while trying to sync post $term_id: " . $e->getMessage(), $e );
94
+        }
95
+    }
96
+
97
+    /**
98
+     * @param $term \WP_Term
99
+     */
100
+    public function delete_term( $term_id ) {
101
+        $args = array( $term_id, get_term_meta( $term_id, 'entity_url', true ) );
102
+        // We can't postpone the execution for a delete because we would miss the actual data.
103
+        $this->do_delete( $args );
104
+        // $this->enqueue( array( 'do_delete', $args ) );
105
+    }
106
+
107
+    public function do_delete( $args ) {
108
+        $term_id         = $args[0];
109
+        $term_entity_uri = $args[1];
110
+
111
+        try {
112
+            $this->sync_service->delete_one( Object_Type_Enum::TERM, $term_id, $term_entity_uri );
113
+        } catch ( \Exception $e ) {
114
+            $this->log->error( "An error occurred while trying to delete term $term_id: " . $e->getMessage(), $e );
115
+        }
116
+    }
117 117
 }
Please login to merge, or discard this patch.
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 	 * @param Sync_Service $sync_service
27 27
 	 * @param Sync_Object_Adapter_Factory $sync_object_factory
28 28
 	 */
29
-	function __construct( $sync_service, $sync_object_factory ) {
29
+	function __construct($sync_service, $sync_object_factory) {
30 30
 		parent::__construct();
31 31
 
32
-		$this->log = \Wordlift_Log_Service::get_logger( get_class() );
32
+		$this->log = \Wordlift_Log_Service::get_logger(get_class());
33 33
 
34 34
 		$this->sync_service        = $sync_service;
35 35
 		$this->sync_object_factory = $sync_object_factory;
@@ -41,77 +41,77 @@  discard block
 block discarded – undo
41 41
 		/**
42 42
 		 * Register hooks for post and meta.
43 43
 		 */
44
-		add_action( 'create_term', array( $this, 'do_sync' ) );
45
-		add_action( 'edit_term', array( $this, 'do_sync' ) );
46
-		add_action( 'added_term_meta', array( $this, 'changed_term_meta' ), 10, 4 );
47
-		add_action( 'updated_term_meta', array( $this, 'changed_term_meta' ), 10, 4 );
48
-		add_action( 'deleted_term_meta', array( $this, 'changed_term_meta' ), 10, 4 );
49
-		add_action( 'pre_delete_term', array( $this, 'delete_term' ) );
44
+		add_action('create_term', array($this, 'do_sync'));
45
+		add_action('edit_term', array($this, 'do_sync'));
46
+		add_action('added_term_meta', array($this, 'changed_term_meta'), 10, 4);
47
+		add_action('updated_term_meta', array($this, 'changed_term_meta'), 10, 4);
48
+		add_action('deleted_term_meta', array($this, 'changed_term_meta'), 10, 4);
49
+		add_action('pre_delete_term', array($this, 'delete_term'));
50 50
 
51 51
 	}
52 52
 
53
-	public function saved_term( $term_id ) {
53
+	public function saved_term($term_id) {
54 54
 
55 55
 		// Sync all the terms without filtering.
56
-		$this->sync( $term_id );
56
+		$this->sync($term_id);
57 57
 	}
58 58
 
59
-	public function changed_term_meta( $meta_id, $term_id, $meta_key, $_meta_value ) {
59
+	public function changed_term_meta($meta_id, $term_id, $meta_key, $_meta_value) {
60 60
 
61
-		if ( in_array( $meta_key,
62
-			apply_filters( 'wl_dataset__sync_post_hooks__ignored_meta_keys',
63
-				apply_filters( 'wl_dataset__sync_hooks__ignored_meta_keys',
61
+		if (in_array($meta_key,
62
+			apply_filters('wl_dataset__sync_post_hooks__ignored_meta_keys',
63
+				apply_filters('wl_dataset__sync_hooks__ignored_meta_keys',
64 64
 					array(
65 65
 						'_pingme',
66 66
 						'_encloseme',
67 67
 						'entity_url',
68
-					) ) ) )
68
+					))))
69 69
 		) {
70 70
 			return;
71 71
 		}
72 72
 
73
-		$this->sync( $term_id );
73
+		$this->sync($term_id);
74 74
 
75 75
 	}
76 76
 
77
-	private function sync( $term_id ) {
77
+	private function sync($term_id) {
78 78
 
79
-		$this->enqueue( array( 'do_sync', $term_id ) );
79
+		$this->enqueue(array('do_sync', $term_id));
80 80
 	}
81 81
 
82
-	public function do_sync( $term_id ) {
82
+	public function do_sync($term_id) {
83 83
 
84 84
 		try {
85
-			$term = get_term( $term_id );
86
-			if ( ! isset( $term ) ) {
85
+			$term = get_term($term_id);
86
+			if ( ! isset($term)) {
87 87
 				return;
88 88
 			}
89
-			$this->sync_service->sync_many( array(
90
-				$this->sync_object_factory->create( Object_Type_Enum::TERM, $term_id ),
91
-			) );
92
-		} catch ( \Exception $e ) {
93
-			$this->log->error( "An error occurred while trying to sync post $term_id: " . $e->getMessage(), $e );
89
+			$this->sync_service->sync_many(array(
90
+				$this->sync_object_factory->create(Object_Type_Enum::TERM, $term_id),
91
+			));
92
+		} catch (\Exception $e) {
93
+			$this->log->error("An error occurred while trying to sync post $term_id: ".$e->getMessage(), $e);
94 94
 		}
95 95
 	}
96 96
 
97 97
 	/**
98 98
 	 * @param $term \WP_Term
99 99
 	 */
100
-	public function delete_term( $term_id ) {
101
-		$args = array( $term_id, get_term_meta( $term_id, 'entity_url', true ) );
100
+	public function delete_term($term_id) {
101
+		$args = array($term_id, get_term_meta($term_id, 'entity_url', true));
102 102
 		// We can't postpone the execution for a delete because we would miss the actual data.
103
-		$this->do_delete( $args );
103
+		$this->do_delete($args);
104 104
 		// $this->enqueue( array( 'do_delete', $args ) );
105 105
 	}
106 106
 
107
-	public function do_delete( $args ) {
107
+	public function do_delete($args) {
108 108
 		$term_id         = $args[0];
109 109
 		$term_entity_uri = $args[1];
110 110
 
111 111
 		try {
112
-			$this->sync_service->delete_one( Object_Type_Enum::TERM, $term_id, $term_entity_uri );
113
-		} catch ( \Exception $e ) {
114
-			$this->log->error( "An error occurred while trying to delete term $term_id: " . $e->getMessage(), $e );
112
+			$this->sync_service->delete_one(Object_Type_Enum::TERM, $term_id, $term_entity_uri);
113
+		} catch (\Exception $e) {
114
+			$this->log->error("An error occurred while trying to delete term $term_id: ".$e->getMessage(), $e);
115 115
 		}
116 116
 	}
117 117
 }
Please login to merge, or discard this patch.
src/wordlift/dataset/index.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -13,35 +13,35 @@
 block discarded – undo
13 13
 use Wordlift\Jsonld\Jsonld_Service;
14 14
 
15 15
 if ( ! defined( 'ABSPATH' ) ) {
16
-	exit;
16
+    exit;
17 17
 }
18 18
 
19 19
 // Register the Dataset JSON Endpoint. The `$api_service` variable must be defined in the calling file (wordlift.php).
20 20
 if ( apply_filters( 'wl_feature__enable__dataset-ng', false ) ) {
21 21
 
22
-	$sync_object_adapter_factory = new Sync_Object_Adapter_Factory();
23
-	$sync_service                = new Sync_Service( $api_service, $sync_object_adapter_factory, Jsonld_Service::get_instance(), Wordlift_Entity_Service::get_instance() );
24
-	new Sync_Post_Hooks( $sync_service, $sync_object_adapter_factory );
25
-	new Sync_User_Hooks( $sync_service );
26
-
27
-	if ( apply_filters( 'wl_feature__enable__no-vocabulary-terms', false ) ) {
28
-		new Sync_Term_Hooks( $sync_service, $sync_object_adapter_factory );
29
-	}
30
-	/**
31
-	 * @since 3.28.0
32
-	 * @see https://github.com/insideout10/wordlift-plugin/issues/1186
33
-	 */
34
-	new Sync_Hooks_Entity_Relation( Wordlift_Entity_Service::get_instance() );
35
-
36
-	if ( apply_filters( 'wl_feature__enable__wordpress-ontology', false ) ) {
37
-		new Sync_Hooks_Wordpress_Ontology();
38
-	}
39
-
40
-	if ( apply_filters( 'wl_feature__enable__sync-background', false ) ) {
41
-		// Set up the sync background process.
42
-		$sync_background_process = new Sync_Background_Process( $sync_service, $sync_object_adapter_factory );
43
-		new Sync_Background_Process_Wpjson_Endpoint( $sync_background_process );
44
-		new Sync_Page();
45
-	}
22
+    $sync_object_adapter_factory = new Sync_Object_Adapter_Factory();
23
+    $sync_service                = new Sync_Service( $api_service, $sync_object_adapter_factory, Jsonld_Service::get_instance(), Wordlift_Entity_Service::get_instance() );
24
+    new Sync_Post_Hooks( $sync_service, $sync_object_adapter_factory );
25
+    new Sync_User_Hooks( $sync_service );
26
+
27
+    if ( apply_filters( 'wl_feature__enable__no-vocabulary-terms', false ) ) {
28
+        new Sync_Term_Hooks( $sync_service, $sync_object_adapter_factory );
29
+    }
30
+    /**
31
+     * @since 3.28.0
32
+     * @see https://github.com/insideout10/wordlift-plugin/issues/1186
33
+     */
34
+    new Sync_Hooks_Entity_Relation( Wordlift_Entity_Service::get_instance() );
35
+
36
+    if ( apply_filters( 'wl_feature__enable__wordpress-ontology', false ) ) {
37
+        new Sync_Hooks_Wordpress_Ontology();
38
+    }
39
+
40
+    if ( apply_filters( 'wl_feature__enable__sync-background', false ) ) {
41
+        // Set up the sync background process.
42
+        $sync_background_process = new Sync_Background_Process( $sync_service, $sync_object_adapter_factory );
43
+        new Sync_Background_Process_Wpjson_Endpoint( $sync_background_process );
44
+        new Sync_Page();
45
+    }
46 46
 
47 47
 }
Please login to merge, or discard this patch.
src/wordlift/dataset/class-sync-object-adapter.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,19 +6,19 @@
 block discarded – undo
6 6
 
7 7
 interface Sync_Object_Adapter {
8 8
 
9
-	/**
10
-	 * @return int see {@link Object_Type_Enum}
11
-	 */
12
-	function get_type();
9
+    /**
10
+     * @return int see {@link Object_Type_Enum}
11
+     */
12
+    function get_type();
13 13
 
14
-	function get_object_id();
14
+    function get_object_id();
15 15
 
16
-	function get_meta( $meta_key, $single );
16
+    function get_meta( $meta_key, $single );
17 17
 
18
-	function update_meta( $meta_key, $meta_value );
18
+    function update_meta( $meta_key, $meta_value );
19 19
 
20
-	function is_published();
20
+    function is_published();
21 21
 
22
-	function is_public();
22
+    function is_public();
23 23
 
24 24
 }
25 25
\ No newline at end of file
Please login to merge, or discard this patch.
src/wordlift/dataset/class-sync-service.php 2 patches
Indentation   +230 added lines, -230 removed lines patch added patch discarded remove patch
@@ -7,237 +7,237 @@
 block discarded – undo
7 7
 use Wordlift\Jsonld\Jsonld_Service;
8 8
 
9 9
 class Sync_Service {
10
-	const JSONLD_HASH = '_wl_jsonld_hash';
11
-	const SYNCED_GMT = '_wl_synced_gmt';
12
-
13
-	/**
14
-	 * @var \Wordlift_Log_Service
15
-	 */
16
-	private $log;
17
-
18
-	/**
19
-	 * @var Api_Service
20
-	 */
21
-	private $api_service;
22
-
23
-	/**
24
-	 * @var Jsonld_Service
25
-	 */
26
-	private $jsonld_service;
27
-
28
-	/**
29
-	 * @var Sync_Background_Process
30
-	 */
31
-	private $sync_background_process;
32
-
33
-	/**
34
-	 * The number of posts processed in one call.
35
-	 *
36
-	 * @var int The batch size.
37
-	 */
38
-	private $batch_size;
39
-
40
-	/**
41
-	 * @var Sync_Object_Adapter_Factory
42
-	 */
43
-	private $sync_object_adapter_factory;
44
-
45
-	/**
46
-	 * @var Sync_Service
47
-	 */
48
-	private static $instance;
49
-	private $entity_service;
50
-
51
-	/**
52
-	 * Constructor.
53
-	 *
54
-	 * @param Api_Service $api_service The {@link Api_Service} used to communicate with the remote APIs.
55
-	 * @param Sync_Object_Adapter_Factory $sync_object_adapter_factory
56
-	 * @param Jsonld_Service $jsonld_service
57
-	 * @param \Wordlift_Entity_Service $entity_service
58
-	 */
59
-	public function __construct( $api_service, $sync_object_adapter_factory, $jsonld_service, $entity_service ) {
60
-
61
-		$this->log = \Wordlift_Log_Service::get_logger( get_class() );
62
-
63
-		$this->api_service                 = $api_service;
64
-		$this->sync_object_adapter_factory = $sync_object_adapter_factory;
65
-		$this->jsonld_service              = $jsonld_service;
66
-		$this->entity_service              = $entity_service;
67
-		$this->batch_size                  = 10;
68
-
69
-		// You need to initialize this early, otherwise the Background Process isn't registered in AJAX calls.
10
+    const JSONLD_HASH = '_wl_jsonld_hash';
11
+    const SYNCED_GMT = '_wl_synced_gmt';
12
+
13
+    /**
14
+     * @var \Wordlift_Log_Service
15
+     */
16
+    private $log;
17
+
18
+    /**
19
+     * @var Api_Service
20
+     */
21
+    private $api_service;
22
+
23
+    /**
24
+     * @var Jsonld_Service
25
+     */
26
+    private $jsonld_service;
27
+
28
+    /**
29
+     * @var Sync_Background_Process
30
+     */
31
+    private $sync_background_process;
32
+
33
+    /**
34
+     * The number of posts processed in one call.
35
+     *
36
+     * @var int The batch size.
37
+     */
38
+    private $batch_size;
39
+
40
+    /**
41
+     * @var Sync_Object_Adapter_Factory
42
+     */
43
+    private $sync_object_adapter_factory;
44
+
45
+    /**
46
+     * @var Sync_Service
47
+     */
48
+    private static $instance;
49
+    private $entity_service;
50
+
51
+    /**
52
+     * Constructor.
53
+     *
54
+     * @param Api_Service $api_service The {@link Api_Service} used to communicate with the remote APIs.
55
+     * @param Sync_Object_Adapter_Factory $sync_object_adapter_factory
56
+     * @param Jsonld_Service $jsonld_service
57
+     * @param \Wordlift_Entity_Service $entity_service
58
+     */
59
+    public function __construct( $api_service, $sync_object_adapter_factory, $jsonld_service, $entity_service ) {
60
+
61
+        $this->log = \Wordlift_Log_Service::get_logger( get_class() );
62
+
63
+        $this->api_service                 = $api_service;
64
+        $this->sync_object_adapter_factory = $sync_object_adapter_factory;
65
+        $this->jsonld_service              = $jsonld_service;
66
+        $this->entity_service              = $entity_service;
67
+        $this->batch_size                  = 10;
68
+
69
+        // You need to initialize this early, otherwise the Background Process isn't registered in AJAX calls.
70 70
 //		$this->sync_background_process = new Sync_Background_Process( $this );;
71 71
 
72
-		// Exclude the JSONLD_HASH meta key from those that require a resync.
73
-		add_filter( 'wl_dataset__sync_hooks__ignored_meta_keys', function ( $args ) {
74
-			$args[] = Sync_Service::JSONLD_HASH;
75
-			$args[] = Sync_Service::SYNCED_GMT;
76
-
77
-			return $args;
78
-		} );
79
-
80
-		self::$instance = $this;
81
-	}
82
-
83
-	public static function get_instance() {
84
-		return self::$instance;
85
-	}
86
-
87
-	/**
88
-	 * @param int $type
89
-	 * @param int $object_id
90
-	 *
91
-	 * @return array|false
92
-	 * @throws Exception
93
-	 */
94
-	public function sync_one( $type, $object_id ) {
95
-
96
-		$object = $this->sync_object_adapter_factory->create( $type, $object_id );
97
-
98
-		return $this->sync_many( array( $object ) );
99
-	}
100
-
101
-	/**
102
-	 * @param $type string Post or User.
103
-	 * @param $object_id  int Post or User id
104
-	 * @param $uri string Entity uri , This needs to be supplied before deletion, if we
105
-	 * get it from meta it might not be available.
106
-	 *
107
-	 * @return bool
108
-	 */
109
-	public function delete_one( $type, $object_id, $uri ) {
110
-		// Entity URL isn't set, bail out.
111
-		if ( empty( $uri ) ) {
112
-			return false;
113
-		}
114
-
115
-		$response = $this->api_service->request(
116
-			'DELETE', sprintf( '/middleware/dataset?uri=%s', rawurlencode( $uri ) ) );
117
-
118
-
119
-		// Update the sync date in case of success, otherwise log an error.
120
-		if ( ! $response->is_success() ) {
121
-			return false;
122
-		}
123
-
124
-		/**
125
-		 * Allow 3rd parties to run additional sync work.
126
-		 */
127
-		do_action( 'wl_sync__delete_one', $type, $object_id, $uri );
128
-
129
-		return true;
130
-	}
131
-
132
-	/**
133
-	 * @param Sync_Object_Adapter[] $objects
134
-	 * @param bool $force Force synchronization even if the json-ld hash hasn't changed.
135
-	 *
136
-	 * @return bool
137
-	 * @throws Exception
138
-	 */
139
-	public function sync_many( $objects, $force = false ) {
140
-
141
-		$hashes   = array();
142
-		$payloads = array();
143
-		foreach ( $objects as $object ) {
144
-			// Bail out if no payload.
145
-			$payload_as_string = $this->get_payload_as_string( $object );
146
-			if ( empty( $payload_as_string ) ) {
147
-				continue;
148
-			}
149
-			$new_hash = sha1( $payload_as_string );
150
-			$old_hash = $object->get_meta( self::JSONLD_HASH, true );
151
-
152
-			// JSON-LD hasn't changed, bail out.
153
-			if ( ! $force && $new_hash === $old_hash ) {
154
-				continue;
155
-			}
156
-
157
-			// Collect the hashes and the payloads.
158
-			$hashes[]   = array( $object, $new_hash, $payload_as_string );
159
-			$payloads[] = $payload_as_string;
160
-		}
161
-
162
-		// Bail out if payloads are empty.
163
-		if ( empty( $payloads ) ) {
164
-			return false;
165
-		}
166
-
167
-		$response = $this->api_service->request(
168
-			'POST', '/middleware/dataset/batch',
169
-			array( 'Content-Type' => 'application/json', ),
170
-			// Put the payload in a JSON array w/o decoding/encoding again.
171
-			'[ ' . implode( ', ', $payloads ) . ' ]' );
172
-
173
-		// Update the sync date in case of success, otherwise log an error.
174
-		if ( ! $response->is_success() ) {
175
-			return false;
176
-		}
177
-
178
-		// If successful update the hashes and sync'ed datetime.
179
-		foreach ( $hashes as $hash ) {
180
-			$object   = $hash[0];
181
-			$new_hash = $hash[1];
182
-			$object->update_meta( self::JSONLD_HASH, $new_hash );
183
-			$object->update_meta( self::SYNCED_GMT, current_time( 'mysql', true ) );
184
-		}
185
-
186
-
187
-		/**
188
-		 * Allow 3rd parties to run additional sync work.
189
-		 */
190
-		do_action( 'wl_sync__sync_many', $hashes );
191
-
192
-		return true;
193
-	}
194
-
195
-	/**
196
-	 * @param Sync_Object_Adapter $object
197
-	 *
198
-	 * @return false|string
199
-	 * @throws Exception
200
-	 */
201
-	private function get_payload_as_string( $object ) {
202
-		$type             = $object->get_type();
203
-		$object_id        = $object->get_object_id();
204
-		$jsonld_as_string = wp_json_encode( apply_filters( 'wl_dataset__sync_service__sync_item__jsonld',
205
-			$this->jsonld_service->get( $type, $object_id ), $type, $object_id ) );
206
-		$uri              = $this->entity_service->get_uri( $object_id, $type );
207
-
208
-		// Entity URL isn't set, bail out.
209
-		if ( empty( $uri ) ) {
210
-			return false;
211
-		}
212
-
213
-		return wp_json_encode( array(
214
-			'uri'     => $uri,
215
-			'model'   => $jsonld_as_string,
216
-			'private' => ! $object->is_public(),
217
-		) );
218
-	}
219
-
220
-	/**
221
-	 * @param $post_id
222
-	 *
223
-	 * @todo Complete the delete item.
224
-	 */
225
-	public function delete_item( $post_id ) {
226
-		$uri = get_post_meta( $post_id, 'entity_url', true );
227
-		// Make a request to the remote endpoint.
228
-		$response = $this->api_service->request(
229
-			'DELETE', '/middleware/dataset?uri=' . rawurlencode( $uri ),
230
-			array( 'Content-Type' => 'application/ld+json', ) );
231
-
232
-	}
233
-
234
-	public function get_batch_size() {
235
-
236
-		return $this->batch_size;
237
-	}
238
-
239
-	public function delete_all() {
240
-		$this->api_service->request( 'DELETE', '/middleware/dataset/all' );
241
-	}
72
+        // Exclude the JSONLD_HASH meta key from those that require a resync.
73
+        add_filter( 'wl_dataset__sync_hooks__ignored_meta_keys', function ( $args ) {
74
+            $args[] = Sync_Service::JSONLD_HASH;
75
+            $args[] = Sync_Service::SYNCED_GMT;
76
+
77
+            return $args;
78
+        } );
79
+
80
+        self::$instance = $this;
81
+    }
82
+
83
+    public static function get_instance() {
84
+        return self::$instance;
85
+    }
86
+
87
+    /**
88
+     * @param int $type
89
+     * @param int $object_id
90
+     *
91
+     * @return array|false
92
+     * @throws Exception
93
+     */
94
+    public function sync_one( $type, $object_id ) {
95
+
96
+        $object = $this->sync_object_adapter_factory->create( $type, $object_id );
97
+
98
+        return $this->sync_many( array( $object ) );
99
+    }
100
+
101
+    /**
102
+     * @param $type string Post or User.
103
+     * @param $object_id  int Post or User id
104
+     * @param $uri string Entity uri , This needs to be supplied before deletion, if we
105
+     * get it from meta it might not be available.
106
+     *
107
+     * @return bool
108
+     */
109
+    public function delete_one( $type, $object_id, $uri ) {
110
+        // Entity URL isn't set, bail out.
111
+        if ( empty( $uri ) ) {
112
+            return false;
113
+        }
114
+
115
+        $response = $this->api_service->request(
116
+            'DELETE', sprintf( '/middleware/dataset?uri=%s', rawurlencode( $uri ) ) );
117
+
118
+
119
+        // Update the sync date in case of success, otherwise log an error.
120
+        if ( ! $response->is_success() ) {
121
+            return false;
122
+        }
123
+
124
+        /**
125
+         * Allow 3rd parties to run additional sync work.
126
+         */
127
+        do_action( 'wl_sync__delete_one', $type, $object_id, $uri );
128
+
129
+        return true;
130
+    }
131
+
132
+    /**
133
+     * @param Sync_Object_Adapter[] $objects
134
+     * @param bool $force Force synchronization even if the json-ld hash hasn't changed.
135
+     *
136
+     * @return bool
137
+     * @throws Exception
138
+     */
139
+    public function sync_many( $objects, $force = false ) {
140
+
141
+        $hashes   = array();
142
+        $payloads = array();
143
+        foreach ( $objects as $object ) {
144
+            // Bail out if no payload.
145
+            $payload_as_string = $this->get_payload_as_string( $object );
146
+            if ( empty( $payload_as_string ) ) {
147
+                continue;
148
+            }
149
+            $new_hash = sha1( $payload_as_string );
150
+            $old_hash = $object->get_meta( self::JSONLD_HASH, true );
151
+
152
+            // JSON-LD hasn't changed, bail out.
153
+            if ( ! $force && $new_hash === $old_hash ) {
154
+                continue;
155
+            }
156
+
157
+            // Collect the hashes and the payloads.
158
+            $hashes[]   = array( $object, $new_hash, $payload_as_string );
159
+            $payloads[] = $payload_as_string;
160
+        }
161
+
162
+        // Bail out if payloads are empty.
163
+        if ( empty( $payloads ) ) {
164
+            return false;
165
+        }
166
+
167
+        $response = $this->api_service->request(
168
+            'POST', '/middleware/dataset/batch',
169
+            array( 'Content-Type' => 'application/json', ),
170
+            // Put the payload in a JSON array w/o decoding/encoding again.
171
+            '[ ' . implode( ', ', $payloads ) . ' ]' );
172
+
173
+        // Update the sync date in case of success, otherwise log an error.
174
+        if ( ! $response->is_success() ) {
175
+            return false;
176
+        }
177
+
178
+        // If successful update the hashes and sync'ed datetime.
179
+        foreach ( $hashes as $hash ) {
180
+            $object   = $hash[0];
181
+            $new_hash = $hash[1];
182
+            $object->update_meta( self::JSONLD_HASH, $new_hash );
183
+            $object->update_meta( self::SYNCED_GMT, current_time( 'mysql', true ) );
184
+        }
185
+
186
+
187
+        /**
188
+         * Allow 3rd parties to run additional sync work.
189
+         */
190
+        do_action( 'wl_sync__sync_many', $hashes );
191
+
192
+        return true;
193
+    }
194
+
195
+    /**
196
+     * @param Sync_Object_Adapter $object
197
+     *
198
+     * @return false|string
199
+     * @throws Exception
200
+     */
201
+    private function get_payload_as_string( $object ) {
202
+        $type             = $object->get_type();
203
+        $object_id        = $object->get_object_id();
204
+        $jsonld_as_string = wp_json_encode( apply_filters( 'wl_dataset__sync_service__sync_item__jsonld',
205
+            $this->jsonld_service->get( $type, $object_id ), $type, $object_id ) );
206
+        $uri              = $this->entity_service->get_uri( $object_id, $type );
207
+
208
+        // Entity URL isn't set, bail out.
209
+        if ( empty( $uri ) ) {
210
+            return false;
211
+        }
212
+
213
+        return wp_json_encode( array(
214
+            'uri'     => $uri,
215
+            'model'   => $jsonld_as_string,
216
+            'private' => ! $object->is_public(),
217
+        ) );
218
+    }
219
+
220
+    /**
221
+     * @param $post_id
222
+     *
223
+     * @todo Complete the delete item.
224
+     */
225
+    public function delete_item( $post_id ) {
226
+        $uri = get_post_meta( $post_id, 'entity_url', true );
227
+        // Make a request to the remote endpoint.
228
+        $response = $this->api_service->request(
229
+            'DELETE', '/middleware/dataset?uri=' . rawurlencode( $uri ),
230
+            array( 'Content-Type' => 'application/ld+json', ) );
231
+
232
+    }
233
+
234
+    public function get_batch_size() {
235
+
236
+        return $this->batch_size;
237
+    }
238
+
239
+    public function delete_all() {
240
+        $this->api_service->request( 'DELETE', '/middleware/dataset/all' );
241
+    }
242 242
 
243 243
 }
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -56,9 +56,9 @@  discard block
 block discarded – undo
56 56
 	 * @param Jsonld_Service $jsonld_service
57 57
 	 * @param \Wordlift_Entity_Service $entity_service
58 58
 	 */
59
-	public function __construct( $api_service, $sync_object_adapter_factory, $jsonld_service, $entity_service ) {
59
+	public function __construct($api_service, $sync_object_adapter_factory, $jsonld_service, $entity_service) {
60 60
 
61
-		$this->log = \Wordlift_Log_Service::get_logger( get_class() );
61
+		$this->log = \Wordlift_Log_Service::get_logger(get_class());
62 62
 
63 63
 		$this->api_service                 = $api_service;
64 64
 		$this->sync_object_adapter_factory = $sync_object_adapter_factory;
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
 //		$this->sync_background_process = new Sync_Background_Process( $this );;
71 71
 
72 72
 		// Exclude the JSONLD_HASH meta key from those that require a resync.
73
-		add_filter( 'wl_dataset__sync_hooks__ignored_meta_keys', function ( $args ) {
73
+		add_filter('wl_dataset__sync_hooks__ignored_meta_keys', function($args) {
74 74
 			$args[] = Sync_Service::JSONLD_HASH;
75 75
 			$args[] = Sync_Service::SYNCED_GMT;
76 76
 
@@ -91,11 +91,11 @@  discard block
 block discarded – undo
91 91
 	 * @return array|false
92 92
 	 * @throws Exception
93 93
 	 */
94
-	public function sync_one( $type, $object_id ) {
94
+	public function sync_one($type, $object_id) {
95 95
 
96
-		$object = $this->sync_object_adapter_factory->create( $type, $object_id );
96
+		$object = $this->sync_object_adapter_factory->create($type, $object_id);
97 97
 
98
-		return $this->sync_many( array( $object ) );
98
+		return $this->sync_many(array($object));
99 99
 	}
100 100
 
101 101
 	/**
@@ -106,25 +106,25 @@  discard block
 block discarded – undo
106 106
 	 *
107 107
 	 * @return bool
108 108
 	 */
109
-	public function delete_one( $type, $object_id, $uri ) {
109
+	public function delete_one($type, $object_id, $uri) {
110 110
 		// Entity URL isn't set, bail out.
111
-		if ( empty( $uri ) ) {
111
+		if (empty($uri)) {
112 112
 			return false;
113 113
 		}
114 114
 
115 115
 		$response = $this->api_service->request(
116
-			'DELETE', sprintf( '/middleware/dataset?uri=%s', rawurlencode( $uri ) ) );
116
+			'DELETE', sprintf('/middleware/dataset?uri=%s', rawurlencode($uri)) );
117 117
 
118 118
 
119 119
 		// Update the sync date in case of success, otherwise log an error.
120
-		if ( ! $response->is_success() ) {
120
+		if ( ! $response->is_success()) {
121 121
 			return false;
122 122
 		}
123 123
 
124 124
 		/**
125 125
 		 * Allow 3rd parties to run additional sync work.
126 126
 		 */
127
-		do_action( 'wl_sync__delete_one', $type, $object_id, $uri );
127
+		do_action('wl_sync__delete_one', $type, $object_id, $uri);
128 128
 
129 129
 		return true;
130 130
 	}
@@ -136,58 +136,58 @@  discard block
 block discarded – undo
136 136
 	 * @return bool
137 137
 	 * @throws Exception
138 138
 	 */
139
-	public function sync_many( $objects, $force = false ) {
139
+	public function sync_many($objects, $force = false) {
140 140
 
141 141
 		$hashes   = array();
142 142
 		$payloads = array();
143
-		foreach ( $objects as $object ) {
143
+		foreach ($objects as $object) {
144 144
 			// Bail out if no payload.
145
-			$payload_as_string = $this->get_payload_as_string( $object );
146
-			if ( empty( $payload_as_string ) ) {
145
+			$payload_as_string = $this->get_payload_as_string($object);
146
+			if (empty($payload_as_string)) {
147 147
 				continue;
148 148
 			}
149
-			$new_hash = sha1( $payload_as_string );
150
-			$old_hash = $object->get_meta( self::JSONLD_HASH, true );
149
+			$new_hash = sha1($payload_as_string);
150
+			$old_hash = $object->get_meta(self::JSONLD_HASH, true);
151 151
 
152 152
 			// JSON-LD hasn't changed, bail out.
153
-			if ( ! $force && $new_hash === $old_hash ) {
153
+			if ( ! $force && $new_hash === $old_hash) {
154 154
 				continue;
155 155
 			}
156 156
 
157 157
 			// Collect the hashes and the payloads.
158
-			$hashes[]   = array( $object, $new_hash, $payload_as_string );
158
+			$hashes[]   = array($object, $new_hash, $payload_as_string);
159 159
 			$payloads[] = $payload_as_string;
160 160
 		}
161 161
 
162 162
 		// Bail out if payloads are empty.
163
-		if ( empty( $payloads ) ) {
163
+		if (empty($payloads)) {
164 164
 			return false;
165 165
 		}
166 166
 
167 167
 		$response = $this->api_service->request(
168 168
 			'POST', '/middleware/dataset/batch',
169
-			array( 'Content-Type' => 'application/json', ),
169
+			array('Content-Type' => 'application/json',),
170 170
 			// Put the payload in a JSON array w/o decoding/encoding again.
171
-			'[ ' . implode( ', ', $payloads ) . ' ]' );
171
+			'[ '.implode(', ', $payloads).' ]' );
172 172
 
173 173
 		// Update the sync date in case of success, otherwise log an error.
174
-		if ( ! $response->is_success() ) {
174
+		if ( ! $response->is_success()) {
175 175
 			return false;
176 176
 		}
177 177
 
178 178
 		// If successful update the hashes and sync'ed datetime.
179
-		foreach ( $hashes as $hash ) {
179
+		foreach ($hashes as $hash) {
180 180
 			$object   = $hash[0];
181 181
 			$new_hash = $hash[1];
182
-			$object->update_meta( self::JSONLD_HASH, $new_hash );
183
-			$object->update_meta( self::SYNCED_GMT, current_time( 'mysql', true ) );
182
+			$object->update_meta(self::JSONLD_HASH, $new_hash);
183
+			$object->update_meta(self::SYNCED_GMT, current_time('mysql', true));
184 184
 		}
185 185
 
186 186
 
187 187
 		/**
188 188
 		 * Allow 3rd parties to run additional sync work.
189 189
 		 */
190
-		do_action( 'wl_sync__sync_many', $hashes );
190
+		do_action('wl_sync__sync_many', $hashes);
191 191
 
192 192
 		return true;
193 193
 	}
@@ -198,23 +198,23 @@  discard block
 block discarded – undo
198 198
 	 * @return false|string
199 199
 	 * @throws Exception
200 200
 	 */
201
-	private function get_payload_as_string( $object ) {
201
+	private function get_payload_as_string($object) {
202 202
 		$type             = $object->get_type();
203 203
 		$object_id        = $object->get_object_id();
204
-		$jsonld_as_string = wp_json_encode( apply_filters( 'wl_dataset__sync_service__sync_item__jsonld',
205
-			$this->jsonld_service->get( $type, $object_id ), $type, $object_id ) );
206
-		$uri              = $this->entity_service->get_uri( $object_id, $type );
204
+		$jsonld_as_string = wp_json_encode(apply_filters('wl_dataset__sync_service__sync_item__jsonld',
205
+			$this->jsonld_service->get($type, $object_id), $type, $object_id));
206
+		$uri              = $this->entity_service->get_uri($object_id, $type);
207 207
 
208 208
 		// Entity URL isn't set, bail out.
209
-		if ( empty( $uri ) ) {
209
+		if (empty($uri)) {
210 210
 			return false;
211 211
 		}
212 212
 
213
-		return wp_json_encode( array(
213
+		return wp_json_encode(array(
214 214
 			'uri'     => $uri,
215 215
 			'model'   => $jsonld_as_string,
216 216
 			'private' => ! $object->is_public(),
217
-		) );
217
+		));
218 218
 	}
219 219
 
220 220
 	/**
@@ -222,12 +222,12 @@  discard block
 block discarded – undo
222 222
 	 *
223 223
 	 * @todo Complete the delete item.
224 224
 	 */
225
-	public function delete_item( $post_id ) {
226
-		$uri = get_post_meta( $post_id, 'entity_url', true );
225
+	public function delete_item($post_id) {
226
+		$uri = get_post_meta($post_id, 'entity_url', true);
227 227
 		// Make a request to the remote endpoint.
228 228
 		$response = $this->api_service->request(
229
-			'DELETE', '/middleware/dataset?uri=' . rawurlencode( $uri ),
230
-			array( 'Content-Type' => 'application/ld+json', ) );
229
+			'DELETE', '/middleware/dataset?uri='.rawurlencode($uri),
230
+			array('Content-Type' => 'application/ld+json',) );
231 231
 
232 232
 	}
233 233
 
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
 	}
238 238
 
239 239
 	public function delete_all() {
240
-		$this->api_service->request( 'DELETE', '/middleware/dataset/all' );
240
+		$this->api_service->request('DELETE', '/middleware/dataset/all');
241 241
 	}
242 242
 
243 243
 }
Please login to merge, or discard this patch.
src/wordlift/webhooks/class-webhooks-manager.php 2 patches
Indentation   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -11,77 +11,77 @@
 block discarded – undo
11 11
 
12 12
 class Webhooks_Manager {
13 13
 
14
-	/**
15
-	 * Registering the actions to call up sync_many or sync_delete methods
16
-	 */
17
-
18
-	public function __construct() {
19
-		add_action( 'wl_sync__sync_many', array( $this, 'sync_many' ), 10 );
20
-		add_action( 'wl_sync__delete_one', array( $this, 'sync_delete' ), 10, 3 );
21
-	}
22
-
23
-	/**
24
-	 * Method to call up webhook with post requested
25
-	 *
26
-	 * @param array $hashes
27
-	 */
28
-
29
-	public function sync_many( $hashes ) {
30
-
31
-		$urls = explode( "\n", get_option( Webhooks_Loader::URLS_OPTION_NAME, '' ) );
32
-		if ( empty( $urls ) ) {
33
-			return;
34
-		}
35
-
36
-		/**
37
-		 * Allow 3rd parties to filter out the objects that we want to send via webhooks.
38
-		 * @since 3.34.0
39
-		 * @var Sync_Object_Adapter[] $filtered_objects
40
-		 */
41
-		$filtered_hashes = apply_filters( 'wl_webhooks__sync_many__objects', $hashes );
42
-
43
-		foreach ( $urls as $url ) {
44
-			foreach ( $filtered_hashes as $hash ) {
45
-				$jsonld       = $hash[2];
46
-				$filtered_url = apply_filters( 'wl_webhooks__sync_many__url', $url, $hash );
47
-				wp_remote_request( $filtered_url, apply_filters( 'wl_webhooks__sync_many__args', array(
48
-					'blocking' => false,
49
-					'method'   => 'PUT',
50
-					'headers'  => array( 'Content-Type' => 'application/json; ' . get_bloginfo( 'charset' ) ),
51
-					'body'     => $jsonld
52
-				) ) );
53
-			}
54
-		}
55
-	}
56
-
57
-	/**
58
-	 * Method to call up webhook with delete requested
59
-	 *
60
-	 * @param string $type
61
-	 * @param int $object_id
62
-	 * @param string $uri
63
-	 */
64
-
65
-	public function sync_delete( $type, $object_id, $uri ) {
66
-
67
-		$urls = explode( "\n", get_option( Webhooks_Loader::URLS_OPTION_NAME, '' ) );
68
-		if ( empty( $urls ) ) {
69
-			return;
70
-		}
71
-
72
-		if ( ! apply_filters( 'wl_webhooks__sync_delete', true, $type, $object_id, $uri ) ) {
73
-			return;
74
-		}
75
-
76
-		foreach ( $urls as $template_url ) {
77
-			$url          = add_query_arg( array( 'uri' => $uri ), $template_url );
78
-			$filtered_url = apply_filters( 'wl_webhooks__sync_delete__url', $url, $type, $object_id, $uri );
79
-			wp_remote_request( $filtered_url, apply_filters( 'wl_webhooks__sync_delete__args', array(
80
-				'blocking' => false,
81
-				'method'   => 'DELETE',
82
-			) ) );
83
-		}
84
-
85
-	}
14
+    /**
15
+     * Registering the actions to call up sync_many or sync_delete methods
16
+     */
17
+
18
+    public function __construct() {
19
+        add_action( 'wl_sync__sync_many', array( $this, 'sync_many' ), 10 );
20
+        add_action( 'wl_sync__delete_one', array( $this, 'sync_delete' ), 10, 3 );
21
+    }
22
+
23
+    /**
24
+     * Method to call up webhook with post requested
25
+     *
26
+     * @param array $hashes
27
+     */
28
+
29
+    public function sync_many( $hashes ) {
30
+
31
+        $urls = explode( "\n", get_option( Webhooks_Loader::URLS_OPTION_NAME, '' ) );
32
+        if ( empty( $urls ) ) {
33
+            return;
34
+        }
35
+
36
+        /**
37
+         * Allow 3rd parties to filter out the objects that we want to send via webhooks.
38
+         * @since 3.34.0
39
+         * @var Sync_Object_Adapter[] $filtered_objects
40
+         */
41
+        $filtered_hashes = apply_filters( 'wl_webhooks__sync_many__objects', $hashes );
42
+
43
+        foreach ( $urls as $url ) {
44
+            foreach ( $filtered_hashes as $hash ) {
45
+                $jsonld       = $hash[2];
46
+                $filtered_url = apply_filters( 'wl_webhooks__sync_many__url', $url, $hash );
47
+                wp_remote_request( $filtered_url, apply_filters( 'wl_webhooks__sync_many__args', array(
48
+                    'blocking' => false,
49
+                    'method'   => 'PUT',
50
+                    'headers'  => array( 'Content-Type' => 'application/json; ' . get_bloginfo( 'charset' ) ),
51
+                    'body'     => $jsonld
52
+                ) ) );
53
+            }
54
+        }
55
+    }
56
+
57
+    /**
58
+     * Method to call up webhook with delete requested
59
+     *
60
+     * @param string $type
61
+     * @param int $object_id
62
+     * @param string $uri
63
+     */
64
+
65
+    public function sync_delete( $type, $object_id, $uri ) {
66
+
67
+        $urls = explode( "\n", get_option( Webhooks_Loader::URLS_OPTION_NAME, '' ) );
68
+        if ( empty( $urls ) ) {
69
+            return;
70
+        }
71
+
72
+        if ( ! apply_filters( 'wl_webhooks__sync_delete', true, $type, $object_id, $uri ) ) {
73
+            return;
74
+        }
75
+
76
+        foreach ( $urls as $template_url ) {
77
+            $url          = add_query_arg( array( 'uri' => $uri ), $template_url );
78
+            $filtered_url = apply_filters( 'wl_webhooks__sync_delete__url', $url, $type, $object_id, $uri );
79
+            wp_remote_request( $filtered_url, apply_filters( 'wl_webhooks__sync_delete__args', array(
80
+                'blocking' => false,
81
+                'method'   => 'DELETE',
82
+            ) ) );
83
+        }
84
+
85
+    }
86 86
 
87 87
 }
Please login to merge, or discard this patch.
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -16,8 +16,8 @@  discard block
 block discarded – undo
16 16
 	 */
17 17
 
18 18
 	public function __construct() {
19
-		add_action( 'wl_sync__sync_many', array( $this, 'sync_many' ), 10 );
20
-		add_action( 'wl_sync__delete_one', array( $this, 'sync_delete' ), 10, 3 );
19
+		add_action('wl_sync__sync_many', array($this, 'sync_many'), 10);
20
+		add_action('wl_sync__delete_one', array($this, 'sync_delete'), 10, 3);
21 21
 	}
22 22
 
23 23
 	/**
@@ -26,10 +26,10 @@  discard block
 block discarded – undo
26 26
 	 * @param array $hashes
27 27
 	 */
28 28
 
29
-	public function sync_many( $hashes ) {
29
+	public function sync_many($hashes) {
30 30
 
31
-		$urls = explode( "\n", get_option( Webhooks_Loader::URLS_OPTION_NAME, '' ) );
32
-		if ( empty( $urls ) ) {
31
+		$urls = explode("\n", get_option(Webhooks_Loader::URLS_OPTION_NAME, ''));
32
+		if (empty($urls)) {
33 33
 			return;
34 34
 		}
35 35
 
@@ -38,18 +38,18 @@  discard block
 block discarded – undo
38 38
 		 * @since 3.34.0
39 39
 		 * @var Sync_Object_Adapter[] $filtered_objects
40 40
 		 */
41
-		$filtered_hashes = apply_filters( 'wl_webhooks__sync_many__objects', $hashes );
41
+		$filtered_hashes = apply_filters('wl_webhooks__sync_many__objects', $hashes);
42 42
 
43
-		foreach ( $urls as $url ) {
44
-			foreach ( $filtered_hashes as $hash ) {
43
+		foreach ($urls as $url) {
44
+			foreach ($filtered_hashes as $hash) {
45 45
 				$jsonld       = $hash[2];
46
-				$filtered_url = apply_filters( 'wl_webhooks__sync_many__url', $url, $hash );
47
-				wp_remote_request( $filtered_url, apply_filters( 'wl_webhooks__sync_many__args', array(
46
+				$filtered_url = apply_filters('wl_webhooks__sync_many__url', $url, $hash);
47
+				wp_remote_request($filtered_url, apply_filters('wl_webhooks__sync_many__args', array(
48 48
 					'blocking' => false,
49 49
 					'method'   => 'PUT',
50
-					'headers'  => array( 'Content-Type' => 'application/json; ' . get_bloginfo( 'charset' ) ),
50
+					'headers'  => array('Content-Type' => 'application/json; '.get_bloginfo('charset')),
51 51
 					'body'     => $jsonld
52
-				) ) );
52
+				)));
53 53
 			}
54 54
 		}
55 55
 	}
@@ -62,24 +62,24 @@  discard block
 block discarded – undo
62 62
 	 * @param string $uri
63 63
 	 */
64 64
 
65
-	public function sync_delete( $type, $object_id, $uri ) {
65
+	public function sync_delete($type, $object_id, $uri) {
66 66
 
67
-		$urls = explode( "\n", get_option( Webhooks_Loader::URLS_OPTION_NAME, '' ) );
68
-		if ( empty( $urls ) ) {
67
+		$urls = explode("\n", get_option(Webhooks_Loader::URLS_OPTION_NAME, ''));
68
+		if (empty($urls)) {
69 69
 			return;
70 70
 		}
71 71
 
72
-		if ( ! apply_filters( 'wl_webhooks__sync_delete', true, $type, $object_id, $uri ) ) {
72
+		if ( ! apply_filters('wl_webhooks__sync_delete', true, $type, $object_id, $uri)) {
73 73
 			return;
74 74
 		}
75 75
 
76
-		foreach ( $urls as $template_url ) {
77
-			$url          = add_query_arg( array( 'uri' => $uri ), $template_url );
78
-			$filtered_url = apply_filters( 'wl_webhooks__sync_delete__url', $url, $type, $object_id, $uri );
79
-			wp_remote_request( $filtered_url, apply_filters( 'wl_webhooks__sync_delete__args', array(
76
+		foreach ($urls as $template_url) {
77
+			$url          = add_query_arg(array('uri' => $uri), $template_url);
78
+			$filtered_url = apply_filters('wl_webhooks__sync_delete__url', $url, $type, $object_id, $uri);
79
+			wp_remote_request($filtered_url, apply_filters('wl_webhooks__sync_delete__args', array(
80 80
 				'blocking' => false,
81 81
 				'method'   => 'DELETE',
82
-			) ) );
82
+			)));
83 83
 		}
84 84
 
85 85
 	}
Please login to merge, or discard this patch.