Open Graph missing after 1.4.2* -> 1.5.2 upgrade #750

Closed
Jovian opened this Issue Mar 12, 2014 · 40 comments

Projects

None yet

8 participants

@Jovian
Jovian commented Mar 12, 2014

Hi, friends.

Just updated and after this there is no meta "og:bla-bla-bla" in the head output on my website.
Even when the appropriate checkboxes a checked/unchecked in the admin panel.

Is it only my website issue or a global?
What's wrong -- any suggestions?

Sorry, I can't show actual website, cos such upgrades are done only on localhost.

@jrfnl
Collaborator
jrfnl commented Mar 12, 2014

I can not reproduce this behaviour. Please check your PHP error logs to see if you can give us more information.

@Jovian
Jovian commented Mar 12, 2014

There are no PHP errors logged regarding this issue.

@Jovian
Jovian commented Mar 12, 2014

BTW, I'm using PHP 5.5. If this could help...

@chuckreynolds

PHP Version 5.3.10-1ubuntu3.7

@jdevalk
Member
jdevalk commented Mar 12, 2014

@Jovian and @chuckreynolds What type of page are you checking and what are your social settings?

@Jovian
Jovian commented Mar 12, 2014

jdevalk, all pages (custom_posts and core pages), regardless of social settings.
Just after update any meta "og:*" dissapeared and did'nt apeared in the head with any checkboxes on/off in social sttings of the plugin

@chuckreynolds

1.5.2.1 fixes ogp. twitter card works ok on posts now too.

@Jovian
Jovian commented Mar 12, 2014

Nope, Open Graph entries still missing.
Tested just now with 1.5.2.1

1.4.2* works perfect.

@jdevalk
Member
jdevalk commented Mar 12, 2014

Same issue reported here, with a possible "fix": https://twitter.com/Beee4life/status/443813701842649088

@Jovian
Jovian commented Mar 12, 2014

Nope -- this "fix" did'nt work for me...

@jdevalk
Member
jdevalk commented Mar 12, 2014

hmm shit. Maybe @jrfnl has an idea what this could be?

@Jovian to confirm: when you use 1.5.2.1, it doesn't work, when you switch back to 1.4.2.x it works?

@Jovian
Jovian commented Mar 12, 2014

jdevalk, my "switches" are:

  1. Upgrade.
  2. Uh, does not work. Click-click-...
  3. After applaying different "clicks" nothing changed.
  4. Delete WP SQL DB and WP SEO folder.
  5. Restore WP SQL DB and WP SEO folder from backup.
  6. Wow! Works!

xD

@jrfnl
Collaborator
jrfnl commented Mar 13, 2014

@Jovian Could you (temporarily) turn on WP_DEBUG and copy & paste the debug information at the bottom of the SEO -> Social page for me to have a look at ? You can remove any privacy sensitive info.

@Jovian
Jovian commented Mar 13, 2014

array(14) { ["fb_admins"]=> array(0) { } ["fbapps"]=> array(0) { } ["fbconnectkey"]=> string(32) "bla-bla-bla..." ["facebook_site"]=> string(0) "" ["og_default_image"]=> string(0) "" ["og_frontpage_desc"]=> string(0) "" ["og_frontpage_image"]=> string(0) "" ["opengraph"]=> bool(true) ["googleplus"]=> bool(false) ["plus-publisher"]=> string(0) "" ["twitter"]=> bool(false) ["twitter_site"]=> string(0) "" ["twitter_card_type"]=> string(7) "summary" ["fbadminapp"]=> int(0) }

@musadosol

I experience similar issues, but other than og:description, open graph meta tags are showing just fine. The problem for me is the og:description and the meta name description; they are not showing in the source of category pages, with or without specifying a custom description in backend for the categories.

@wwdboer
wwdboer commented Mar 13, 2014

Experiencing the same problem. Open graph tags are missing from the head. When I switch back to 1.4.25 the problem is resolved.

@jrfnl
Collaborator
jrfnl commented Mar 13, 2014

As I can't reproduce the issue and your settings seem ok, I'm at a bit of a loss what to do to fix this. Just to verify: you are saying all open graph tags for all post/pages are missing ?

May be a bit silly: but could you check if the file /frontend/class-opengraph.php exists ? It might be that the upgrade did not complete properly, though I would expect to see PHP errors then.

@wwdboer
wwdboer commented Mar 13, 2014

In my case all open graph tags are missing on pages/posts. When I switch to another theme, Twenty Fourteen for instance, the tags are there again. This makes me think there is something wrong with my theme, but prior to the last couple of version everything worked just fine. The class-opengraph.php exists btw.

@Jovian
Jovian commented Mar 14, 2014

1.5.22 -- still no OG. Disabling and then enabling OG did nothing.

@Jovian
Jovian commented Mar 14, 2014

CONFIRMING theme-related issue!

Switching to Twenty Fourteen made OG visible in the head.
If it will help -- i'm using Roots Theme (https://github.com/roots/roots)

@jrfnl
Collaborator
jrfnl commented Mar 14, 2014

@Jovian @wwdboer Thanks for confirming this is a theme related issue. @Jovian is using Roots @wwdboer what theme are you using ?

@wwdboer
wwdboer commented Mar 14, 2014

I'm using a custom theme that I've built from scratch. Maybe I'll make the most minimalistic theme possible, and then gradually start adding functionality to see when it breaks the open graph tags.

@Jovian
Jovian commented Mar 14, 2014

