Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

Jovian opened this issue Mar 12, 2014 · 40 comments

Comments

@Jovian
Copy link

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
Copy link
Contributor

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
Copy link
Author

Jovian commented Mar 12, 2014

There are no PHP errors logged regarding this issue.

@Jovian
Copy link
Author

Jovian commented Mar 12, 2014

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

@chuckreynolds
Copy link
Contributor

PHP Version 5.3.10-1ubuntu3.7

@jdevalk
Copy link
Contributor

jdevalk commented Mar 12, 2014

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

@Jovian
Copy link
Author

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
Copy link
Contributor

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

@Jovian
Copy link
Author

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
Copy link
Contributor

jdevalk commented Mar 12, 2014

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

@Jovian
Copy link
Author

Jovian commented Mar 12, 2014

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

@jdevalk
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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
Copy link

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
Copy link

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
Copy link
Contributor

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
Copy link

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
Copy link
Author

Jovian commented Mar 14, 2014

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

@Jovian
Copy link
Author

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
Copy link
Contributor

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
Copy link

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

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
Copy link
Author

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
Copy link

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
Copy link
Contributor

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
Copy link
Contributor

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
Copy link

retlehs commented Mar 14, 2014

that fixes it for roots!

@jdevalk
Copy link
Contributor

jdevalk commented Mar 14, 2014

Awesome.

@jrfnl
Copy link
Contributor

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
Copy link
Contributor

jrfnl commented Mar 14, 2014

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

@jdevalk
Copy link
Contributor

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
Copy link

Thanks it's working fine now!! :)

@jrfnl
Copy link
Contributor

jrfnl commented Mar 15, 2014

@sunnyujjawal Glad to hear it ;-)

@Jovian
Copy link
Author

Jovian commented Mar 15, 2014

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

@jrfnl
Copy link
Contributor

jrfnl commented Mar 15, 2014

@Jovian Glad to hear it ;-)

@jdevalk
Copy link
Contributor

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants