Forum Replies Created

Viewing 15 replies - 1 through 15 (of 56 total)
  • Thread Starter Luigino

    (@luigino)

    At the end I solved with a little PHP procedure calling wp_insert_user() from that another table specifying the role as default’s wordpress. Thanks anyway!

    Thread Starter Luigino

    (@luigino)

    Hello @gappiah ! Thanks for the suggest….It looks like it was probably that plugin since last update because deactivating it I can enter to modify pages now… maybe it should be opened a bug for that plugin to automattic since the owner are them?

    Thread Starter Luigino

    (@luigino)

    EDIT:

    Investigating some more using error_log I modified previous login code with:

    function my_login_redirect( $user_login, WP_User $user ) {
            
        $session_lang = pll_current_language(); 
        $browser_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
        
        if (current_user_can('administrator') == false) {
            if ($session_lang != $browser_lang) {
                $redirect_url = "https://example.com/" . $session_lang . "/";
            } else {
                $redirect_url = "https://example.com/";
            }
        } else {
            $redirect_url = admin_url();
        }
        error_log(__METHOD__ . ": value = $redirect_url");
        wp_redirect( $redirect_url );   
        exit;
    }
    add_action('wp_login', 'my_login_redirect', 10, 2);

    and in debug.log I see $redirect_url as https://example.com but it doesn’t redirect to that homepage but it goes to login page itself…. why? I’m really stuck here….

    Thank you in advance!
    Cheers!

    • This reply was modified 2 years, 7 months ago by Luigino.
    Thread Starter Luigino

    (@luigino)

    After some investigation I considered those two scenarios:

    1°) I am in my country and I use the website in local language which is browser’s one;
    2°) I am in another country and I use the website in my language selecting language by Polylang so pll_current_language() != substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);

    Having WPS Hide Login settled without any redirection fields settled and Success Endpoint deactivated to manage by language I reached to manage logouts correctly between those two scenarios to redirect to homepage with logout_url hook:

    function my_logout_redirect($link) { 
      	
      	$session_lang = pll_current_language();	
    	$browser_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
    
    	if ($session_lang != $browser_lang && ! is_admin() ) {
    		$redirect_url = "https://example.com/wpshidelogin/?action=logout&redirect_to=https%3A%2F%2Fexample.com%2F" . $session_lang . "%2F" . "&_wpnonce=" . wp_create_nonce( 'log-out' );
    		return $redirect_url;				
    	} 
    	if ($session_lang == $browser_lang && ! is_admin() ) {
    		$redirect_url = "https://example.com/wpshidelogin/?action=logout&redirect_to=https%3A%2F%2Fexample.com%2F" . "&_wpnonce=" . wp_create_nonce( 'log-out' );
    		return $redirect_url;
    	}
    	if (is_admin()) {
    		$redirect_url = "https://example.com/wpshidelogin/?action=logout&redirect_to=https%3A%2F%2Fexample.com%2F" . "&_wpnonce=" . wp_create_nonce( 'log-out' );
    		return $redirect_url;
    	}		
    	return $link;	
    }
    add_filter( 'logout_url', 'my_logout_redirect', 10, 3);

    but to manage login, redirecting to homepage once logged, it looks like a bit messing up using this code:

    function my_login_redirect( $redirect_to, $request, $user ) {
    //function my_login_redirect() {
    	$session_lang = pll_current_language();	
    	$browser_lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
    	$redirect_url = "";
    		
    	if (!is_admin()) {
    		$redirect_url = "https://example.com" . ( ($session_lang != $browser_lang ) ? $session_lang : "" ) . "/";
    	}
    	if (is_admin())
    		$redirect_url = admin_url();
    
    	/*
    	if ($current_language == "it" && $current_language != substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) && current_user_can('administrator') == false) 
    		return "https://example.com/it/";
    	else 
    		return "https://example.com/wp-admin";
    	if ($current_language == "en" && $current_language != substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) && current_user_can('administrator') == false) 
    		return "https://example.com/en/";
    	else	
    		return "https://example.com/wp-admin";
    	if ($current_language == "es" && $current_language != substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) && current_user_can('administrator') == false) 
    		return "https://example.com/es/";
    	else
    		return "https://example.com/wp-admin";
    	if ($current_language == "fr" && $current_language != substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) && current_user_can('administrator') == false) 	
    		return "https://example.com/fr/";
    	else	
    		return "https://example.com/wp-admin";
    	if ($current_language == "de" && $current_language != substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) && current_user_can('administrator') == false) 
    		return "https://example.com/de/";
    	else
    		return "https://example.com/wp-admin";
    	*/
    	
    	//return home_url();
    	//wp_safe_redirect($redirect_url);
    	//exit;
    	return $redirect_url;
    }
    //add_action('wp_login', 'my_login_redirect');
    add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );

    where it always goes to login page (yes, as login page I created a page with [xoo_el_inline_form active=”login”] shortcode since I use Login/Signup Popup plugin for login/logouts…. even if I log in in admin panel it goes to Login page instead of wp-admin…
    Any suggests?

    Thanks in advance!
    Cheers

    Thread Starter Luigino

    (@luigino)

    HI @seinomedia !

    First thank you for your answer!
    In fact in my functions.php ‘s theme I added this to manage 5 languages:

    function my_logout_redirect($items){
      foreach($items as $item){
        if( $item->url == "https://XXXXXXXXXXXX/es/YYYYYYYYYYYYY/?action=logout") {
    		 $item->url = "https://XXXXXXXXXXXX/YYYYYYYYYYYYY/?action=logout&redirect_to=https%3A%2F%2FXXXXXXXXXXXX%2Fes%2F" . "&_wpnonce=" . wp_create_nonce( 'log-out' );
        }
    	if( $item->url == "https://XXXXXXXXXXXX/en/YYYYYYYYYYYYY/?action=logout") {
    		 $item->url = "https://XXXXXXXXXXXX/YYYYYYYYYYYYY/?action=logout&redirect_to=https%3A%2F%2FXXXXXXXXXXXX%2Fen%2F" . "&_wpnonce=" . wp_create_nonce( 'log-out' );
        }
    	if( $item->url == "https://XXXXXXXXXXXX/fr/YYYYYYYYYYYYY/?action=logout") {
    		 $item->url = "https://XXXXXXXXXXXX/YYYYYYYYYYYYY/?action=logout&redirect_to=https%3A%2F%2FXXXXXXXXXXXX%2Ffr%2F" . "&_wpnonce=" . wp_create_nonce( 'log-out' );
        }
    	if( $item->url == "https://XXXXXXXXXXXX/de/YYYYYYYYYYYYY/?action=logout") {
    		 $item->url = "https://XXXXXXXXXXXX/YYYYYYYYYYYYY/?action=logout&redirect_to=https%3A%2F%2FXXXXXXXXXXXX%2Fde%2F" . "&_wpnonce=" . wp_create_nonce( 'log-out' );
        }
    	if( $item->url == "https://XXXXXXXXXXXX/it/YYYYYYYYYYYYY/?action=logout" ) {
    		 $item->url = "https://XXXXXXXXXXXX/YYYYYYYYYYYYY/?action=logout&redirect_to=https%3A%2F%2FXXXXXXXXXXXX%2Fit%2F" . "&_wpnonce=" . wp_create_nonce( 'log-out' );
        }
    	
      }
      return $items;
    }
    add_filter('wp_nav_menu_objects', 'k3_logout_redirect');
    
    function k3_login_redirect( $redirect_to, $request, $user ) {
    	$current_language = isset($_COOKIE['pll_language']) ? $_COOKIE['pll_language'] : false;	
    	
    	file_put_contents( '/debug_login.txt', print_r( 'Debug check: '. $current_language . ' - ' . substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) . PHP_EOL, true ), FILE_APPEND );
    	
    	if ($current_language == "it" && $current_language != substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)) 
    		return "https://XXXXXXXXXXX/it/";		
    	if ($current_language == "en" && $current_language != substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)) 
    		return "https://XXXXXXXXXXX/en/";
    	if ($current_language == "es" && $current_language != substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)) 
    		return "https://XXXXXXXXXXX/es/";
    	if ($current_language == "fr" && $current_language != substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)) 
    		return "https://XXXXXXXXXXX/fr/";
    	if ($current_language == "de" && $current_language != substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2)) 
    		return "https://XXXXXXXXXXX/de/";
    	
    	return home_url();
    }
    add_filter( 'login_redirect', 'k3_login_redirect', 10, 3 );

    where XXXXXXXXXXX is the domain and YYYYYYYYYYYYY is the fake path where hide login… maybe could because of this snippet?
    Because I written that due if someone , for example spanish guy , goes to Italy and on an italian PC wants to visit the site in spanish when normally wordpress works with native browser language….

    Thanks in advance!
    Cheers:-)

    Thread Starter Luigino

    (@luigino)

    I checked the htaccess of the server and it’s settled as

    # BEGIN WordPress
    # Le direttive (linee) tra <code>BEGIN WordPress</code> e <code>END WordPress</code> sono
    # generate dinamicamente, e dovrebbero essere modificate solo tramite i filtri di WordPress.
    # Ogni modifica alle direttive tra questi marcatori verrà sovrascritta.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress

    Could be something of this .htaccess the cause of missing redirect to wp-admin panel?

    Thanks in advance!
    Cheers

    Thread Starter Luigino

    (@luigino)

    Hello @adamkheckler ,

    First, thank you for your answer.

    About Earnings tab I read it here:

    https://support.stripe.com/express/questions/can-i-see-where-my-payout-was-deposited?locale=en-US

    about the payment in “Paid” state and the Status->System Status , yes I have something acct_XXXXXXXXXXX … should I give that via ticket support instead of public forum?

    About the issue of odd state I already opened a ticket today and I explained in detail about that migration so at least via ticket it can be investigated more….

    In the meanwhile, thank you again for your help!
    Cheers! ??

    Thread Starter Luigino

    (@luigino)

    HI @maykato , yes then I did right some time ago including a link to this thread ?? Then I’ll have just to wait the email answer contact ?? Thanks ??

    Thread Starter Luigino

    (@luigino)

    HI @ihereira , just to be sure, to submit a ticket I have to write down in Support Request section on Help with my account for this kind of issue , right? Or shall I have to write somewhere else?….

    Thread Starter Luigino

    (@luigino)

    HI @simplysaru

    I’ll open a ticket right now immediately! Thank you! ??

    Let’s get in touch in the ticket
    Thank you again
    Cheers!

    Thread Starter Luigino

    (@luigino)

    Hello @simplysaru !

    Thank you for your answer, in fact, about the website I am managing:
    – previously was hosted on another place with an username administrator and an email and there were no credit cards payments settled but only money transfer;
    – actually it’s hosted in another place with same username administrator as previously but with a different email and settled woocommerce payments connected to Stripe Express;

    On Orders admin page I can see some orders in “Paid” state done with credit cards (I can read also ID transactions in Payments page details of the orders), but I opened Woocommerce Dashboard (had to create a new account with the email settled on the website actually) but on Dashboard Orders I don’t see any orders list…

    And plus since I read in the documentation it needs something like 7 days to complete process and see funds in the account, isn’t there a way to speed it up? Because normally payments by credit cards takes just 2-3 days to complete process and see funds in bank account, plus we have an order paid on March 22 and it’s supposed to see funds yesterday but no funds yet in bank account….

    Maybe I should open a ticket to investigate together more deeply?…

    In the meanwhile, thank you in advance for your help
    Cheers!

    Thread Starter Luigino

    (@luigino)

    Since the website I am working on :
    – previously was hosted on another place with an username administrator and an email and there were no credit cards payments settled but only money transfer;
    – actually it’s hosted in another place with same username administrator as previously but with a different email and settled woocommerce payments connected to Stripe Express;

    On Orders admin page I can see some orders in “Paid” state done with credit cards (I can read also ID transactions in Payments page details of the orders), but I opened Woocommerce Dashboard (had to create a new account with the email settled on the website actually) but on Dashboard Orders I don’t see any orders list… why?

    And plus since I read in the documentation it needs something like 7 days to complete process and see funds in the account, isn’t there a way to speed it up? Because normally payments by credit cards takes just 2-3 days to complete process and see funds in bank account, plus we have an order paid on March 22 and it’s supposed to see funds yesterday but no funds yet in bank account….

    If needed, I can open a ticket pasting url of this conversation and giving some more details in private about website’s woocommerce account…..

    Waiting for your answer I thank you in advance!
    Cheers! ??

    Thread Starter Luigino

    (@luigino)

    Hello @adamkheckler

    here’s the link of documentation where I saw about Earnings tab.

    https://support.stripe.com/express/questions/can-i-see-where-my-payout-was-deposited?locale=en-US

    in the meanwhile, woocommerce payments plugin in website normally is associated of the website’s email of administrator , right ? or the username?
    Because this website previously was hosted in a place and based on another email and now which it’s hosted on another host but with a different email account even if the administrator username is the same as old. So I logged and opened the Woocommerce dashboard but I don’t see the list of orders I have on Orders page in the admin panel ; so I thought maybe woocommerce has connected the plugin with the new email address but there wasn’t an account on woocommerce with the new email so I created a new account with the new mail actually used in the website, but no orders list in the dashboard….. what I could do?….

    Thanks
    Cheers

    Thread Starter Luigino

    (@luigino)

    Hello @ihereira ,

    First thank you for your answer! I can understand your explanation but also reading on Stripe Express’s documentation I see I should see an Earnings folder in my Stripe Express account where to see transactions list but I don’t see it… I can see transactions list actually only in Woocommerce Payments payments list tab… do you know maybe if there’s a way to see that Earnings folder in Stripe Express account?

    Thanks in advance!
    Cheers! ??

    Thread Starter Luigino

    (@luigino)

    Hello @maykato !

    First thank you for a lot your answer … In fact I read that page about woocommerce payments at https://woocommerce.com/document/payments/built-in-partnership-with-stripe/ and there’s a table about Dashboard feature comparison and I see for standard account (which would mean also stripe express as standard account) there should be also transaction list. But now you made me a little doubt : is stripe express a standard account or a limited account? Because that’s how I settled via Woocommerce Payments settings…
    And about times of payments completion looks like 7 days are huge when digitally it should just need at least 2-3 days as normal credit card payments to arrive at our bank account, is there a way to speed that up from 7 days to at max 3 days?

    Thank you again in advance!
    Cheers!

Viewing 15 replies - 1 through 15 (of 56 total)