Roots theme is also just a minimalistic framework.
But it has rewrites and some cleanup of the Wordpress mess, that can cause some issues.
Will check what I can.

@jrfnl
Collaborator
jrfnl commented Mar 14, 2014

@Jovian @wwdboer You might want to install the Debug Bar Actions & Filters plugin (in combination with the Debug Bar) to help with the checking.

If you have and click on the "Debug" button in the admin bar while on a front end page, you will see a 'Filter Hooks' page in the debug menu on the left. Go there and look for the below three actions and associated functions/methods:

wp_head
    Priority: 1
        [object] WPSEO_Frontend -> head

wpseo_head
    Priority: 30
        [object] WPSEO_OpenGraph -> opengraph

wpseo_opengraph
    Priority: 1
        [object] WPSEO_OpenGraph -> locale
    Priority: 5
        [object] WPSEO_OpenGraph -> type
    Priority: 10
        [object] WPSEO_OpenGraph -> og_title
    Priority: 11
        [object] WPSEO_OpenGraph -> description
    Priority: 12
        [object] WPSEO_OpenGraph -> url
    Priority: 13
        [object] WPSEO_OpenGraph -> site_name
    Priority: 14
        [object] WPSEO_OpenGraph -> website_facebook
    Priority: 20
        [object] WPSEO_OpenGraph -> site_owner
    Priority: 30
        [object] WPSEO_OpenGraph -> image
  • If those are there, WPSEO is doing what it should be doing and something else is blocking the actions from being executed.
  • If they are not there, something is blocking WPSEO from adding the actions.

Knowing which it is will help figure out the next step in debugging this.

@Jovian
Jovian commented Mar 14, 2014

wp_head
Priority: 1
wp_enqueue_scripts
noindex
[object] Debug_Bar -> ensure_ajaxurl
Priority: 8
wp_print_styles
Priority: 9
wp_print_head_scripts
Priority: 10
locale_stylesheet
rel_canonical
jquery_local_fallback
wp_admin_bar_header
_admin_bar_bump_cb

wpseo_head is missing

the only "open graph" mentioned on the page":
sanitize_post_meta__yoast_wpseo_opengraph-description
Priority: 10
[class] WPSEO_Meta :: sanitize_post_meta
auth_post_meta__yoast_wpseo_opengraph-description
Priority: 10
__return_false
sanitize_post_meta__yoast_wpseo_opengraph-image
Priority: 10
[class] WPSEO_Meta :: sanitize_post_meta
auth_post_meta__yoast_wpseo_opengraph-image
Priority: 10
__return_false

@jrfnl
Collaborator
jrfnl commented Mar 14, 2014

@Jovian if that's what's in wp_head, then the whole WPSEO block for any page would be missing... is that the case ? (i.e. not just the opengraph tags)

@Jovian
Jovian commented Mar 14, 2014

But I see this in my head tag:

meta name="description" content="bla-bla-bla"> link rel="canonical" href="http://bla-bla-bla">
@retlehs
retlehs commented Mar 14, 2014

commit that broke og in roots: b838be2

in roots we don't use get_header because of our template organization, but for plugin compatability reasons we do do_action('get_header'); (https://github.com/roots/roots/blob/master/base.php#L11)

right now i'm not sure why the open graph part is missing..

@jrfnl
Collaborator
jrfnl commented Mar 14, 2014

@Jovian then you should at the very least also see the below as that's the action which places the markers...

wp_head
    Priority: 1
        [object] WPSEO_Frontend -> head

Also: could you check if the theme uses the default WP function get_header() to load the template header ?

@jrfnl
Collaborator
jrfnl commented Mar 14, 2014

@retlehs Nice catch finding the specific commit! Strange though that the og actions would not be added if you do do_action('get_header');, they should...

I'm currently thinking of moving the action back a bit to the wp hook to see if that solves it just in case to prevent themes blocking the actions being added.

Anyone willing to test this ?
If so, just change line 193 of wpseo-main.php:

-   add_action( 'get_header', 'wpseo_frontend_head_init' );
+   add_action( 'wp', 'wpseo_frontend_head_init' );
@retlehs
retlehs commented Mar 14, 2014

that fixes it for roots!

@jdevalk
Member
jdevalk commented Mar 14, 2014

Awesome.

@jrfnl
Collaborator
jrfnl commented Mar 14, 2014

For future information: the reason it was moved forward to the get_header hook was to avoid issues with is_singular() not being correctly filled yet. I'm now moving it to the wp hook which is only just before the get_header hook and should avoid both problems.

@jrfnl
Collaborator
jrfnl commented Mar 14, 2014

Pull request #807 send in which will fix this. Everyone ok with me closing the issue ?

@jdevalk jdevalk closed this in 87663a9 Mar 14, 2014
@jdevalk
Member
jdevalk commented Mar 14, 2014

Merged and thus closed. Thanks for all the work here everyone, really great to see everyone collaborating like this. I love open source :)

@sunnyujjawal

Thanks it's working fine now!! :)

@jrfnl
Collaborator
jrfnl commented Mar 15, 2014

@sunnyujjawal Glad to hear it ;-)

@Jovian
Jovian commented Mar 15, 2014

YES! It works now!
Thank you (and me :P )!

@jrfnl
Collaborator
jrfnl commented Mar 15, 2014

@Jovian Glad to hear it ;-)

@jdevalk
Member
jdevalk commented Mar 15, 2014

For reference: this impacts GraphPaperPress themes too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment