Alert says using deprecated HREF without absolute URL
Asked Answered
G

3

20

Message alert in Facebook developer page that my site is currently using the following deprecated features:

Social Plugins (Like Button, Like Box) without absolute URL's in their href parameter. This must be fixed before July 2013.

I'm guessing it's talking about the data-href parameter for likes, but my like buttons are being generated with the following simple code:

data-href="http://<?php echo $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"];?>"

And the results when viewed in the browser (looking at the HTML source) certainly look like absolute URLs to me. What is this alert actually trying to tell me? That they've scanned the site and that there are actual HREFs that have problems, or just that there might be some?

Is it referring to some other HREF parameter?

Gautea answered 29/4, 2013 at 1:34 Comment(8)
You can simply enable the July migrations and see if anything breaks if you are sure about it.Calvano
The href parameter is a part of the like button developers.facebook.com/docs/reference/plugins/like and other social plugins . The parameter is listed in the current docs as href not data-href , did that change or are you referring to a different parameter? I also had the same warning , double checked the code , and have enabled the changes to no ill effects.Skiff
Thanks for pointing out that the docs says href, not data-href. Strangely, if you use the little form they have that generates a like button, and click "Get Code" it generates code such as: <div class="fb-like" data-href="http://www.example.com/" data-send="true" data-width="450" data-show-faces="true"></div>Gautea
What about using the og:url meta tag? Does the like button then still need the data-href attribute?Homer
Basically FB will throw this warning whether it is accurate or not. If you are sure about it, you can do as others have suggested and enable the migrations or you can just ignore the error. :)Gennagennaro
I'm assuming that this still means that the href value is optional, but if supplied has to be absolute? The wording really isn't very clear in the Facebook documentation.Lifeless
@Gautea could you select correct (if exists) answer on your question?Lebaron
I thought I had already marked it as the answer, but I had just marked it as useful.Gautea
L
6

If you use absolute url in data-href attribute of this social plugin, just enable July 2013 Breaking Changes in settings of your facebook application.

Lebaron answered 29/4, 2013 at 15:0 Comment(2)
Please provide link/s OR steps about how one can enable "July 2013 Breaking Changes"Schlesinger
open developer page: developers.facebook.com/apps/__appId__/advanced?ref=nav where appId - is your app id and set radiobutton to enabled in block migration on "... Changes element"Lebaron
T
1

In Like Button code, data-href is href for HTML5.

Tawnyatawsha answered 2/5, 2013 at 0:30 Comment(1)
I'm pretty sure the data-href is right for HTML5, but the documentation is confusing for new users.Gautea
S
0

Absolute URL:

https://mcmap.net/q/626341/-alert-says-using-deprecated-href-without-absolute-url

Relative URL

../questions/16270043/alert-says-using-deprecated-href-without-absolute-url

Social Plugins must have absolute URL your site and looks like your site has.

Sorcim answered 29/4, 2013 at 4:20 Comment(1)
I've been a developer for a while and knew the difference between the 2, but couldn't figure out the issue. If anyone here is using addthis, make sure the "addthis:url" is absolute based on Greg's answer. Solved it for me, thanks man!Unpriced

© 2022 - 2024 — McMap. All rights reserved.