Code Monkey home page Code Monkey logo

wpfbogp's Issues

Fallback image shows up before the actual image (Bug?)

I have the plugin configured in a way that it always adds the fallback image.
Right now I see a behavior where the fallback image is the first image and the (for example) post-image is the second.

<meta property="og:image" content="https://asset1.betterplace.org/assets/default/og-image.betterplace.png"/>
<meta property="og:image" content="http://www.betterplace.org/c/ueber-uns/files/2014/05/generic-content-header_desktop-1024x448.jpg"/>

With this code Facebook takes the fallback as primary image.
Screenshot: https://developers.facebook.com/tools/debug/og/object/ shows:

bildschirmfoto 2015-01-09 um 17 59 29

In the code, there is a place that manually changes the order of the array. So it looks like, the plugin should behave correctly already. See https://github.com/chuckreynolds/WPFBOGP/blob/master/wp-facebook-ogp.php#L188

Question:

  • Did the Facebook default behavior change?
  • Is the plugin reverse-array-code wrong?
  • Is it a local problem only for our website?

Thanks

re-sort image array for default first

right now if there's a default image it shows up last in the array according to the debugger (and google plus). Need to flip that order so if there's a default image link it'll show first on FB.

Also consider if the checkbox is set to only default then we may not want to display the rest of images in the array at all.

adding debugging support helpers to source output

Considering adding some small designators in the comment output code that would tell me the setup people have a little more.. only this plugin.. nothing invasive but...
for example:

  • if they have the default checkbox checked or not.
  • or if there's a featured image set for the url or not.
  • if they have a url in the fallback image input or not.

In order as an example.. maybe something like diYftNfbN.
Would help me with support in the WP forums as nobody ever relays that info.

new facebook page post link image sizes and ratio

Mobile (which is bigger ?? hokay - should default to this)
~~> Image aspect ratio: 1.91:1 ~~
> Image specs in ad: 560x292 px
~~> If the uploaded image is smaller than ~~
~~> 560x292 px, then it will render as 100x100px ~~
> MAX 110 characters (90 preferable)
Desktop
~~> Image aspect ratio: 1.91:1 ~~
~~> Image specs in ad: 400x209 px ~~
~~> If the uploaded image is smaller than ~~
~~> 400x209 px, then it will render as 154x154 ~~
~~> or 90x90 px (the largest available size) ~~
> MAX 500 characters

edit: optimal sizes now: "Use images that are at least 1200 x 630 pixels for the best display on high resolution devices. At the minimum, you should use images that are 600 x 315 pixels to display link page posts with larger images."

source:

Better sanitize ALL input fields

This support request had some weird shit going on in adminID and appID output... not sure what they did but need to make sure we're scrubbing that.

<meta property="fb:admins" content="100000195032462"100000195032462"/>
<meta property="fb:app_id" content="1801701280113135"1801701280113135"/>

edit: need to better sanitize them all lol.

<meta property="og:title" content="Nutrition&nbsp;: qui écouter&nbsp;?"/>

Nutrition : qui écouter ?

Facebook Error "Circular Redirect Path"

