Completed
Push — develop ( 0c26c3...8268ab )
by David
03:02
created

Wordlift_Configuration_Service   C

Complexity

Total Complexity 53

Size/Duplication

Total Lines 704
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
dl 0
loc 704
rs 6.856
c 0
b 0
f 0
wmc 53
lcom 1
cbo 3

36 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A get_instance() 0 4 1
A get() 0 6 2
A set() 0 8 2
A get_entity_base_path() 0 4 1
A set_entity_base_path() 0 5 1
A is_skip_wizard() 0 4 1
A set_skip_wizard() 0 5 1
A get_key() 0 4 1
A set_key() 0 4 1
A get_language_code() 0 4 1
A set_language_code() 0 5 1
A set_diagnostic_preferences() 0 5 1
A get_diagnostic_preferences() 0 4 1
A get_country_code() 0 4 1
A set_country_code() 0 5 1
A get_publisher_id() 0 4 1
A set_publisher_id() 0 5 1
A get_dataset_uri() 0 8 2
A set_dataset_uri() 0 4 1
A get_package_type() 0 4 1
A set_package_type() 0 4 1
A update_key() 0 21 3
B get_remote_dataset_uri() 0 72 6
A maybe_update_dataset_uri() 0 18 6
A get_accounts_by_key_dataset_uri() 0 4 1
A get_accounts() 0 4 1
A is_link_by_default() 0 4 1
A set_link_by_default() 0 4 2
A is_analytics_enable() 0 3 1
A set_is_analytics_enable() 0 4 2
A get_analytics_entity_uri_dimension() 0 3 1
A get_analytics_entity_type_dimension() 0 3 1
A get_autocomplete_url() 0 5 1
A get_deactivation_feedback_url() 0 5 1
A get_api_url() 0 4 1

How to fix   Complexity   

Complex Class

Complex classes like Wordlift_Configuration_Service often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use Wordlift_Configuration_Service, and based on these observations, apply Extract Interface, too.

1
<?php
2
/**
3
 * Wordlift_Configuration_Service class.
4
 *
5
 * The {@link Wordlift_Configuration_Service} class provides helper functions to get configuration parameter values.
6
 *
7
 * @link       https://wordlift.io
8
 *
9
 * @package    Wordlift
10
 * @since      3.6.0
11
 */
12
13
use Wordlift\Api\Default_Api_Service;
14
15
if ( ! defined( 'ABSPATH' ) ) {
16
	exit;
17
}
18
19
/**
20
 * Get WordLift's configuration settings stored in WordPress database.
21
 *
22
 * @since 3.6.0
23
 */
24
class Wordlift_Configuration_Service {
25
26
	/**
27
	 * The entity base path option name.
28
	 *
29
	 * @since 3.6.0
30
	 */
31
	const ENTITY_BASE_PATH_KEY = 'wl_entity_base_path';
32
33
	/**
34
	 * The skip wizard (admin installation wizard) option name.
35
	 *
36
	 * @since 3.9.0
37
	 */
38
	const SKIP_WIZARD = 'wl_skip_wizard';
39
40
	/**
41
	 * WordLift's key option name.
42
	 *
43
	 * @since 3.9.0
44
	 */
45
	const KEY = 'key';
46
47
	/**
48
	 * WordLift's configured language option name.
49
	 *
50
	 * @since 3.9.0
51
	 */
52
	const LANGUAGE = 'site_language';
53
54
	/**
55
	 * WordLift's configured country code.
56
	 *
57
	 * @since 3.18.0
58
	 */
59
	const COUNTRY_CODE = 'country_code';
60
61
	/**
62
	 * The publisher entity post ID option name.
63
	 *
64
	 * @since 3.9.0
65
	 */
66
	const PUBLISHER_ID = 'publisher_id';
67
68
	/**
69
	 * The dataset URI option name
70
	 *
71
	 * @since 3.10.0
72
	 */
73
	const DATASET_URI = 'redlink_dataset_uri';
74
75
	/**
76
	 * The link by default option name.
77
	 *
78
	 * @since 3.11.0
79
	 */
80
	const LINK_BY_DEFAULT = 'link_by_default';
81
82
	/**
83
	 * The analytics enable option.
84
	 *
85
	 * @since 3.21.0
86
	 */
87
	const ANALYTICS_ENABLE = 'analytics_enable';
88
89
	/**
90
	 * The analytics entity uri dimension option.
91
	 *
92
	 * @since 3.21.0
93
	 */
94
	const ANALYTICS_ENTITY_URI_DIMENSION = 'analytics_entity_uri_dimension';
95
96
	/**
97
	 * The analytics entity type dimension option.
98
	 *
99
	 * @since 3.21.0
100
	 */
101
	const ANALYTICS_ENTITY_TYPE_DIMENSION = 'analytics_entity_type_dimension';
102
103
	/**
104
	 * The user preferences about sharing data option.
105
	 *
106
	 * @since 3.19.0
107
	 */
108
	const SEND_DIAGNOSTIC = 'send_diagnostic';
109
110
	/**
111
	 * The package type configuration key.
112
	 *
113
	 * @since 3.20.0
114
	 */
115
	const PACKAGE_TYPE = 'package_type';
116
117
	/**
118
	 * The {@link Wordlift_Log_Service} instance.
119
	 *
120
	 * @since 3.16.0
121
	 *
122
	 * @var \Wordlift_Log_Service $log The {@link Wordlift_Log_Service} instance.
123
	 */
124
	private $log;
125
126
	/**
127
	 * The Wordlift_Configuration_Service's singleton instance.
128
	 *
129
	 * @since  3.6.0
130
	 *
131
	 * @access private
132
	 * @var \Wordlift_Configuration_Service $instance Wordlift_Configuration_Service's singleton instance.
133
	 */
134
	private static $instance;
135
136
	/**
137
	 * Create a Wordlift_Configuration_Service's instance.
138
	 *
139
	 * @since 3.6.0
140
	 */
141
	public function __construct() {
142
143
		$this->log = Wordlift_Log_Service::get_logger( get_class() );
144
145
		self::$instance = $this;
146
147
	}
148
149
	/**
150
	 * Get the singleton instance.
151
	 *
152
	 * @return \Wordlift_Configuration_Service
153
	 * @since 3.6.0
154
	 *
155
	 */
156
	public static function get_instance() {
157
158
		return self::$instance;
159
	}
160
161
	/**
162
	 * Get a configuration given the option name and a key. The option value is
163
	 * expected to be an array.
164
	 *
165
	 * @param string $option The option name.
166
	 * @param string $key A key in the option value array.
167
	 * @param string $default The default value in case the key is not found (by default an empty string).
168
	 *
169
	 * @return mixed The configuration value or the default value if not found.
170
	 * @since 3.6.0
171
	 *
172
	 */
173
	private function get( $option, $key, $default = '' ) {
174
175
		$options = get_option( $option, array() );
176
177
		return isset( $options[ $key ] ) ? $options[ $key ] : $default;
178
	}
179
180
	/**
181
	 * Set a configuration parameter.
182
	 *
183
	 * @param string $option Name of option to retrieve. Expected to not be SQL-escaped.
184
	 * @param string $key The value key.
185
	 * @param mixed $value The value.
186
	 *
187
	 * @since 3.9.0
188
	 *
189
	 */
190
	private function set( $option, $key, $value ) {
191
192
		$values         = get_option( $option );
193
		$values         = isset( $values ) ? $values : array();
194
		$values[ $key ] = $value;
195
		update_option( $option, $values );
196
197
	}
198
199
	/**
200
	 * Get the entity base path, by default 'entity'.
201
	 *
202
	 * @return string The entity base path.
203
	 * @since 3.6.0
204
	 *
205
	 */
206
	public function get_entity_base_path() {
207
208
		return $this->get( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, 'entity' );
209
	}
210
211
	/**
212
	 * Get the entity base path.
213
	 *
214
	 * @param string $value The entity base path.
215
	 *
216
	 * @since 3.9.0
217
	 *
218
	 */
219
	public function set_entity_base_path( $value ) {
220
221
		$this->set( 'wl_general_settings', self::ENTITY_BASE_PATH_KEY, $value );
222
223
	}
224
225
	/**
226
	 * Whether the installation skip wizard should be skipped.
227
	 *
228
	 * @return bool True if it should be skipped otherwise false.
229
	 * @since 3.9.0
230
	 *
231
	 */
232
	public function is_skip_wizard() {
233
234
		return $this->get( 'wl_general_settings', self::SKIP_WIZARD, false );
0 ignored issues
show
Documentation introduced by
false is of type boolean, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
235
	}
236
237
	/**
238
	 * Set the skip wizard parameter.
239
	 *
240
	 * @param bool $value True to skip the wizard. We expect a boolean value.
241
	 *
242
	 * @since 3.9.0
243
	 *
244
	 */
245
	public function set_skip_wizard( $value ) {
246
247
		$this->set( 'wl_general_settings', self::SKIP_WIZARD, true === $value );
248
249
	}
250
251
	/**
252
	 * Get WordLift's key.
253
	 *
254
	 * @return string WordLift's key or an empty string if not set.
255
	 * @since 3.9.0
256
	 *
257
	 */
258
	public function get_key() {
259
260
		return $this->get( 'wl_general_settings', self::KEY, '' );
261
	}
262
263
	/**
264
	 * Set WordLift's key.
265
	 *
266
	 * @param string $value WordLift's key.
267
	 *
268
	 * @since 3.9.0
269
	 *
270
	 */
271
	public function set_key( $value ) {
272
273
		$this->set( 'wl_general_settings', self::KEY, $value );
274
	}
275
276
	/**
277
	 * Get WordLift's configured language, by default 'en'.
278
	 *
279
	 * Note that WordLift's language is used when writing strings to the Linked Data dataset, not for the analysis.
280
	 *
281
	 * @return string WordLift's configured language code ('en' by default).
282
	 * @since 3.9.0
283
	 *
284
	 */
285
	public function get_language_code() {
286
287
		return $this->get( 'wl_general_settings', self::LANGUAGE, 'en' );
288
	}
289
290
	/**
291
	 * Set WordLift's language code, used when storing strings to the Linked Data dataset.
292
	 *
293
	 * @param string $value WordLift's language code.
294
	 *
295
	 * @since 3.9.0
296
	 *
297
	 */
298
	public function set_language_code( $value ) {
299
300
		$this->set( 'wl_general_settings', self::LANGUAGE, $value );
301
302
	}
303
304
	/**
305
	 * Set the user preferences about sharing diagnostic with us.
306
	 *
307
	 * @param string $value The user preferences(yes/no).
308
	 *
309
	 * @since 3.19.0
310
	 *
311
	 */
312
	public function set_diagnostic_preferences( $value ) {
313
314
		$this->set( 'wl_general_settings', self::SEND_DIAGNOSTIC, $value );
315
316
	}
317
318
	/**
319
	 * Get the user preferences about sharing diagnostic.
320
	 *
321
	 * @since 3.19.0
322
	 */
323
	public function get_diagnostic_preferences() {
324
325
		return $this->get( 'wl_general_settings', self::SEND_DIAGNOSTIC, 'no' );
326
	}
327
328
	/**
329
	 * Get WordLift's configured country code, by default 'us'.
330
	 *
331
	 * @return string WordLift's configured country code ('us' by default).
332
	 * @since 3.18.0
333
	 *
334
	 */
335
	public function get_country_code() {
336
337
		return $this->get( 'wl_general_settings', self::COUNTRY_CODE, 'us' );
338
	}
339
340
	/**
341
	 * Set WordLift's country code.
342
	 *
343
	 * @param string $value WordLift's country code.
344
	 *
345
	 * @since 3.18.0
346
	 *
347
	 */
348
	public function set_country_code( $value ) {
349
350
		$this->set( 'wl_general_settings', self::COUNTRY_CODE, $value );
351
352
	}
353
354
	/**
355
	 * Get the publisher entity post id.
356
	 *
357
	 * The publisher entity post id points to an entity post which contains the data for the publisher used in schema.org
358
	 * Article markup.
359
	 *
360
	 * @return int|NULL The publisher entity post id or NULL if not set.
361
	 * @since 3.9.0
362
	 *
363
	 */
364
	public function get_publisher_id() {
365
366
		return $this->get( 'wl_general_settings', self::PUBLISHER_ID, null );
367
	}
368
369
	/**
370
	 * Set the publisher entity post id.
371
	 *
372
	 * @param int $value The publisher entity post id.
373
	 *
374
	 * @since 3.9.0
375
	 *
376
	 */
377
	public function set_publisher_id( $value ) {
378
379
		$this->set( 'wl_general_settings', self::PUBLISHER_ID, $value );
380
381
	}
382
383
	/**
384
	 * Get the dataset URI.
385
	 *
386
	 * @return string The dataset URI or an empty string if not set.
387
	 * @since 3.10.0
388
	 * @since 3.27.7 Always return null if `wl_features__enable__dataset` is disabled.
389
	 *
390
	 */
391
	public function get_dataset_uri() {
392
393
		if ( apply_filters( 'wl_features__enable__dataset', true ) ) {
394
			return $this->get( 'wl_advanced_settings', self::DATASET_URI, null );
395
		} else {
396
			return null;
397
		}
398
	}
399
400
	/**
401
	 * Set the dataset URI.
402
	 *
403
	 * @param string $value The dataset URI.
404
	 *
405
	 * @since 3.10.0
406
	 *
407
	 */
408
	public function set_dataset_uri( $value ) {
409
410
		$this->set( 'wl_advanced_settings', self::DATASET_URI, $value );
411
	}
412
413
	/**
414
	 * Get the package type.
415
	 *
416
	 * @return string The package type or an empty string if not set.
417
	 * @since 3.20.0
418
	 *
419
	 */
420
	public function get_package_type() {
421
422
		return $this->get( 'wl_advanced_settings', self::PACKAGE_TYPE, null );
423
	}
424
425
	/**
426
	 * Set the package type.
427
	 *
428
	 * @param string $value The package type.
429
	 *
430
	 * @since 3.20.0
431
	 *
432
	 */
433
	public function set_package_type( $value ) {
434
435
		$this->set( 'wl_advanced_settings', self::PACKAGE_TYPE, $value );
436
	}
437
438
	/**
439
	 * Intercept the change of the WordLift key in order to set the dataset URI.
440
	 *
441
	 *
442
	 * @since 3.20.0 as of #761, we save settings every time a key is set, not only when the key changes, so to
443
	 *               store the configuration parameters such as country or language.
444
	 * @since 3.11.0
445
	 *
446
	 * @see https://github.com/insideout10/wordlift-plugin/issues/761
447
	 *
448
	 * @param array $old_value The old settings.
449
	 * @param array $new_value The new settings.
450
	 */
451
	public function update_key( $old_value, $new_value ) {
0 ignored issues
show
Unused Code introduced by
The parameter $old_value is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
452
453
		// Check the old key value and the new one. We're going to ask for the dataset URI only if the key has changed.
454
		// $old_key = isset( $old_value['key'] ) ? $old_value['key'] : '';
455
		$new_key = isset( $new_value['key'] ) ? $new_value['key'] : '';
456
457
		// If the key hasn't changed, don't do anything.
458
		// WARN The 'update_option' hook is fired only if the new and old value are not equal.
459
		//		if ( $old_key === $new_key ) {
460
		//			return;
461
		//		}
462
463
		// If the key is empty, empty the dataset URI.
464
		if ( '' === $new_key ) {
465
			$this->set_dataset_uri( '' );
466
		}
467
468
		// make the request to the remote server.
469
		$this->get_remote_dataset_uri( $new_key );
470
471
	}
472
473
	/**
474
	 * Handle retrieving the dataset uri from the remote server.
475
	 *
476
	 * If a valid dataset uri is returned it is stored in the appropriate option,
477
	 * otherwise the option is set to empty string.
478
	 *
479
	 * @param string $key The key to be used.
480
	 *
481
	 * @since 3.12.0
482
	 *
483
	 * @since 3.17.0 send the site URL and get the dataset URI.
484
	 */
485
	public function get_remote_dataset_uri( $key ) {
486
487
		$this->log->trace( 'Getting the remote dataset URI and package type...' );
488
489
		if ( empty( $key ) ) {
490
			$this->log->warn( 'Key set to empty value.' );
491
492
			$this->set_dataset_uri( '' );
493
			$this->set_package_type( null );
494
495
			return;
496
		}
497
498
		/**
499
		 * Allow 3rd parties to change the site_url.
500
		 *
501
		 * @param string $site_url The site url.
502
		 *
503
		 * @see https://github.com/insideout10/wordlift-plugin/issues/850
504
		 *
505
		 * @since 3.20.0
506
		 *
507
		 */
508
		$home_url = defined( 'WP_HOME' ) ? WP_HOME : get_option( 'home' );
509
		$site_url = apply_filters( 'wl_production_site_url', untrailingslashit( $home_url ) );
510
511
		// Build the URL.
512
		$url = '/accounts'
513
		       . '?key=' . rawurlencode( $key )
514
		       . '&url=' . rawurlencode( $site_url )
515
		       . '&country=' . $this->get_country_code()
516
		       . '&language=' . $this->get_language_code();
517
518
		$api_service = Default_Api_Service::get_instance();
519
		$response    = $api_service->request( 'PUT', $url )->get_response();
520
521
		// The response is an error.
522
		if ( is_wp_error( $response ) ) {
523
			$this->log->error( 'An error occurred setting the dataset URI: ' . $response->get_error_message() );
524
525
			$this->set_dataset_uri( '' );
526
			$this->set_package_type( null );
527
528
			return;
529
		}
530
531
		// The response is not OK.
532
		if ( 200 !== (int) $response['response']['code'] ) {
533
			$base_url = $api_service->get_base_url();
534
			$this->log->error( "Unexpected status code when opening URL $base_url$url: " . $response['response']['code'] . "\n" . var_export( $response, true ) );
535
536
			$this->set_dataset_uri( '' );
537
			$this->set_package_type( null );
538
539
			return;
540
		}
541
542
		/*
543
		 * We also store the package type.
544
		 *
545
		 * @since 3.20.0
546
		 */
547
		$json         = json_decode( $response['body'] );
548
		$dataset_uri  = $json->datasetURI;
549
		$package_type = isset( $json->packageType ) ? $json->packageType : null;
550
551
		$this->log->info( "Updating [ dataset uri :: $dataset_uri ][ package type :: $package_type ]..." );
552
553
		$this->set_dataset_uri( $dataset_uri );
554
		$this->set_package_type( $package_type );
555
556
	}
557
558
	/**
559
	 * Handle the edge case where a user submits the same key again
560
	 * when he does not have the dataset uri to regain it.
561
	 *
562
	 * This can not be handled in the normal option update hook because
563
	 * it is not being triggered when the save value equals to the one already
564
	 * in the DB.
565
	 *
566
	 * @param mixed $value The new, unserialized option value.
567
	 * @param mixed $old_value The old option value.
568
	 *
569
	 * @return mixed The same value in the $value parameter
570
	 * @since 3.12.0
571
	 *
572
	 */
573
	function maybe_update_dataset_uri( $value, $old_value ) {
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
574
575
		// Check the old key value and the new one. Here we're only handling the
576
		// case where the key hasn't changed and the dataset URI isn't set. The
577
		// other case, i.e. a new key is inserted, is handled at `update_key`.
578
		$old_key = isset( $old_value['key'] ) ? $old_value['key'] : '';
579
		$new_key = isset( $value['key'] ) ? $value['key'] : '';
580
581
		$dataset_uri = $this->get_dataset_uri();
582
583
		if ( ! empty( $new_key ) && $new_key === $old_key && empty( $dataset_uri ) ) {
584
585
			// make the request to the remote server to try to get the dataset uri.
586
			$this->get_remote_dataset_uri( $new_key );
587
		}
588
589
		return $value;
590
	}
591
592
	/**
593
	 * Get the API URI to retrieve the dataset URI using the WordLift Key.
594
	 *
595
	 * @param string $key The WordLift key to use.
596
	 *
597
	 * @return string The API URI.
598
	 * @since 3.11.0
599
	 *
600
	 */
601
	public function get_accounts_by_key_dataset_uri( $key ) {
602
603
		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . "accounts/key=$key/dataset_uri";
604
	}
605
606
	/**
607
	 * Get the `accounts` end point.
608
	 *
609
	 * @return string The `accounts` end point.
610
	 * @since 3.16.0
611
	 *
612
	 */
613
	public function get_accounts() {
614
615
		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'accounts';
616
	}
617
618
	/**
619
	 * Get the `link by default` option.
620
	 *
621
	 * @return bool True if entities must be linked by default otherwise false.
622
	 * @since 3.13.0
623
	 *
624
	 */
625
	public function is_link_by_default() {
626
627
		return 'yes' === $this->get( 'wl_general_settings', self::LINK_BY_DEFAULT, 'yes' );
628
	}
629
630
	/**
631
	 * Set the `link by default` option.
632
	 *
633
	 * @param bool $value True to enabling linking by default, otherwise false.
634
	 *
635
	 * @since 3.13.0
636
	 *
637
	 */
638
	public function set_link_by_default( $value ) {
639
640
		$this->set( 'wl_general_settings', self::LINK_BY_DEFAULT, true === $value ? 'yes' : 'no' );
641
	}
642
643
	/**
644
	 * Get the 'analytics-enable' option.
645
	 *
646
	 * @return string 'no' or 'yes' representing bool.
647
	 * @since 3.21.0
648
	 *
649
	 */
650
	public function is_analytics_enable() {
651
		return 'yes' === $this->get( 'wl_analytics_settings', self::ANALYTICS_ENABLE, 'no' );
652
	}
653
654
	/**
655
	 * Set the `analytics-enable` option.
656
	 *
657
	 * @param bool $value True to enabling analytics, otherwise false.
658
	 *
659
	 * @since 3.21.0
660
	 *
661
	 */
662
	public function set_is_analytics_enable( $value ) {
663
664
		$this->set( 'wl_general_settings', self::ANALYTICS_ENABLE, true === $value ? 'yes' : 'no' );
665
	}
666
667
	/**
668
	 * Get the 'analytics-entity-uri-dimention' option.
669
	 *
670
	 * @return int
671
	 * @since 3.21.0
672
	 *
673
	 */
674
	public function get_analytics_entity_uri_dimension() {
675
		return (int) $this->get( 'wl_analytics_settings', self::ANALYTICS_ENTITY_URI_DIMENSION, 1 );
676
	}
677
678
	/**
679
	 * Get the 'analytics-entity-type-dimension' option.
680
	 *
681
	 * @return int
682
	 * @since 3.21.0
683
	 *
684
	 */
685
	public function get_analytics_entity_type_dimension() {
686
		return $this->get( 'wl_analytics_settings', self::ANALYTICS_ENTITY_TYPE_DIMENSION, 2 );
687
	}
688
689
	/**
690
	 * Get the URL to perform autocomplete request.
691
	 *
692
	 * @return string The URL to call to perform the autocomplete request.
693
	 * @since 3.15.0
694
	 *
695
	 */
696
	public function get_autocomplete_url() {
697
698
		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'autocomplete';
699
700
	}
701
702
	/**
703
	 * Get the URL to perform feedback deactivation request.
704
	 *
705
	 * @return string The URL to call to perform the feedback deactivation request.
706
	 * @since 3.19.0
707
	 *
708
	 */
709
	public function get_deactivation_feedback_url() {
710
711
		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE . 'feedbacks';
712
713
	}
714
715
	/**
716
	 * Get the base API URL.
717
	 *
718
	 * @return string The base API URL.
719
	 * @since 3.20.0
720
	 *
721
	 */
722
	public function get_api_url() {
723
724
		return WL_CONFIG_WORDLIFT_API_URL_DEFAULT_VALUE;
725
	}
726
727
}
728