Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
All forum links and rss feeds ssl and upgrade difficulties
Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Nov 25, 2014 - 12:40 pm

Sorry hadn't hit refresh and seen your post. Yes I have tried that now but unfortunately same result.

Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Nov 25, 2014 - 12:50 pm

In post 38 in the sp-control.php file.. do you need?

if (is_admin() && force_ssl_admin()) $home = str_replace(‘http://’, ‘https://’, $home);

 

If the user wants the public/front of their site https they will put it in the site_url which you have already called?

"Returns the ‘site_url’ option with the appropriate protocol, ‘https’ if is_ssl() and ‘http’ otherwise. If $scheme is ‘http’ or ‘https’, is_ssl() is overridden."

https://developer.wordpress.or.....ource-code

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Nov 25, 2014 - 1:13 pm

you are not reading that code correctly....  the is_admin() check at beginning ONLY does it on admin pages...

the problem is home_url(), site_url() and get_permalink() from wp all report https...

Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Nov 25, 2014 - 1:33 pm

Thank you for your patience.

But as in the test site details I gave it is only happening on the forum pages?

It's frustrating because it doesn't seem to make any sense.

I have now added your test code into the header of the main site template

echo site_url and echo home_url

If you go to the test site link in post 30 you will see you arrive on http. If you go between the 2 pages you get http.

Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Nov 25, 2014 - 1:33 pm

2 posts again - only due to link limit warning

 

The pages and forum page link are http which I used the page editor to apply
ie. I didn't type in the link URL as http:

But the forum comment part link added by Simplepress is showing as an https link

  Join the forum discussion on this post

 

If clicking on the 'Forum Link' I have made in the test page you enter the forum as http, you will see in the template your test code in the header says http. All the forum links though are https and once clicked on any forum link your test code changes to https, it appears like its just calling the current url home and changes depending what connection you have.

Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Nov 25, 2014 - 2:57 pm

Mr Papa said
you are not reading that code correctly....  the is_admin() check at beginning ONLY does it on admin pages...

the problem is home_url(), site_url() and get_permalink() from wp all report https...

So to confirm this only happens on the admin pages but when I click on 'Update Permalink' under integration I am on an admin page. Therefore will it not capture  SFHOMEURL as https: and input it into the permalink?

Would that not explain why when the plugin is activated it looks to site_url and sets it to http but when I click the button in the integration page because I am in an admin page over SSL it captures SFHOMEURL as https?

I tried to test this by adding

$permhome = trailingslashit(home_url());
define ('SFPERMURL', $permhome);

to sp-control.php so that I could get the home_url without it being manipulated to https to see if was causing the issue

 

and then changed in spa-integration-page-form.php line below to include SFPERMURL instead of SFHOMEURL

function spa_paint_update_permalink() {
    $site = SFPERMURL.'index.php?sp_ahah=integration-perm&sfnonce='.wp_create_nonce('forum-ahah').'&item=upperm';
    $target = 'adminupresult';
    $gif = SFCOMMONIMAGES.'working.gif';

    echo '<input type="button" class="button button-highlighted" value="'.spa_text('Update Forum Permalink').'" onclick="spjAdminTool(\''.$site.'\', \''.$target.'\', \''.$gif.'\');" />';
}

 

But this just hangs because of insecure content being loaded (as screenshot) being blocked.

insecure.jpgImage Enlarger

just to rule this out, are any of your test sites able to get an http permalink when in the admin screen under https?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Nov 25, 2014 - 3:59 pm

my ssl site is down... certificate thingy... again... so hard to keep it running... and doesnt get much use since its always been working...  and yours is the only issue currently... doesnt mean its not an issue, but more folks do use ssl...

No, the update permalink is not on an admin page... the actual update is via ajax and technically through the front end... but doesnt really matter since home_url(), site_url() and the code you pulled from sp-control.php are not involved...

I posted the permalink update code earlier for test 3...

$slug = sp_get_option('sfslug');
$pageslug = basename($slug);
$page = spdb_table(SFWPPOSTS, "post_name='$pageslug' AND post_status='publish' AND post_type='page'", 'row');
echo get_permalink($page->ID);

notice its simply a request to wp for the page permalink... completely outside the purview of simple press...  please note, I output the permalink for the test.. the code actually just stores it in the db...

So, our permalink update just gets the permalink from wp...  the code you referenced, comes into effect on admin page loads and we update permalinks to https if so directed by the config constants...

why is wp repeatedly telling us its https?  I dont know...  usually that is done by a plugin...

anything in your .htaccess that could be at play?

does it do with all other wp plugins disabled? and/or with the default wp theme?

Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Nov 26, 2014 - 6:58 am

It definitely appears to be if in the admin page under h ttps then the permalink is recognized as h ttps

If in the dashboard as h ttp then the permalink is recognized as h ttp.

I have deactivated all the plugins possible and tested on the twentyeleven theme with the same results.

 

Done some digging - may be a waste of time but please let me know if this makes any sense.

 

You have been calling 'get permalink'

which according to this https://developer.wordpress.or.....ource-code

gets it from home url

But...

home url by default seems to pull everything after the http/s as the scheme default is 'null'

http://codex.wordpress.org/Fun.....tonome_url

According to the top of the page:

The home_url template tag retrieves the home URL for the current site, optionally with the $path argument appended. The function determines the appropriate protocol, "https" if is_ssl() and "http" otherwise. If the $scheme argument is "http" or "https" the is_ssl() check is overridden.

The is_ssl() page says that it takes the ssl status of the current page - ie the admin integration page not he front of the site?

http://codex.wordpress.org/Fun.....nce/is_ssl

 

Is this relevant at all or am I going down the wrong track?

Thanks

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Nov 26, 2014 - 9:55 am

No, I think you are on the right track...  but still not sure why wp would be trying to force https for a front end page...  if what you are implying were true, then I would see get_permalink() return https now since we (and wp) almost always use an empty schema in that function... 

Since the permalink update is done through ajax, it actually goes through the front end (main wp index.php) with an ajax hook...  only thing that comes to mind there is if the home_url() link is incorrect (wouldnt think so, but cant test currently)...

Potentially, it seems, with this info, that if you updated the entire integration panel (vice just using the update permalink button), the is_ssl() function could return the wrong info (for front end post)...

what is more troubling would be why is this not globally happening?  we have a fair number of users doing ssl with simple press... and quite oddly, when they have an issue, its usually the opposite, they have trouble getting the whole site ssl, but only get the admin in ssl (settings correct that)...  no reports of not getting only the admin in ssl...  wonder if this could be multisite unique?

have I asked what version of WP is this?

perhaps this weekend, I can try working the ssl site again...

Avatar
Kenn
Somerset, UK
Member
Free Members
sp_UserOfflineSmall Offline
Nov 26, 2014 - 11:34 am

Thanks, I think it's the ajax part I wasn't understanding that it was going to the front of the site to get the home url.

Hope you manage to get your ssl site working and look forward to hearing from you.

Screenshot attached of setup from toolbox - environment. Let me know if you need the other half with remaining sp plugins. It is worth noting I have had difficulties updating in the past but believe the 5.5.2 is accurate.

2014-11-26-16_30_45-Integration-‹-Forum-—-WordPress.jpgImage Enlarger

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625