The Facebook Debug Tool (https://developers.facebook.com/tools/debug/og/object/) gives me the following error for our wordpress pages.

I see this error for the first time so I guess facebook changed their behavior!

We have some logik somewhere in wordpress (probably core, since I cannot find any plugins or custom changes about this) that will always redirect you to the version of an url that ends in "/" -> https://www.betterplace.org/c/neues is redirected to https://www.betterplace.org/c/neues/

The bug:
The the og-URL says <meta property="og:url" content="https://www.betterplace.org/c/ueber-uns"/>(without the trailing slash)

How can I fix this?

bildschirmfoto 2015-01-09 um 17 47 38

wpfbogp_admin_warnings is being displayed to non-admins

function wpfbogp_admin_warnings is being displayed to all logged in users - even on the subscriber level.

solution is adding: if ( current_user_can('manage_options') ) as condition but it does not work due to some wordpress limitation because the user level can not be determined at that point.

Although in my OOP code https://github.com/Foe-Services-Labs/WPFBOGP/blob/oop-conversion/wp-facebook-ogp.php#L128 it's working fine.
-> OOP rulez! 👿

what is the license?

Nothing serious. Just to clarify.

What is the right license so I can sync it all around the files?

GPLv2
or
GPLv2 or later

in hotfix/2.0.12 branch Undefined index: wpfbogp_force_fallback

Notice: Undefined index: wpfbogp_force_fallback in /var/www/public/wp-content/plugins/WPFBOGP/wp-facebook-ogp.php on line 408

function wpfbogp_validate($input) {
    $input['wpfbogp_admin_ids'] = wp_filter_nohtml_kses($input['wpfbogp_admin_ids']);
    $input['wpfbogp_app_id'] = wp_filter_nohtml_kses($input['wpfbogp_app_id']);
    $input['wpfbogp_fallback_img'] = wp_filter_nohtml_kses($input['wpfbogp_fallback_img']);
    $input['wpfbogp_force_fallback'] = ($input['wpfbogp_force_fallback'] == 1)  ? 1 : 0;
    return $input;
}

list in admin images to exclude

Would like to be able to exclude the itunes image buttons on my site from being included in the og:image tags. A field on the settings page where we could paste the URLs to such images, maybe as a comma separated list, would be useful.

consider Adding new article publisher & author tags

article:publisher lets a publisher link an article to their own Facebook page. When the article is shared in News Feed, a "like" button is displayed so people can like the publisher page.
<meta property="article:publisher" content="https://www.facebook.com/cnn" />
article:author lets a publisher link an article to the Facebook profile of the author. When the article is shared in News Feed, a "follow" button is displayed so people can follow the author. The author needs to have Follow activated on his or her profile for this button to appear.
<meta property="article:author" content="https://www.facebook.com/fareedzakaria" />

Problem comes in when they don't have social links in meta w/ a plugin or anything... do I want to add that to this plugin? fuck no.

Plugin still works fine for the "good" rules for FB w/o these but just consider for future:
https://developers.facebook.com/docs/opengraph/howtos/maximizing-distribution-media-content/#tags

should make description a little smarter

First off it needs a super fallback in case no excerpt or no content; which agreeably is rare but it happens. Also need a fallback if description is empty. which again; rare but... happens.

Secondly, and optionally, I'd like to try and filter for seo plugins. Hence smarter.

Protocol-less image URLs aren't handled properly

We use img tags with src="//imghostname/path_to/xyz.jpg" URLs that don't have the protocol. This allows HTTP pages to use an HTTP URL and HTTPS pages to use an HTTPS URL.

The WPFBOG plugin turns this into:

<meta property="og:image" content="https://bloghostname/blogpath/imghostname/path_to/xyz.jpg"/>

The preg_match() call on line 57 needs to be modified to check for a valid "//" prefix URL match.

2.0.10 seems to be duplicating og:image tags

<meta property="og:image" content="http://redacted.com/wp-content/uploads/2014/04/facebookicon.jpg"/>
<meta property="og:image" content="http://redacted.com/wp-content/uploads/2014/04/facebookicon.jpg"/>

look into it

Check post thumbnail images for relative paths and prepend site URLs

The find_images method already does this for all images in the post that aren't the featured image. (lines 92-96)

The same logic would need to be added starting around line 266 where the post thumbnail is added to the $wpfbogp_images array. I didn't think it would be possible for this to not have the full URL, but if a site has the "Full URL path to files" set in the Media settings (ugh), this will happen.

2014-04-21 at 11 03 am

If, by chance, this could make it into a 2.0.11 release, that would be awesome and I can happily throw away my forked version of the plugin. 😃

test using mb_substr and set charset on meta descriptions

On some posts (written in Icelandic) I've noticed that the meta description is missing.
This happens on wp 3.6.1 with plugin version 2.0.7.
I'm not sure what exactly triggers this, but I managed to solve it by replacing this line:

$description = str_replace( "\r\n", ' ' , substr( strip_tags( strip_shortcodes( $post->post_content ) ), 0, 160 ) );

with:

$charset = get_option( 'blog_charset' );
if( ! $charset )
    $charset = 'UTF-8';
$wpfbogp_description = str_replace( "\r\n", ' ' , mb_substr( strip_tags( strip_shortcodes( $post->post_content ) ), 0, 160, $charset ) );

where I use mb_substr() instead of substr(), i.e. the multi-byte version of substr().

Looking for feedback: Show fallback image if a featured image is found?

Lately I've been considering not showing the fallback image if there's a featured image present. Thought is - if you have a featured image it's probably more important than a fallback image and because FB sometimes pulls the image array in different orders - the fallback gets shown sometimes when it should use the featured image.

Open to opinions here.

Multiple admin ids throws Parser Mismatched Metadata

have to use the array format [http://ogp.me/#array]

instead of
meta property="fb:admins" content="1111111111,222222222" />

must now be
meta property="fb:admins" content="1111111111" />
meta property="fb:admins" content="2222222222" />

check if jetpack OGP and facebook OGP are on

need to add if
add_filter( 'jetpack_enable_opengraph', '__return_false', 99 );

code they use to detect FB I should add too:

if ( in_array( 'facebook/facebook.php', $active_plugins ) )
add_filter( 'jetpack_enable_opengraph', '__return_false', 99 );

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.