Completed
Push — develop ( ce465f...dc3813 )
by David
02:29 queued 11s
created

Wordlift_Install_3_24_2::install()   A

Complexity

Conditions 4
Paths 8

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
nc 8
nop 0
dl 0
loc 20
rs 9.6
c 0
b 0
f 0
1
<?php
2
/**
3
 * This file provides the install 3.24.2 procedure.
4
 *
5
 * This procedure sets the autoload option on several WLP options that are often queries.
6
 *
7
 * @author David Riccitelli <[email protected]>
8
 * @since 3.24.2
9
 * @package Wordlift/install
10
 */
11
12
class Wordlift_Install_3_24_2 extends Wordlift_Install {
13
14
	/**
15
	 * {@inheritdoc}
16
	 */
17
	protected static $version = '3.24.2';
18
19
	/**
20
	 * @inheritDoc
21
	 */
22
	public function install() {
23
24
		global $wpdb;
25
26
		if ( false === get_option( 'wl_mappings' ) ) {
27
			add_option( 'wl_mappings', array(), '', true );
28
		}
29
30
		if ( false === get_option( 'wl_analytics_settings' ) ) {
31
			add_option( 'wl_analytics_settings', false, '', true );
32
		}
33
34
		if ( false === get_option( 'wl_entity_type_settings' ) ) {
35
			add_option( 'wl_entity_type_settings', array(), '', true );
36
		}
37
38
		$wpdb->query( "UPDATE {$wpdb->options} SET autoload = 'yes'"
39
		              . " WHERE option_name IN ( 'wl_mappings', 'wl_analytics_settings', 'wl_entity_type_settings', 'WPLANG' )" );
40
41
	}
42
43
}
44