Changeset 2018123
- Timestamp:
- 01/24/2019 06:42:11 AM (7 years ago)
- Location:
- marketpowerwp/trunk
- Files:
-
- 3 edited
-
leplugin.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
src/Multisoft/MPP/Replication/ReplicationController.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
marketpowerwp/trunk/leplugin.php
r2017382 r2018123 4 4 * Plugin Name: Multisoft MarketPowerPRO Tools 5 5 * Description: Integration of MarketPowerPro to Wordpress 6 * Version: 2.2. 26 * Version: 2.2.3 7 7 * Author: Rodine Mark Paul L. Villar 8 8 * Author URI: mailto:dine@multisoft.com?subject=Multisoft+MarketPowerPRO+Tools -
marketpowerwp/trunk/readme.txt
r2017382 r2018123 3 3 Tags: marketpowerpro, multisoft 4 4 Requires at least: 3.4+ 5 Stable tag: 2.2. 26 Version: 2.2. 25 Stable tag: 2.2.3 6 Version: 2.2.3 7 7 Tested up to: 5.0.1 8 8 License: Commercial -
marketpowerwp/trunk/src/Multisoft/MPP/Replication/ReplicationController.php
r2017382 r2018123 28 28 const OPTION_CHECK_SITE_NAME_PATH_QUERY_FORMAT = 'check_site_name_path_query_format'; 29 29 const OPTION_DEFAULT_REPLICATED_SITE_NAME = 'default_replicated_site_name'; 30 30 31 31 private $replicationGateway; 32 32 private $mpp_error_view; … … 45 45 $this->add_filter('option_siteurl', 'replication_site_url'); 46 46 } 47 48 if (file_exists(ABSPATH . "logs")){47 48 if (file_exists(ABSPATH . "logs")) { 49 49 $logDir = ABSPATH . "logs"; 50 } else{50 } else { 51 51 $logDir = $this->_plugin_dir . '/logs'; 52 52 } 53 53 54 54 if (MPP_DEBUG) { 55 55 $logger = new Logger($logDir, LogLevel::DEBUG, array( … … 73 73 [$this, 'index'] 74 74 ); 75 75 76 76 $this->add_action('wp_enqueue_scripts', 'mppe_enqueue_autoprefix', 99999); 77 77 … … 110 110 ); 111 111 } 112 112 113 113 $default_replicated_site_name = $this->_config->__get('default_replicated_site_name'); 114 114 if ($default_replicated_site_name) { … … 146 146 self::SECTION_MPP_REPLICATION, 147 147 self::OPTION_DEFAULT_REPLICATED_SITE_NAME 148 );148 ); 149 149 150 150 $settingsGateway->addSettingsSection( … … 204 204 return $href['scheme'] . '://' . $_SERVER['HTTP_HOST']; 205 205 } 206 207 public function mppe_enqueue_autoprefix(){ 206 207 public function mppe_enqueue_autoprefix() 208 { 208 209 $settingsGateway = SettingsGateway::getInstance(); 209 210 $autoprefix = $settingsGateway->get(self::OPTION_AUTOPREFIX); 210 211 211 if ($autoprefix){212 if ($autoprefix) { 212 213 wp_enqueue_script('mppe-jurlp', $this->_js_dir_url . 'jurlp/jurlp.min.js', ['jquery']); 213 214 wp_register_script('mppe-autoprefix', $this->_js_dir_url . 'mpp/autoprefix.js', ['jquery', 'mppe-jurlp'], '0', true); 214 215 215 216 $replicationGateway = $this->replicationGateway; 216 217 $xxx = $replicationGateway->get_replication_site_name(true); … … 223 224 ] 224 225 ); 225 226 226 227 wp_enqueue_script('mppe-autoprefix'); 227 } 228 } 228 229 } 229 230 … … 235 236 236 237 $info = false; 238 $default = false; 237 239 238 240 extract(shortcode_atts(array( 239 "info" => false 241 "info" => false, 242 "default" => false 240 243 ), $atts)); 241 244 … … 249 252 if ($info) { 250 253 $info = str_replace("MPPE_", "", str_replace(""", "", $info)); 251 return $mppe_info[strtoupper($info)]; 254 $mppe_data = trim($mppe_info[strtoupper($info)]); 255 if (empty($mppe_data) && $default) { 256 $mppe_data = str_replace(""", "", $default); 257 } 258 return $mppe_data; 252 259 } 253 260 if ($content) { … … 276 283 'Multisoft MarketPowerPRO ' . 277 284 $valid->get_error_code() . ': ' . $valid->get_error_message(), 278 'notice-error', false 285 'notice-error', false 279 286 ); 280 287 } else if ($valid === false) { … … 292 299 } 293 300 294 public function mppe_invalid_site_name_redirect() { 301 public function mppe_invalid_site_name_redirect() 302 { 295 303 $settingsGateway = SettingsGateway::getInstance(); 296 304 $redirection_page = $settingsGateway->get(self::OPTION_NON_EXIST_REDIRECTION); … … 298 306 $prefix = $wpdb->prefix; 299 307 $original_site_url = $wpdb->get_var("SELECT option_value FROM {$prefix}options WHERE option_name = 'siteurl'"); 300 if ($redirection_page) {308 if ($redirection_page) { 301 309 $url = strtolower(get_permalink($redirection_page)); 302 310 $url = Utils::str_replace_first(strtolower(site_url()), $original_site_url, $url); … … 340 348 $replicationView->assign('replicated_site_name', $settingsGateway->get( 341 349 self::OPTION_DEFAULT_REPLICATED_SITE_NAME 342 ));350 )); 343 351 $replicationView->display(); 344 352 }
Note: See TracChangeset
for help on using the changeset viewer.