예제 #1
0
/**
* Deprecated in optimizeMember v3.5+.
*
* Needed by the optimizeMember Pro upgrader prior to optimizeMember Pro v1.5+.
*
* @package optimizeMember
* @since 3.0
*
* @deprecated Starting with optimizeMember v3.5+, please use:
* 	``c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice()``
*
* @see optimizeMember\Admin_Notices\c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice()
*/
function ws_plugin__optimizemember_enqueue_admin_notice($notice = FALSE, $on_pages = FALSE, $error = FALSE, $time = FALSE, $dismiss = FALSE)
{
    return c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, $on_pages, $error, $time, $dismiss);
}
예제 #2
0
 /**
  * Builds the Forms page for this Payment Gateway.
  *
  * @package optimizeMember\Menu_Pages
  * @since 1.5
  *
  * @return null
  */
 public static function authnet_forms_page()
 {
     if (c_ws_plugin__optimizemember_pro_authnet_responses::authnet_form_api_validation_errors()) {
         /* Report error if Authorize.Net Options are not yet configured. */
         c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Please configure <code>optimizeMember -> Authorize.Net Options</code> first. Once all of your Authorize.Net Options are configured, return to this page &amp; generate your Authorize.net Form(s).', true);
     }
     /**/
     include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/menu-pages/authnet-forms.inc.php";
     /**/
     return;
     /* Return for uniformity. */
 }
예제 #3
0
 /**
  * Builds the Buttons panel for this Payment Gateway.
  *
  * @package optimizeMember\Menu_Pages
  * @since 1.5
  *
  * @return null
  */
 public static function ccbill_buttons_page()
 {
     if (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_id"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_client_sid"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_form_name"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_dl_user"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_dl_pass"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_ccbill_salt_key"]) {
         c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Please configure <code>optimizeMember -> ccBill Options</code> first. Once all of your cBill Options have been configured, return to this page &amp; generate your ccBill Button(s).', true);
     }
     /**/
     include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/menu-pages/ccbill-buttons.inc.php";
     /**/
     return;
     /* Return for uniformity. */
 }
예제 #4
0
 /**
  * Builds the Forms page for this Payment Gateway.
  *
  * @package optimizeMember\Menu_Pages
  * @since 140617
  */
 public static function stripe_forms_page()
 {
     if (c_ws_plugin__optimizemember_pro_stripe_responses::stripe_form_api_validation_errors()) {
         // Report error if Stripe Options are not yet configured.
         c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Please configure <code>optimizeMember -› Stripe Options</code> first. Once all of your Stripe Options are configured, return to this page &amp; generate your Stripe Form(s).', TRUE);
     }
     include_once dirname(dirname(dirname(dirname(__FILE__)))) . '/menu-pages/stripe-forms.inc.php';
 }
예제 #5
0
 /**
  * Handles the importation of options.
  *
  * @package optimizeMember\Imports
  * @since 110815
  *
  * @return null
  */
 public static function import_ops()
 {
     if (!empty($_POST["ws_plugin__optimizemember_pro_import_ops"]) && ($nonce = $_POST["ws_plugin__optimizemember_pro_import_ops"]) && wp_verify_nonce($nonce, "ws-plugin--optimizemember-pro-import-ops") && current_user_can("create_users")) {
         @set_time_limit(0);
         /* Make time for processing large import files. */
         @ini_set("memory_limit", apply_filters("admin_memory_limit", WP_MAX_MEMORY_LIMIT));
         /**/
         if (!empty($_FILES["ws_plugin__optimizemember_pro_import_ops_file"]) && empty($_FILES["ws_plugin__optimizemember_pro_import_ops_file"]["error"])) {
             $file = file_get_contents($_FILES["ws_plugin__optimizemember_pro_import_ops_file"]["tmp_name"], "r");
         }
         /**/
         if (!empty($file)) {
             if (is_array($import = c_ws_plugin__optimizemember_pro_utils_ops::op_replace(@unserialize($file), true)) && !empty($import) && ($import["configured"] = "1")) {
                 unset($import["options_checksum"], $import["options_version"]);
                 /**/
                 foreach ($import as $key => $value) {
                     is_array($value) ? array_unshift($value, "update-signal") : null;
                     $import["ws_plugin__optimizemember_" . $key] = $value;
                     unset($import[$key]);
                 }
                 /**/
                 c_ws_plugin__optimizemember_menu_pages::update_all_options($import, true, true, false, false, false);
             } else {
                 $errors[] = "Invalid data received. Please try again.";
             }
             /* Unserialization failed? */
         } else {
             $errors[] = "No data was received. Please try again.";
         }
         /* The upload failed, or it was empty. */
         /**/
         if (!empty($errors)) {
             /* Here is where a detailed error log will be returned to the Site Owner; as a way of clarifying what just happened during importation. */
             c_ws_plugin__optimizemember_admin_notices::display_admin_notice('<strong>The following errors were encountered during importation:</strong><ul style="font-size:80%; list-style:disc outside; margin-left:25px;"><li>' . implode("</li><li>", $errors) . '</li></ul>', true);
         } else {
             c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Operation complete. Options imported.');
         }
     }
     /**/
     return;
     /* Return for uniformity. */
 }
