W3 Total Cache, HTTPS and Goog Analytics - wordpress

I have a website, I've implemented the SSL functionability a few days ago.
Now the website is correctly reachable at HTTPS url.
However...
When I visit any page of my website, the URL shown in the navigator address bar is correct... example: https://domain.com/post/.
That's fine.
However, Google Analytics is registering those visits as webpages with another URL. Google analytics shows another url where the visit was done, and that url is in this example: /wp-content/cache/page_enhanced/domain.com/post/_index.html_gzip
How can I resolve that problem? Where is the issue?
Things I've done:
1) 301 redirect from all old http url to all new https url.
2) Google Analytics property was configured, the url of the website was changed to HTTPS.
Thanks all for reading and hope to find a solution for this problem.
Regards,
Pablo

This depends on how you included Analytics.
1) If the WordPress framework send the 'click' to Analytics in the back-end code, then there might be a problem with sending the wrong 'url' that is visited. (Have a look at PHP's $_SERVER variables; probably the SCRIPT_FILENAME is sent instead of REQUEST_URI.)
2) If you manually insterted the embed code from Analytics in your template, the url detection is all done based on the url in the browser, so you would never see your own filepath info there, unless it's being sent.

Related

Oauth what redirect uri for wordpress plugin

I am creating a free wordpress plugin that interacts with the Spotify API.
Users can download it, install it in their websites, activate it and they can then get specific information about a track.
Everything works in the v1 version. However i have trouble with the redirect uri.
I have to specify a specific redirect uri with Spotify, however the redirect differs on every instal, since its a different domain.
Should I redirect everything to a domain that i own, and redirect from there?
Is there a way to have a dynamic redirect uri?
Is there another method i dont know?
Please help!
I managed to fix this using a fixed redirect uri and the state parameter.
Every Oauth authorization is sent to the same redirect uri, which is a domain that I control.
I added the domain which the Oauth originated from to the state parameter.
From that point i am able to redirect the user back to the orignal domain. This whole proces goes so fast that it feels like a dynamic redirect URI, but in reality it is not.

Wordpress Website Link Preview not working in LinkedIn Groups

