page-forum - Preloader loop

User avatar
axew3
w3all User
w3all User
Posts: 2184
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

page-forum - Preloader loop

Post by axew3 »

It has been reported a loop for preloader on iframe in various scenarios.
It is not a loop, it is the preloader that is not removed, after the page has been completely loaded.
A jQuery instruction is deprecated, and no longer used on jQuery.

This in attach fix:
preloader that is not correctly removed, iframe problem when in not linked users mode, and more.

It will be substantially the new page-forum.php available and suitable for next v6 iframe code, that run ok also into v5 code.

To resolve and fix these and more issues at once, remove the old page-forum and replace with the new one, renaming it as required and substituting into your active template folder.

removed, download last version more below

xray1
Posts: 2
Joined: Sat Jan 30, 2021 10:51 am

Re: page-forum - Preloader loop

Post by xray1 »

I've attempted to use the new fix, but still getting the infinite loop after trying to login. On one user login, it's redirecting me to the WP login, but then it states it does not recognize the user - user email or password. This is even when trying to use the password reset.

User avatar
axew3
w3all User
w3all User
Posts: 2184
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: page-forum - Preloader loop

Post by axew3 »

to disable the plugin safely:
viewtopic.php?f=13&t=679

you can login with another user and check what's wrong with this user that cannot login (his state in phpBB, if there is another in wp sharing same email of someone else in phpBB etc, if really exist in wp etc)?

It seem there are some problem with this, the page do not loop in true, the page forum just do not remove the preloader when should, because someway the js that remove it when iframe loaded, fail on execute (and the screen remain with preloader on).

Can you send me a pm and i will take a look: it also happen here, then i reload the page and all work fine.
It will be fixed as soon

User avatar
axew3
w3all User
w3all User
Posts: 2184
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: page-forum - Preloader loop

Post by axew3 »

to see that it is as i say, open page-forum and remove this line:
<div id="w3_toogle_wrap_loader" class="w3_no_wrap_loader"><div class="w3_loader"></div></div>
you'll see that the problem disappear, but of course also the preloader.
I will fix this giving a time this night if possible

User avatar
axew3
w3all User
w3all User
Posts: 2184
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: page-forum - Preloader loop

Post by axew3 »

This is the last version of page-forum, that fix preloader loop and more issues about push history
If anybody can try and report would be great, it has been updated also here online with this same new version:

removed, the new is more below

xray1
Posts: 2
Joined: Sat Jan 30, 2021 10:51 am

Re: page-forum - Preloader loop

Post by xray1 »

I downloaded the new file and installed. I attempted to login and was redirected to WP_login. Still did not recognize username. When I used a different username, I was able to get into the WP_Admin so I could rebuild the page. When selecting the forum, Infinite Loop.

When I logged into your site today, I also was redirected to the WP_Login page and had to enter in login detail, which took me to my WP_profile page. I then followed path to forum here.

User avatar
axew3
w3all User
w3all User
Posts: 2184
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: page-forum - Preloader loop

Post by axew3 »

Uncaught TypeError: e.indexOf is not a function
load jQuery
<anonymous> https://armyranger.com/bb/index.php:2021
i assume that this error cause your problem: it make it fail the subsequent forum's page jquery instruction that should remove the preloader (it is not a loop).

So to resolve, you can do two things:
resolve the js error coming out due to a wp plugin or wp theme or wp theme plugin, or into phpBB template, like it is in your case, or remove the preloader into page forum for the moment: just open it and remove this code:

search:

Code: Select all

<!-- START iframe div -->
<div id="w3_toogle_wrap_loader" class="w3_no_wrap_loader"><div class="w3_loader"></div></div>
remove the line

Code: Select all

<div id="w3_toogle_wrap_loader" class="w3_no_wrap_loader"><div class="w3_loader"></div></div>
.

But so you'll not have a preloader.

The page-forum js code will be updated to fix issues like these: if there are errors coming out due to some code in wp plugins/themes or phpBB templates, it will work by the way.

I would like to remember also that disabling js on browser, you can stop any issue with javascript, so you can manage and adjust things, if you fall into problems with iframe and preloader that do not disappear.

