Forum Replies Created

Viewing 15 replies - 121 through 135 (of 172 total)
  • Plugin Author Josh Levinson

    (@joshlevinson)

    Hi there! Sorry to hear you are having trouble.

    For the settings, I am not sure why you are getting a blank screen. The following information would be helpful:

    • Version of WordPress installed
    • Version of WooCommerce installed
    • A list of all active plugins
    • The name of your site’s active theme

    As for the WooFAQs – these are not meant to be added from the Dashboard. They are meant to be added from the front-end.
    If you visit a single product, you will notice a “FAQs” tab beside the other, built-in WooCommerce tabs. This FAQs tab has a form to submit a question. You can submit a question yourself, you will just receive two notifications – one for submitting the question and one to notify you when an answer is posted (by yourself of course).

    Plugin Author Josh Levinson

    (@joshlevinson)

    Plugin Author Josh Levinson

    (@joshlevinson)

    Sounds great!

    Plugin Author Josh Levinson

    (@joshlevinson)

    Nope, but that’s a great idea ?? I’ll consider doing so!

    Plugin Author Josh Levinson

    (@joshlevinson)

    If someone has posted a FAQ, you will first need to visit the “WooFAQs” section of your Dashboard and approve the question you want visible. You can then reply to it from the front-end. After you have approved/replied to the question, the customer will get an email with a link back to the product’s FAQ tab.

    Thread Starter Josh Levinson

    (@joshlevinson)

    Found the issue. Types plugin from WP-Types caused the load apparently. Deactivating that plugin and registering the post type myself fixed it.

    Forum: Plugins
    In reply to: [WP Modal Login] Redirect
    Thread Starter Josh Levinson

    (@joshlevinson)

    Close but no cigar ??

    add_filter('wpml_redirect_to','my_wpml_redirect');
    function my_wpml_redirect(){
    return 'https://www.myredirecturl.com';
    }

    That is the most compatible way to do it.

    Thread Starter Josh Levinson

    (@joshlevinson)

    Apparently it was the theme I had installed. Go figure. Should have checked that first!

    Forum: Plugins
    In reply to: [Page Links To] Link to #

    If the only reason you installed this plugin was to have a dummy parent menu, uninstall it. You can do this in WP’s menu panel – just add a custom link whose URL is # and whatever title you want.

    For reference, my changes to s2Member were:

    The first step was changing the logic from hooking into wp_login to filtering the login_redirect. Since s2Member removes all filters on login_redirect, I also had to modify login-redirects-r.inc.php to add the filter back after all others are removed.

    The altered login_redirect function in login-redirects.inc.php:

    public static function login_redirect ($redirect,$request,$user)
    					{
    						foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
    						do_action ("ws_plugin__s2member_before_login_redirect", get_defined_vars ());
    						unset /* Unset defined __refs, __v. */ ($__refs, $__v);
    						$username = $user->user_login;
    						if (is_string($username) && $username && is_object ($user) && !empty ($user->ID) && ($user_id = $user->ID))
    							{
    								update_user_option ($user_id, "s2member_last_login_time", time());
    
    								if /* Have we got this yet? */ (!get_user_option ("s2member_registration_ip", $user_id))
    									update_user_option ($user_id, "s2member_registration_ip", $_SERVER["REMOTE_ADDR"]);
    
    								if (($logins = (int)get_user_option ("s2member_login_counter", $user_id) + 1) >= 1 || ($logins = 1))
    									update_user_option ($user_id, "s2member_login_counter", $logins);
    
    								if /* Nag em? */ ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["custom_reg_password"])
    									delete_user_setting ("default_password_nag") . update_user_option ($user_id, "default_password_nag", false, true);
    
    								$disable_login_ip_restrictions = apply_filters ("ws_plugin__s2member_disable_login_ip_restrictions", false, get_defined_vars ());
    
    								if (($ok = true) && !is_super_admin ($user_id) && $username !== "demo" && !$disable_login_ip_restrictions)
    									$ok = c_ws_plugin__s2member_ip_restrictions::ip_restrictions_ok ($_SERVER["REMOTE_ADDR"], $username);
    
    								if (($redirect = apply_filters ("ws_plugin__s2member_login_redirect", (($user->has_cap ("edit_posts")) ? false : true), get_defined_vars ())))
    									{
    										$obey_redirect_to = apply_filters ("ws_plugin__s2member_obey_login_redirect_to", /* By default, we obey this. */ true, get_defined_vars ());
    
    										if (!$obey_redirect_to || empty ($_REQUEST["redirect_to"]) || !is_string ($_REQUEST["redirect_to"]) || $_REQUEST["redirect_to"] === admin_url () || preg_match ("/^\/?wp-admin\/?$/", $_REQUEST["redirect_to"]))
    											{
    												foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
    												do_action ("ws_plugin__s2member_during_login_redirect", get_defined_vars ());
    												unset /* Unset defined __refs, __v. */ ($__refs, $__v);
    
    												if /* Is this a string? */ ($redirect && is_string ($redirect))
    													return /* Dynamic URL introduced by a Filter? */ ($redirect);
    
    												else if ($redirection_url = c_ws_plugin__s2member_login_redirects::login_redirection_url ($user))
    													return /* Special Redirection URL configured with s2Member. */ ($redirection_url);
    
    												else // Else we use the Login Welcome Page configured for s2Member.
    													return (get_page_link ($GLOBALS["WS_PLUGIN__"]["s2member"]["o"]["login_welcome_page"]));
    
    												exit /* Clean exit. */ ();
    											}
    									}
    							}
    
    						foreach(array_keys(get_defined_vars())as$__v)$__refs[$__v]=&$$__v;
    						do_action ("ws_plugin__s2member_after_login_redirect", get_defined_vars ());
    						unset /* Unset defined __refs, __v. */ ($__refs, $__v);
    
    						return /* Return for uniformity. */;
    					}

    My altered filter in hooks.php (replaces the add_action(‘wp_login’)):

    add_filter("login_redirect", "c_ws_plugin__s2member_login_redirects::login_redirect", 20, 3);

    My altered remove_login_redirect_filters in login-redirects-r.inc.php:

    public static function remove_login_redirect_filters ()
    					{
    						//if(defined ("DOING_AJAX") || DOING_AJAX) return;
    						do_action ("ws_plugin__s2member_before_remove_login_redirect_filters", get_defined_vars ());
    
    						if (!apply_filters ("ws_plugin__s2member_allow_other_login_redirect_filters", false, get_defined_vars ()))
    							{
    								remove_all_filters /* Removes all <code>login_redirect</code> Filters. */("login_redirect");
    								add_filter ("login_redirect", "c_ws_plugin__s2member_login_redirects_r::_empty_login_redirect_filter");
    								add_filter("login_redirect", "c_ws_plugin__s2member_login_redirects::login_redirect", 20, 3);
    
    								do_action ("ws_plugin__s2member_during_remove_login_redirect_filters", get_defined_vars ());
    							}
    
    						do_action ("ws_plugin__s2member_after_remove_login_redirect_filters", get_defined_vars ());
    
    						return /* Return for uniformity. */;
    					}

    I realize that filtering the login_redirect twice may be redundant, but I will leave that decision up to s2Member’s team.

    The summary of my changes are:

    1. Changing the use of wp_login hook to login_redirect filter.
    2. Altering the login_redirect function of s2Member to return the url instead of redirecting to it.
    3. Re-adding the filter after all filters are removed by remove_login_redirect_filters.

    Cole, I noticed that your plugin redirects to the same page unconditionally, instead of allowing the redirect to be changed. I suggest that you modify this block:

    if ( ! is_user_logged_in() ) {
    	wp_localize_script( 'wpml-script', 'wpml_script', array(
    		'ajaxurl' => admin_url( 'admin-ajax.php' ),
    		'redirecturl' =>$_SERVER['REQUEST_URI',
    		'loadingmessage' => __( 'checking credentials...' ),
    	) );
    }

    to

    if ( ! is_user_logged_in() ) {
    	wp_localize_script( 'wpml-script', 'wpml_script', array(
    		'ajaxurl' => admin_url( 'admin-ajax.php' ),
    		'redirecturl' =>                 apply_filters('wpml_redirect_to',$_SERVER['REQUEST_URI']),
    		'loadingmessage' => __( 'checking credentials...' ),
    	) );
    }

    so that we can have control over what page WP Modal Login redirects to.

    On the topic of s2Member, I do agree that the fault is s2Members. I have modified s2Member for now to filter the login_redirect instead of wp_redirect’ing on the wp_login hook, as I feel this is a more appropriate place to redirect. This, in combination with the filter I added to your plugin’s redirecturl, solved my problems for the time being.

    Thread Starter Josh Levinson

    (@joshlevinson)

    I noticed that the message is still stored in the database though ?? I modified your plugin to add another column for the message content, though a scroll-able modal would be best for it considering the content can be quite long.

    Okay so here is my deduction of what is going on…
    Modal Login calls wp_signon with the POSTed data.
    Modal Login expects to retrieve a WP_User object in return.

    Meanwhile….
    s2Member adds an action to wp_login – their redirect logic.
    The wp_login hook is fired by Modal Login’s wp_signon call.
    s2Member performs it’s wp_redirect (the success of which can be seen by watching the Network panel of Chrome’s developer toolbar).

    Back to Modal Login…
    Modal Login expects to retrieve the WP_User object, but by this time, we’ve already moved on to the redirected page. So No WP_User for Modal Login. Hence, Modal Login just sits.

    For a fix…I believe it is on the end of s2Member – maybe using the login_redirect filter INSTEAD of the wp_login hook.

    In s2Member, the problem lies in the class ‘c_ws_plugin__s2member_login_redirects’, which is defined in \s2member\includes\classes\login-redirects.inc.php. The specific function causing the problem is at line 67 of my installed version:
    public static function login_redirect ($username = FALSE, $user = FALSE)
    To remove the issue temporarily, I added:
    if(defined ("DOING_AJAX") || DOING_AJAX) return;
    to the top of that function, which resolved the issue for the time being.

    I am thinking that s2Member is probably using a bad filter; they are definitely not return the WP_User object correctly using the filter they are using currently.

    Correction: it’s not a filter, it’s an action…so it shouldn’t have to return the user object.

    This appears to be an issue also when s2Member is installed.

Viewing 15 replies - 121 through 135 (of 172 total)