I want to share this article link (https://www.ngdevelop.tech/handsontable/) in the LinkedIn groups but the link preview is not working. This same thing happens for my previous two link share. Before the last two share, Link preview was working fine, but now it is not working.
When I checked the response from LinkedIn link preview service I got Error Code 500 for the link share in my status.
For Link share in group, I got below response : {"data":[{"images":[],"id":"https://www.ngdevelop.tech/handsontable/?2","type":"UrlPreview","status":"FAILED"}],"meta":{},"id":"/communities-api/v1/url-preview/https%3A%2F%2Fwww.ngdevelop.tech%2Fhandsontable%2F%3F2"}
This is my Open Graph Check https://opengraphcheck.com/result.php?url=https%3A%2F%2Fwww.ngdevelop.tech%2Fhandsontable%2F#.W0TlRNIzaM8
and social debug : https://socialdebug.com/results?url=https%3A%2F%2Fwww.ngdevelop.tech%2Fhandsontable%2F
I have also refered Stackoverflow
: LinkedIn doesn't fetch metadata when sharing website post, and https://www.linkedin.com/help/linkedin/answer/46687/making-your-website-shareable-on-linkedin?lang=en but nothing worked.
Please help...
I have been seeing this problem as well and have isolated what is going on.
Here is the behavior I have seen with LinkedIn recently when sharing pages from my WordPress.com site:
- Sharing in my own feed works with the content preview... sometimes.
- Sharing in a LinkedIn Group does not work at all. The LinkedIn XHR request that builds the preview actually returns a 500.
Using the LinkedIn Post Inspector tool I was able to see that their crawler was hitting a redirect loop. They would request an HTTPS URL, get redirected to an HTTP URL, then get redirected to an HTTPS URL, on and on.
When browsing to the same pages with Safari or Chrome I was not redirected. Finally I tried the same using the user-agent of the LinkedIn crawler. Aha! That was the key. WordPress.com is treating the LinkedIn (and Facebook) user-agents differently and redirecting them into a loop.
Example using curl:
curl -v -I -A 'LinkedInBot/1.0 (compatible; Mozilla/5.0; Jakarta Commons-HttpClient/3.1 +http://www.linkedin.com)' -k --http1.1 --header 'Host: yoursite.com' 'https://wordpress origin IPv4 address'
After a week of back and forth with WordPress.com support they say now that this is intentional. The reason this redirect behavior is in place is that Facebook, LinkedIn, etc. count the number of times a URL is shared. And the redirect prevents these sites from counting an HTTPS URL separately from an HTTP URL for the same resource. Their redirect is an attempt to canonicalize the URL.
This sharing count "fix" is moot if the redirect prevents anyone from sharing the URL, which is where I am right now.
Good luck!

Blocked Access to geolocation was blocked over secure connection with mixed content

I'm using a plugin in WordPress that uses the Google Maps API but keep getting this error:
[blocked] Access to geolocation was blocked over secure connection with mixed content to...
My site is on SSL, and I've checked that the google API script is not trying to be pulled in via http (it is https as it should be).
I'm not sure what could be causing this issue. Maybe there is something I need to do in my htaccess file? Please help! Thanks!
Check below list,
Your site have http link instead of https links, so only you facing the mixed content warning( you can fine this warning in your browser console). Find those links in your website and change those as a https links.
Add google API key in configuration.
https://developers.google.com/maps/documentation/javascript/get-api-key

How can Https links from Google search be redirected to Http after the SSL was removed from site?

Recently I added SSL to my WordPress site but it started causing some problems (conflicts with Woocommerce and WP Super Cache plugins). The problem the I was having because of SSL was that the the Woocommerce cart was sometimes showing empty even after adding a product ans sometime the cart was not proceeding to checkout page. Do you think it had something to do with WP Super Cache or SSL or both? Anyway, I couldn't get it solved and removed the SSL after 2 days. But meanwhile Google had indexed the HTTPS URLs of my site and was showing them in the search results and they were returning SSL connection error. Now my question is how can I redirect all those HTTPS URLs to the HTTP ones? I asked my web host for help but said the redirection is not possible through htaccess or any other method. Was he right? How long will Google take to 'forget' these HTTPS links and show the HTTPS links again in search Results?
There are two standard ways to redirect:
At the DNS level
At the HTTP level
The DNS level can't help you because it just changes hostname. You want to keep the same hostname but change the scheme. This means you need an HTTP server to do the redirect.
In order to redirect from https to http you need to have an HTTPS service running on the computer with the IP address that the hostname resolves to.
Without that, there is nothing the receive the HTTP request over SSL and response with "Oh, this has moved to plain HTTP".
If the SSL service isn't running, then there is nothing that can do that.
(.htaccess is just a (suboptimal) means to configure an HTTP server, that does no good if you don't have the HTTP server listening on SSL).
Personally I'd fix the https issues. The world is going more https everyday so it's a backwards step to go from https to http. If you elaborate on what issues you had someone might be able to help.
However if you really want to do this then you need to run both http and https and redirect all traffic from https to http. How you do this depends on your set up (in Apache you'd do it using htaccess config).
How long it takes Google to fronded your site depends on many factors including the size and popularity of your site - which governs how often Google crawls your website. Give it a month at least for a small site. You can give it a kick by submitting your site to Google Search Console (the new name for Google Webmaster Tools).
Btw StackOverflow is primarily for programming questions so questions like this might be better asked on the http://webmasters.stackexchange.com sister site.

switching between http and https - how to inform google

My site is deployed on amazon aws and I have two listeners on the load balancer.
One for http and one for https.
Google links to the http url, however I'd like it to link to the https listener as I am about to disable the http listener on port 80.
Can anyone recommend an approach which will result in the smoothest transition from the perspective of people finding my site through google?
You'll need a redirect. This means, that for now, you can't turn of the listener on http, but need to put the permanent redirect there instead. When google next checks, it'll spot the permanent redirect, drop the old link and create the new.
You could try submitting a new site map, but you'd lose any ranking your old links had gained as they would all appear as new links, plus there's no telling how long it would take Google to use the site map.
And there's also Bing and Yahoo and other search engines. Probably not as common, but best to hits a solution that gets them all.
Redirect using .htaccess - google it or reply here if you're stuck and I'll add to the answer

Resources