@@ -68,16 +68,16 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function __construct() { |
70 | 70 | |
71 | - add_action( 'admin_init', array( $this, 'compatible_version_check' ) ); |
|
71 | + add_action('admin_init', array($this, 'compatible_version_check')); |
|
72 | 72 | |
73 | 73 | // Don't run anything else in the plugin, if we're on an incompatible PHP version |
74 | - if ( ! self::compatible_version() ) { |
|
74 | + if (!self::compatible_version()) { |
|
75 | 75 | return; |
76 | 76 | } |
77 | 77 | |
78 | 78 | $this->set_variables(); |
79 | 79 | |
80 | - add_action( 'init', array( $this, 'load_plugin_textdomain' ) ); |
|
80 | + add_action('init', array($this, 'load_plugin_textdomain')); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | * @since 1.0.0 |
96 | 96 | */ |
97 | 97 | public static function compatible_version() { |
98 | - if ( version_compare( PHP_VERSION, '5.6', '<' ) ) { |
|
98 | + if (version_compare(PHP_VERSION, '5.6', '<')) { |
|
99 | 99 | return false; |
100 | 100 | } |
101 | 101 | |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | * @since 1.0.0 |
110 | 110 | */ |
111 | 111 | public function compatible_version_check() { |
112 | - if ( ! self::compatible_version() ) { |
|
113 | - if ( is_plugin_active( plugin_basename( WETU_IMPORTER_CORE ) ) ) { |
|
114 | - deactivate_plugins( plugin_basename( WETU_IMPORTER_CORE ) ); |
|
115 | - add_action( 'admin_notices', array( $this, 'compatible_version_notice' ) ); |
|
112 | + if (!self::compatible_version()) { |
|
113 | + if (is_plugin_active(plugin_basename(WETU_IMPORTER_CORE))) { |
|
114 | + deactivate_plugins(plugin_basename(WETU_IMPORTER_CORE)); |
|
115 | + add_action('admin_notices', array($this, 'compatible_version_notice')); |
|
116 | 116 | |
117 | - if ( isset( $_GET['activate'] ) ) { |
|
118 | - unset( $_GET['activate'] ); |
|
117 | + if (isset($_GET['activate'])) { |
|
118 | + unset($_GET['activate']); |
|
119 | 119 | } |
120 | 120 | } |
121 | 121 | } |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function compatible_version_notice() { |
130 | 130 | $class = 'notice notice-error'; |
131 | - $message = esc_html__( 'Wetu Importer Plugin requires PHP 5.6 or higher.', 'wetu-importer' ); |
|
132 | - printf( '<div class="%1$s"><p>%2$s</p></div>', esc_html( $class ), esc_html( $message ) ); |
|
131 | + $message = esc_html__('Wetu Importer Plugin requires PHP 5.6 or higher.', 'wetu-importer'); |
|
132 | + printf('<div class="%1$s"><p>%2$s</p></div>', esc_html($class), esc_html($message)); |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -139,9 +139,9 @@ discard block |
||
139 | 139 | * @since 1.0.0 |
140 | 140 | */ |
141 | 141 | public static function compatible_version_check_on_activation() { |
142 | - if ( ! self::compatible_version() ) { |
|
143 | - deactivate_plugins( plugin_basename( WETU_IMPORTER_CORE ) ); |
|
144 | - wp_die( esc_html__( 'Wetu Importer Plugin requires PHP 5.6 or higher.', 'wetu-importer' ) ); |
|
142 | + if (!self::compatible_version()) { |
|
143 | + deactivate_plugins(plugin_basename(WETU_IMPORTER_CORE)); |
|
144 | + wp_die(esc_html__('Wetu Importer Plugin requires PHP 5.6 or higher.', 'wetu-importer')); |
|
145 | 145 | } |
146 | 146 | } |
147 | 147 | |
@@ -149,9 +149,9 @@ discard block |
||
149 | 149 | * Sets the variables used throughout the plugin. |
150 | 150 | */ |
151 | 151 | public function set_variables() { |
152 | - $temp_options = get_option('_lsx-to_settings',false); |
|
152 | + $temp_options = get_option('_lsx-to_settings', false); |
|
153 | 153 | |
154 | - if(isset($temp_options[$this->plugin_slug])) { |
|
154 | + if (isset($temp_options[$this->plugin_slug])) { |
|
155 | 155 | $this->options = $temp_options[$this->plugin_slug]; |
156 | 156 | |
157 | 157 | $this->api_key = false; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | if (isset($this->options['cropping']) && '' !== $this->options['cropping']) { |
175 | 175 | $cropping = $this->options['cropping']; |
176 | 176 | } |
177 | - $this->image_scaling_url = 'https://wetu.com/ImageHandler/' . $cropping . $width . 'x' . $height . '/'; |
|
177 | + $this->image_scaling_url = 'https://wetu.com/ImageHandler/'.$cropping.$width.'x'.$height.'/'; |
|
178 | 178 | } |
179 | 179 | } |
180 | 180 | } |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | * @since 1.0.0 |
187 | 187 | */ |
188 | 188 | public function load_plugin_textdomain() { |
189 | - load_plugin_textdomain( 'wetu-importer', FALSE, basename( WETU_IMPORTER_PATH ) . '/languages'); |
|
189 | + load_plugin_textdomain('wetu-importer', FALSE, basename(WETU_IMPORTER_PATH).'/languages'); |
|
190 | 190 | } |
191 | 191 | } |
192 | 192 | $wetu_importer = new WETU_Importer(); |
@@ -11,12 +11,12 @@ discard block |
||
11 | 11 | * Domain Path: /languages/ |
12 | 12 | */ |
13 | 13 | |
14 | -define('WETU_IMPORTER_PATH', plugin_dir_path( __FILE__ ) ); |
|
15 | -define('WETU_IMPORTER_CORE', __FILE__ ); |
|
16 | -define('WETU_IMPORTER_URL', plugin_dir_url( __FILE__ ) ); |
|
17 | -define('WETU_IMPORTER_VER', '1.0.0' ); |
|
14 | +define('WETU_IMPORTER_PATH', plugin_dir_path(__FILE__)); |
|
15 | +define('WETU_IMPORTER_CORE', __FILE__); |
|
16 | +define('WETU_IMPORTER_URL', plugin_dir_url(__FILE__)); |
|
17 | +define('WETU_IMPORTER_VER', '1.0.0'); |
|
18 | 18 | |
19 | -register_activation_hook( WETU_IMPORTER_CORE, array( 'WETU_Importer', 'register_activation_hook' ) ); |
|
19 | +register_activation_hook(WETU_IMPORTER_CORE, array('WETU_Importer', 'register_activation_hook')); |
|
20 | 20 | |
21 | 21 | require_once(WETU_IMPORTER_PATH.'classes/class-importer.php'); |
22 | 22 | require_once(WETU_IMPORTER_PATH.'classes/class-admin.php'); |
@@ -26,6 +26,6 @@ discard block |
||
26 | 26 | require_once(WETU_IMPORTER_PATH.'classes/class-connect-accommodation.php'); |
27 | 27 | require_once(WETU_IMPORTER_PATH.'classes/class-settings.php'); |
28 | 28 | |
29 | -if(class_exists('Lsx_Banners')){ |
|
29 | +if (class_exists('Lsx_Banners')) { |
|
30 | 30 | require_once(WETU_IMPORTER_PATH.'classes/lsx-banners-integration.php'); |
31 | 31 | } |
32 | 32 | \ No newline at end of file |