diff --git a/class/MainWPChildBranding.class.php b/class/MainWPChildBranding.class.php index 887e502..4f843a3 100644 --- a/class/MainWPChildBranding.class.php +++ b/class/MainWPChildBranding.class.php @@ -404,12 +404,13 @@ class MainWPChildBranding $content = nl2br(stripslashes($_POST['mainwp_branding_contact_message_content'])); if (!empty($_POST['mainwp_branding_contact_message_content']) && !empty($email)) { + global $current_user; $mail = '
Support Email from: ' . site_url() . '
'; $mail .= 'Sent from WordPress page: ' . (!empty($_POST['mainwp_branding_send_from_page']) ? '' . $_POST['mainwp_branding_send_from_page'] . '
' : ""); - $mail .= 'Admin email: ' . get_option('admin_email') . '
'; + $mail .= 'Client Email: ' . $current_user->user_email . '
'; $mail .= 'Support Text:
'; $mail .= '' . $content . '
'; - if (wp_mail($email, 'MainWP - Support Contact', $mail, array('From: "' . get_option('admin_email') . '" <' . get_option('admin_email') . '>', 'content-type: text/html'))) ; + if (wp_mail($email, 'MainWP - Support Contact', $mail, array('From: "' . $current_user->user_email . '" <' . $current_user->user_email . '>', 'content-type: text/html'))) ; return true; } return false; diff --git a/class/MainWPHelper.class.php b/class/MainWPHelper.class.php index 3a8c19a..292fb12 100644 --- a/class/MainWPHelper.class.php +++ b/class/MainWPHelper.class.php @@ -249,11 +249,11 @@ class MainWPHelper if (!$seo_ext_activated) { // if Wordpress SEO plugin is not activated do not save yoast post meta - if(strpos($meta_key, "_yoast_wpseo_") !== false) + if(strpos($meta_key, "_yoast_wpseo_") === false) add_post_meta($new_post_id, $meta_key, $meta_value); - } else { + } else { add_post_meta($new_post_id, $meta_key, $meta_value); - } + } } } else if ($meta_key == '_sticky') diff --git a/class/MainWPKeywordLinks.class.php b/class/MainWPKeywordLinks.class.php index ffd8a56..a3f5901 100644 --- a/class/MainWPKeywordLinks.class.php +++ b/class/MainWPKeywordLinks.class.php @@ -10,6 +10,8 @@ class MainWPKeywordLinks protected $link_temp; protected $link_count_temp; protected $link_count_each_temp; + protected $link_exact_match = 1; + protected $link_case_sensitive = 1; static function Instance() { if (MainWPKeywordLinks::$instance == null) { @@ -141,12 +143,16 @@ class MainWPKeywordLinks return true; } else if ('' == get_option( 'permalink_structure')) { include_once(ABSPATH . '/wp-admin/includes/misc.php'); - $redirection_folder = $this->get_option('redirection_folder', 'goto'); - if (empty($redirection_folder)) - $redirection_folder = "goto"; - - //Create rewrite ruler - $rules = $this->mod_rewrite_rules(array($redirection_folder.'/' => 'index.php')); + $redirection_folder = $this->get_option('redirection_folder', ''); + if (empty($redirection_folder)) { + $rules = $this->get_cloak_rules(); + $rules = $this->mod_rewrite_rules($rules); + //error_log(print_r($rules, true)); + //self::clear_htaccess(); + } else { + //Create rewrite ruler + $rules = $this->mod_rewrite_rules(array($redirection_folder.'/' => 'index.php')); + } $home_path = ABSPATH; $htaccess_file = $home_path . '.htaccess'; if (function_exists('save_mod_rewrite_rules')) @@ -164,6 +170,15 @@ class MainWPKeywordLinks } + function get_cloak_rules() { + $cloak_rules = array(); + foreach($this->keyword_links as $link) { + if (!empty($link->cloak_path)) { + $cloak_rules[$link->cloak_path] = "index.php"; + } + } + return $cloak_rules; + } public function saveClickCallback() { @@ -282,15 +297,14 @@ class MainWPKeywordLinks // save specific link if ($post) { - $specific_link = get_post_meta($post->ID, '_mainwp_kwl_specific_link', true); - $specific_link = unserialize($specific_link); + $specific_link = unserialize(get_post_meta($post->ID, '_mainwp_kwl_specific_link', true)); if (is_array($specific_link) && count($specific_link) > 0) { $specific_link = current($specific_link); $specific_link->post_id = $post->ID; //update_post_meta($post->ID, '_mainwp_kwl_specific_link_save', array($specific_link->id => $specific_link)); update_post_meta($post->ID, '_mainwp_kwl_specific_link_id', $specific_link->id); if ($this->set_link($specific_link->id, $specific_link)) - delete_post_meta($post->ID, '_mainwp_kwl_specific_link'); // delete the source meta + update_post_meta($post->ID, '_mainwp_kwl_specific_link', "