예제 #6
0
 /**
  * Builds the Buttons panel for this Payment Gateway.
  *
  * @package optimizeMember\Menu_Pages
  * @since 1.5
  *
  * @return null
  */
 public static function alipay_buttons_page()
 {
     if (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_seller_email"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_partner_id"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_alipay_security_code"]) {
         c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Please configure <code>optimizeMember -> AliPay Options</code> first. Once all of your AliPay Options have been configured, return to this page &amp; generate your AliPay Button(s).', true);
     }
     /**/
     include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/menu-pages/alipay-buttons.inc.php";
     /**/
     return;
     /* Return for uniformity. */
 }
예제 #7
0
 /**
  * Activation routines for optimizeMember.
  *
  * @package optimizeMember\Installation
  * @since 3.5
  *
  * @return null
  */
 public static function activate($reactivation_reason = FALSE)
 {
     global $wpdb;
     /* Global database object reference. */
     global $current_site, $current_blog;
     /* Multisite. */
     /**/
     do_action("ws_plugin__optimizemember_before_activation", get_defined_vars());
     /**/
     c_ws_plugin__optimizemember_roles_caps::config_roles();
     /* Config Roles/Caps. */
     update_option("ws_plugin__optimizemember_activated_levels", $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]);
     /**/
     /*THIS LINE MOVE PRO FOLDER INTO RIGHT PLACE!*/
     //@rename($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["dir"].'/optimizeMember-pro', WP_PLUGIN_DIR.'/optimizeMember-pro');
     if (!is_dir($files_dir = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir"])) {
         if (is_writable(dirname(c_ws_plugin__optimizemember_utils_dirs::strip_dir_app_data($files_dir)))) {
             mkdir($files_dir, 0777, true);
         }
     }
     /**/
     if (is_dir($files_dir) && is_writable($files_dir)) {
         if (!file_exists($htaccess = $files_dir . "/.htaccess") || !apply_filters("ws_plugin__optimizemember_preserve_files_dir_htaccess", false, get_defined_vars())) {
             file_put_contents($htaccess, trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["files_dir_htaccess"]))));
         }
     }
     /**/
     c_ws_plugin__optimizemember_files::write_no_gzip_into_root_htaccess();
     /**/
     if (!is_dir($logs_dir = $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["logs_dir"])) {
         if (is_writable(dirname(c_ws_plugin__optimizemember_utils_dirs::strip_dir_app_data($logs_dir)))) {
             mkdir($logs_dir, 0777, true);
         }
     }
     /**/
     if (is_dir($logs_dir) && is_writable($logs_dir)) {
         if (!file_exists($htaccess = $logs_dir . "/.htaccess") || !apply_filters("ws_plugin__optimizemember_preserve_logs_dir_htaccess", false, get_defined_vars())) {
             file_put_contents($htaccess, trim(c_ws_plugin__optimizemember_utilities::evl(file_get_contents($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["logs_dir_htaccess"]))));
         }
     }
     /**/
     !is_array(get_option("ws_plugin__optimizemember_cache")) ? update_option("ws_plugin__optimizemember_cache", array()) : null;
     !is_array(get_option("ws_plugin__optimizemember_notices")) ? update_option("ws_plugin__optimizemember_notices", array()) : null;
     !is_array(get_option("ws_plugin__optimizemember_options")) ? update_option("ws_plugin__optimizemember_options", array()) : null;
     !is_numeric(get_option("ws_plugin__optimizemember_configured")) ? update_option("ws_plugin__optimizemember_configured", "0") : null;
     /**/
     if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["configured"]) {
         $v = get_option("ws_plugin__optimizemember_activated_version");
         /* Currently. */
         /**/
         if (!$v || !version_compare($v, "3.2", ">=")) {
             $like = "`meta_key` LIKE 's2member\\_%' AND `meta_key` NOT LIKE '%s2member\\_originating\\_blog%'";
             $wpdb->query("UPDATE `" . $wpdb->usermeta . "` SET `meta_key` = CONCAT('" . $wpdb->prefix . "', `meta_key`) WHERE " . $like);
         }
         /**/
         if (!$v || !version_compare($v, "3.2.5", ">=")) {
             $wpdb->query("DELETE FROM `" . $wpdb->options . "` WHERE `option_name` LIKE '\\_transient\\_%'");
         }
         /**/
         if (!$v || !version_compare($v, "3.2.6", ">=")) {
             $wpdb->query("DELETE FROM `" . $wpdb->postmeta . "` WHERE `meta_key` = 'optimizemember_ccaps_req' AND `meta_value` IN('','a:0:{}','a:1:{i:0;s:0:\"\";}')");
         }
         /**/
         if (!$v || !version_compare($v, "110912", ">=") && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["filter_wp_query"] === array("all")) {
             //$notice = '<strong>IMPORTANT:</strong> This version of optimizeMember changes the way your <code>Alternative View Protections</code> work. Please review your options under: <code>optimizeMember -> Restriction Options -> Alternative View Protections</code>.<br />';
             $notice = '';
             c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, array("blog|network:plugins.php", "blog|network:ws-plugin--optimizemember-start", "blog|network:ws-plugin--optimizemember-mms-ops", "blog|network:ws-plugin--optimizemember-gen-ops", "blog|network:ws-plugin--optimizemember-res-ops"));
         }
         /**/
         $notice = '<strong>optimizeMember</strong> has been <strong>reactivated</strong>, with ' . ($reactivation_reason === "levels" ? '<code>' . esc_html($GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["levels"]) . '</code> Membership Levels' : 'the latest version') . '.<br />';
         $notice .= 'You now have version ' . esc_html(WS_PLUGIN__OPTIMIZEMEMBER_VERSION) . '. Your existing configuration remains.';
         /**/
         if (!is_multisite() || !c_ws_plugin__optimizemember_utils_conds::is_multisite_farm() || is_main_site()) {
             /* No Changelog on a Multisite Blog Farm. */
             //$notice .= '<br />Have fun, <a href="'.esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-info#rm-changelog")).'">read the Changelog</a>, and make some money! :-)';
             /**/
             c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, array("blog|network:plugins.php", "blog|network:ws-plugin--optimizemember-start", "blog|network:ws-plugin--optimizemember-mms-ops", "blog|network:ws-plugin--optimizemember-gen-ops", "blog|network:ws-plugin--optimizemember-res-ops"));
         }
     } else {
         $notice = '<strong>Note:</strong> optimizeMember adds some new data columns to your list of Users/Members. If your list gets overcrowded, please use the <strong>Screen Options</strong> tab <em>( upper right-hand corner )</em>. With WordPress Screen Options, you can add/remove specific data columns; thereby making the most important data easier to read. For example, if you create Custom Registration/Profile Fields with optimizeMember, those Custom Fields will result in new data columns; which can cause your list of Users/Members to become nearly unreadable. So just use the Screen Options tab to clean things up.';
         /**/
         c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, "blog:users.php", false, false, true);
         /**/
         $notice = '<strong>optimizeMember</strong> v' . esc_html(WS_PLUGIN__OPTIMIZEMEMBER_VERSION) . ' has been <strong>activated</strong>. Nice work!<br />';
         $notice .= 'Have fun, <a href="' . esc_attr(admin_url("/admin.php?page=ws-plugin--optimizemember-start")) . '">read the Quick Start Guide</a>, and make some money! :-)';
         /**/
         c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, array("blog|network:plugins.php", "blog|network:ws-plugin--optimizemember-start", "blog|network:ws-plugin--optimizemember-mms-ops", "blog|network:ws-plugin--optimizemember-gen-ops", "blog|network:ws-plugin--optimizemember-res-ops"));
     }
     /**/
     if (is_multisite() && is_main_site()) {
         $wpdb->query("INSERT INTO `" . $wpdb->usermeta . "` (`user_id`, `meta_key`, `meta_value`) SELECT `ID`, 'optimizemember_originating_blog', '" . esc_sql($current_site->blog_id) . "' FROM `" . $wpdb->users . "` WHERE `ID` NOT IN (SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE `meta_key` = 'optimizemember_originating_blog')");
         /**/
         $notice = '<strong>Multisite Network</strong> updated automatically by <strong>optimizeMember</strong> v' . esc_html(WS_PLUGIN__OPTIMIZEMEMBER_VERSION) . '.<br />';
         $notice .= 'You\'ll want to configure optimizeMember\'s Multisite options now.<br />';
         $notice .= 'In the Dashboard for your Main Site, see:<br />';
         $notice .= '<code>optimizeMember -> Multisite ( Config )</code>.';
         /**/
         c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, array("blog|network:plugins.php", "blog|network:ws-plugin--optimizemember-start", "blog|network:ws-plugin--optimizemember-mms-ops", "blog|network:ws-plugin--optimizemember-gen-ops", "blog|network:ws-plugin--optimizemember-res-ops"));
         /**/
         update_site_option("ws_plugin__optimizemember_options", (array) get_option("ws_plugin__optimizemember_options"));
         /**/
         update_option("ws_plugin__optimizemember_activated_mms_version", WS_PLUGIN__OPTIMIZEMEMBER_VERSION);
     }
     /**/
     update_option("ws_plugin__optimizemember_activated_version", WS_PLUGIN__OPTIMIZEMEMBER_VERSION);
     /**/
     do_action("ws_plugin__optimizemember_after_activation", get_defined_vars());
     /**/
     return;
     /* Return for uniformity. */
 }
예제 #8
0
 /**
  * Processes all administrative notices.
  *
  * @package optimizeMember\Admin_Notices
  * @since 3.5
  *
  * @attaches-to ``add_action("admin_notices");``
  * @attaches-to ``add_action("user_admin_notices");``
  * @attaches-to ``add_action("network_admin_notices");``
  * @todo Update to ``add_action("all_admin_notices");``.
  *
  * @return null
  */
 public static function admin_notices()
 {
     global $pagenow;
     /* This holds the current page filename. */
     /**/
     do_action("ws_plugin__optimizemember_before_admin_notices", get_defined_vars());
     /**/
     if (is_admin() && is_array($notices = get_option("ws_plugin__optimizemember_notices")) && !empty($notices)) {
         $a = is_blog_admin() ? "blog" : $a;
         $a = is_user_admin() ? "user" : $a;
         $a = is_network_admin() ? "network" : $a;
         $a = !$a ? "blog" : $a;
         /* Default Blog Admin. */
         /**/
         foreach ($notices as $i => $notice) {
             /* Check several things about each Notice. */
             foreach (!$notice["on_pages"] ? array("*") : (array) $notice["on_pages"] as $page) {
                 if (!preg_match("/^(.+?)\\:/", $page)) {
                     /* NO prefix? */
                     $page = "blog:" . ltrim($page, ":");
                 }
                 /* `blog:` */
                 /**/
                 $adms = preg_split("/\\|/", preg_replace("/\\:(.*)\$/i", "", $page));
                 $page = preg_replace("/^([^\\:]*)\\:/i", "", $page);
                 /**/
                 if (empty($adms) || in_array("*", $adms) || in_array($a, $adms)) {
                     if (!$page || "*" === $page || $pagenow === $page || $_GET["page"] === $page) {
                         if (strtotime("now") >= (int) $notice["time"]) {
                             eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
                             do_action("ws_plugin__optimizemember_during_admin_notices_before_display", get_defined_vars());
                             unset($__refs, $__v);
                             /* Unset defined __refs, __v. */
                             /**/
                             if (!$notice["dismiss"] || !empty($_GET["ws-plugin--optimizemember-dismiss-admin-notice"]) && $_GET["ws-plugin--optimizemember-dismiss-admin-notice"] === md5($notice["notice"])) {
                                 unset($notices[$i]);
                             }
                             /* Clear this administrative notice now? */
                             /**/
                             if (!$notice["dismiss"] || empty($_GET["ws-plugin--optimizemember-dismiss-admin-notice"]) || $_GET["ws-plugin--optimizemember-dismiss-admin-notice"] !== md5($notice["notice"])) {
                                 c_ws_plugin__optimizemember_admin_notices::display_admin_notice($notice["notice"], $notice["error"], $notice["dismiss"]);
                             }
                             /**/
                             do_action("ws_plugin__optimizemember_during_admin_notices_after_display", get_defined_vars());
                         }
                         /**/
                         continue 2;
                         /* This Notice processed; continue. */
                     }
                 }
             }
         }
         /**/
         $notices = array_merge($notices);
         /* Re-index array. */
         /**/
         eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
         do_action("ws_plugin__optimizemember_during_admin_notices", get_defined_vars());
         unset($__refs, $__v);
         /* Unset defined __refs, __v. */
         /**/
         update_option("ws_plugin__optimizemember_notices", $notices);
     }
     /**/
     do_action("ws_plugin__optimizemember_after_admin_notices", get_defined_vars());
     /**/
     return;
     /* Return for uniformity. */
 }
예제 #9
0
 /**
  * Builds the Buttons panel for this Payment Gateway.
  *
  * @package optimizeMember\Menu_Pages
  * @since 1.5
  *
  * @return null
  */
 public static function clickbank_buttons_page()
 {
     if (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_clickbank_username"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_clickbank_clerk_key"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_clickbank_developer_key"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_clickbank_secret_key"]) {
         c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Please configure <code>optimizeMember -› ClickBank® Options</code> first. Once all of your ClickBank® Options have been configured, return to this page &amp; generate your ClickBank® Button(s).', true);
     }
     include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/menu-pages/clickbank-buttons.inc.php";
     return;
 }
예제 #10
0
 /**
  * Builds the Buttons panel for this Payment Gateway.
  *
  * @package optimizeMember\Menu_Pages
  * @since 1.5
  *
  * @return null
  */
 public static function google_buttons_page()
 {
     if (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_id"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["pro_google_merchant_key"]) {
         c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Please configure <code>optimizeMember -> Google Options</code> first. Once all of your Google Options have been configured, return to this page &amp; generate your Google Checkout Button(s).', true);
     }
     /**/
     include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/menu-pages/google-buttons.inc.php";
     /**/
     return;
     /* Return for uniformity. */
 }
예제 #11
0
 /**
  * Builds and handles the PayPal Button Generator page.
  * 
  * @package optimizeMember\Menu_Pages
  * @since 3.5
  * 
  * @return null
  */
 public static function paypal_buttons_page()
 {
     do_action("ws_plugin__optimizemember_before_paypal_buttons_page", get_defined_vars());
     /**/
     if (!$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_business"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_api_username"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_api_password"] || !$GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["paypal_api_signature"]) {
         c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Please configure <code>optimizeMember -> PayPal Options</code> first. Once all of your PayPal Options are configured; including your Email Address, API Username, Password, and Signature; return to this page &amp; generate your PayPal Button(s).', true);
     }
     /**/
     include_once dirname(dirname(__FILE__)) . "/menu-pages/paypal-buttons.inc.php";
     /**/
     do_action("ws_plugin__optimizemember_after_paypal_buttons_page", get_defined_vars());
     /**/
     return;
     /* Return for uniformity. */
 }
