@@ -11,50 +11,50 @@ 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.1.2' ); |
|
| 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.1.2'); |
|
| 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 | /* ======================= The API Classes ========================= */ |
| 22 | 22 | |
| 23 | -if ( ! class_exists( 'LSX_API_Manager' ) ) { |
|
| 24 | - require_once( 'classes/class-lsx-api-manager.php' ); |
|
| 23 | +if (!class_exists('LSX_API_Manager')) { |
|
| 24 | + require_once('classes/class-lsx-api-manager.php'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** |
| 28 | 28 | * Grabs the email and api key from settings. |
| 29 | 29 | */ |
| 30 | -function lsx_to_wetu_importer_options_pages_filter( $pages ) { |
|
| 30 | +function lsx_to_wetu_importer_options_pages_filter($pages) { |
|
| 31 | 31 | $pages[] = 'lsx-to-settings'; |
| 32 | 32 | return $pages; |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | -add_filter( 'lsx_api_manager_options_pages', 'lsx_to_wetu_importer_options_pages_filter', 10, 1 ); |
|
| 35 | +add_filter('lsx_api_manager_options_pages', 'lsx_to_wetu_importer_options_pages_filter', 10, 1); |
|
| 36 | 36 | |
| 37 | 37 | function lsx_to_wetu_importer_api_admin_init() { |
| 38 | - $options = get_option( '_lsx-to_settings', false ); |
|
| 38 | + $options = get_option('_lsx-to_settings', false); |
|
| 39 | 39 | |
| 40 | 40 | $data = array( |
| 41 | 41 | 'api_key' => '', |
| 42 | 42 | 'email' => '', |
| 43 | 43 | ); |
| 44 | 44 | |
| 45 | - if ( false !== $options && isset( $options['api'] ) ) { |
|
| 46 | - if ( isset( $options['api']['wetu-importer_api_key'] ) && '' !== $options['api']['wetu-importer_api_key'] ) { |
|
| 45 | + if (false !== $options && isset($options['api'])) { |
|
| 46 | + if (isset($options['api']['wetu-importer_api_key']) && '' !== $options['api']['wetu-importer_api_key']) { |
|
| 47 | 47 | $data['api_key'] = $options['api']['wetu-importer_api_key']; |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | - if ( isset( $options['api']['wetu-importer_email'] ) && '' !== $options['api']['wetu-importer_email'] ) { |
|
| 50 | + if (isset($options['api']['wetu-importer_email']) && '' !== $options['api']['wetu-importer_email']) { |
|
| 51 | 51 | $data['email'] = $options['api']['wetu-importer_email']; |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - $instance = get_option( 'lsx_api_instance', false ); |
|
| 55 | + $instance = get_option('lsx_api_instance', false); |
|
| 56 | 56 | |
| 57 | - if ( false === $instance ) { |
|
| 57 | + if (false === $instance) { |
|
| 58 | 58 | $instance = LSX_API_Manager::generatePassword(); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -67,14 +67,14 @@ discard block |
||
| 67 | 67 | 'file' => 'wetu-importer.php', |
| 68 | 68 | ); |
| 69 | 69 | |
| 70 | - $lsx_to_wetu_importer_api_manager = new LSX_API_Manager( $api_array ); |
|
| 70 | + $lsx_to_wetu_importer_api_manager = new LSX_API_Manager($api_array); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | -add_action( 'admin_init', 'lsx_to_wetu_importer_api_admin_init' ); |
|
| 73 | +add_action('admin_init', 'lsx_to_wetu_importer_api_admin_init'); |
|
| 74 | 74 | |
| 75 | 75 | /* ======================= Below is the Plugin Class init ========================= */ |
| 76 | 76 | |
| 77 | -require_once( WETU_IMPORTER_PATH . 'classes/class-lsx-logger.php' ); |
|
| 78 | -require_once( WETU_IMPORTER_PATH . 'classes/class-wetu-importer.php' ); |
|
| 77 | +require_once(WETU_IMPORTER_PATH.'classes/class-lsx-logger.php'); |
|
| 78 | +require_once(WETU_IMPORTER_PATH.'classes/class-wetu-importer.php'); |
|
| 79 | 79 | //require_once(WETU_IMPORTER_PATH.'classes/class-wetu-importer-connect-accommodation.php'); |
| 80 | -require_once( WETU_IMPORTER_PATH . 'classes/class-wetu-importer-settings.php' ); |
|
| 80 | +require_once(WETU_IMPORTER_PATH.'classes/class-wetu-importer-settings.php'); |
|