Plugin Directory

Changeset 571850


Ignore:
Timestamp:
07/13/2012 05:06:30 PM (14 years ago)
Author:
mattwkelly
Message:

1.0.2

  • Fixed issue where some sites were extremely slow as a result of installing the plugin (due to cURL not being installed).
  • Added warning and actively disable portions of the plugin if SSL not installed.
  • Fixed bug in social publishing.
  • Added logic to disable meta boxes/publishing if social publishing is disabled.
  • Fixed forever loading issue on FB settings page if no active user exists.
  • Added proper escaping.
  • Added global settings to set whether social plugins show on all posts, all pages, both, or neither. Done for like button, subscribe button, send button, comments, and recommendations bar.
  • Added per-post/page settings for showing/hiding social plugins.
  • Fixed poorly formatted description that was being set when publishing to friends' and Pages' feeds.
  • Added notification if plugins that are potentially conflicting are installed.
  • Added suggestions for what to enter in fields in the new user experience.
  • Bug fixes to ensure everything works on mobile (including support for WPTouch).
  • Bug fixes to Pages drop down on the Facebook settings page.
  • Removed the need to create PHP sessions, relying on user meta/transients now.
Location:
facebook/trunk
Files:
2 added
20 edited

Legend:

Unmodified
Added
Removed
  • facebook/trunk/facebook.php

    r561366 r571850  
    22/**
    33 * @package Facebook
    4  * @version 1.0.1
     4 * @version 1.0.2
    55 */
    66/*
     
    1010Author: Facebook
    1111Author URI: https://developers.facebook.com/wordpress/
    12 Version: 1.0.1
     12Version: 1.0.2
    1313License: GPL2
    1414License URI: license.txt
     
    1717
    1818global $fb_ver;
    19 $fb_ver = '1.0';
     19$fb_ver = '1.0.2';
    2020
    2121$facebook_plugin_directory = dirname(__FILE__);
  • facebook/trunk/fb-admin-menu.php

    r561366 r571850  
    1717    add_action( 'admin_print_styles-' . $page, 'fb_admin_style');
    1818    add_action( 'admin_print_scripts-' . $page, 'fb_admin_scripts' );
     19}
     20
     21
     22/**
     23 * Function to check if the wordpress user has plugins that may conflict
     24 * with the Facebook plugin (due to Open Graph).
     25 */
     26function fb_notify_user_of_plugin_conflicts()
     27{
     28    //static array of potentially conflicting plugins
     29  //add to this list of conflicting plugins from the big list below
     30    $og_conflicting_plugins_static = array( "http://wordpress.org/extend/plugins/facebook/",
     31        "http://wordpress.org/extend/plugins/opengraph/",
     32        "http://yoast.com/wordpress/seo/#utm_source=wpadmin&utm_medium=plugin&utm_campaign=wpseoplugin",
     33    "http://wordbooker.tty.org.uk",
     34        "http://ottopress.com/wordpress-plugins/simple-facebook-connect/",
     35        "http://www.whiletrue.it",
     36        "http://aaroncollegeman.com/sharepress"
     37    );
     38
     39    $og_conflicting_plugins = array (
     40    "http://wordpress.org/extend/plugins/kevinjohn-gallagher-pure-web-brilliants-social-graph-control/",
     41        "http://wordpress.org/extend/plugins/1-click-retweetsharelike",
     42        "http://wordpress.org/extend/plugins/2-click-socialmedia-buttons",
     43        "http://wordpress.org/extend/plugins/add-facebook-og-meta-tags-paulund",
     44        "http://wordpress.org/extend/plugins/add-link-to-facebook",
     45        "http://wordpress.org/extend/plugins/add-meta-tags",
     46        "http://wordpress.org/extend/plugins/aj-wp-facebook-like-and-send",
     47        "http://wordpress.org/extend/plugins/amarinfotech-downlaod-with-fb-connect",
     48        "http://wordpress.org/extend/plugins/another-wordpress-classifieds-plugin",
     49        "http://wordpress.org/extend/plugins/aprils-facebook-like-button", 
     50        "http://wordpress.org/extend/plugins/aprils-super-functions-pack",
     51        "http://wordpress.org/extend/plugins/author-hreview",
     52        "http://wordpress.org/extend/plugins/bye-maridjan-seo",
     53        "http://wordpress.org/extend/plugins/cd34-header",
     54        "http://wordpress.org/extend/plugins/comment-juice",
     55        "http://wordpress.org/extend/plugins/contentshare",
     56        "http://wordpress.org/extend/plugins/custom-facebook-and-google-thumbnail",
     57        "http://wordpress.org/extend/plugins/dudelols-easy-facebook-share-thumbnails",
     58        "http://wordpress.org/extend/plugins/dw-fb-sendlike",
     59        "http://wordpress.org/extend/plugins/easy-facebook-share-thumbnails",
     60        "http://wordpress.org/extend/plugins/easy-social-media",
     61    "http://wordpress.org/extend/plugins/easy-toolbox",
     62    "http://wordpress.org/extend/plugins/facebook-awd",
     63    "http://wordpress.org/extend/plugins/facebook-comment-for-wordpress",
     64    "http://wordpress.org/extend/plugins/facebook-comments-for-wordpress",
     65    "http://wordpress.org/extend/plugins/facebook-connect-plugin",
     66    "http://wordpress.org/extend/plugins/facebook-ilike",
     67    "http://wordpress.org/extend/plugins/facebook-image-fix",
     68    "http://wordpress.org/extend/plugins/facebook-like",
     69    "http://wordpress.org/extend/plugins/facebook-like-a-lot",
     70    "http://wordpress.org/extend/plugins/facebook-like-and-comment",
     71    "http://wordpress.org/extend/plugins/facebook-like-and-send-2-in-1",
     72    "http://wordpress.org/extend/plugins/facebook-like-button",
     73    "http://wordpress.org/extend/plugins/facebook-like-button-for-dummies",
     74    "http://wordpress.org/extend/plugins/facebook-like-button-plugin",
     75    "http://wordpress.org/extend/plugins/facebook-like-content-locker",
     76    "http://wordpress.org/extend/plugins/facebook-like-for-marketers",
     77    "http://wordpress.org/extend/plugins/facebook-likes-you",
     78    "http://wordpress.org/extend/plugins/facebook-meta-tags",
     79    "http://wordpress.org/extend/plugins/facebook-open-graph-meta",
     80    "http://wordpress.org/extend/plugins/facebook-open-graph-meta-for-wordpress",
     81    "http://wordpress.org/extend/plugins/facebook-open-graph-meta-in-wordpress",
     82    "http://wordpress.org/extend/plugins/facebook-open-graph-widget",
     83    "http://wordpress.org/extend/plugins/facebook-opengraph",
     84    "http://wordpress.org/extend/plugins/facebook-optimize",
     85    "http://wordpress.org/extend/plugins/facebook-page-publish",
     86    "http://wordpress.org/extend/plugins/facebook-recommend-widget",
     87    "http://wordpress.org/extend/plugins/facebook-revised-open-graph-meta-tag",
     88    "http://wordpress.org/extend/plugins/facebook-send-button",
     89    "http://wordpress.org/extend/plugins/facebook-share-new",
     90    "http://wordpress.org/extend/plugins/facebook-social-plugins",
     91    "http://wordpress.org/extend/plugins/facebook-tools",
     92    "http://wordpress.org/extend/plugins/fanpage-connect",
     93    "http://wordpress.org/extend/plugins/fatpanda-facebook-comments",
     94    "http://wordpress.org/extend/plugins/fb-open-graph-actions-free",
     95    "http://wordpress.org/extend/plugins/fb-thumbnail-config",
     96    "http://wordpress.org/extend/plugins/fbpromotions",
     97    "http://wordpress.org/extend/plugins/fbvirallike",
     98    "http://wordpress.org/extend/plugins/fix-facebook-like",
     99    "http://wordpress.org/extend/plugins/flexo-facebook-manager",
     100    "http://wordpress.org/extend/plugins/flexo-social-gallery",
     101    "http://wordpress.org/extend/plugins/foragr-activity-stream",
     102    "http://wordpress.org/extend/plugins/foxyshop",
     103    "http://wordpress.org/extend/plugins/fp",
     104    "http://wordpress.org/extend/plugins/head-cleaner",
     105    "http://wordpress.org/extend/plugins/head-meta-facebook",
     106    "http://wordpress.org/extend/plugins/hyves-respect",
     107    "http://wordpress.org/extend/plugins/jotlinks-button",
     108    "http://wordpress.org/extend/plugins/jw-player-plugin-for-wordpress",
     109    "http://wordpress.org/extend/plugins/kblog-metadata",
     110    "http://wordpress.org/extend/plugins/kevinjohn-gallagher-pure-web-brilliants-social-graph-control",
     111    "http://wordpress.org/extend/plugins/leenkme",
     112    "http://wordpress.org/extend/plugins/like",
     113    "http://wordpress.org/extend/plugins/like-button-plugin-for-wordpress",
     114    "http://wordpress.org/extend/plugins/like-buttons",
     115    "http://wordpress.org/extend/plugins/me-likey-a-facebook-open-graph-plugin",
     116    "http://wordpress.org/extend/plugins/mediaembedder",
     117    "http://wordpress.org/extend/plugins/meta-ographr",
     118    "http://wordpress.org/extend/plugins/mouseover-share-buttons-by-newsgrape",
     119    "http://wordpress.org/extend/plugins/multilpe-social-media",
     120    "http://wordpress.org/extend/plugins/network-publisher",
     121    "http://wordpress.org/extend/plugins/og-meta",
     122    "http://wordpress.org/extend/plugins/ogp",
     123    "http://wordpress.org/extend/plugins/only-tweet-like-share-and-google-1",
     124    "http://wordpress.org/extend/plugins/open-graph",
     125    "http://wordpress.org/extend/plugins/open-graph-protocol-in-posts-and-pages",
     126    "http://wordpress.org/extend/plugins/open-graph-protocol-tools",
     127    "http://wordpress.org/extend/plugins/opengraph-and-microdata-generator",
     128    "http://wordpress.org/extend/plugins/opengraph-metatags-for-facebook",
     129    "http://wordpress.org/extend/plugins/professional-share",
     130    "http://wordpress.org/extend/plugins/scrolling-social-sharebar",
     131    "http://wordpress.org/extend/plugins/scrolling-twitter-like-google-plusone-linkedin-and-stumbleupon",
     132    "http://wordpress.org/extend/plugins/seo-facebook-comments",
     133    "http://wordpress.org/extend/plugins/seopress",
     134    "http://wordpress.org/extend/plugins/share-buttons",
     135    "http://wordpress.org/extend/plugins/share-center-pro",
     136    "http://wordpress.org/extend/plugins/shareyourcart",
     137    "http://wordpress.org/extend/plugins/sharing-is-caring",
     138    "http://wordpress.org/extend/plugins/shopp-facebook-like-button-sflb",
     139    "http://wordpress.org/extend/plugins/shopp-open-graph-helper",
     140    "http://wordpress.org/extend/plugins/shorten2ping",
     141    "http://wordpress.org/extend/plugins/simple-facebook-comments-for-wordpress",
     142    "http://wordpress.org/extend/plugins/simple-facebook-connect",
     143    "http://wordpress.org/extend/plugins/simple-open-graph",
     144    "http://wordpress.org/extend/plugins/slick-social-share-buttons",
     145    "http://wordpress.org/extend/plugins/social-discussions",
     146    "http://wordpress.org/extend/plugins/social-graph-protocol",
     147    "http://wordpress.org/extend/plugins/social-kundi",
     148    "http://wordpress.org/extend/plugins/social-maven",
     149    "http://wordpress.org/extend/plugins/social-networks-auto-poster-facebook-twitter-g",
     150    "http://wordpress.org/extend/plugins/social-sharing-toolkit",
     151    "http://wordpress.org/extend/plugins/socialize",
     152    "http://wordpress.org/extend/plugins/wonderm00ns-simple-facebook-open-graph-tags",
     153    "http://wordpress.org/extend/plugins/woocommerce",
     154    "http://wordpress.org/extend/plugins/wordpress-connect",
     155    "http://wordpress.org/extend/plugins/wordpress-facebook-integrate",
     156    "http://wordpress.org/extend/plugins/wordpress-plugin-seo-and-facebook-opengraph-and-google-schema",
     157    "http://wordpress.org/extend/plugins/wordpress-seo",
     158    "http://wordpress.org/extend/plugins/wordpress-social-ring",
     159    "http://wordpress.org/extend/plugins/wp-facebook-like",
     160    "http://wordpress.org/extend/plugins/wp-facebook-like-send-open-graph-meta",
     161    "http://wordpress.org/extend/plugins/wp-facebook-like-this",
     162    "http://wordpress.org/extend/plugins/wp-facebook-likebutton",
     163    "http://wordpress.org/extend/plugins/wp-facebook-open-graph-protocol",
     164    "http://wordpress.org/extend/plugins/wp-facebook-plugin",
     165    "http://wordpress.org/extend/plugins/wp-facebookconnect",
     166    "http://wordpress.org/extend/plugins/wp-fb-commerce",
     167    "http://wordpress.org/extend/plugins/wp-grow-button",
     168    "http://wordpress.org/extend/plugins/wp-ogp",
     169    "http://wordpress.org/extend/plugins/wp-open-graph-meta",
     170    "http://wordpress.org/extend/plugins/wpmu-dev-facebook-addon",
     171    "http://wordpress.org/extend/plugins/wpstorecart",
     172    "http://wordpress.org/extend/plugins/zoltonorg-social-plugin"
     173    );
     174
     175    //fetch activated plugins
     176    $plugins_list = get_option( 'active_plugins', array() );
     177
     178    $num_conflicting = 0;
     179    $conflicting_plugins = array();
     180
     181    //iterate through activated plugins, checking if they are in the list of conflict plugins
     182    foreach ( $plugins_list as $val ) {
     183        $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $val);     
     184        $plugin_uri = $plugin_data['PluginURI'];
     185        $plugin_name = $plugin_data['Name'];
     186   
     187        if( $plugin_uri == "http://wordpress.org/extend/plugins/facebook/" ) {
     188            continue;
     189        }
     190       
     191        if( in_array($plugin_uri, $og_conflicting_plugins_static) ) {
     192            $num_conflicting += 1;
     193     
     194            if( $num_conflicting == 1 ) {
     195        array_push( $conflicting_plugins, $plugin_name);
     196            }
     197            else {
     198        array_push( $conflicting_plugins, ", " . $plugin_name );
     199            }
     200        }
     201    }
     202
     203    //if there are more than 1 plugins relying on Open Graph, warn the user on this plugins page
     204    if ( $num_conflicting >= 1 ) {
     205        fb_admin_dialog( sprintf( __( 'You have plugins installed that could potentially conflict with the Facebook plugin. Please consider disabling the following plugins on the %sPlugins Settings page%s:', 'facebook' ) . "</br>" . implode($conflicting_plugins), '<a href="plugins.php" aria-label="Plugins 0">', '</a>' ), true);
     206    }
    19207}
    20208
     
    133321                echo '<p>' . sprintf( esc_html( __( 'If you don\'t already have an app for this website, go to %s and click the "Create New App" button.    You\'ll see a dialog like the one below.    Fill this in and click "Continue".', 'facebook' ) ), '<a href="https://developers.facebook.com/apps" target="_blank">https://developers.facebook.com/apps</a>' );
    134322                echo '<p><img src="' . plugins_url( 'images/nux_create_app.png', __FILE__ ) . '"></p>';
     323                echo "</br>Here are for some recommendations for filling this form out. </br>";
     324       
     325        echo "<b> App Name: </b>" . get_bloginfo('name') . "</br>";
     326        echo "<b> App Namespace: </b>". strtolower(str_replace( " ", "-", get_bloginfo('name') ) ) . '-' . rand( 0, 999 ) . "</br>";
    135327
    136328                echo '<a name="step-2"></a><h2>' . esc_html__( 'Step 2: Set up the App', 'facebook' ) . '</h2>';
    137329                echo sprintf( esc_html( __( 'Next, set up your app so that it looks like the settings below.    Make sure you set your app\'s icon and image, too.  If you already have an app and skipped Step 1, you can view your app settings by going to %s', 'facebook' ) ), '<a href="https://developers.facebook.com/apps">https://developers.facebook.com/apps</a>.</p>' );
    138                 echo '<p><img src="' . plugins_url( 'images/nux_app_settings.png', __FILE__ ) . '"></p>';
     330               
     331        echo "</br>Here are for some recommendations for filling this form out, based on where this plugin is installed.</br>";
     332        echo "<b> App Domains: </b>" . parse_url(home_url('/'), PHP_URL_HOST) . "</br>";
     333        echo "<b> Site URL and Mobile Web URL: </b> " .  get_bloginfo( 'wpurl' ) . "</br>";
     334       
     335                echo '<p><img src="' . plugins_url( 'images/nux_app_settings.png', __FILE__ ) . '" style="border: 1px solid #ccc; margin: 5px; padding: 5px;"></p>';
    139336
    140337                echo '<h2>' . esc_html__( 'Step 3: WordPress settings', 'facebook' ) . '</h2>';
     
    152349                echo '<p>' . sprintf( esc_html( __( 'These settings affect Pages and Posts only.    Additional Social Plugins are also available in the %sWidgets settings%s.', 'facebook' ) ), '<a href="widgets.php">', '</a>' );
    153350
     351                fb_notify_user_of_plugin_conflicts();
    154352                fb_get_social_publisher_fields();
    155353                fb_get_like_fields();
  • facebook/trunk/fb-core.php

    r561366 r571850  
    22add_action( 'init', 'fb_init' );
    33add_action( 'admin_notices', 'fb_install_warning' );
     4add_action( 'admin_notices', 'fb_ssl_warning' );
    45//add_action( 'admin_notices', 'fb_rate_message' );
    56add_action( 'wp_enqueue_scripts', 'fb_style' );
     
    1718    if ((empty($options['app_id']) || empty($options['app_secret'])) && $page != 'facebook-settings' && current_user_can( 'manage_options' ) ) {
    1819        fb_admin_dialog( sprintf( __('You must %sconfigure the plugin%s to enable Facebook for WordPress.', 'facebook' ), '<a href="admin.php?page=facebook-settings">', '</a>' ), true);
     20    }
     21}
     22
     23/**
     24 * Display an admin-facing warning if openSSL is not installed properly
     25 *
     26 * @since 1.0.2
     27 */
     28function fb_ssl_warning() {
     29    $options = get_option( 'fb_options' );
     30
     31    $page = (isset($_GET['page']) ? $_GET['page'] : null);
     32
     33    if ( ! wp_http_supports( array( 'ssl' => true ) )  && current_user_can( 'manage_options' ) ) {
     34        $msg = 'SSL must be enabled on your server for Facebook Social Publisher to work.';
     35        if ( $options['social_publisher']['enabled'] ) {
     36            unset($options['social_publisher']['enabled']);
     37            update_option( 'fb_options', $options );
     38            $msg .= ' As a result, Social Publisher has been disabled.';
     39        }
     40        fb_admin_dialog( __( $msg, 'facebook' ), true );
    1941    }
    2042}
     
    5981   
    6082    if ( isset($_GET['fb_rate_message_ignore']) && '1' == $_GET['fb_rate_message_ignore'] ) {
    61         add_user_meta($user_id, 'fb_rate_message_ignore_notice', 'true', true);
     83        fb_update_user_meta($user_id, 'fb_rate_message_ignore_notice', 'true');
    6284    }
    6385}
     
    84106    ) );
    85107
    86     // enforce minimum requirements
    87     if ( empty( $args['appId'] ) )
    88         return;
    89 
    90108    echo '<script type="text/javascript">window.fbAsyncInit=function(){FB.init(' . json_encode( $args ) . ');';
    91109    do_action( 'fb_async_init', $args );
     
    125143    // appId and secret are required by BaseFacebook
    126144    if ( ( ! empty( $options['app_id'] ) && ! empty( $options['app_secret'] ) ) ) {
    127         $facebook = new Facebook_WP(array(
     145        $facebook = new Facebook_WP_Extend(array(
    128146            'appId'  => $options['app_id'],
    129147            'secret' => $options['app_secret'],
  • facebook/trunk/fb-login.php

    r561366 r571850  
    5555   
    5656    if ( false === ( $test = get_transient( 'fb_extended_access_token_' . $facebook->getUser() ) ) ) {
    57         $facebook->getExtendedAccessToken();
     57        $facebook->setExtendedAccessToken();
    5858       
    5959        //the extended token should be good for a couple of months, but lets refresh it every couple of weeks just in case
     
    7878        return $user;
    7979    }
    80     catch (FacebookApiException $e) {
     80    catch (WP_FacebookApiException $e) {
    8181    }
    8282}
  • facebook/trunk/fb-open-graph.php

    r561366 r571850  
    77 * @param mixed content attribute value for the given property. use an array for array property values or structured properties
    88 */
     9
    910function fb_output_og_protocol( $property, $content ) {
    1011    if ( empty( $property ) || empty( $content ) )
     
    2627    }
    2728}
     29
     30function fb_strip_and_format_desc( $post ) {
     31   
     32    $desc_no_html = "";
     33    $desc_no_html = strip_shortcodes( $desc_no_html ); // Strip shortcodes first in case there is HTML inside the shortcode
     34        $desc_no_html = wp_strip_all_tags( $desc_no_html ); // Strip all html
     35        $desc_no_html = trim( $desc_no_html ); // Trim the final string, we may have stripped everything out of the post so this will make the value empty if that's the case
     36
     37    // Check if empty, may be that the strip functions above made excerpt empty, doubhtful but we want to be 100% sure.
     38    if( empty($desc_no_html) ) {
     39        $desc_no_html = $post->post_content; // Start over, this time with the post_content
     40        $desc_no_html = strip_shortcodes( $desc_no_html ); // Strip shortcodes first in case there is HTML inside the shortcode
     41        $desc_no_html = str_replace(']]>', ']]&gt;', $desc_no_html); // Angelo Recommendation, if for some reason ]]> happens to be in the_content, rare but We've seen it happen
     42        $desc_no_html = wp_strip_all_tags($desc_no_html);
     43        $excerpt_length = apply_filters('excerpt_length', 55);
     44        $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
     45        $desc_no_html = wp_trim_words( $desc_no_html, $excerpt_length, $excerpt_more );
     46        $desc_no_html = trim($desc_no_html); // Trim the final string, we may have stripped everything out of the post so this will make the value empty if that's the case
     47    }
     48   
     49    $desc_no_html = str_replace( array( "\r\n", "\r", "\n" ), ' ',$desc_no_html); // I take it Facebook doesn't like new lines?
     50    return $desc_no_html;
     51}
     52
    2853
    2954/**
     
    5580            if ( !post_password_required($post) ) {
    5681                // First lets get the post excerpt (shouldn't have any html, but anyone can enter anything...)
    57                 $desc_no_html = $post->post_excerpt;
    58                 if ( !empty($excerpt_no_html) ) {
    59                     $desc_no_html = strip_shortcodes($desc_no_html); // Strip shortcodes first in case there is HTML inside the shortcode
    60                     $desc_no_html = wp_strip_all_tags($desc_no_html); // Strip all html
    61                     $desc_no_html = trim($desc_no_html); // Trim the final string, we may have stripped everything out of the post so this will make the value empty if that's the case
    62                 }
    63                
    64                 // Recheck if empty, may be that the strip functions above made excerpt empty, doubhtful but we want to be 100% sure.
    65                 if( empty($desc_no_html) ) {
    66                     $desc_no_html = $post->post_content; // Start over, this time with the post_content
    67                     $desc_no_html = strip_shortcodes( $desc_no_html ); // Strip shortcodes first in case there is HTML inside the shortcode
    68                     $desc_no_html = str_replace(']]>', ']]&gt;', $desc_no_html); // Angelo Recommendation, if for some reason ]]> happens to be in the_content, rare but We've seen it happen
    69                     $desc_no_html = wp_strip_all_tags($desc_no_html);
    70                     $excerpt_length = apply_filters('excerpt_length', 55);
    71                     $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
    72                     $desc_no_html = wp_trim_words( $desc_no_html, $excerpt_length, $excerpt_more );
    73                     $desc_no_html = trim($desc_no_html); // Trim the final string, we may have stripped everything out of the post so this will make the value empty if that's the case
    74                 }
    75                
    76                 $desc_no_html = str_replace( array( "\r\n", "\r", "\n" ), ' ',$desc_no_html); // I take it Facebook doesn't like new lines?
    77                 $meta_tags['http://ogp.me/ns#description'] = $desc_no_html;
     82                $meta_tags['http://ogp.me/ns#description'] = fb_strip_and_format_desc ( $post );
    7883            }
    7984        }
  • facebook/trunk/fb-social-publisher-mentioning.php

    r561366 r571850  
    2525          $friends = $facebook->api('/me/friends', 'GET', array('ref' => 'fbwpp'));
    2626        }
    27         catch (FacebookApiException $e) {
     27        catch (WP_FacebookApiException $e) {
    2828        }
    2929       
     
    7373          $pages = $facebook->api( '/search', 'GET', array( 'access_token' => '', 'q' => $_GET['q'], 'type' => 'page', 'fields' => 'picture,name,id,likes', 'ref' => 'fbwpp' ) );
    7474        }
    75         catch (FacebookApiException $e) {
     75        catch (WP_FacebookApiException $e) {
    7676        }
    7777        set_transient( 'fb_pages_' . $_GET['q'], $pages, 60*60 );
     
    132132function fb_add_page_mention_box() {
    133133    global $post;
    134    
     134    global $facebook;
     135    $options = get_option('fb_options');
     136 
    135137    if ($post->post_status == 'publish')   
    136138        return;
    137139   
    138     add_meta_box(
    139             'fb_page_mention_box_id',
    140             __( 'Mention Facebook Pages', 'facebook' ),
    141             'fb_add_page_mention_box_content',
    142             'post',
    143             'side'
    144     );
    145     add_meta_box(
    146             'fb_page_mention_box_id',
    147             __( 'Mention Facebook Pages', 'facebook' ),
    148             'fb_add_page_mention_box_content',
    149             'page',
    150             'side'
    151     );
     140  if ( isset( $options['social_publisher']['enabled'] ) ) {
     141    add_meta_box(
     142        'fb_page_mention_box_id',
     143        __( 'Mention Facebook Pages', 'facebook' ),
     144        'fb_add_page_mention_box_content',
     145        'post',
     146        'side'
     147    );
     148    add_meta_box(
     149        'fb_page_mention_box_id',
     150        __( 'Mention Facebook Pages', 'facebook' ),
     151        'fb_add_page_mention_box_content',
     152        'page',
     153        'side'
     154    );
     155  }
    152156}
    153157
    154158function fb_add_page_mention_box_content( $post ) {
    155     //wp_enqueue_script('suggest');
     159    wp_enqueue_script('suggest');
    156160
    157161    global $facebook;
     
    177181        echo '<input type="text" class="widefat" id="pages-mention-message" name="fb_page_mention_box_message" value="" size="44" placeholder="'.esc_attr__('Write something...').'" />';
    178182        echo '<p class="howto">';
    179         if ( is_page() ) {
     183        if ( $post->post_type == 'page' ) {
    180184            _e('This will add the page and message to the Timeline of each Facebook Page mentioned. They will also appear in the contents of the page.', 'facebook');
    181185        } else {
     
    249253    global $post;
    250254    global $facebook;
    251    
     255    $options = get_option('fb_options');
     256 
    252257    if ($post->post_status == 'publish')   
    253258        return;
    254259   
    255     add_meta_box(
    256             'fb_friend_mention_box_id',
    257             __( 'Mention Facebook Friends', 'facebook' ),
    258             'fb_add_friend_mention_box_content',
    259             'post',
    260             'side'
    261     );
    262     add_meta_box(
    263             'fb_friend_mention_box_id',
    264             __( 'Mention Facebook Friends', 'facebook' ),
    265             'fb_add_friend_mention_box_content',
    266             'page',
    267             'side'
    268     );
     260  if ( isset( $options['social_publisher']['enabled'] ) ) {
     261    add_meta_box(
     262        'fb_friend_mention_box_id',
     263        __( 'Mention Facebook Friends', 'facebook' ),
     264        'fb_add_friend_mention_box_content',
     265        'post',
     266        'side'
     267    );
     268    add_meta_box(
     269        'fb_friend_mention_box_id',
     270        __( 'Mention Facebook Friends', 'facebook' ),
     271        'fb_add_friend_mention_box_content',
     272        'page',
     273        'side'
     274    );
     275  }
    269276}
    270277
     
    295302
    296303        echo '<p class="howto">';
    297         if ( is_page() ) {
     304        if ( $post->post_type == 'page' ) {
    298305            _e('This will add the page and message to the Timeline of each friend mentioned. They will also appear in the contents of the page.', 'facebook');
    299306        } else {
  • facebook/trunk/fb-social-publisher.php

    r561428 r571850  
    11<?php
    22require_once( $facebook_plugin_directory . '/fb-social-publisher-mentioning.php');
     3require_once('fb-open-graph.php');
    34
    45$options = get_option('fb_options');
     
    1617/**
    1718 * Add meta boxes for a custom Status that is used when posting to an Author's Timeline
    18  *
     19 *5
    1920 * @since 1.0
    2021 */
    2122function fb_add_author_message_box() {
    2223    global $post;
    23    
     24    $options = get_option('fb_options');
     25 
    2426    if ($post->post_status == 'publish')   
    2527        return;
    26 
    27     add_meta_box(
    28         'fb_author_message_box_id',
    29         __( 'Facebook Status on Your Timeline', 'facebook' ),
    30         'fb_add_author_message_box_content',
    31         'post'
    32     );
    33     add_meta_box(
    34         'fb_author_message_box_id',
    35         __( 'Facebook Status on Your Timeline', 'facebook' ),
    36         'fb_add_author_message_box_content',
    37         'page'
    38     );
     28 
     29  if ( isset( $options['social_publisher']['enabled'] ) ) {
     30    add_meta_box(
     31      'fb_author_message_box_id',
     32      __( 'Facebook Status on Your Timeline', 'facebook' ),
     33      'fb_add_author_message_box_content',
     34      'post'
     35    );
     36    add_meta_box(
     37      'fb_author_message_box_id',
     38      __( 'Facebook Status on Your Timeline', 'facebook' ),
     39      'fb_add_author_message_box_content',
     40      'page'
     41    );
     42  }
    3943}
    4044
     
    123127        return;
    124128   
    125   if ( isset( $fan_page_info ) && isset( $fan_page_info[0] ) && isset( $fan_page_info[0][2] ) ) {
     129  if ( isset( $options['social_publisher']['enabled'] ) && isset( $fan_page_info ) && isset( $fan_page_info[0] ) && isset( $fan_page_info[0][2] ) ) {
    126130    add_meta_box(
    127131      'fb_fan_page_message_box_id',
     
    232236        'name' => get_the_title(),
    233237        'caption' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    234         'description' => apply_filters( 'the_excerpt', get_the_excerpt() ),
     238        'description' => fb_strip_and_format_desc( $post ),
    235239        'message' => $fan_page_message,
    236240      );
     
    243247        'name' => get_the_title(),
    244248        'caption' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    245         'description' => apply_filters( 'the_excerpt', get_the_excerpt() ),
     249        'description' => fb_strip_and_format_desc( $post ),
    246250        'message' => $fan_page_message,
    247251      );
     
    260264      update_post_meta($post_id, 'fb_fan_page_post_id', sanitize_text_field($publish_result['id']));
    261265    }
    262     catch (FacebookApiException $e) {
     266    catch (WP_FacebookApiException $e) {
    263267      $error_result = $e->getResult();
    264268     
     
    351355                        'name' => get_the_title(),
    352356                        'caption' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    353                         'description' => apply_filters( 'the_excerpt', get_the_excerpt() ),
     357                            'description' => fb_strip_and_format_desc( $post ),
    354358                        'message' => $mentioned_friends_message,
    355359                    );
     
    361365                        'name' => get_the_title(),
    362366                        'caption' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    363                         'description' => apply_filters( 'the_excerpt', get_the_excerpt() ),
     367                            'description' => fb_strip_and_format_desc( $post ),
    364368                        'message' => $mentioned_friends_message,
    365369                    );
     
    372376                $publish_ids_friends[] = sanitize_text_field( $publish_result['id'] );
    373377               
    374                 $friends_posts .= '<a href="' . sanitize_text_field( fb_get_permalink_from_feed_publish_id( $publish_result['id'] ) ) . '" target="_blank"><img src="http://graph.facebook.com/' . $friend['id'] . '/picture" width="15"></a> ';
    375             }
    376             catch (FacebookApiException $e) {
     378                $friends_posts .= '<a href="' . esc_url( fb_get_permalink_from_feed_publish_id( $publish_result['id'] ) ) . '" target="_blank"><img src="' . esc_url( 'http://graph.facebook.com/' . $friend['id'] . '/picture' ) . '" width="15"></a> ';
     379            }
     380            catch (WP_FacebookApiException $e) {
    377381        $error_result = $e->getResult();
    378382       
    379383        if ($e->getCode() == 210) {
    380           $status_messages[] = array( 'message' => sprintf( __( 'Failed posting to mentioned friend\'s Facebook Timeline. <img src="http://graph.facebook.com/' . $friend['id'] . '/picture" width="15"> Error: Page doesn\'t allow posts from other Facebook users. Full error: ' . json_encode ( $error_result['error'] ), true ) ), 'error' => true );
     384          $status_messages[] = array( 'message' => sprintf( __( 'Failed posting to mentioned friend\'s Facebook Timeline. <img src="' . esc_url( 'http://graph.facebook.com/' . $friend['id'] . '/picture' ) . '" width="15"> Error: Page doesn\'t allow posts from other Facebook users. Full error: ' . json_encode ( $error_result['error'] ), true ) ), 'error' => true );
    381385        }
    382386        else {
    383           $status_messages[] = array( 'message' => sprintf( __( 'Failed posting to mentioned friend\'s Facebook Timeline. <img src="http://graph.facebook.com/' . $friend['id'] . '/picture" width="15"> Error: ' . json_encode ( $error_result['error'] ), true ) ), 'error' => true );
     387          $status_messages[] = array( 'message' => sprintf( __( 'Failed posting to mentioned friend\'s Facebook Timeline. <img src="' . esc_url( 'http://graph.facebook.com/' . $friend['id'] . '/picture' ) . '" width="15"> Error: ' . json_encode ( $error_result['error'] ), true ) ), 'error' => true );
    384388        }
    385389            }
     
    410414                        'name' => get_the_title(),
    411415                        'caption' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    412                         'description' => apply_filters( 'the_excerpt', get_the_excerpt() ),
     416                            'description' => fb_strip_and_format_desc( $post ),
    413417                        'message' => $mentioned_pages_message,
    414418                    );
     
    420424                        'name' => get_the_title(),
    421425                        'caption' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    422                         'description' => apply_filters( 'the_excerpt', get_the_excerpt() ),
     426                            'description' => fb_strip_and_format_desc( $post ),
    423427                        'message' => $mentioned_pages_message,
    424428                    );
     
    434438
    435439            }
    436             catch (FacebookApiException $e) {
     440            catch (WP_FacebookApiException $e) {
    437441        $error_result = $e->getResult();
    438442       
     
    469473     
    470474    }
    471     catch (FacebookApiException $e) {
     475    catch (WP_FacebookApiException $e) {
    472476      $error_result = $e->getResult();
    473477     
     
    510514    if ( ! isset( $facebook ) )
    511515        return;
    512 
    513     $accounts = fb_get_user_pages();
    514 
    515     $accounts_options = array('disabled' => '[Disabled]');
    516    
    517     $options = get_option('fb_options');
    518 
    519     if (isset($options['social_publisher']) && isset($options['social_publisher']['publish_to_fan_page']) && $options['social_publisher']['publish_to_fan_page'] != 'disabled') {
    520         preg_match_all("/(.*?)@@!!(.*?)@@!!(.*?)$/su", $options['social_publisher']['publish_to_fan_page'], $fan_page_info, PREG_SET_ORDER);
    521     }
    522 
    523     foreach($accounts as $account) {
    524         if (isset($account['name']) && isset($account['category']) && $account['category'] != 'Application') {
    525             $account_options_key = $account['name'] . "@@!!" . $account['id'] . "@@!!" . $account['access_token'];
    526             $accounts_options[$account_options_key] = $account['name'];
    527            
    528             if ( isset( $fan_page_info ) && isset( $fan_page_info[0] ) && isset( $fan_page_info[0][2] ) ) {
    529                 if ($account['id'] == $fan_page_info[0][2]) {
    530                     $options['social_publisher']['publish_to_fan_page'] = $account_options_key;
    531                
    532                     update_option( 'fb_options', $options );
    533                 }
    534             }
    535         }
    536     }
     516 
     517  $fan_page_option = array();
     518 
     519  if (!$facebook->getUser() ) {
     520    $fan_page_option = array(
     521            'name' => 'publish_to_fan_page',
     522            'type' => 'disabled_text',
     523            'disabled_text' => '<a href="#" onclick="authFacebook(); return false;">'.__('Link your Facebook account to your WordPress account to enable.','facebook').'</a>',
     524            'help_text' => __( 'All new posts will be automatically published to this Facebook Page.', 'facebook' ),
     525            );
     526  }
     527    else {
     528    $accounts = fb_get_user_pages();
     529
     530    $accounts_options = array('disabled' => '[Disabled]');
     531   
     532    $options = get_option('fb_options');
     533 
     534    if (isset($options['social_publisher']) && isset($options['social_publisher']['publish_to_fan_page']) && $options['social_publisher']['publish_to_fan_page'] != 'disabled') {
     535      preg_match_all("/(.*?)@@!!(.*?)@@!!(.*?)$/su", $options['social_publisher']['publish_to_fan_page'], $fan_page_info, PREG_SET_ORDER);
     536    }
     537 
     538    foreach($accounts as $account) {
     539      if (isset($account['name']) && isset($account['category']) && $account['category'] != 'Application') {
     540        $account_options_key = $account['name'] . "@@!!" . $account['id'] . "@@!!" . $account['access_token'];
     541        $accounts_options[$account_options_key] = $account['name'];
     542       
     543        if ( isset( $fan_page_info ) && isset( $fan_page_info[0] ) && isset( $fan_page_info[0][2] ) ) {
     544          if ($account['id'] == $fan_page_info[0][2]) {
     545            $options['social_publisher']['publish_to_fan_page'] = $account_options_key;
     546         
     547            update_option( 'fb_options', $options );
     548          }
     549        }
     550      }
     551    }
     552   
     553    $fan_page_option = array(
     554      'name' => 'publish_to_fan_page',
     555      'type' => 'dropdown',
     556      'options' => $accounts_options,
     557      'help_text' => __( 'New posts will be publish to this Facebook Page.', 'facebook' ),
     558      );
     559   
     560  }
    537561   
    538562    $parent = array(
     
    544568        'image' => plugins_url( 'images/settings_social_publisher.png', __FILE__)
    545569    );
    546 
    547     if (count($accounts_options) < 2) {
    548         $fan_page_option = array(
    549             'name' => 'publish_to_fan_page',
    550             'type' => 'disabled_text',
    551             'disabled_text' => '<a href="#" onclick="authFacebook(); return false;">'.__('Link your Facebook account to your WordPress account to enable.','facebook').'</a>',
    552             'help_text' => __( 'All new posts will be automatically published to this Facebook Page.', 'facebook' ),
    553             );
    554     }
    555     else {
    556         $fan_page_option = array(
    557             'name' => 'publish_to_fan_page',
    558             'type' => 'dropdown',
    559             'options' => $accounts_options,
    560             'help_text' => __( 'New posts will be publish to this Facebook Page.', 'facebook' ),
    561             );
    562     }
    563 
     570 
    564571    $children = array(
    565572        array(
     
    593600add_action( 'transition_post_status', 'fb_publish_later', 10, 3);
    594601function fb_publish_later($new_status, $old_status, $post) {
     602  $options = get_option('fb_options');
     603 
    595604    // check that the new status is "publish" and that the old status was not "publish"
    596605    if ($new_status == 'publish' && $old_status != 'publish') {
     
    598607        $post_types = get_post_types( array('public' => true), 'objects' );
    599608        foreach ( $post_types as $post_type ) {
    600             if ( $post->post_type == $post_type->name ) {
     609            if ( $post->post_type == $post_type->name && isset( $options['social_publisher']['enabled'] ) ) {
    601610                fb_post_to_fb_page($post->ID);
    602611
     
    623632            $delete_result = $facebook->api('/' . $fb_page_post_id, 'DELETE', array('ref' => 'fbwpp'));
    624633        }
    625         catch (FacebookApiException $e) {
     634        catch (WP_FacebookApiException $e) {
    626635        }
    627636    }
     
    633642            $delete_result = $facebook->api('/' . $fb_author_post_id, 'DELETE', array('ref' => 'fbwpp'));
    634643        }
    635         catch (FacebookApiException $e) {
     644        catch (WP_FacebookApiException $e) {
    636645        }
    637646
     
    645654                    $delete_result = $facebook->api('/' . $page_post_ids, 'DELETE', array('ref' => 'fbwpp'));
    646655            }
    647             catch (FacebookApiException $e) {
     656            catch (WP_FacebookApiException $e) {
    648657            }
    649658        }
     
    657666                    $delete_result = $facebook->api('/' . $page_post_ids, 'DELETE', array('ref' => 'fbwpp'));
    658667            }
    659             catch (FacebookApiException $e) {
     668            catch (WP_FacebookApiException $e) {
    660669            }
    661670        }
     
    686695        $accounts = $facebook->api('/me/accounts', 'GET', array('ref' => 'fbwpp'));
    687696    }
    688     catch (FacebookApiException $e) {
     697    catch (WP_FacebookApiException $e) {
    689698        return $accounts;
    690699    }
  • facebook/trunk/fb-wp-helpers.php

    r561366 r571850  
    258258
    259259
     260function fb_option_name($field){
     261    switch ($field) {
     262        case 'app_id':
     263            return 'App ID';
     264            break;
     265        case 'app_secret':
     266            return 'App secret';
     267            break;
     268        case 'app_namespace':
     269            return 'App namespace';
     270            break;
     271        case 'social_publisher':
     272            return "Social Publisher";
     273            break;
     274        case 'recommendations_bar':
     275            return "Recommendations Bar";
     276            break;
     277        case 'like':
     278            return "Like Button";
     279            break;
     280        case 'subscribe':
     281            return "Subscribe Button";
     282            break;
     283        case 'send':
     284            return "Send Button";
     285            break;
     286        case 'comments':
     287            return "Comments Box";
     288            break;
     289        default:
     290            return '';
     291            break;
     292    }
     293}
     294
    260295?>
  • facebook/trunk/includes/facebook-php-sdk/base_facebook.php

    r556379 r571850  
    1616 */
    1717
    18 if ( ! class_exists( 'FacebookApiException' ) ):
     18if ( ! class_exists( 'WP_FacebookApiException' ) ):
    1919/**
    2020 * Thrown when an API call returns an exception.
     
    2222 * @author Naitik Shah <[email protected]>
    2323 */
    24 class FacebookApiException extends Exception
     24class WP_FacebookApiException extends Exception
    2525{
    2626  /**
     
    3737    $this->result = $result;
    3838
    39     $code = isset($result['error_code']) ? $result['error_code'] : 0;
     39    //when api call fails (no available transport, i.e. cURL etc. not working), error code comes
     40    // out as string 'http_failure', but $code needs to be int. is_int returns false if !isset()
     41    $code = is_int($result['error_code']) ? $result['error_code'] : 0;
    4042
    4143    if (isset($result['error_description'])) {
     
    102104endif;
    103105
    104 if ( ! class_exists( 'BaseFacebook' ) ):
     106if ( ! class_exists( 'WP_BaseFacebook' ) ):
    105107/**
    106108 * Provides access to the Facebook Platform.  This class provides
     
    112114 * @author Naitik Shah <[email protected]>
    113115 */
    114 abstract class BaseFacebook
     116abstract class WP_BaseFacebook
    115117{
    116118  /**
     
    214216   *
    215217   * @param string $appId The Application ID
    216    * @return BaseFacebook
     218   * @return WP_BaseFacebook
    217219   */
    218220  public function setAppId($appId) {
     
    234236   *
    235237   * @param string $apiSecret The App Secret
    236    * @return BaseFacebook
     238   * @return WP_BaseFacebook
    237239   * @deprecated
    238240   */
     
    246248   *
    247249   * @param string $appSecret The App Secret
    248    * @return BaseFacebook
     250   * @return WP_BaseFacebook
    249251   */
    250252  public function setAppSecret($appSecret) {
     
    276278   * Thanks to http://stackoverflow.com/questions/486896/adding-a-parameter-to-the-url-with-javascript for the workaround
    277279   */
    278   public function getExtendedAccessToken() {
     280  public function setExtendedAccessToken() {
    279281    try {
    280282      // need to circumvent json_decode by calling _oauthRequest
     
    288290          'fb_exchange_token'=>$this->getAccessToken(),
    289291        ));
    290       } catch (FacebookApiException $e) {
     292      } catch (WP_FacebookApiException $e) {
    291293        // most likely that user very recently revoked authorization.
    292294        // In any event, we don't have an access token, so say so.
     
    314316   *
    315317   * @param boolean $fileUploadSupport The file upload support status.
    316    * @return BaseFacebook
     318   * @return WP_BaseFacebook
    317319   */
    318320  public function setFileUploadSupport($fileUploadSupport) {
     
    347349   *
    348350   * @param string $access_token an access token.
    349    * @return BaseFacebook
     351   * @return WP_BaseFacebook
    350352   */
    351353  public function setAccessToken($access_token) {
     
    616618   * Constructs and returns the name of the cookie that
    617619   * potentially houses the signed request for the app user.
    618    * The cookie is not set by the BaseFacebook class, but
     620   * The cookie is not set by the WP_BaseFacebook class, but
    619621   * it may be set by the JavaScript SDK.
    620622   *
     
    628630  /**
    629631   * Constructs and returns the name of the coookie that potentially contain
    630    * metadata. The cookie is not set by the BaseFacebook class, but it may be
     632   * metadata. The cookie is not set by the WP_BaseFacebook class, but it may be
    631633   * set by the JavaScript SDK.
    632634   *
     
    678680      $user_info = $this->api('/me');
    679681      return $user_info['id'];
    680     } catch (FacebookApiException $e) {
     682    } catch (WP_FacebookApiException $e) {
    681683      return 0;
    682684    }
     
    737739                          'redirect_uri' => $redirect_uri,
    738740                          'code' => $code));
    739     } catch (FacebookApiException $e) {
     741    } catch (WP_FacebookApiException $e) {
    740742      // most likely that user very recently revoked authorization.
    741743      // In any event, we don't have an access token, so say so.
     
    762764   *
    763765   * @return mixed The decoded response object
    764    * @throws FacebookApiException
     766   * @throws WP_FacebookApiException
    765767   */
    766768  protected function _restserver($params) {
     
    810812   *
    811813   * @return mixed The decoded response object
    812    * @throws FacebookApiException
     814   * @throws WP_FacebookApiException
    813815   */
    814816  protected function _graph($path, $method = 'GET', $params = array()) {
     
    845847   *
    846848   * @return string The decoded response object
    847    * @throws FacebookApiException
     849   * @throws WP_FacebookApiException
    848850   */
    849851  protected function _oauthRequest($url, $params) {
     
    908910
    909911    if ($result === false) {
    910       $e = new FacebookApiException(array(
     912      $e = new WP_FacebookApiException(array(
    911913        'error_code' => curl_errno($ch),
    912914        'error' => array(
     
    11281130   */
    11291131  protected function throwAPIException($result) {
    1130     $e = new FacebookApiException($result);
     1132    $e = new WP_FacebookApiException($result);
    11311133    switch ($e->getType()) {
    11321134      // OAuth 2.0 Draft 00 style
     
    12681270
    12691271  /**
    1270    * Get the data for $key, persisted by BaseFacebook::setPersistentData()
     1272   * Get the data for $key, persisted by WP_BaseFacebook::setPersistentData()
    12711273   *
    12721274   * @param string $key The key of the data to retrieve
  • facebook/trunk/includes/facebook-php-sdk/class-facebook-wp.php

    r561366 r571850  
    11<?php
    22
    3 if ( ! class_exists( 'Facebook' ) )
     3if ( ! class_exists( 'WP_Facebook' ) )
    44    require_once( dirname( __FILE__ ) . '/facebook.php' );
    55
     
    99 * @since 1.0
    1010 */
    11 class Facebook_WP extends Facebook {
     11class Facebook_WP_Extend extends WP_Facebook {
    1212    /**
    1313     * Override Facebook PHP SDK cURL function with WP_HTTP
     
    2525
    2626        if ( empty( $url ) || empty( $params ) )
    27             throw new FacebookApiException( array( 'error_code' => 400, 'error' => array( 'type' => 'makeRequest', 'message' => 'Invalid parameters and/or URI passed to makeRequest' ) ) );
    28 
     27            throw new WP_FacebookApiException( array( 'error_code' => 400, 'error' => array( 'type' => 'makeRequest', 'message' => 'Invalid parameters and/or URI passed to makeRequest' ) ) );
     28           
    2929        $params = array(
    3030            'redirection' => 0,
     
    3232            'timeout' => 60,
    3333            'user-agent' => apply_filters( 'http_headers_useragent', 'WordPress/' . $wp_version . '; ' . get_bloginfo( 'url' ) . '; facebook-php-' . self::VERSION . '-wp' ),
    34             'headers' => array( 'Expect:' ),
     34            'headers' => array( 'Connection' => 'close' , 'Content-type' => 'application/x-www-form-urlencoded'),
    3535            'sslverify' => false, // warning: might be overridden by 'https_ssl_verify' filter
    3636            'body' => http_build_query( $params, '', '&' )
     
    4040       
    4141        if ( is_wp_error( $response ) ) {
    42             throw new FacebookApiException( array( 'error_code' => $response->get_error_code(), 'error_msg' => $response->get_error_message() ) );
     42            throw new WP_FacebookApiException( array( 'error_code' => $response->get_error_code(), 'error_msg' => $response->get_error_message() ) );
    4343        }
    4444        else if ( wp_remote_retrieve_response_code( $response ) != '200' ) {
     
    5151            }
    5252           
    53             throw new FacebookApiException(array(
     53            throw new WP_FacebookApiException(array(
    5454        'error_code' => $fb_response->error->code,
    5555        'error' => array(
     
    6767   * Thanks to http://stackoverflow.com/questions/486896/adding-a-parameter-to-the-url-with-javascript for the workaround
    6868   */
    69   public function getExtendedAccessToken() {
     69  public function setExtendedAccessToken() {
    7070    try {
    7171      // need to circumvent json_decode by calling _oauthRequest
     
    7979          'fb_exchange_token'=>$this->getAccessToken(),
    8080        ));
    81       } catch (FacebookApiException $e) {
     81      } catch (WP_FacebookApiException $e) {
    8282        // most likely that user very recently revoked authorization.
    8383        // In any event, we don't have an access token, so say so.
  • facebook/trunk/includes/facebook-php-sdk/facebook.php

    r556379 r571850  
    1818require_once( dirname(__FILE__) . '/base_facebook.php' );
    1919
    20 if ( ! class_exists( 'Facebook' ) ):
     20if ( ! class_exists( 'WP_Facebook' ) ):
    2121
    2222/**
    23  * Extends the BaseFacebook class with the intent of using
     23 * Extends the WP_BaseFacebook class with the intent of using
    2424 * PHP sessions to store user ids and access tokens.
    2525 */
    26 class Facebook extends BaseFacebook
     26class WP_Facebook extends WP_BaseFacebook
    2727{
    2828  /**
     
    3333   *
    3434   * @param Array $config the application configuration.
    35    * @see BaseFacebook::__construct in facebook.php
     35   * @see WP_BaseFacebook::__construct in facebook.php
    3636   */
    3737  public function __construct($config) {
    38     if (!session_id()) {
    39       session_start();
    40     }
     38   
    4139    parent::__construct($config);
    4240  }
  • facebook/trunk/readme.txt

    r561366 r571850  
    11=== Facebook ===
    2 Contributors: Facebook, automattic, mattwkelly, niallkennedy, jamesgpearce, ravi.grover, danielbachhuber, gigawats, eosgood, Otto42
     2Contributors: Facebook, automattic, mattwkelly, niallkennedy, rgharpuray, ngfeldman, jamesgpearce, ravi.grover, danielbachhuber, gigawats, eosgood, Otto42
    33Tags: Facebook, comments, social, friends, like, like button, social plugins, facebook platform, page, posts, sidebar, plugin, open graph
    44Requires at least: 3.2.1
     
    5555== Changelog ==
    5656
     57= 1.0.2 =
     58
     59* Fixed issue where some sites were extremely slow as a result of installing the plugin (due to cURL not being installed).
     60* Added warning and actively disable portions of the plugin if SSL not installed.
     61* Fixed bug in social publishing.
     62* Added logic to disable meta boxes/publishing if social publishing is disabled.
     63* Fixed forever loading issue on FB settings page if no active user exists.
     64* Added proper escaping.
     65* Added global settings to set whether social plugins show on all posts, all pages, both, or neither. Done for like button, subscribe button, send button, comments, and recommendations bar.
     66* Added per-post/page settings for showing/hiding social plugins.
     67* Fixed poorly formatted description that was being set when publishing to friends' and Pages' feeds.
     68* Added notification if plugins that are potentially conflicting are installed.
     69* Added suggestions for what to enter in fields in the new user experience.
     70* Bug fixes to ensure everything works on mobile (including support for WPTouch).
     71* Bug fixes to Pages drop down on the Facebook settings page.
     72* Removed the need to create PHP sessions, relying on user meta/transients now.
     73
    5774= 1.0.1 =
    5875
  • facebook/trunk/scripts/fb-admin.dev.js

    r561366 r571850  
    4949
    5050jQuery(function() {
    51     jQuery("#suggest-friends").tokenInput("?fb-friends=1", {
     51    jQuery("#suggest-friends").tokenInput(ajaxurl + "?fb-friends=1&action=fb_friend_page_autocomplete&autocompleteNonce=" +FBNonce.autocompleteNonce, {
    5252        theme: "facebook",
    5353        preventDuplicates: true,
    54         hintText: "Type to find a friend."
     54        hintText: "Type to find a friend.",
     55        animateDropdown: false,
     56        noResultsText: "No friend found.",
    5557    });
    56 });;
     58});
     59
     60jQuery(function() {
     61    jQuery("#suggest-pages").tokenInput(ajaxurl + "?fb-pages=1&action=fb_friend_page_autocomplete&autocompleteNonce=" +FBNonce.autocompleteNonce, {
     62        theme: "facebook",
     63        preventDuplicates: true,
     64        hintText: "Type to find a page.",
     65        animateDropdown: false,
     66        noResultsText: "No page found.",
     67    });
     68});
    5769
    5870function fbShowDebugInfo() {
    59   $('#debug-output').show();
    60  
    61   return false;
     71  jQuery('#debug-output').show();
    6272}
  • facebook/trunk/social-plugins/fb-comments.php

    r561366 r571850  
    4747    if ( isset ( $post ) ) {
    4848        if ( comments_open( get_the_ID() ) && post_type_supports( get_post_type(), 'comments' ) ) {
    49             if ( is_singular() ) {
    50                 $options = get_option('fb_options');
    51    
    52                 foreach($options['comments'] as $param => $val) {
    53                     $param = str_replace('_', '-', $param);
    54    
     49            $options = get_option('fb_options');
     50            $show_indiv = get_post_meta( $post->ID, 'fb_social_plugin_settings_box_comments', true );
     51            if ( ! is_home() && ( 'default' == $show_indiv || empty( $show_indiv ) ) && $options['comments']['show_on'] ) {
     52                if ( ( is_page() && ( $options['comments']['show_on'] == 'all pages' || $options['comments']['show_on'] == 'all posts and pages' ) )
     53                        or ( is_single() &&  ( $options['comments']['show_on'] == 'all posts' || $options['comments']['show_on'] == 'all posts and pages' ) ) )
     54                {
     55                    foreach( $options['comments'] as $param => $val ) {
     56                        $param = str_replace( '_', '-', $param );
     57       
     58                        $params[$param] = $val;
     59                    }
     60       
     61                    $content .= fb_get_comments( $params );
     62                }
     63            }
     64            elseif ( 'show' == $show_indiv ) {
     65                foreach( $options['comments'] as $param => $val ) {
     66                    $param = str_replace( '_', '-', $param );
     67               
    5568                    $params[$param] = $val;
    5669                }
    57    
    58                 $content .= fb_get_comments($params);
     70               
     71                $content .= fb_get_comments( $params );
    5972            }
    60             else {
    61             }
     73            //elseif ( 'no' == $show_indiv ) {
     74            //}
    6275        }
    6376    }
     
    7790                $comments = $facebook->api('/comments', array('ids' => $url));
    7891            }
    79                 catch (FacebookApiException $e) {
     92                catch (WP_FacebookApiException $e) {
    8093            }
    8194           
     
    137150                                                    'help_text' => 'The color scheme of the plugin.',
    138151                                                    ),
     152                                        array('name' => 'show_on',
     153                                                    'type' => 'dropdown',
     154                                                    'default' => 'all posts and pages',
     155                                                    'options' => array('all posts' => 'all posts', 'all pages' => 'all pages', 'all posts and pages' => 'all posts and pages', 'individual posts and pages' => 'individual posts and pages' ),
     156                                                    'help_text' => __( 'Whether the plugin will appear on all posts or pages by default. If "individual posts and pages" is selected, you must explicitly set each post and page to display the plugin.', 'facebook' ),
     157                                                    )
    139158                                        );
    140159
  • facebook/trunk/social-plugins/fb-like.php

    r561366 r571850  
    4545        }
    4646   
    47         if ( empty( $options['like']['show_on_homepage'] ) && is_singular() ) {
     47        $show_indiv = get_post_meta( $post->ID, 'fb_social_plugin_settings_box_like', true );
     48       
     49        if ( is_home() && isset ( $options['like']['show_on_homepage'] ) ) {
    4850            $content = $new_content;
    4951        }
    50         elseif ( isset($options['like']['show_on_homepage']) ) {
     52        elseif ( ( 'default' == $show_indiv || empty( $show_indiv ) ) && isset ( $options['like']['show_on'] ) ) {     
     53            if ( is_page() && ( $options['like']['show_on'] == 'all pages' || $options['like']['show_on'] == 'all posts and pages' ) )
     54                $content = $new_content;
     55            elseif ( is_single() && ( $options['like']['show_on'] == 'all posts' || $options['like']['show_on'] == 'all posts and pages' ) )
     56                $content = $new_content;
     57        }
     58        elseif ( 'show' == $show_indiv ) {
    5159            $content = $new_content;
    5260        }
     
    193201                                                    'help_text' => __( 'Where the button will display on the page or post.', 'facebook' ),
    194202                                                    );
     203        $array['children'][] = array('name' => 'show_on',
     204                                                    'type' => 'dropdown',
     205                                                    'default' => 'all posts and pages',
     206                                                    'options' => array('all posts' => 'all posts', 'all pages' => 'all pages', 'all posts and pages' => 'all posts and pages', 'individual posts and pages' => 'individual posts and pages' ),
     207                                                    'help_text' => __( 'Whether the plugin will appear on all posts or pages by default. If "individual posts and pages" is selected, you must explicitly set each post and page to display the plugin.', 'facebook' ),
     208                                                    );
    195209        $array['children'][] = array('name' => 'show_on_homepage',
    196210                                                    'type' => 'checkbox',
  • facebook/trunk/social-plugins/fb-recommendations-bar.php

    r556379 r571850  
    66}
    77
    8 function fb_recommendations_bar_automatic($content) {
    9     if (!is_home()) {
    10         $options = get_option('fb_options');
    11 
    12         $content .= fb_get_recommendations_bar($options['recommendations_bar']);
     8function fb_recommendations_bar_automatic( $content ) {
     9    global $post;
     10    $show_indiv = get_post_meta( $post->ID, 'fb_social_plugin_settings_box_recommendations_bar', true );
     11    $options = get_option('fb_options');
     12    if ( ! is_home() && ( 'default' == $show_indiv || empty( $show_indiv ) ) && $options['recommendations_bar']['show_on'] ) {
     13        if ( ( is_page() && ( $options['recommendations_bar']['show_on'] == 'all pages' || $options['recommendations_bar']['show_on'] == 'all posts and pages' ) )
     14                or ( is_single() &&  ( $options['recommendations_bar']['show_on'] == 'all posts' || $options['recommendations_bar']['show_on'] == 'all posts and pages' ) ) )
     15        {
     16            $content .= fb_get_recommendations_bar( $options['recommendations_bar'] );
     17        }
    1318    }
    14 
     19    elseif ( 'show' == $show_indiv ) {
     20        $content .= fb_get_recommendations_bar( $options['recommendations_bar'] );
     21    }
     22    //elseif ( 'no' == $show_indiv ) {
     23    //}
     24   
    1525    return $content;
    1626}
     
    5363                                                    'help_text' => __( 'The side of the window that the plugin will display.', 'facebook' ),
    5464                                                    ),
     65                                        array('name' => 'show_on',
     66                                                    'type' => 'dropdown',
     67                                                    'default' => 'all posts and pages',
     68                                                    'options' => array('all posts' => 'all posts', 'all pages' => 'all pages', 'all posts and pages' => 'all posts and pages', 'individual posts and pages' => 'individual posts and pages' ),
     69                                                    'help_text' => __( 'Whether the plugin will appear on all posts or pages by default. If "individual posts and pages" is selected, you must explicitly set each post and page to display the plugin.', 'facebook' ),
     70                                                    )
    5571                                        );
    5672
  • facebook/trunk/social-plugins/fb-send.php

    r561366 r571850  
    1212   
    1313    if ( isset( $post ) ) {
    14         if ( isset($options['send']['show_on_homepage']) ) {
     14        if ( isset( $options['send']['show_on_homepage'] ) ) {
    1515            $options['send']['href'] = get_permalink($post->ID);
    1616        }
     
    1818        $new_content = '';
    1919   
    20         switch ($options['send']['position']) {
     20        switch ( $options['send']['position'] ) {
    2121            case 'top':
    22                 $new_content = fb_get_send_button($options['send']) . $content;
     22                $new_content = fb_get_send_button( $options['send'] ) . $content;
    2323                break;
    2424            case 'bottom':
    25                 $new_content = $content . fb_get_send_button($options['send']);
     25                $new_content = $content . fb_get_send_button( $options['send'] );
    2626                break;
    2727            case 'both':
    28                 $new_content = fb_get_send_button($options['send']) . $content;
    29                 $new_content .= fb_get_send_button($options['send']);
     28                $new_content = fb_get_send_button( $options['send'] ) . $content;
     29                $new_content .= fb_get_send_button( $options['send'] );
    3030                break;
    3131        }
    32    
    33         if ( empty( $options['send']['show_on_homepage'] ) && is_singular() ) {
     32       
     33        $show_indiv = get_post_meta( $post->ID, 'fb_social_plugin_settings_box_send', true );
     34       
     35        if ( is_home() && isset ( $options['send']['show_on_homepage'] ) ) {
    3436            $content = $new_content;
    3537        }
    36         elseif ( isset($options['send']['show_on_homepage']) ) {
     38        elseif ( ( 'default' == $show_indiv || empty( $show_indiv ) ) && isset ( $options['send']['show_on'] ) ) {     
     39            if ( is_page() && ( $options['send']['show_on'] == 'all pages' || $options['send']['show_on'] == 'all posts and pages' ) )
     40                $content = $new_content;
     41            elseif ( is_single() && ( $options['send']['show_on'] == 'all posts' || $options['send']['show_on'] == 'all posts and pages' ) )
     42                $content = $new_content;
     43        }
     44        elseif ( 'show' == $show_indiv ) {
    3745            $content = $new_content;
    3846        }
     47       
    3948    }
    4049   
     
    156165                                                    'help_text' => __( 'Where the button will display on the page or post.', 'facebook' ),
    157166                                                    );
     167        $array['children'][] = array('name' => 'show_on',
     168                                                    'type' => 'dropdown',
     169                                                    'default' => 'all posts and pages',
     170                                                    'options' => array('all posts' => 'all posts', 'all pages' => 'all pages', 'all posts and pages' => 'all posts and pages', 'individual posts and pages' => 'individual posts and pages' ),
     171                                                    'help_text' => __( 'Whether the plugin will appear on all posts or pages by default. If "individual posts and pages" is selected, you must explicitly set each post and page to display the plugin.', 'facebook' ),
     172                                                    );
    158173        $array['children'][] = array('name' => 'show_on_homepage',
    159174                                                    'type' => 'checkbox',
  • facebook/trunk/social-plugins/fb-social-plugins.php

    r561366 r571850  
    6565    return $params;
    6666}
     67
     68if ( true ) {
     69    add_action( 'add_meta_boxes', 'fb_add_social_plugin_settings_box' );
     70    add_action( 'save_post', 'fb_add_social_plugin_settings_box_save' );
     71}
     72
     73/**
     74 * Add meta box for social plugin settings for individual posts and pages
     75 *
     76 * @since 1.0.2
     77 */
     78function fb_add_social_plugin_settings_box() {
     79    global $post;
     80    $options = get_option('fb_options');
     81
     82    if ( true ) {
     83        add_meta_box(
     84                'fb_social_plugin_settings_box_id',
     85                __( 'Facebook Social Plugins', 'facebook' ),
     86                'fb_add_social_plugin_settings_box_content',
     87                'post'
     88        );
     89        add_meta_box(
     90                'fb_social_plugin_settings_box_id',
     91                __( 'Facebook Social Plugins', 'facebook' ),
     92                'fb_add_social_plugin_settings_box_content',
     93                'page'
     94        );
     95    }
     96}
     97
     98/**
     99 * Add meta boxes for a custom Status that is used when posting to an Author's Timeline
     100 *
     101 * @since 1.0.2
     102 */
     103function fb_add_social_plugin_settings_box_content( $post ) {
     104    $options = get_option('fb_options');
     105
     106    $features = array( 'like', 'subscribe', 'send', 'comments', 'recommendations_bar' );
     107    echo '<table><p>Change the settings below to show or hide particular Social Plugins. </p>';
     108    foreach ( $features as $feature ) {
     109        if ( $options[ $feature ]['enabled'] ) {
     110            $value = get_post_meta($post->ID,"fb_social_plugin_settings_box_$feature",true);
     111            echo '<tr><td>' . fb_option_name( $feature ) . "</td> <td><label><input type = \"radio\" name=\"fb_social_plugin_settings_box_$feature\" value=\"default\" "
     112                . ( $value == 'default' || empty($value) ? 'checked="checked" ' : '' ) . "/>Default (" . $options[$feature]['show_on'] . ")</label></td> <td><label><input type=\"radio\" name=\"fb_social_plugin_settings_box_$feature\" value =\"show\" "
     113                . ( $value == 'show' ? 'checked="checked" ' : '' ) . "/>Show</label></td> <td><label><input type=\"radio\" name=\"fb_social_plugin_settings_box_$feature\" value =\"hide\" "
     114                . ( $value == 'hide'  ? 'checked="checked" ' : '' ) . "/>Hide</label></td> </tr>" ;
     115        }
     116    }
     117    echo '</table><p class="howto"> If \'Default\' is selected, the Social Plugin will appear based on the global setting, set on the Facebook Settings page.  If you choose "Show" or "Hide", the Social Plugin will ignore the global setting for this ' . ( $post->post_type == 'page' ? 'page' : 'post' ) . '.</p>';
     118}
     119
     120function fb_add_social_plugin_settings_box_save( $post_id ) {
     121    $features = array( 'like', 'subscribe', 'send', 'comments', 'recommendations_bar' );
     122    foreach ( $features as $feature ) {
     123        $index = "fb_social_plugin_settings_box_$feature";
     124        if ( isset( $_POST) && isset( $_POST[$index] )) {
     125            switch ( $_POST[ $index ]) {
     126                case 'default':
     127                    update_post_meta( $post_id, $index, 'default' );
     128                    break;
     129                case 'show':
     130                    update_post_meta( $post_id, $index, 'show' );
     131                    break;
     132                case 'hide':
     133                    update_post_meta( $post_id, $index, 'hide' );
     134                    break;
     135            }
     136        }
     137    }
     138}
     139
     140
     141/*
     142 function fb_add_social_plugin_settings_box_content( $post ) {
     143    $options = get_option('fb_options');
     144
     145    $features = array( 'like', 'subscribe', 'send', 'comments', 'recommendations_bar' );
     146    echo '<table><p>Change the settings below to show or hide particular Social Plugins.</p>';
     147    foreach ( $features as $feature ) {
     148        if ( $options[$feature]['enabled'] ) {
     149            $value = get_post_meta( $post->ID, "fb_social_plugin_settings_box_$feature", true );
     150           
     151            if ( empty( $value ) ) {
     152                if ( $post->post_type == 'page' ) {
     153                    if ( $options[$feature]['show_on'] == 'all posts and pages' || $options[$feature]['show_on'] == 'all pages' ) {
     154                        $value = 'show';
     155                    }
     156                    else {
     157                        $value = 'hide';
     158                    }
     159                }
     160                else {
     161                    if ( $options[$feature]['show_on'] == 'all posts and pages' || $options[$feature]['show_on'] == 'all posts' ) {
     162                        $value = 'show';
     163                    }
     164                    else {
     165                        $value = 'hide';
     166                    }
     167                }
     168            }
     169           
     170            echo '<tr><td>' . fb_option_name( $feature ) . "</td> <td><label><input type=\"radio\" name=\"fb_social_plugin_settings_box_$feature\" value =\"show\" "
     171                . ( $value == 'show' ? 'checked="checked" ' : '' ) . "/>Show</label></td> <td><label><input type=\"radio\" name=\"fb_social_plugin_settings_box_$feature\" value =\"hide\" "
     172                . ( $value == 'hide'  ? 'checked="checked" ' : '' ) . "/>Hide</label></td> </tr>" ;
     173        }
     174    }
     175    echo '</table>';
     176}
     177
     178function fb_add_social_plugin_settings_box_save( $post_id ) {
     179    $features = array( 'like', 'subscribe', 'send', 'comments', 'recommendations_bar' );
     180    foreach ( $features as $feature ) {
     181        $index = "fb_social_plugin_settings_box_$feature";
     182        if ( isset( $_POST) && isset( $_POST[$index] )) {
     183            switch ( $_POST[$index]) {
     184                case 'show':
     185                    update_post_meta( $post_id, $index, 'show' );
     186                    break;
     187                case 'hide':
     188                    update_post_meta( $post_id, $index, 'hide' );
     189                    break;
     190            }
     191        }
     192    }
     193}
     194*/
    67195?>
  • facebook/trunk/social-plugins/fb-subscribe.php

    r561366 r571850  
    1212   
    1313    if ( isset ($post ) ) {
    14         if ( isset($options['subscribe']['show_on_homepage']) ) {
    15        
    16             $options['subscribe']['href'] = get_permalink($post->ID);
    17         }
    18        
    19         $fb_data = fb_get_user_meta(get_the_author_meta('ID'), 'fb_data', true);
    20    
    21         if (!$fb_data) {
     14        if ( isset( $options['subscribe']['show_on_homepage'] ) ) {
     15       
     16            $options['subscribe']['href'] = get_permalink( $post->ID );
     17        }
     18       
     19        $fb_data = fb_get_user_meta( get_the_author_meta( 'ID' ), 'fb_data', true );
     20   
     21        if ( ! $fb_data ) {
    2222            return $content;
    2323        }
     
    2727        $new_content = '';
    2828   
    29         if (isset($fb_data['username'])) {
    30             switch ($options['subscribe']['position']) {
     29        if ( isset( $fb_data['username'] ) ) {
     30            switch ( $options['subscribe']['position'] ) {
    3131                case 'top':
    32                     $new_content = fb_get_subscribe_button($options['subscribe']) . $content;
     32                    $new_content = fb_get_subscribe_button( $options['subscribe'] ) . $content;
    3333                    break;
    3434                case 'bottom':
    35                     $new_content = $content . fb_get_subscribe_button($options['subscribe']);
     35                    $new_content = $content . fb_get_subscribe_button( $options['subscribe'] );
    3636                    break;
    3737                case 'both':
    38                     $new_content = fb_get_subscribe_button($options['subscribe']) . $content;
    39                     $new_content .= fb_get_subscribe_button($options['subscribe']);
     38                    $new_content = fb_get_subscribe_button( $options['subscribe'] ) . $content;
     39                    $new_content .= fb_get_subscribe_button( $options['subscribe'] );
    4040                    break;
    4141            }
    4242        }
    4343   
    44         if ( empty( $options['subscribe']['show_on_homepage'] ) && is_singular() ) {
     44        $show_indiv = get_post_meta( $post->ID, 'fb_social_plugin_settings_box_subscribe', true );
     45       
     46        if ( is_home() && isset ( $options['subscribe']['show_on_homepage'] ) ) {
    4547            $content = $new_content;
    4648        }
    47         elseif ( isset($options['subscribe']['show_on_homepage']) ) {
     49        elseif ( ( 'default' == $show_indiv || empty( $show_indiv ) ) && isset ( $options['subscribe']['show_on'] ) ) {     
     50            if ( is_page() && ( $options['subscribe']['show_on'] == 'all pages' || $options['subscribe']['show_on'] == 'all posts and pages' ) )
     51                $content = $new_content;
     52            elseif ( is_single() && ( $options['subscribe']['show_on'] == 'all posts' || $options['subscribe']['show_on'] == 'all posts and pages' ) )
     53                $content = $new_content;
     54        }
     55        elseif ( 'show' == $show_indiv ) {
    4856            $content = $new_content;
    4957        }
    5058    }
    5159   
    52    
    53 
    5460    return $content;
    5561}
     
    188194                                                    'help_text' => __( 'Where the button will display on the page or post.', 'facebook' ),
    189195                                                    );
     196        $array['children'][] = array('name' => 'show_on',
     197                                                    'type' => 'dropdown',
     198                                                    'default' => 'all posts and pages',
     199                                                    'options' => array('all posts' => 'all posts', 'all pages' => 'all pages', 'all posts and pages' => 'all posts and pages', 'individual posts and pages' => 'individual posts and pages' ),
     200                                                    'help_text' => __( 'Whether the plugin will appear on all posts or pages by default. If "individual posts and pages" is selected, you must explicitly set each post and page to display the plugin.', 'facebook' ),
     201                                                    );
    190202        $array['children'][] = array('name' => 'show_on_homepage',
    191203                                                    'type' => 'checkbox',
     
    193205                                                    'help_text' => __( 'If the plugin should appear on the homepage as part of the Post previews.  If unchecked, the plugin will only display on the Post itself.', 'facebook' ),
    194206                                                    );
     207
    195208    }
    196209
  • facebook/trunk/style/style.css

    r556868 r571850  
    1212    margin-bottom: 2px;
    1313}
     14
     15@media only screen and (max-device-width: 480px) {
     16    .fb-like {
     17        float: left;
     18        width: 100%;   
     19    }
     20
     21    div#page {
     22        width: 480px;
     23    }
     24
     25    div.fb-comments span{
     26        float:left;
     27        width:100%;
     28    }
     29}
     30
Note: See TracChangeset for help on using the changeset viewer.