'http://ma-group5.com/api/a2wl/v1/', 'item_purchase_code'=>'', 'envato_personal_token'=>'', 'account_type'=> 'aliexpress', 'use_custom_account'=>false, 'account_data'=> array('aliexpress'=>array('appkey'=>'', 'trackingid'=>''), 'admitad'=>array('cashback_url'=>'')), 'import_language'=> 'en', 'local_currency'=> 'usd', 'default_product_type'=> 'simple', 'default_product_status'=> 'publish', 'not_import_attributes'=> false, 'not_import_description'=> false, 'not_import_description_images'=> false, 'import_extended_attribute'=> false, 'import_extended_variation_attribute'=> true, 'import_product_images_limit'=> 0, 'use_external_image_urls'=> true, 'use_cdn'=> false, 'use_random_stock'=> false, 'use_random_stock_min'=> 5, 'use_random_stock_max'=> 15, 'split_attribute_values'=> true, 'attribute_values_separator'=> ',', 'currency_conversion_factor'=> 1, 'auto_update'=> false, 'not_available_product_status'=> 'trash', 'sync_type'=> 'price_and_stock', 'new_variation_action'=>'add', 'fulfillment_prefship'=> 'EMS_ZX_ZX_US', 'fulfillment_phone_code'=> '', 'fulfillment_phone_number'=> '', 'fulfillment_custom_note'=> '', 'order_translitirate' => false, 'order_third_name' => false, 'use_extended_price_markup'=> false, 'use_compared_price_markup'=> false, 'price_cents'=> -1, 'price_compared_cents'=> -1, 'default_formula'=> false, 'formula_list'=> array(), 'phrase_list'=> array(), 'json_api_base'=> 'a2wl_api', 'json_api_controllers'=> 'core,auth', 'system_message_last_update'=> 0, 'image_editor_srickers'=> array( 'https://ali2woo.com/static/stickers/stick-001.png', 'https://ali2woo.com/static/stickers/stick-002.png', 'https://ali2woo.com/static/stickers/stick-003.png', 'https://ali2woo.com/static/stickers/stick-004.png', 'https://ali2woo.com/static/stickers/stick-005.png', 'https://ali2woo.com/static/stickers/stick-006.png', 'https://ali2woo.com/static/stickers/stick-007.png', 'https://ali2woo.com/static/stickers/stick-008.png', 'https://ali2woo.com/static/stickers/stick-009.png', 'https://ali2woo.com/static/stickers/stick-010.png', 'https://ali2woo.com/static/stickers/stick-011.png', 'https://ali2woo.com/static/stickers/stick-012.png', 'https://ali2woo.com/static/stickers/stick-013.png', 'https://ali2woo.com/static/stickers/stick-014.png', 'https://ali2woo.com/static/stickers/stick-015.png', 'https://ali2woo.com/static/stickers/stick-016.png', 'https://ali2woo.com/static/stickers/stick-017.png', 'https://ali2woo.com/static/stickers/stick-018.png', 'https://ali2woo.com/static/stickers/stick-019.png', 'https://ali2woo.com/static/stickers/stick-020.png', 'https://ali2woo.com/static/stickers/stick-021.png', 'https://ali2woo.com/static/stickers/stick-022.png') ); private static $_instance = null; protected function __construct() { $this->load(); } protected function __clone() { } static public function instance() { if (is_null(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; } public function auto_commit($auto_commit = true){ $this->auto_commit = $auto_commit; } public function load(){ $this->settings = array_merge($this->default_settings, get_option('a2wl_settings', array())); } public function commit(){ update_option('a2wl_settings', $this->settings); } public function to_string() { } public function from_string($str) { } public function get($setting, $default=''){ return isset($this->settings[$setting])?$this->settings[$setting]:$default; } public function set($setting, $value){ $old_value = isset($this->settings[$setting])?$this->settings[$setting]:''; do_action('a2wl_pre_set_setting_'.$setting, $old_value, $value, $setting); $this->settings[$setting] = $value; if($this->auto_commit){ $this->commit(); } do_action('a2wl_set_setting_'.$setting, $old_value, $value, $setting); } public function del($setting){ if(isset($this->settings[$setting])){ unset($this->settings[$setting]); if($this->auto_commit){ $this->commit(); } } } } } if (!function_exists('a2wl_settings')) { function a2wl_settings() { return A2WL_Settings::instance(); } } if (!function_exists('a2wl_get_setting')) { function a2wl_get_setting($setting, $default='') { return a2wl_settings()->get($setting, $default); } } if (!function_exists('a2wl_set_setting')) { function a2wl_set_setting($setting, $value) { if (a2wl_check_defined('A2WL_DEMO_MODE') && in_array($setting, array('use_external_image_urls'))) { return; } return a2wl_settings()->set($setting, $value); } } if (!function_exists('a2wl_del_setting')) { function a2wl_del_setting($setting) { return a2wl_settings()->del($setting); } }