Support has been upgraded!
The Support Forum is closed. Not to worry! Providing the top quality support you expect and we're known for will continue! We're not ending support, just changing where you submit requests. This will provide you with the best experience possible.
Premium Support
Have you purchased an addon for Connections such as one of our premium templates or extensions with a valid license and you need help?
Please open a Support Ticket in your user account.
Free Support
Are you using the free Connections plugin? Don't worry, you are still very important to us! We are still providing you with the same high quality support that we're known for.
Please open a new support topic in the WordPress support forums for Connections.
Tagged: 0.8.5, admin-ajax.php, ajax, form, ssl
- This topic has 4 replies, 2 voices, and was last updated 8 years, 9 months ago by
Mario Ferreira.
-
AuthorPosts
-
05/08/2014 at 10:09 am #290617
Mario Ferreira
ParticipantHi Steven,
I made a hook that may help someone with problems with “force ssl”.
Or, maybe You would like to see if it is interesting to change the source with something like that.I had problems with “force ssl” on a page that I am using [connections_form]:
a)It was freezing (analizing source) at:
<script type=’text/javascript’>
/* <![CDATA[ */
var cn_form = {“ajaxurl”:”http:\/\/ieage.org\/wp-admin\/admin-ajax.php”,”debug”:””,”strSubmitting”:”Please wait, your submission is being processed.”,”strSubmitted”:”Submission received.”,”strSubmittedMsg”:”We will review and approve your submission soon.”};
/* ]]> */
</script>**** (OBS: MARIO: FREEZES HERE=>”Please wait…”, and I didn’t receive e-mail (neither the user) and the entry was totally lost; something with “admin_url” was not working)****
b) I studied Connections_form.php, (and made some “google” about wp+ajax+ssl), and:
b.1)line 131-132:
$protocol = isset( $_SERVER[‘HTTPS’] ) ? ‘https://’ : ‘http://’;
$attr = array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ , $protocol ) , ‘debug’ => $this->demo );b.2)it wasn’t setting to HTTPS
b.3)I changed the code to:
————————————————-
//$protocol = isset( $_SERVER[‘HTTPS’] ) ? ‘https://’ : ‘http://’;
$marprot=admin_url(‘admin-ajax.php’);
if ( is_ssl() && ‘http:’ == substr( $marprot, 0, 5 ) )
$marprot = ‘https:’ . substr( $marprot, 5 );//$attr = array( ‘ajaxurl’ => admin_url( ‘admin-ajax.php’ , $protocol ) , ‘debug’ => $this->demo );
$attr = array( ‘ajaxurl’ => $marprot , ‘debug’ => $this->demo );
————————————————-b.4) Now it is working with, and without, “force ssl” on the page.
Cheers,
Mario05/08/2014 at 11:37 am #290624Steven Zahm
Keymaster@ Mario
Thanks for reporting this with a solution!
Quick question, can you try this solution?
Comment out this line, like you’ve done:
$protocol = isset( $_SERVER['HTTPS'] ) ? 'https://' : 'http://';
So it becomes:
//$protocol = isset( $_SERVER['HTTPS'] ) ? 'https://' : 'http://';
Now, change this line from:
'ajaxurl' => admin_url( 'admin-ajax.php', $protocol ),
To this:
'ajaxurl' => admin_url( 'admin-ajax.php', ( is_ssl() ? 'https' : 'http' ) ),
That should do it so you do not have to do the string replace. Let me know. And thanks again!
05/08/2014 at 1:30 pm #290694Mario Ferreira
ParticipantHi, Steven,
Don’t ask me “Why”…rsrs
but not worked out!I remember, I tried to use directly ‘https’ on admin_url and nothing happened.
Despite that, I made your’s suggestions, and nothing happened again.a)with your code I returned to:
/* <![CDATA[ */var cn_form ={“ajaxurl”:”http:\/\/ieage.org\/wp-admin…b)when I restore with my code:
/* <![CDATA[ */var cn_form = {“ajaxurl”:”https:\/\/ieage.org\/wp-admin…It seems that the problem is with “admin_url”, something is not working as it should be.
Best regards,
Mario05/08/2014 at 2:11 pm #290701Steven Zahm
KeymasterHmmm, check this page out, under the Notes section.
I wonder if you are facing a similar issue, that your site behind some type of load balancer or proxy server….
05/08/2014 at 2:33 pm #290703Mario Ferreira
ParticipantActually, I read that page, but I am using:
if ( is_ssl() && ‘http:’ == substr( $marprot, 0, 5 ) )
and it works…
Why? I really don’t know.
But I was reviewing where I found this code, and it was on PHP from “Contact 7 form”, which I use also and loads “loaderurl=https..” fine.My site is hosted by Hostgator…
-
AuthorPosts
You cannot reply to this support topic. Please open your own support topic.