oferlaor
User w
User w
Posts: 10
Joined: Wed Jan 27, 2021 2:24 pm

Re: page-forum - Preloader loop

Post by oferlaor »

this is what I did on my site:

Code: Select all

jQuery(window).on('DOMContentLoaded', function(){
	setTimeout(function(){
	 jQuery('#w3_toogle_wrap_loader').attr( \"class\", \"w3_no_wrap_loader\" );
	},500);
});
jQuery(window).on('load', function(){
 jQuery('#w3_toogle_wrap_loader').attr( \"class\", \"w3_no_wrap_loader\" );
});
About the loop, this can be caused by two reasons, either the window.top doesn't stick or the login sync doesn't work (phpbb thinks it's logged in but the login doesn't stick because of a mismatch between WP & phpbb login credentials).


for the first in overall_header.php:

Code: Select all

if ((window.self !== window.top) != true) {
		if(/adm\//ig.exec(window.location.href) === null){ // avoid x ACP
			var w3all_r = window.location.href.replace(/sid=.+/gi, '');
			w3all_r = w3all0Normalize_phpBBUrl(w3all_r);
			hrefEnc = window.btoa(unescape(encodeURIComponent(w3all_r)));
			href0 =  wordpress_url_page_f + '/?'+ w3all_custom_wp_w3fancyurl + '=' + hrefEnc;
			if (document.location.href!= href0)
				document.location.replace(href0);
		}
	}
for the second case in page-forum.php, note the protection that's supposed to prevent the loop. The issue is likely caused when there's a mismatch between phpbb & WP credentials, it might be smarter to redirect to recommit the login info into WP, since it's like that's the root cause for the loop:

Code: Select all

	function w3all_ajaxup_from_phpbb(res, hash = ''){
            function reloadPage() {
                document.location.reload();
            }
            function redirectToForum() {
                        // no one will use the index.php notation naturally, but we can also add another notation
			if (document.location.href!= ($w3allhomeurl."/index.php/".$wp_w3all_forum_folder_wp))
				document.location.replace('".$w3allhomeurl."/index.php/".$wp_w3all_forum_folder_wp."/');
            }
            function showLoader() {
                jQuery('#w3_toogle_wrap_loader').attr( \"class\", \"w3_wrap_loader\" );
            }
            
          var w3all_phpbb_u_logged  = /#w3all_phpbb_u_logged=1/ig.exec(res);

          if( w3all_phpbb_u_logged == null && wp_u_logged > 0 ||
            wp_u_logged == 0 && res.indexOf('#w3all_phpbb_u_logged=1') > -1 ){
             showLoader();
             
             if( hash == 'unread' ){
                reloadPage(); //no need to redirect to forum homepage
             } else {
                reloadPage();
             }
          } else if (wp_u_logged == 0 && res.indexOf('#w3all_phpbb_u_logged=1') > -1){
            redirectToForum()
          }

User avatar
DjPorkchop73
User www
User www
Posts: 61
Joined: Thu Aug 20, 2020 6:45 pm
Location: Egyptian Valley of Illinois

Re: page-forum - Preloader loop

Post by DjPorkchop73 »

I upgraded and no matter what I do, I get the preloader loop. I have tried everything I can think of. If anyone has any ideas at all, I am all ears. I even tried the test above to see if the loop went away and it did not while the preloader did.

I removed :

Code: Select all

<div id="w3_toogle_wrap_loader" class="w3_no_wrap_loader"><div class="w3_loader"></div></div>
Still have a loop.

My website is setup the old way so Wordpress Admin and phpBB admin match. I shutoff profile options in phpBB and only allow registration and login in phpBB.

If I turn java off in my browser, the loop is gone and website works normal except obviously I have no iframe integration at that point.
If I could I would. If I don't, it's because I am lazy!

User avatar
axew3
w3all User
w3all User
Posts: 2184
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: page-forum - Preloader loop

Post by axew3 »

Ok: i will stop a while today the extension audio/video to post, to take a look into this and i hope to find out the main problem immediately.
i will report soon the result here. Anyway:

Code: Select all

<div id="w3_toogle_wrap_loader" class="w3_no_wrap_loader"><div class="w3_loader"></div></div>
the fact you say
Still have a loop until i do not disable the javascript on browser results to me very strange.
let see...

User avatar
DjPorkchop73
User www
User www
Posts: 61
Joined: Thu Aug 20, 2020 6:45 pm
Location: Egyptian Valley of Illinois

Re: page-forum - Preloader loop

Post by DjPorkchop73 »

axew3 wrote:
Wed Feb 17, 2021 8:29 am
Ok: i will stop a while today the extension audio/video to post, to take a look into this and i hope to find out the main problem immediately.
i will report soon the result here. Anyway:

Code: Select all

<div id="w3_toogle_wrap_loader" class="w3_no_wrap_loader"><div class="w3_loader"></div></div>
the fact you say
Still have a loop until i do not disable the javascript on browser results to me very strange.
let see...
I continued to work on it tonight. I am putting it back to the way it was right after i upgraded the website. I fear the harder I try the worse I make it. So I will take it back to as was after the upgrade so it is fresh so I can try a clean problem solve with you. I appreciate you thinking about a solution.
If I could I would. If I don't, it's because I am lazy!

User avatar
DjPorkchop73
User www
User www
Posts: 61
Joined: Thu Aug 20, 2020 6:45 pm
Location: Egyptian Valley of Illinois

Re: page-forum - Preloader loop

Post by DjPorkchop73 »

I did forget to add, When I visit the website for the first time as not logged in, when I visit the phpBB forum, I do not loop. When I click the login link and enter my credentials and submit, I then enter the endless loop. no matter what I do after that, I can not stop it. I also double checked the Remember Me setting, The forced SSL settings, I double and triple checked my cookie settings as well.

If I can be fast and catch a link on the website and click it fast enough, I can get back on the phpBB and I am logged in. However, if I attempt to leave the phpBB at all, I then loop once again. I can never make it to the WordPress. If I manage to click a WordPress link fast enough while in the loop, I can get to WordPress then, but I am NOT logged in.

If I get rid of the iframe integration and use the force integration trick instead, I have no issues at all with the plugin.
If I could I would. If I don't, it's because I am lazy!

User avatar
DjPorkchop73
User www
User www
Posts: 61
Joined: Thu Aug 20, 2020 6:45 pm
Location: Egyptian Valley of Illinois

Re: page-forum - Preloader loop

Post by DjPorkchop73 »

1 more update on this issue, I don't think my issue is preloader at all. I think it is some settings maybe? All user accounts on my website login and work just fine without any loop at all including another admin account. My Main admin account that was used to install WordPress and phpBB both, that is the only account that Loops.
If I could I would. If I don't, it's because I am lazy!

User avatar
axew3
w3all User
w3all User
Posts: 2184
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: page-forum - Preloader loop

Post by axew3 »

if it is the unique user that loop, and is the id 1 in wp, it is ok!

the uid 1 in wordpress and uid 2 in phpBB are not linked anymore since 2.4.0
if the user id1 in wp or uid 2 in phpBB try to load page forum, it is normal that they fall into loop.

sorry that yesterday i had no chance to take o look, i will do surely today fixing this part-

anyway, here, i see my account that is not uid1 in wp nor uid2 in phpBB that loop sometime, and as reported also by someone else, there is surely something to be fixed. It happen especially if the session expire and i go to click into a notification email link.
When page forum open, i fall into the problem that the preloader do not disappear.

this is another problem than the uid1 in wp or uid2 in phpBB. Your, with uid1 is truly a loop if you visits page forum, this other is instead about the fact that the preloader is not removed as soon the page load, and remain in place. I can see that if i reload the page all goes fine: this need to be resolved immediately!

User avatar
axew3
w3all User
w3all User
Posts: 2184
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: page-forum - Preloader loop

Post by axew3 »

Just over to fix all things about iframe and page forum.

this is the page forum that should:
fix uid1 WP and phpBB uid2 loop
fix the pushState on page forum landing and oniframe navigation
fix the empty w3= (or custom fancy= url) that sometime was happening on address bar


not sure if it fix the preloader that sometime do not disappear (and there is no stop until page reloaded may due to explicit reload by browser button)

page-forum.zip
(5.29 KiB) Downloaded 1 time

You can play it like a telegram or whatsapp audio (still under construction but fully working):
viewtopic.php?f=20&t=1628

MyCiaoToYou.mp3
(235.13 KiB) Not downloaded yet

User avatar
DjPorkchop73
User www
User www
Posts: 61
Joined: Thu Aug 20, 2020 6:45 pm
Location: Egyptian Valley of Illinois

Re: page-forum - Preloader loop

Post by DjPorkchop73 »

I used the new file and am still looping with my main admin account. I can login just fine with every other account on the website with no loops at all. 1 other is a admin and another is a editor.

I will add this much: I used this latest file that you offered and made sure website worked 100%. I THEN upgraded to the latest version of w3all phpBB integration 2.4.3 and I was able to use the website for a couple day s with no errors at all and no loops.

So today I attempted to use the phpbb w3all login widget and I got the same error that I have always got since day 1 that I started using the plugin: Invalid Credentials. After this incident, I now get loops every time I attempt to login with that account no matter what browser I try and no matter if it is on my laptop, my wife's laptop, my cellphone or my PS4 browser even. Maybe coincidental?

I have run out of things to try and to look at. Maybe someone can take a look for me and or suggest detail for detail settings that I need set properly. I am now 100% officially lost and ready to not use iframe anymore even though I like it much better than separate forums. My struggle is real. :D
If I could I would. If I don't, it's because I am lazy!

User avatar
DjPorkchop73
User www
User www
Posts: 61
Joined: Thu Aug 20, 2020 6:45 pm
Location: Egyptian Valley of Illinois

Re: page-forum - Preloader loop

Post by DjPorkchop73 »

DjPorkchop73 wrote:
Fri Feb 26, 2021 6:12 am

So today I attempted to use the phpbb w3all login widget and I got the same error that I have always got since day 1 that I started using the plugin: Invalid Credentials. After this incident, I now get loops every time I attempt to login with that account no matter what browser I try and no matter if it is on my laptop, my wife's laptop, my cellphone or my PS4 browser even. Maybe coincidental?
Sorry I was to late to edit my own post. I did not want to give false info so I need to correct.

That widget login only happens on my main admin account as well that was used to create the wordpress and phpBB forums. when I attempted to use ti I got a reauth link and ivalid credentials error even though my credentials are correct. That is when the loop happens. So if I delete cookies and cache and come back and try to login via phpBB login link. I still loop. Kind of strange.

Here is the reauth link I get on credentials error. https://paparayphotography.com/community/?reauth=1
If I could I would. If I don't, it's because I am lazy!

User avatar
axew3
w3all User
w3all User
Posts: 2184
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: page-forum - Preloader loop

Post by axew3 »

Hello! 2.4.4 is ready, just checked the issue, and all is working ok here for what i have configured and tested out.

you say you get this only with id1 wp admin.

admin uid1 in wp and phpBB uid2 are not linked anymore, so asking myself how this can happen at moment. Checking further more...

User avatar
DjPorkchop73
User www
User www
Posts: 61
Joined: Thu Aug 20, 2020 6:45 pm
Location: Egyptian Valley of Illinois

Re: page-forum - Preloader loop

Post by DjPorkchop73 »

I might may have some settings wrong? I am not real sure. I do have one other issue that I mentioned a post back that kicked off my loop tonight. I will post screenshots.
If I could I would. If I don't, it's because I am lazy!

User avatar
DjPorkchop73
User www
User www
Posts: 61
Joined: Thu Aug 20, 2020 6:45 pm
Location: Egyptian Valley of Illinois

Re: page-forum - Preloader loop

Post by DjPorkchop73 »

I made another post with further details and screenshots. I don't believe your preloader is bad. Please feel free to move my last couple posts to the other if you wish so you can keep them straight and tidy.
If I could I would. If I don't, it's because I am lazy!

Post Reply