예제 #12
0
 /**
  * Deals with Reading Option conflicts.
  *
  * @package optimizeMember\Option_Notices
  * @since 3.5
  *
  * @attaches-to ``add_action("load-options-reading.php");``
  *
  * @return null
  */
 public static function reading_ops_notice()
 {
     global $pagenow;
     /* Need this global variable. */
     /**/
     do_action("ws_plugin__optimizemember_before_reading_ops_notice", get_defined_vars());
     /**/
     if (is_blog_admin() && $pagenow === "options-reading.php" && !isset($_GET["page"])) {
         do_action("ws_plugin__optimizemember_during_reading_ops_notice", get_defined_vars());
         /* Now check for conflicts. */
         /**/
         if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"] && (string) get_option("page_on_front") === $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"] && ($notice = '<strong>NOTE:</strong> Your Membership Options Page for optimizeMember is currently configured as your Home Page ( i.e. static page ) for WordPress. This causes internal conflicts with optimizeMember. Your Membership Options Page MUST stand alone. Please correct this.')) {
             c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, "blog:" . $pagenow, true);
         }
         /**/
         if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_welcome_page"] && (string) get_option("page_on_front") === $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_welcome_page"] && ($notice = '<strong>NOTE:</strong> Your Login Welcome Page for optimizeMember is currently configured as your Home Page ( i.e. static page ) for WordPress. This causes internal conflicts with optimizeMember. Your Login Welcome Page MUST stand alone. Please correct this.')) {
             c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, "blog:" . $pagenow, true);
         }
         /**/
         if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"] && (string) get_option("page_for_posts") === $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["membership_options_page"] && ($notice = '<strong>NOTE:</strong> Your Membership Options Page for optimizeMember is currently configured as your Posts Page ( i.e. static page ) for WordPress. This causes internal conflicts with optimizeMember. Your Membership Options Page MUST stand alone. Please correct this.')) {
             c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, "blog:" . $pagenow, true);
         }
         /**/
         if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_welcome_page"] && (string) get_option("page_for_posts") === $GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["login_welcome_page"] && ($notice = '<strong>NOTE:</strong> Your Login Welcome Page for optimizeMember is currently configured as your Posts Page ( i.e. static page ) for WordPress. This causes internal conflicts with optimizeMember. Your Login Welcome Page MUST stand alone. Please correct this.')) {
             c_ws_plugin__optimizemember_admin_notices::enqueue_admin_notice($notice, "blog:" . $pagenow, true);
         }
     }
     /**/
     do_action("ws_plugin__optimizemember_after_reading_ops_notice", get_defined_vars());
     /**/
     return;
     /* Return for uniformity. */
 }
