Not working over https
-
When https is enabled on the site the plugin is not working. It stays at the last view: “Sending your invitation…” and not sending anything.
I could not able to see the log for the plugin. Do you have any idea?
Thanks,
-
Do you have a link where I can check?
You may try at datekiss.com . Currently FORCE_SSL_ADMIN is set as true. Plugin works if it is false.
In the last view that says “Sending invitations…”, actual address line is https (since it is a wp-admin page) but I guess there is a problem with the arguments current-url and redirect-url, they are http. I dig out the code but could not find the actual location.
OK so only the backend uses https. In which page I could test the plugin?
I have just added the widget to the footer which you may find at any page.
Try changing on line 319 of wp-social-invitations.php the following:
wp_localize_script( 'wsi-js', 'WsiMyAjax', array( 'url' => site_url( 'wp-login.php' ),'admin_url' => admin_url( 'admin-ajax.php' ), 'nonce' => wp_create_nonce( 'wsi-ajax-nonce' ) ) );to:
wp_localize_script( 'wsi-js', 'WsiMyAjax', array( 'url' => site_url( 'wp-login.php' ),'admin_url' => admin_url( 'admin-ajax.php',https' ), 'nonce' => wp_create_nonce( 'wsi-ajax-nonce' ) ) );Let me know if its works
I changed the line but it is still not working.
Can we try to change redirect_url and current_url arguments to https?
PS: I guess there is a typo, so I changed
,https'to,'https'.The problem is that the popup need to access the opener screen which is http. Javascript blocks requests when frames uses different protocols.
I think we can trick the url to let the invitations send but they opener window will not be updated saying that the messages were sent.
Take a look to:
$.post(window.opener.WsiMyAjax.admin_url, $('#collect_emails').serialize(), function(response){ $('#<?php echo $_GET['widget_id'];?> #<?php echo $provider;?>-provider',window.opener.document).addClass('completed'); $('#<?php echo $_GET['widget_id'];?> #wsi_provider',window.opener.document).html('<?php echo ucfirst($provider);?>'); $('#<?php echo $_GET['widget_id'];?> .wsi_success',window.opener.document).fadeIn('slow',function(){ window.self.close(); <?php if( isset( $settings['redirect_url']) && $settings['redirect_url'] != '' ) :?> window.opener.location.href = '<?php echo $settings['redirect_url'];?>'; <?php endif;?> });We could change the window.opener.WsiMyAjax.admin_url with <?php echo admin_url( ‘admin-ajax.php’,’https’ );?> and the messages will go but the other parts that uses window.openener.document won’t
The frontend of your site will remain http?
I have tried changing window.opener.WsiMyAjax.admin_url with <?php echo admin_url( ‘admin-ajax.php’,’https’ );?> , but it does not help either.
I guess I am very good at finding interesting bugs like this one π I have enabled https entirely and the plugin has worked fine since redirect-to is written as https as you say. Plugin is also working over http. Enabling https entirely is solving the problem, it is in the plans so for the time being I guess I will just wait till then.
Thanks for your efforts and your plugin, if anything comes to your mind I will be glad to hear.
Np, I will have this in mind, but for now Im afraid that backend and front end will have to go with same protocol in order to work.
Regards
The topic ‘Not working over https’ is closed to new replies.