예제 #13
0
 /**
  * Handles patches on a Multisite Network installation.
  *
  * @package optimizeMember\Main_Multisite_Patches
  * @since 3.5
  *
  * @param bool $display_notices Defaults to false. If true, notices are displayed.
  * @return bool True if Multisite patches were processed, else false.
  */
 public static function mms_patches($display_notices = FALSE)
 {
     eval('foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;');
     do_action("ws_plugin__optimizemember_before_mms_patches", get_defined_vars());
     unset($__refs, $__v);
     /* Unset defined __refs, __v. */
     /**/
     if (is_multisite() && is_admin() && is_main_site() && $GLOBALS["WS_PLUGIN__"]["optimizemember"]["c"]["configured"]) {
         if ($GLOBALS["WS_PLUGIN__"]["optimizemember"]["o"]["mms_auto_patch"] && (!defined("DISALLOW_FILE_MODS") || !DISALLOW_FILE_MODS)) {
             do_action("ws_plugin__optimizemember_during_mms_patches_before", get_defined_vars());
             /**/
             $wp_login_file = ABSPATH . "wp-login.php";
             /* This works for both WordPress 3.0 and 3.1. WordPress 3.1+ uses: `site_url('wp-signup.php')`. WordPress 3.5+ uses: `network_site_url('wp-signup.php')`. . WordPress v3.7 uses `$sign_up_url`. */
             $wp_login_section = "/(\\s+)(wp_redirect( *?)\\(( *?)apply_filters( *?)\\(( *?)['\"]wp_signup_location['\"]( *?),( *?)(site_url( *?)\\(( *?)['\"]wp-signup\\.php['\"]( *?)\\)|network_site_url( *?)\\(( *?)['\"]wp-signup\\.php['\"]( *?)\\)|get_bloginfo( *?)\\(['\"]wpurl['\"]\\)( *?)\\.( *?)['\"]\\/wp-signup\\.php['\"]|\\\$sign_?up_url)( *?)\\)( *?)\\)( *?);)(\\s+)(exit( *?);)/";
             $wp_login_replace = "\n\t\t// Modified for full plugin compatiblity.\n\t\t//wp_redirect( apply_filters( 'wp_signup_location', network_site_url('wp-signup.php') ) );\n\t\t//exit;";
             /**/
             if (file_exists($wp_login_file) && ($wp_login = file_get_contents($wp_login_file)) && is_writable($wp_login_file)) {
                 if (($wp_login_written = file_put_contents($wp_login_file, preg_replace($wp_login_section, $wp_login_replace, $wp_login, 1, $wp_login_patched))) && $wp_login_patched || ($wp_login_patched_already = $wp_login_patched = strpos($wp_login, $wp_login_replace))) {
                     $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-login.php</code> file ' . ($wp_login_patched_already ? 'is patched' : 'has been patched successfully') . '.') : null;
                 } else {
                     if (!$wp_login_written) {
                         /* Otherwise, we need to report that /wp-login.php could NOT be updated. Possibly a permissions error. */
                         $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-login.php</code> file could NOT be patched. Patch NOT written.', true) : null;
                     } else {
                         if (!$wp_login_patched) {
                             /* Otherwise, we need to report that /wp-login.php could NOT be updated. Wrong WordPress version? */
                             $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-login.php</code> file could NOT be patched. Unverifiable.', true) : null;
                         }
                     }
                 }
             } else {
                 /* Otherwise, we need to report that /wp-login.php could NOT be updated. Possibly a permissions error. */
                 $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-login.php</code> file could NOT be patched. File NOT writable.', true) : null;
             }
             /**/
             $load_file = ABSPATH . WPINC . "/load.php";
             $load_section = "/([\r\n\t\\s ]+)(if( *?)\\(( *?)empty( *?)\\(( *?)\\\$active_plugins( *?)\\)( *?)\\|\\|( *?)defined( *?)\\(( *?)['\"]WP_INSTALLING['\"]( *?)\\)( *?)\\))/";
             $load_replace = "\n\n\t// Modified for full plugin compatiblity.\n\t//if ( empty( \$active_plugins ) || defined( 'WP_INSTALLING' ) )\n\tif ( empty( \$active_plugins ) || ( defined( 'WP_INSTALLING' ) && !preg_match(\"/\\/wp-activate\\.php/\", \$_SERVER[\"REQUEST_URI\"]) ) )";
             /**/
             if (file_exists($load_file) && ($load = file_get_contents($load_file)) && is_writable($load_file)) {
                 if (($load_written = file_put_contents($load_file, preg_replace($load_section, $load_replace, $load, 1, $load_patched))) && $load_patched || ($load_patched_already = $load_patched = strpos($load, $load_replace))) {
                     $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-includes/load.php</code> file ' . ($load_patched_already ? 'is patched' : 'has been patched successfully') . '.') : null;
                 } else {
                     if (!$load_written) {
                         /* Otherwise, we need to report that /wp-includes/load.php could NOT be updated. Possibly a permissions error. */
                         $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-includes/load.php</code> file could NOT be patched. Patch NOT written.', true) : null;
                     } else {
                         if (!$load_patched) {
                             /* Otherwise, we need to report that /wp-includes/load.php could NOT be updated. Wrong WordPress version? */
                             $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-includes/load.php</code> file could NOT be patched. Unverifiable.', true) : null;
                         }
                     }
                 }
             } else {
                 /* Otherwise, we need to report that /wp-includes/load.php could NOT be updated. Possibly a permissions error. */
                 $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-includes/load.php</code> file could NOT be patched. File NOT writable.', true) : null;
             }
             /**/
             $user_new_file = ABSPATH . "wp-admin/user-new.php";
             $user_new_section = "/([\r\n\t\\s ]+)(wpmu_signup_user( *?)\\(( *?)\\\$new_user_login,( *?)\\\$_REQUEST\\[( *?)'email'( *?)\\],( *?)array( *?)\\(( *?)'add_to_blog'( *?)\\=\\>( *?)\\\$wpdb->blogid,( *?)'new_role'( *?)\\=\\>( *?)\\\$_REQUEST\\[( *?)'role'( *?)\\]( *?)\\)( *?)\\);)/";
             $user_new_replace = "\n\t\t\t// Modified for full plugin compatiblity.\n\t\t\t//wpmu_signup_user( \$new_user_login, \$_REQUEST[ 'email' ], array( 'add_to_blog' => \$wpdb->blogid, 'new_role' => \$_REQUEST[ 'role' ] ) );\n\t\t\twpmu_signup_user( \$new_user_login, \$_REQUEST[ 'email' ], apply_filters( 'add_signup_meta', array( 'add_to_blog' => \$wpdb->blogid, 'new_role' => \$_REQUEST[ 'role' ] ) ) );";
             /**/
             if (file_exists($user_new_file) && ($user_new = file_get_contents($user_new_file)) && is_writable($user_new_file)) {
                 if (($user_new_written = file_put_contents($user_new_file, preg_replace($user_new_section, $user_new_replace, $user_new, 1, $user_new_patched))) && $user_new_patched || ($user_new_patched_already = $user_new_patched = strpos($user_new, $user_new_replace))) {
                     $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-admin/user-new.php</code> file ' . ($user_new_patched_already ? 'is patched' : 'has been patched successfully') . '.') : null;
                 } else {
                     if (!$user_new_written) {
                         /* Otherwise, we need to report that /wp-admin/user-new.php could NOT be updated. Possibly a permissions error. */
                         $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-admin/user-new.php</code> file could NOT be patched. Patch NOT written.', true) : null;
                     } else {
                         if (!$user_new_patched) {
                             /* Otherwise, we need to report that /wp-admin/user-new.php could NOT be updated. Wrong WordPress version? */
                             $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-admin/user-new.php</code> file could NOT be patched. Unverifiable.', true) : null;
                         }
                     }
                 }
             } else {
                 /* Otherwise, we need to report that /wp-admin/user-new.php could NOT be updated. Possibly a permissions error. */
                 $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-admin/user-new.php</code> file could NOT be patched. File NOT writable.', true) : null;
             }
             /**/
             $ms_functions_file = ABSPATH . "wp-includes/ms-functions.php";
             $ms_functions_section = "/([\r\n\t\\s ]+)(return new WP_Error( *?)\\(( *?)'user_already_exists'( *?),( *?)__( *?)\\(( *?)'That username is already activated.'( *?)\\),( *?)\\\$signup( *?)\\);)/";
             $ms_functions_replace = "\n\t\t\t// Modified for full plugin compatiblity.\n\t\t\t//return new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), \$signup);\n\t\t\treturn apply_filters('_wpmu_activate_existing_error_', new WP_Error( 'user_already_exists', __( 'That username is already activated.' ), \$signup), get_defined_vars());";
             /**/
             if (file_exists($ms_functions_file) && ($ms_functions = file_get_contents($ms_functions_file)) && is_writable($ms_functions_file)) {
                 if (($ms_functions_written = file_put_contents($ms_functions_file, preg_replace($ms_functions_section, $ms_functions_replace, $ms_functions, 1, $ms_functions_patched))) && $ms_functions_patched || ($ms_functions_patched_already = $ms_functions_patched = strpos($ms_functions, $ms_functions_replace))) {
                     $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-includes/ms-functions.php</code> file ' . ($ms_functions_patched_already ? 'is patched' : 'has been patched successfully') . '.') : null;
                 } else {
                     if (!$ms_functions_written) {
                         /* Otherwise, we need to report that /wp-includes/ms-functions.php could NOT be updated. Possibly a permissions error. */
                         $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-includes/ms-functions.php</code> file could NOT be patched. Patch NOT written.', true) : null;
                     } else {
                         if (!$ms_functions_patched) {
                             /* Otherwise, we need to report that /wp-includes/ms-functions.php could NOT be updated. Wrong WordPress version? */
                             $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-includes/ms-functions.php</code> file could NOT be patched. Unverifiable.', true) : null;
                         }
                     }
                 }
             } else {
                 /* Otherwise, we need to report that /wp-includes/ms-functions.php could NOT be updated. Possibly a permissions error. */
                 $display_notices ? c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Your <code>/wp-includes/ms-functions.php</code> file could NOT be patched. File NOT writable.', true) : null;
             }
             /**/
             $ran_mms_patches = true;
             /* Flag indicating this routine was indeed processed. */
             /**/
             do_action("ws_plugin__optimizemember_during_mms_patches_after", get_defined_vars());
         }
     }
     /**/
     do_action("ws_plugin__optimizemember_after_mms_patches", get_defined_vars());
     /**/
     return !empty($ran_mms_patches) ? $ran_mms_patches : false;
 }
예제 #14
0
 /**
  * Builds the Pro Forms page for this Payment Gateway.
  *
  * @package optimizeMember\Menu_Pages
  * @since 1.5
  *
  * @return null
  */
 public static function paypal_forms_page()
 {
     if (c_ws_plugin__optimizemember_pro_paypal_responses::paypal_form_api_validation_errors()) {
         /* Report error if PayPal Options are not yet configured. */
         c_ws_plugin__optimizemember_admin_notices::display_admin_notice('Please configure <code>optimizeMember -> PayPal Options</code> first. Once all of your PayPal Options are configured; including your Email Address, API Username, Password, and Signature; return to this page &amp; generate your PayPal Pro Form(s).<br /><br />*NOTE: If you\'re ONLY planning to use Free Registration Forms (e.g. you\'re NOT going to accept payments), you can safely ignore this warning and continue to use the Free Registration Form shortcode provided below.', true);
     }
     /**/
     include_once dirname(dirname(dirname(dirname(__FILE__)))) . "/menu-pages/paypal-forms.inc.php";
     /**/
     return;
     /* Return for uniformity. */
 }