├── .gitattributes
├── .gitignore
├── CONTRIBUTING.md
├── admin
├── index.php
├── profile.php
├── settings-app.php
├── settings-comments.php
├── settings-debug.php
├── settings-follow-button.php
├── settings-like-button.php
├── settings-recommendations-bar.php
├── settings-send-button.php
├── settings-social-plugin-button.php
├── settings-social-plugin.php
├── settings-social-publisher.php
├── settings.php
└── social-publisher
│ ├── index.php
│ ├── mentions
│ ├── index.php
│ └── mentions-search.php
│ ├── publish-box-page.php
│ ├── publish-box-profile.php
│ └── social-publisher.php
├── extras
├── google-analytics.php
└── index.php
├── facebook-user.php
├── facebook.php
├── includes
├── facebook-php-sdk
│ ├── base_facebook.php
│ ├── class-facebook-wp.php
│ ├── facebook.php
│ ├── fb_ca_chain_bundle.crt
│ └── index.php
└── index.php
├── index.php
├── languages
├── facebook.pot
└── index.php
├── license.txt
├── open-graph-protocol.php
├── readme.txt
├── social-plugins
├── class-facebook-activity-feed.php
├── class-facebook-comments-box.php
├── class-facebook-comments.php
├── class-facebook-embedded-post.php
├── class-facebook-follow-button.php
├── class-facebook-like-box.php
├── class-facebook-like-button.php
├── class-facebook-recommendations-bar.php
├── class-facebook-recommendations-box.php
├── class-facebook-send-button.php
├── class-facebook-social-plugin.php
├── comments.php
├── index.php
├── shortcodes.php
├── social-plugins.php
└── widgets
│ ├── activity-feed.php
│ ├── follow-button.php
│ ├── index.php
│ ├── like-box.php
│ ├── like-button.php
│ ├── recommendations-box.php
│ └── send-button.php
├── static
├── css
│ ├── admin
│ │ ├── debug.css
│ │ ├── debug.min.css
│ │ ├── icons.css
│ │ ├── icons.min.css
│ │ ├── index.html
│ │ ├── mentions.css
│ │ └── mentions.min.css
│ └── index.html
├── fonts
│ ├── facebookdashicons.eot
│ ├── facebookdashicons.svg
│ ├── facebookdashicons.ttf
│ ├── facebookdashicons.woff
│ └── index.html
├── img
│ ├── create-app.png
│ └── index.html
├── index.html
└── js
│ ├── admin
│ ├── index.html
│ ├── login.js
│ ├── login.min.js
│ ├── mentions.js
│ └── mentions.min.js
│ └── extras
│ ├── analytics
│ ├── google-analytics.js
│ ├── google-analytics.min.js
│ └── index.html
│ └── index.html
└── uninstall.php
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Set default behaviour, in case users don't have core.autocrlf set.
2 | * text=auto
3 |
4 | # Explicitly declare text files we want to always be normalized and converted
5 | # to native line endings on checkout.
6 | *.css text
7 | *.html text diff=html
8 | *.js text
9 | *.php text diff=php
10 |
11 | # Denote all files that are truly binary and should not be modified.
12 | *.png binary
13 | *.jpg binary
14 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing to Facebook for WordPress
2 |
3 | If you want to help contribute code to the Facebook for WordPress plugin, we want to make it as easy as possible. Here are some guidelines to help you get on your way.
4 |
5 | ## Getting Started
6 | At a minimum, you'll need the following -
7 | * An installation of [WordPress](http://wordpress.org/)
8 | * A Facebook App ID, available through the [App Dashboard](https://developers.facebook.com/apps/)
9 | * A [GitHub account](https://github.com/signup/free)
10 | * Let us know what you want to do using Issues.
11 | * Fork the repository on GitHub
12 |
13 | ## Making your changes
14 | * Create a new branch for your feature / bug fix
15 | * Follow the [WordPress Coding Standards](http://codex.wordpress.org/WordPress_Coding_Standards)
16 | * When you're done, squash to one commit.
17 | * Reference your issue number in the commit message
18 |
19 | ## Submitting the change
20 | * Sign the Facebook [Contributor License Agreement](https://developers.facebook.com/opensource/cla). We can't accept changes without it.
21 | * Push the changes up to your fork
22 | * Submit a pull request, we'll review it as soon as we can.
23 |
24 | # Some relevant docs
25 | * [Facebook API Docs](https://developers.facebook.com/docs/reference/apis/)
26 | * The WordPress guide to [writing plugins](http://codex.wordpress.org/Writing_a_Plugin)
27 | * [Facebook for WordPress Homepage](https://developers.facebook.com/wordpress/)
28 |
29 |
--------------------------------------------------------------------------------
/admin/index.php:
--------------------------------------------------------------------------------
1 | get_data( $handle, 'data' );
52 | if ( $data )
53 | $script = $data . "\n" . $script;
54 | $wp_scripts->add_data( $handle, 'data', $script );
55 | }
56 |
57 | /**
58 | * Allow an author to disable posting to Timeline by default.
59 | *
60 | * @since 1.2
61 | *
62 | * @param WP_User $wordpress_user WordPress user object for the current profile.
63 | * @return void
64 | */
65 | public static function personal_options( $wordpress_user ) {
66 | if ( ! ( $wordpress_user && isset( $wordpress_user->ID ) ) )
67 | return;
68 |
69 | if ( ! class_exists( 'Facebook_User' ) )
70 | require_once( dirname( dirname(__FILE__) ) . '/facebook-user.php' );
71 |
72 | if ( ! Facebook_User::can_publish_to_facebook( $wordpress_user->ID, false /* do not check for the presence of publish override in this option field */ ) )
73 | return;
74 |
75 | echo '
Facebook ID, 'facebook_timeline_disabled', true ) );
77 |
78 | echo ' /> ' . esc_html( __( 'Post an article to my Facebook Timeline after it is public.', 'facebook' ) ) . ' ';
79 | }
80 |
81 | /**
82 | * Add a Facebook section to the WordPress user profile page.
83 | *
84 | * @since 1.5
85 | *
86 | * @global \Facebook_Loader $facebook_loader Access Facebook application credentials.
87 | * @param WP_User $wp_user WordPress user for the current profile page.
88 | * @return void
89 | */
90 | public static function facebook_section( $wp_user ) {
91 | global $facebook_loader;
92 |
93 | if ( ! ( $wp_user && isset( $wp_user->ID ) && method_exists( $wp_user, 'exists' ) && $wp_user->exists() && user_can( $wp_user, 'edit_posts' ) ) )
94 | return;
95 |
96 | $section = '' . esc_html( __( 'Facebook Account', 'facebook' ) ) . ' ';
97 |
98 | if ( ! class_exists( 'Facebook_User' ) )
99 | require_once( dirname( dirname(__FILE__) ) . '/facebook-user.php' );
100 | $facebook_user_data = Facebook_User::get_user_meta( $wp_user->ID, 'fb_data', true );
101 |
102 | $section .= '';
142 | echo $section;
143 | }
144 |
145 | /**
146 | * Save custom user information.
147 | *
148 | * @since 1.2
149 | *
150 | * @uses current_user_can() current user must be able to edit the passed WordPress user ID
151 | * @param int $wordpress_user_id WordPress user identifier
152 | * @return void
153 | */
154 | public static function save_data( $wordpress_user_id ) {
155 | if ( ! ( $wordpress_user_id && current_user_can( 'edit_user', $wordpress_user_id ) ) )
156 | return;
157 |
158 | // allow decoupling of a WordPress account and a Facebook account
159 | if ( isset( $_POST['facebook_remove'] ) ) {
160 | // WordPress Facebook User helper functions
161 | if ( ! class_exists( 'Facebook_User' ) )
162 | require_once( dirname( dirname(__FILE__) ) . '/facebook-user.php' );
163 |
164 | $facebook_user_id = Facebook_User::get_facebook_profile_id( $wordpress_user_id );
165 | if ( $facebook_user_id ) {
166 |
167 | // delete mapped FBID and other data
168 | Facebook_User::delete_user_meta( $wordpress_user_id, 'fb_data' );
169 |
170 | // delete post to Timeline opt-in if stored
171 | Facebook_User::delete_user_meta( $wordpress_user_id, 'facebook_timeline_disabled' );
172 |
173 | // Load WP HTTP helpers
174 | if ( ! class_exists( 'Facebook_WP_Extend' ) )
175 | require_once( dirname( dirname(__FILE__) ) . '/includes/facebook-php-sdk/class-facebook-wp.php' );
176 |
177 | // Revoke connection to app and all permissions
178 | Facebook_WP_Extend::graph_api_with_app_access_token( $facebook_user_id . '/permissions', 'DELETE' );
179 | }
180 | unset( $facebook_user_id );
181 |
182 | // no need to store any other Facebook data
183 | return;
184 | }
185 |
186 | if ( isset( $_POST['facebook_fbid'] ) && ctype_digit( $_POST['facebook_fbid'] ) ) {
187 | // WordPress Facebook User helper functions
188 | if ( ! class_exists( 'Facebook_User' ) )
189 | require_once( dirname( dirname(__FILE__) ) . '/facebook-user.php' );
190 |
191 | try {
192 | $facebook_user = Facebook_User::get_facebook_user( $_POST['facebook_fbid'], array( 'fields' => array( 'id', 'username', 'link', 'third_party_id' ) ) );
193 | if ( isset( $facebook_user['id'] ) ) {
194 | $facebook_user_data = array(
195 | 'fb_uid' => $facebook_user['id'],
196 | 'activation_time' => time()
197 | );
198 | if ( ! empty( $facebook_user['username'] ) )
199 | $facebook_user_data['username'] = $facebook_user['username'];
200 | if ( ! empty( $facebook_user['link'] ) )
201 | $facebook_user_data['link'] = $facebook_user['link'];
202 | if ( ! empty( $facebook_user['third_party_id'] ) )
203 | $facebook_user_data['third_party_id'] = $facebook_user['third_party_id'];
204 |
205 | Facebook_User::update_user_meta( $wordpress_user_id, 'fb_data', $facebook_user_data );
206 | unset( $facebook_user_data );
207 | }
208 | unset( $facebook_user );
209 | } catch(Exception $e) {}
210 | }
211 |
212 | if ( isset( $_POST[ 'facebook_timeline' ] ) && $_POST[ 'facebook_timeline' ] == '1' ) {
213 | // WordPress Facebook User helper functions
214 | if ( ! class_exists( 'Facebook_User' ) )
215 | require_once( dirname( dirname(__FILE__) ) . '/facebook-user.php' );
216 | Facebook_User::delete_user_meta( $wordpress_user_id, 'facebook_timeline_disabled' ); // delete if stored
217 | } else {
218 | // WordPress Facebook User helper functions
219 | if ( ! class_exists( 'Facebook_User' ) )
220 | require_once( dirname( dirname(__FILE__) ) . '/facebook-user.php' );
221 | Facebook_User::update_user_meta( $wordpress_user_id, 'facebook_timeline_disabled', '1' );
222 | }
223 | }
224 | }
225 | ?>
226 |
--------------------------------------------------------------------------------
/admin/settings-send-button.php:
--------------------------------------------------------------------------------
1 | existing_options = $options;
50 | else
51 | $this->existing_options = array();
52 | }
53 |
54 | /**
55 | * Reference the social plugin by name.
56 | *
57 | * @since 1.1
58 | *
59 | * @return string social plugin name
60 | */
61 | public static function social_plugin_name() {
62 | return __( 'Send Button', 'facebook' );
63 | }
64 |
65 | /**
66 | * Navigate to the settings page through the Facebook top-level menu item.
67 | *
68 | * @since 1.1
69 | *
70 | * @uses add_submenu_page()
71 | * @param string $parent_slug Facebook top-level menu item slug
72 | * @return string submenu hook suffix
73 | */
74 | public static function add_submenu_item( $parent_slug ) {
75 | $send_button_settings = new Facebook_Send_Button_Settings();
76 |
77 | $hook_suffix = add_submenu_page(
78 | $parent_slug,
79 | self::social_plugin_name(),
80 | self::social_plugin_name(),
81 | 'manage_options',
82 | self::PAGE_SLUG,
83 | array( &$send_button_settings, 'settings_page' )
84 | );
85 |
86 | if ( $hook_suffix ) {
87 | $send_button_settings->hook_suffix = $hook_suffix;
88 | register_setting( $hook_suffix, self::OPTION_NAME, array( 'Facebook_Send_Button_Settings', 'sanitize_options' ) );
89 | add_action( 'load-' . $hook_suffix, array( &$send_button_settings, 'onload' ) );
90 | }
91 |
92 | return $hook_suffix;
93 | }
94 |
95 | /**
96 | * Load stored options and scripts on settings page view.
97 | *
98 | * @since 1.1
99 | */
100 | public function onload() {
101 | $options = get_option( self::OPTION_NAME );
102 | if ( ! is_array( $options ) )
103 | $options = array();
104 | $this->existing_options = $options;
105 |
106 | $this->settings_api_init();
107 | }
108 |
109 | /**
110 | * Load the page.
111 | *
112 | * @since 1.1
113 | *
114 | * @return void
115 | */
116 | public function settings_page() {
117 | if ( ! isset( $this->hook_suffix ) )
118 | return;
119 |
120 | Facebook_Settings::settings_page_template( $this->hook_suffix, sprintf( __( '%s Settings', 'facebook' ), self::social_plugin_name() ) );
121 | }
122 |
123 | /**
124 | * Hook into the settings API.
125 | *
126 | * @since 1.1
127 | *
128 | * @uses add_settings_section()
129 | * @uses add_settings_field()
130 | * @return void
131 | */
132 | private function settings_api_init() {
133 | if ( ! isset( $this->hook_suffix ) )
134 | return;
135 |
136 | $section = 'facebook-send-button';
137 | add_settings_section(
138 | $section,
139 | '', // blank title for main page section
140 | array( &$this, 'section_header' ),
141 | $this->hook_suffix
142 | );
143 |
144 | // when, where
145 | add_settings_field(
146 | 'facebook-send-show-on',
147 | _x( 'Show on', 'Display the social plugin in specific areas of a website', 'facebook' ),
148 | array( &$this, 'display_show_on' ),
149 | $this->hook_suffix,
150 | $section
151 | );
152 | add_settings_field(
153 | 'facebook-send-position',
154 | _x( 'Position', 'Desired position of a Facebook social plugin relative to main post content.', 'facebook' ),
155 | array( &$this, 'display_position' ),
156 | $this->hook_suffix,
157 | $section,
158 | array( 'label_for' => 'facebook-send-position' )
159 | );
160 |
161 | // send button option
162 | add_settings_field(
163 | 'facebook-send-font',
164 | __( 'Font', 'facebook' ),
165 | array( &$this, 'display_font' ),
166 | $this->hook_suffix,
167 | $section,
168 | array( 'label_for' => 'facebook-send-position' )
169 | );
170 | add_settings_field(
171 | 'facebook-send-colorscheme',
172 | __( 'Color scheme', 'facebook' ),
173 | array( &$this, 'display_colorscheme' ),
174 | $this->hook_suffix,
175 | $section
176 | );
177 | }
178 |
179 | /**
180 | * Introduce publishers to the Send Button social plugin.
181 | *
182 | * @since 1.1
183 | *
184 | * @return void
185 | */
186 | public function section_header() {
187 | echo '';
188 | echo esc_html( __( 'Help site visitors send your URL in a message to any email address, a message to his or her Facebook friends, or a post to a Facebook group.', 'facebook' ) );
189 | echo ' ' . ' ' . esc_html( __( 'Read more...', 'facebook' ) ) . ' ';
190 | echo '
';
191 | }
192 |
193 | /**
194 | * Where should the button appear?
195 | *
196 | * @since 1.1
197 | *
198 | * @param array $extra_attributes custom form attributes
199 | * @return void
200 | */
201 | public function display_show_on( $extra_attributes = array() ) {
202 | $key = 'show_on';
203 |
204 | extract( self::parse_form_field_attributes(
205 | $extra_attributes,
206 | array(
207 | 'id' => 'facebook-send-show-on',
208 | 'class' => '',
209 | 'name' => self::OPTION_NAME . '[' . $key . ']'
210 | )
211 | ) );
212 |
213 | echo '' . self::show_on_choices( $name, self::get_display_conditionals_by_feature( 'send', 'all' ), 'all' ) . ' ';
217 |
218 | echo '' . esc_html( self::show_on_description( __( 'Send Button', 'facebook' ) ) ) . '
';
219 | }
220 |
221 | /**
222 | * Where would you like it?
223 | *
224 | * @since 1.1
225 | * @param array $extra_attributes custom form attributes
226 | */
227 | public function display_position( $extra_attributes = array() ) {
228 | $key = 'position';
229 |
230 | extract( self::parse_form_field_attributes(
231 | $extra_attributes,
232 | array(
233 | 'id' => 'facebook-send-' . $key,
234 | 'class' => '',
235 | 'name' => self::OPTION_NAME . '[' . $key . ']'
236 | )
237 | ) );
238 |
239 | if ( isset( $this->existing_options[$key] ) && in_array( $this->existing_options[$key], self::$position_choices, true ) )
240 | $existing_value = $this->existing_options[$key];
241 | else
242 | $existing_value = 'both';
243 |
244 | echo '' . self::position_choices( $existing_value ) . ' ';
248 | }
249 |
250 | /**
251 | * Choose a custom font.
252 | *
253 | * @since 1.1
254 | *
255 | * @param array $extra_attributes custom form attributes
256 | * @return void
257 | */
258 | public function display_font( $extra_attributes = array() ) {
259 | $key = 'font';
260 |
261 | extract( self::parse_form_field_attributes(
262 | $extra_attributes,
263 | array(
264 | 'id' => 'facebook-send-' . $key,
265 | 'class' => '',
266 | 'name' => self::OPTION_NAME . '[' . $key . ']'
267 | )
268 | ) );
269 |
270 | echo '' . self::font_choices( isset( $this->existing_options[$key] ) ? $this->existing_options[$key] : '' ) . ' ';
274 | }
275 |
276 | /**
277 | * Customize the color scheme.
278 | *
279 | * @since 1.1
280 | *
281 | * @param array $extra_attributes custom form attributes
282 | * @return void
283 | */
284 | public function display_colorscheme( $extra_attributes = array() ) {
285 | $key = 'colorscheme';
286 |
287 | extract( self::parse_form_field_attributes(
288 | $extra_attributes,
289 | array(
290 | 'id' => 'facebook-send-' . $key,
291 | 'class' => '',
292 | 'name' => self::OPTION_NAME . '[' . $key . ']'
293 | )
294 | ) );
295 |
296 | echo '' . self::color_scheme_choices( $name, isset( $this->existing_options[$key] ) ? $this->existing_options[$key] : '' ) . ' ';
300 | }
301 |
302 | /**
303 | * Sanitize Send Button settings before they are saved to the database
304 | *
305 | * @since 1.1
306 | *
307 | * @param array $options Send Button options
308 | * @return array clean option sets. note: we remove Send Button social plugin default options, storing only custom settings (e.g. dark color scheme stored, light is default and therefore not stored)
309 | */
310 | public static function sanitize_options( $options ) {
311 | if ( ! is_array( $options ) || empty( $options ) )
312 | return array();
313 |
314 | if ( ! class_exists( 'Facebook_Send_Button' ) )
315 | require_once( dirname( dirname(__FILE__) ) . '/social-plugins/class-facebook-send-button.php' );
316 |
317 | // Handle display preferences first
318 | $clean_options = parent::sanitize_options( $options );
319 | if ( isset( $clean_options['show_on'] ) ) {
320 | self::update_display_conditionals( 'send', $clean_options['show_on'], self::get_show_on_choices( 'all' ) );
321 | unset( $clean_options['show_on'] );
322 | }
323 | unset( $options['show_on'] );
324 |
325 | $send_button = Facebook_Send_Button::fromArray( $options );
326 | $send_button_options = $send_button->toHTMLDataArray();
327 | if ( ! empty( $send_button_options ) )
328 | return array_merge( $clean_options, $send_button_options );
329 |
330 | return $clean_options;
331 | }
332 | }
333 |
334 | ?>
335 |
--------------------------------------------------------------------------------
/admin/settings-social-plugin-button.php:
--------------------------------------------------------------------------------
1 | s
28 | */
29 | public static function position_choices( $existing_value = 'both' ) {
30 | if ( ! ( is_string( $existing_value) && $existing_value && in_array( $existing_value, self::$position_choices ) ) )
31 | $existing_value = 'both';
32 |
33 | $descriptions = array(
34 | 'both' => __( 'before & after the post', 'facebook' ),
35 | 'bottom' => __( 'after the post', 'facebook' ),
36 | 'top' => __( 'before the post', 'facebook' )
37 | );
38 |
39 | $options = '';
40 | foreach( self::$position_choices as $position ) {
41 | $options .= '';
42 | if ( isset( $descriptions[$position] ) )
43 | $options .= esc_html( $descriptions[$position] );
44 | else
45 | $options .= $position;
46 | $options .= ' ';
47 | }
48 |
49 | return $options;
50 | }
51 |
52 | /**
53 | * Sanitize social plugin button common settings before they are saved to the database
54 | *
55 | * @since 1.1
56 | *
57 | * @uses Facebook_Social_Plugin_Settings::sanitize_options()
58 | * @param array $options social plugin button options
59 | * @return array clean option set
60 | */
61 | public static function sanitize_options( $options ) {
62 | $clean_options = parent::sanitize_options( $options );
63 |
64 | if ( isset( $options['position'] ) && in_array( $options['position'], self::$position_choices, true ) )
65 | $clean_options['position'] = $options['position'];
66 | else
67 | $clean_options['position'] = 'both';
68 |
69 | return $clean_options;
70 | }
71 | }
72 |
73 | ?>
--------------------------------------------------------------------------------
/admin/settings-social-plugin.php:
--------------------------------------------------------------------------------
1 | 'background-color:#ECEEF5;color:#3B5998', 'dark' => 'background-color:#C7C7C7;color:#333' );
26 |
27 | /**
28 | * Returns all public post types for the current site
29 | *
30 | * @since 1.1
31 | * @param string $scope 'all' to include home and archive conditionals
32 | * @return array flat array of post type identifiers
33 | */
34 | public static function get_show_on_choices( $scope = 'posts' ) {
35 | $public_post_types = get_post_types( array( 'public' => true ) );
36 | if ( $scope === 'all' )
37 | return array_merge( array( 'home', 'archive' ), $public_post_types );
38 | else
39 | return $public_post_types;
40 | }
41 |
42 | /**
43 | * Checkboxes allowing a site publisher to which pages should display a social plugin
44 | *
45 | * @since 1.1
46 | * @param string $name HTML name attribute
47 | * @param array $existing_value stored preference
48 | * @param string $scope 'all' to include home and archive conditionals
49 | * @return string labeled checkboxes
50 | */
51 | public static function show_on_choices( $name, $existing_value = '', $scope = 'posts' ) {
52 | if ( ! ( is_string( $name ) && $name ) )
53 | return '';
54 |
55 | $choices = self::get_show_on_choices( $scope );
56 | if ( ! is_array( $existing_value ) )
57 | $existing_value = $choices;
58 |
59 | $fields = array();
60 | foreach( $choices as $type ) {
61 | $field = ' ';
64 |
65 | $fields[] = $field;
66 | unset( $field );
67 | }
68 |
69 | return implode( ' ', $fields );
70 | }
71 |
72 | /**
73 | * Describe the show_on setting
74 | *
75 | * @since 1.1
76 | * @param string $social_plugin_name translated name of the social plugin
77 | * @return string description text
78 | */
79 | public static function show_on_description( $social_plugin_name ) {
80 | if ( ! ( is_string( $social_plugin_name ) && $social_plugin_name ) )
81 | return '';
82 |
83 | return sprintf( __( 'Choose where the %s will appear including your site homepage, archive pages, or individual public post types.', 'facebook' ), $social_plugin_name );
84 | }
85 |
86 | /**
87 | * List of font choices as a HTML option list
88 | *
89 | * @since 1.1
90 | * @param string $existing_value existing font preference
91 | * @return string HTML s suitable for use as children of a select
92 | */
93 | public static function font_choices( $existing_value = '' ) {
94 | if ( ! class_exists( 'Facebook_Social_Plugin' ) )
95 | require_once( dirname( dirname(__FILE__) ) . '/social-plugins/class-facebook-social-plugin.php' );
96 |
97 | if ( ! ( is_string( $existing_value ) && isset( Facebook_Social_Plugin::$font_choices[$existing_value] ) ) )
98 | $existing_value = '';
99 |
100 | $choices = array_keys( Facebook_Social_Plugin::$font_choices );
101 | $options = ' ';
102 | foreach( $choices as $font ) {
103 | $options .= '' . $font . ' ';
104 | }
105 |
106 | return $options;
107 | }
108 |
109 | /**
110 | * Choose a color scheme from a set of checkboxes
111 | *
112 | * @param string $name HTML input attribute name
113 | * @param string $existing_value stored value, if one exists
114 | * @return string one or more input type=checkbox HTML elements; empty string possible if passed parameters in error
115 | */
116 | public static function color_scheme_choices( $name, $existing_value = 'light' ) {
117 | if ( ! ( is_string( $name ) && $name ) )
118 | return '';
119 |
120 | if ( ! class_exists( 'Facebook_Social_Plugin' ) )
121 | require_once( dirname( dirname(__FILE__) ) . '/social-plugins/class-facebook-social-plugin.php' );
122 |
123 | if ( ! ( is_string( $existing_value ) && $existing_value && isset( Facebook_Social_Plugin::$colorscheme_choices[$existing_value] ) ) )
124 | $existing_value = 'light';
125 |
126 | $choices = array_keys( Facebook_Social_Plugin::$colorscheme_choices );
127 | $checkboxes = '';
128 | foreach( $choices as $color_scheme ) {
129 | $checkboxes .= ' ';
135 | $checkboxes .= ' ' . esc_html( __( $color_scheme, 'facebook' ) ) . ' ';
136 | }
137 | return rtrim( $checkboxes );
138 | }
139 |
140 | /**
141 | * Clean up custom form field attributes (fieldset, input, select) before use.
142 | * Used by widget builders. Could be used by other plugins building on top of plugin
143 | *
144 | * @since 1.1
145 | * @param array $attributes attributes that may possibly map to a HTML attribute we would like to use
146 | * @param array $default_values fallback values
147 | * @return array sanitized values unique to each field
148 | */
149 | public static function parse_form_field_attributes( $attributes, $default_values ) {
150 | $attributes = wp_parse_args( (array) $attributes, $default_values );
151 |
152 | if ( ! empty( $attributes['id'] ) )
153 | $attributes['id'] = sanitize_html_class( $attributes['id'] );
154 | if ( ! empty( $attributes['class'] ) ) {
155 | $classes = explode( ' ', $attributes['class'] );
156 | array_walk( $classes, 'sanitize_html_class' );
157 | $attributes['class'] = implode( ' ', $classes );
158 | }
159 |
160 | return $attributes;
161 | }
162 |
163 | /**
164 | * Sanitize social plugin common settings before they are saved to the database
165 | *
166 | * @since 1.1
167 | * @param array $options social plugin options
168 | * @return array clean option set
169 | */
170 | public static function sanitize_options( $options ) {
171 | $clean_options = array( 'show_on' => array() );
172 |
173 | if ( isset( $options['show_on'] ) ) {
174 | if ( is_array( $options['show_on'] ) )
175 | $clean_options['show_on'] = array_unique( $options['show_on'] ); // SORT_STRING default after PHP 5.2.10. WordPress min requirement is 5.2.4
176 | else if ( is_string( $options['show_on'] ) )
177 | $clean_options['show_on'] = array( $options['show_on'] );
178 | }
179 |
180 | return $clean_options;
181 | }
182 |
183 | /**
184 | * Build a list of places the publisher would like to display a given feature
185 | *
186 | * @since 1.1
187 | * @param string $feature_slug unique identifier for the feature. e.g. 'like'
188 | * @param string $scope specify 'all' to include archive listings and home
189 | * @return array matched display conditionals
190 | */
191 | public static function get_display_conditionals_by_feature( $feature_slug, $scope = 'posts' ) {
192 | $all_possible_display_types = self::get_show_on_choices( $scope );
193 | $show_on = array();
194 |
195 | // iterate through all display types, looking for our feature in each
196 | foreach ( $all_possible_display_types as $display_type ) {
197 | $display_preferences = get_option( "facebook_{$display_type}_features" );
198 | if ( ! is_array( $display_preferences ) )
199 | continue;
200 | if ( isset( $display_preferences[$feature_slug] ) )
201 | $show_on[$display_type] = true;
202 | unset( $display_preferences );
203 | }
204 |
205 | return $show_on;
206 | }
207 |
208 | /**
209 | * Update the options we use to determine what to load based on the incoming request
210 | *
211 | * @since 1.1
212 | * @param string $feature_slug unique identifier for the feature. e.g. 'like'
213 | * @param array $show_on publisher preferences for display conditional triggers
214 | * @param array $all_possible_values all possible conditional triggers we match agaisnt
215 | */
216 | public static function update_display_conditionals( $feature_slug, $show_on, $all_possible_values ) {
217 | if ( ! $feature_slug || ! is_array( $all_possible_values ) || empty( $all_possible_values ) )
218 | return;
219 | if ( ! is_array( $show_on ) )
220 | $show_on = array();
221 |
222 | foreach( $all_possible_values as $display_type ) {
223 | $option_name = "facebook_{$display_type}_features";
224 | // avoid DB writes if possible
225 | $update = false;
226 |
227 | $display_preferences = get_option( $option_name );
228 | if ( ! is_array( $display_preferences ) ) {
229 | $display_preferences = array();
230 | $update = true;
231 | }
232 |
233 | if ( in_array( $display_type, $show_on, true ) ) {
234 | if ( ! isset( $display_preferences[$feature_slug] ) ) {
235 | $display_preferences[$feature_slug] = true;
236 | $update = true;
237 | }
238 | } else if ( isset( $display_preferences[$feature_slug] ) ) {
239 | // remove if present
240 | unset( $display_preferences[$feature_slug] );
241 | $update = true;
242 | }
243 |
244 | if ( $update )
245 | update_option( $option_name, $display_preferences );
246 |
247 | unset( $update );
248 | unset( $option_name );
249 | unset( $display_preferences );
250 | }
251 | }
252 | }
253 |
254 | ?>
--------------------------------------------------------------------------------
/admin/social-publisher/index.php:
--------------------------------------------------------------------------------
1 | 'please use HTTP GET' ) );
50 | exit;
51 | }
52 |
53 | if ( ! current_user_can( 'edit_posts' ) || empty( $_GET['autocompleteNonce'] ) || ! wp_verify_nonce( $_GET['autocompleteNonce'], 'facebook_autocomplete_nonce' ) ) {
54 | status_header( 403 );
55 | // use WordPress standard rejection message
56 | echo json_encode( array( 'error' => __( 'Cheatin\' uh?' ) ) );
57 | exit;
58 | }
59 |
60 | if ( ! ( isset( $facebook_loader ) && $facebook_loader->app_access_token_exists() ) ) {
61 | status_header( 403 );
62 | echo json_encode( array( 'error' => __( 'Facebook credentials not properly configured on the server', 'facebook' ) ) );
63 | exit;
64 | }
65 |
66 | if ( ! ( isset( $_GET ) && ! empty( $_GET['q'] ) && $search_term = sanitize_text_field( trim( $_GET['q'] ) ) ) ) {
67 | status_header( 400 );
68 | echo json_encode( array( 'error' => __( 'search term required', 'facebook' ) ) );
69 | exit;
70 | }
71 |
72 | $results = self::search_friends( $search_term, self::MAX_RESULTS / 2 );
73 | $results = array_merge( $results, self::search_pages( $search_term, self::MAX_RESULTS - count($results) ) );
74 | if ( empty( $results ) ) {
75 | status_header( 404 );
76 | echo json_encode( array( 'error' => __( 'No results' ) ) );
77 | } else {
78 | echo json_encode( $results );
79 | }
80 | exit;
81 | }
82 |
83 | /**
84 | * Search Facebook friends with names matching a given string up to a maximum number of results
85 | *
86 | * @since 1.2
87 | *
88 | * @param string $search_term search string
89 | * @param int $limit maximum number of results
90 | * @return array {
91 | * friend results
92 | *
93 | * @type string 'object_type' user. Differentiate between User and Page results combined in one search.
94 | * @type string 'id' Facebook User identifier.
95 | * @type string 'name' Facebook User name.
96 | * @type string 'picture' Facebook User picture URL.
97 | * }
98 | */
99 | public static function search_friends( $search_term, $limit = 4 ) {
100 | if ( ! class_exists( 'Facebook_User' ) )
101 | require_once( dirname( dirname( dirname( dirname(__FILE__) ) ) ) . '/facebook-user.php' );
102 |
103 | $facebook_user_id = Facebook_User::get_facebook_profile_id( get_current_user_id() );
104 | if ( ! $facebook_user_id )
105 | return array();
106 |
107 | // cached list of all friends
108 | $cache_key = 'facebook_13_friends_' . $facebook_user_id;
109 | $friends = get_transient( $cache_key );
110 | if ( $friends === false ) {
111 | if ( ! class_exists( 'Facebook_WP_Extend' ) )
112 | require_once( dirname( dirname( dirname( dirname(__FILE__) ) ) ) . '/includes/facebook-php-sdk/class-facebook-wp.php' );
113 |
114 | try {
115 | $friends = Facebook_WP_Extend::graph_api_with_app_access_token( $facebook_user_id . '/friends', 'GET', array( 'fields' => 'id,name,picture', 'ref' => 'fbwpp' ) );
116 | } catch ( WP_FacebookApiException $e ) {
117 | return array();
118 | }
119 |
120 | if ( isset( $friends['data'] ) && is_array( $friends['data'] ) ) {
121 | $friends = $friends['data'];
122 | $clean_friends = array();
123 | foreach ( $friends as $friend ) {
124 | // FBID and name required
125 | if ( ! ( isset( $friend['name'] ) && $friend['name'] && isset( $friend['id'] ) && $friend['id'] ) )
126 | continue;
127 |
128 | $clean_friend = array( 'id' => $friend['id'], 'name' => $friend['name'], 'name_lower' => strtolower( $friend['name'] ) );
129 | if ( isset( $friend['picture']['data']['url'] ) )
130 | $clean_friend['picture'] = $friend['picture']['data']['url'];
131 | $clean_friends[] = $clean_friend;
132 | unset( $clean_friend );
133 | }
134 | $friends = $clean_friends;
135 | unset( $clean_friends );
136 | } else {
137 | $friends = array();
138 | }
139 | set_transient( $cache_key, $friends, 60*15 ); // cache friends list for 15 minutes
140 | }
141 |
142 | // no friends to match against
143 | if ( empty( $friends ) )
144 | return array();
145 |
146 | $search_term = strtolower( $search_term );
147 | // nothing to search against
148 | if ( ! $search_term )
149 | return array();
150 |
151 | $matched_friends = array();
152 | $matched_count = 0;
153 | foreach( $friends as $friend ) {
154 | if ( $matched_count === $limit )
155 | break;
156 |
157 | // does the search term appear in the name?
158 | if ( strpos( $friend['name_lower'], $search_term ) !== false ) {
159 | $friend['object_type'] = 'user';
160 | unset( $friend['name_lower'] );
161 | $matched_friends[] = $friend;
162 | $matched_count++;
163 | }
164 | }
165 |
166 | return $matched_friends;
167 | }
168 |
169 | /**
170 | * Search for Facebook pages matching a given string up to maximum number of results
171 | *
172 | * @since 1.2
173 | *
174 | * @param string $search_term search string
175 | * @param int $limit maximum number of results
176 | * @return array {
177 | * friend results
178 | *
179 | * @type string 'object_type' page. Differentiate between Page and User objects in the same search results set
180 | * @type string 'id' Facebook Page id.
181 | * @type string 'name' Facebook Page name.
182 | * @type string 'image' Facebook Page image URL
183 | * @type int 'likes' Number of Likes received by the Page.
184 | * @type int 'talking_about_count' Number of Facebook Users talking about the Page.
185 | * @type string 'category' Page category.
186 | * @type string 'location' Page location (if a physical place).
187 | * }
188 | */
189 | public static function search_pages( $search_term, $limit = 4 ) {
190 | global $facebook_loader;
191 |
192 | $cache_key = 'facebook_12_pages_' . $search_term;
193 |
194 | $matched_pages = get_transient( $cache_key );
195 | if ( $matched_pages === false ) {
196 | if ( ! class_exists( 'Facebook_WP_Extend' ) )
197 | require_once( dirname( dirname( dirname( dirname(__FILE__) ) ) ) . '/includes/facebook-php-sdk/class-facebook-wp.php' );
198 |
199 | $params = array( 'type' => 'page', 'fields' => 'id,name,is_published,picture,category,location,likes,talking_about_count', 'limit' => $limit, 'q' => $search_term, 'ref' => 'fbwpp' );
200 | if ( isset( $facebook_loader ) && isset( $facebook_loader->locale ) )
201 | $params['locale'] = $facebook_loader->locale;
202 |
203 | try {
204 | $pages = Facebook_WP_Extend::graph_api_with_app_access_token( 'search', 'GET', $params );
205 | } catch (WP_FacebookApiException $e) {
206 | return array();
207 | }
208 | unset( $params );
209 |
210 | if ( ! ( isset( $pages['data'] ) && is_array( $pages['data'] ) ) )
211 | return array();
212 |
213 | $pages = $pages['data'];
214 |
215 | $matched_pages = array();
216 | $matched_count = 0;
217 |
218 | // cleanup the picture response
219 | foreach ( $pages as $page ) {
220 | if ( $matched_count === $limit )
221 | break;
222 |
223 | if ( ! ( isset( $page['id'] ) && isset( $page['name'] ) && isset( $page['is_published'] ) ) )
224 | continue;
225 | if ( ! $page['is_published'] )
226 | continue;
227 |
228 | if ( isset( $page['picture'] ) ) {
229 | if ( isset( $page['picture']['data']['url'] ) && ( ! isset( $page['picture']['data']['is_silhouette'] ) || $page['picture']['data']['is_silhouette'] === false ) ) {
230 | $picture = esc_url_raw( $page['picture']['data']['url'], array( 'http', 'https' ) );
231 | if ( $picture )
232 | $page['image'] = $picture;
233 | unset( $picture );
234 | }
235 | unset( $page['picture'] );
236 | }
237 |
238 | $clean_page = array(
239 | 'object_type' => 'page',
240 | 'id' => $page['id'],
241 | 'name' => $page['name']
242 | );
243 | if ( isset( $page['image'] ) )
244 | $clean_page['image'] = $page['image'];
245 | if ( isset( $page['likes'] ) )
246 | $clean_page['likes'] = absint( $page['likes'] );
247 | if ( isset( $page['talking_about_count'] ) )
248 | $clean_page['talking_about'] = absint( $page['talking_about_count'] );
249 | if ( isset( $page['category'] ) )
250 | $clean_page['category'] = $page['category'];
251 | if ( isset( $page['location'] ) )
252 | $clean_page['location'] = $page['location'];
253 | $matched_pages[] = $clean_page;
254 | $matched_count++;
255 | unset( $clean_page );
256 | }
257 | set_transient( $cache_key, $matched_pages, 60*60 );
258 | }
259 |
260 | return $matched_pages;
261 | }
262 | }
263 |
264 | ?>
265 |
--------------------------------------------------------------------------------
/admin/social-publisher/publish-box-page.php:
--------------------------------------------------------------------------------
1 | ID, self::POST_META_KEY_FEATURE_ENABLED, true ) === '0' )
91 | $feature_enabled = false;
92 | echo '';
95 |
96 | $stored_message = get_post_meta( $post->ID, self::POST_META_KEY, true );
97 | echo '' . esc_html( sprintf( __( 'This message will show as part of the story on the %s Timeline.', 'facebook'), $page['name'] ) ) . '
';
101 | }
102 |
103 | /**
104 | * Save the custom Status, used when posting to an Fan Page's Timeline.
105 | *
106 | * @since 1.0
107 | *
108 | * @param int $post_id WordPress post identifier
109 | * @return void
110 | */
111 | public static function save( $post_id ) {
112 | // verify if this is an auto save routine.
113 | // If it is our form has not been submitted, so we dont want to do anything
114 | if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
115 | return;
116 |
117 | // verify this came from the our screen and with proper authorization,
118 | // because save_post can be triggered at other times
119 |
120 | if ( ! isset( $_POST[self::FIELD_MESSAGE] ) || empty( $_POST[self::NONCE_NAME] ) || ! wp_verify_nonce( $_POST[self::NONCE_NAME], plugin_basename( __FILE__ ) ) )
121 | return;
122 |
123 | // Check permissions
124 | $post_type = get_post_type( $post_id );
125 | if ( ! $post_type )
126 | return;
127 |
128 | if ( ! class_exists( 'Facebook_Social_Publisher' ) )
129 | require_once( dirname(__FILE__) . '/social_publisher.php' );
130 | $capability_singular_base = Facebook_Social_Publisher::post_type_capability_base( $post_type );
131 |
132 | if ( ! current_user_can( 'edit_' . $capability_singular_base, $post_id ) )
133 | return;
134 |
135 | $feature_enabled = '1';
136 | if ( ! isset( $_POST[self::FIELD_FEATURE_ENABLED] ) || $_POST[self::FIELD_FEATURE_ENABLED] === '0' )
137 | $feature_enabled = '0';
138 |
139 | update_post_meta( $post_id, self::POST_META_KEY_FEATURE_ENABLED, $feature_enabled );
140 | unset( $feature_enabled );
141 |
142 | $message = trim( sanitize_text_field( $_POST[self::FIELD_MESSAGE] ) );
143 | if ( $message )
144 | update_post_meta( $post_id, self::POST_META_KEY, $message );
145 | }
146 | }
147 |
148 | ?>
149 |
--------------------------------------------------------------------------------
/admin/social-publisher/publish-box-profile.php:
--------------------------------------------------------------------------------
1 | plugin_directory . 'facebook.php' ), array( 'jquery-ui-autocomplete' ), '1.3', true );
97 | wp_enqueue_style( 'facebook-mentions', plugins_url( 'static/css/admin/mentions' . $suffix . '.css', $facebook_loader->plugin_directory . 'facebook.php' ), array(), '1.3' );
98 | }
99 |
100 | /**
101 | * Add content to the profile publisher meta box
102 | *
103 | * @since 1.0
104 | *
105 | * @global WP_Locale $wp_locale display Like counts in the number format of the current locale
106 | * @param stdClass $post current post
107 | * @return void
108 | */
109 | public static function content( $post ) {
110 | global $wp_locale;
111 |
112 | if ( ! isset( $post->ID ) )
113 | return;
114 |
115 | // Use nonce for verification
116 | wp_nonce_field( plugin_basename( __FILE__ ), self::NONCE_NAME );
117 |
118 | $feature_enabled = true;
119 | if ( get_post_meta( $post->ID, self::POST_META_KEY_FEATURE_ENABLED, true ) === '0' )
120 | $feature_enabled = false;
121 | echo '';
124 |
125 | $field_message_id = 'facebook-timeline-mention-message';
126 | echo 'ID, self::POST_META_KEY_MESSAGE, true );
128 | if ( $stored_message )
129 | echo ' value="' . esc_attr( $stored_message ) . '"';
130 |
131 | echo ' />
'. esc_html( __( 'This message will show as part of the story on your Facebook Timeline.', 'facebook' ) ) .'
';
132 |
133 | if ( ! class_exists( 'Facebook_Social_Publisher_Settings' ) )
134 | require_once( dirname( dirname( __FILE__ ) ) . '/settings-social-publisher.php' );
135 | if ( get_option( Facebook_Social_Publisher_Settings::OPTION_OG_ACTION ) ) {
136 | // set JavaScript properties for localized text
137 | echo '';
145 | }
146 | echo '
';
147 | }
148 |
149 | /**
150 | * Save the custom Status, used when posting to a User's Timeline.
151 | *
152 | * @since 1.0
153 | *
154 | * @param int $post_id WordPress post identifier
155 | * @global void
156 | */
157 | public static function save( $post_id ) {
158 | // verify if this is an auto save routine.
159 | // If it is our form has not been submitted, so we dont want to do anything
160 | if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
161 | return;
162 |
163 | // verify this came from the our screen and with proper authorization,
164 | // because save_post can be triggered at other times
165 |
166 | if ( ! isset( $_POST[self::FIELD_MESSAGE] ) || empty( $_POST[self::NONCE_NAME] ) || ! wp_verify_nonce( $_POST[self::NONCE_NAME], plugin_basename( __FILE__ ) ) )
167 | return;
168 |
169 | // Check permissions
170 | $post_type = get_post_type( $post_id );
171 | if ( ! ( $post_type && post_type_supports( $post_type, 'author' ) ) )
172 | return;
173 |
174 | if ( ! class_exists( 'Facebook_Social_Publisher' ) )
175 | require_once( dirname(__FILE__) . '/social_publisher.php' );
176 | $capability_singular_base = Facebook_Social_Publisher::post_type_capability_base( $post_type );
177 |
178 | if ( ! current_user_can( 'edit_' . $capability_singular_base, $post_id ) )
179 | return;
180 |
181 | $feature_enabled = '1';
182 | if ( ! isset( $_POST[self::FIELD_FEATURE_ENABLED] ) || $_POST[self::FIELD_FEATURE_ENABLED] === '0' )
183 | $feature_enabled = '0';
184 |
185 | update_post_meta( $post_id, self::POST_META_KEY_FEATURE_ENABLED, $feature_enabled );
186 | unset( $feature_enabled );
187 |
188 | $message = trim( sanitize_text_field( $_POST[self::FIELD_MESSAGE] ) );
189 | if ( $message )
190 | update_post_meta( $post_id, self::POST_META_KEY_MESSAGE, $message );
191 | }
192 | }
193 |
194 | ?>
--------------------------------------------------------------------------------
/extras/google-analytics.php:
--------------------------------------------------------------------------------
1 | query( self::SCRIPT_HANDLE, 'done' ) )
98 | echo '';
99 | }
100 | }
101 | ?>
102 |
--------------------------------------------------------------------------------
/extras/index.php:
--------------------------------------------------------------------------------
1 | initSharedSession();
63 | }
64 | }
65 |
66 | /**
67 | * Supported keys for persistent data
68 | *
69 | * @var array
70 | */
71 | protected static $kSupportedKeys =
72 | array('state', 'code', 'access_token', 'user_id');
73 |
74 | /**
75 | * Initiates Shared Session
76 | */
77 | protected function initSharedSession() {
78 | $cookie_name = $this->getSharedSessionCookieName();
79 | if (isset($_COOKIE[$cookie_name])) {
80 | $data = $this->parseSignedRequest($_COOKIE[$cookie_name]);
81 | if ($data && !empty($data['domain']) &&
82 | self::isAllowedDomain($this->getHttpHost(), $data['domain'])) {
83 | // good case
84 | $this->sharedSessionID = $data['id'];
85 | return;
86 | }
87 | // ignoring potentially unreachable data
88 | }
89 | // evil/corrupt/missing case
90 | $base_domain = $this->getBaseDomain();
91 | $this->sharedSessionID = md5(uniqid(mt_rand(), true));
92 | $cookie_value = $this->makeSignedRequest(
93 | array(
94 | 'domain' => $base_domain,
95 | 'id' => $this->sharedSessionID,
96 | )
97 | );
98 | $_COOKIE[$cookie_name] = $cookie_value;
99 | if (!headers_sent()) {
100 | $expire = time() + self::FBSS_COOKIE_EXPIRE;
101 | setcookie($cookie_name, $cookie_value, $expire, '/', '.'.$base_domain);
102 | } else {
103 | // @codeCoverageIgnoreStart
104 | self::errorLog(
105 | 'Shared session ID cookie could not be set! You must ensure you '.
106 | 'create the Facebook instance before headers have been sent. This '.
107 | 'will cause authentication issues after the first request.'
108 | );
109 | // @codeCoverageIgnoreEnd
110 | }
111 | }
112 |
113 | /**
114 | * Provides the implementations of the inherited abstract
115 | * methods. The implementation uses PHP sessions to maintain
116 | * a store for authorization codes, user ids, CSRF states, and
117 | * access tokens.
118 | */
119 |
120 | /**
121 | * {@inheritdoc}
122 | *
123 | * @see WP_BaseFacebook::setPersistentData()
124 | */
125 | protected function setPersistentData($key, $value) {
126 | if (!in_array($key, self::$kSupportedKeys)) {
127 | self::errorLog('Unsupported key passed to setPersistentData.');
128 | return;
129 | }
130 |
131 | $session_var_name = $this->constructSessionVariableName($key);
132 | $_SESSION[$session_var_name] = $value;
133 | }
134 |
135 | /**
136 | * {@inheritdoc}
137 | *
138 | * @see WP_BaseFacebook::getPersistentData()
139 | */
140 | protected function getPersistentData($key, $default = false) {
141 | if (!in_array($key, self::$kSupportedKeys)) {
142 | self::errorLog('Unsupported key passed to getPersistentData.');
143 | return $default;
144 | }
145 |
146 | $session_var_name = $this->constructSessionVariableName($key);
147 | return isset($_SESSION[$session_var_name]) ?
148 | $_SESSION[$session_var_name] : $default;
149 | }
150 |
151 | /**
152 | * {@inheritdoc}
153 | *
154 | * @see WP_BaseFacebook::clearPersistentData()
155 | */
156 | protected function clearPersistentData($key) {
157 | if (!in_array($key, self::$kSupportedKeys)) {
158 | self::errorLog('Unsupported key passed to clearPersistentData.');
159 | return;
160 | }
161 |
162 | $session_var_name = $this->constructSessionVariableName($key);
163 | if (isset($_SESSION[$session_var_name])) {
164 | unset($_SESSION[$session_var_name]);
165 | }
166 | }
167 |
168 | /**
169 | * {@inheritdoc}
170 | *
171 | * @see WP_BaseFacebook::clearAllPersistentData()
172 | */
173 | protected function clearAllPersistentData() {
174 | foreach (self::$kSupportedKeys as $key) {
175 | $this->clearPersistentData($key);
176 | }
177 | if ($this->sharedSessionID) {
178 | $this->deleteSharedSessionCookie();
179 | }
180 | }
181 |
182 | /**
183 | * Deletes Shared session cookie
184 | */
185 | protected function deleteSharedSessionCookie() {
186 | $cookie_name = $this->getSharedSessionCookieName();
187 | unset($_COOKIE[$cookie_name]);
188 | $base_domain = $this->getBaseDomain();
189 | setcookie($cookie_name, '', 1, '/', '.'.$base_domain);
190 | }
191 |
192 | /**
193 | * Returns the Shared session cookie name
194 | *
195 | * @return string The Shared session cookie name
196 | */
197 | protected function getSharedSessionCookieName() {
198 | return self::FBSS_COOKIE_NAME . '_' . $this->getAppId();
199 | }
200 |
201 | /**
202 | * Constructs and returns the name of the session key.
203 | *
204 | * @see setPersistentData()
205 | * @param string $key The key for which the session variable name to construct.
206 | *
207 | * @return string The name of the session key.
208 | */
209 | protected function constructSessionVariableName($key) {
210 | $parts = array('fb', $this->getAppId(), $key);
211 | if ($this->sharedSessionID) {
212 | array_unshift($parts, $this->sharedSessionID);
213 | }
214 | return implode('_', $parts);
215 | }
216 | }
217 | endif;
218 |
--------------------------------------------------------------------------------
/includes/facebook-php-sdk/index.php:
--------------------------------------------------------------------------------
1 | recommendations = true;
63 | return $this;
64 | }
65 |
66 | /**
67 | * Filter which URLs are shown in the plugin by including a directory path.
68 | *
69 | * Facebook will parse up to two directories deep: e.g. /section1/section2
70 | * Does not apply to recommendations
71 | *
72 | * @since 1.1
73 | *
74 | * @var string $path URL path in current site
75 | * @return Facebook_Activity_Feed support chaining
76 | */
77 | public function setFilter( $path ) {
78 | if ( is_string( $path ) ) {
79 | $path = parse_url( $path, PHP_URL_PATH );
80 | if ( $path )
81 | $this->filter = $path;
82 | }
83 | return $this;
84 | }
85 |
86 | /**
87 | * Convert the class to data-* attribute friendly associative array.
88 | *
89 | * will become data-key="value"
90 | * Exclude values if default
91 | *
92 | * @return array associative array
93 | */
94 | public function toHTMLDataArray() {
95 | $data = parent::toHTMLDataArray();
96 |
97 | if ( isset( $this->recommendations ) && $this->recommendations === true )
98 | $data['recommendations'] = 'true';
99 |
100 | if ( isset( $this->filter ) )
101 | $data['filter'] = $this->filter;
102 |
103 | return $data;
104 | }
105 |
106 | /**
107 | * convert an options array into an object.
108 | *
109 | * @since 1.1
110 | *
111 | * @param array $values associative array
112 | * @return Facebook_Activity_Feed activity feed object
113 | */
114 | public static function fromArray( $values ) {
115 | if ( ! is_array( $values ) || empty( $values ) )
116 | return;
117 |
118 | $feed = new Facebook_Activity_Feed();
119 |
120 | if ( isset( $values['site'] ) )
121 | $feed->setSite( $values['site'] );
122 |
123 | if ( isset( $values['action'] ) ) {
124 | if ( is_string( $values['action'] ) ) {
125 | $feed->addAction( $values['action'] );
126 | } else if ( is_array( $values['action'] ) ) {
127 | foreach( $values['action'] as $action ) {
128 | $feed->addAction( $action );
129 | }
130 | }
131 | }
132 |
133 | if ( isset( $values['app_id'] ) )
134 | $feed->setAppID( $values['app_id'] );
135 |
136 | if ( isset( $values['width'] ) )
137 | $feed->setWidth( absint( $values['width'] ) );
138 |
139 | if( isset( $values['height'] ) )
140 | $feed->setHeight( absint( $values['height'] ) );
141 |
142 | if ( isset( $values['header'] ) && ( $values['header'] === true || $values['header'] === 'true' || $values['header'] == 1 ) )
143 | $feed->showHeader();
144 | else
145 | $feed->hideHeader();
146 |
147 | if ( isset( $values['recommendations'] ) && ( $values['recommendations'] === true || $values['recommendations'] === 'true' || $values['recommendations'] == 1 ) )
148 | $feed->includeRecommendations();
149 |
150 | if ( isset( $values['filter'] ) )
151 | $feed->setFilter( $values['filter'] );
152 |
153 | if ( isset( $values['linktarget'] ) )
154 | $feed->setLinkTarget( $values['linktarget'] );
155 |
156 | if ( isset( $values['max_age'] ) )
157 | $feed->setMaxAge( absint( $values['max_age'] ) );
158 |
159 | if ( isset( $values['font'] ) )
160 | $feed->setFont( $values['font'] );
161 |
162 | if ( isset( $values['colorscheme'] ) )
163 | $feed->setColorScheme( $values['colorscheme'] );
164 |
165 | if ( isset( $values['ref'] ) )
166 | $feed->setReference( $values['ref'] );
167 |
168 | return $feed;
169 | }
170 |
171 | /**
172 | * Output Activity Feed div with data-* attributes
173 | *
174 | * @since 1.1
175 | *
176 | * @param array $div_attributes associative array. customize the returned div with id, class, or style attributes
177 | * @return HTML div or empty string
178 | */
179 | public function asHTML( $div_attributes=array() ) {
180 | $div_attributes = self::add_required_class( 'fb-' . self::ID, $div_attributes );
181 | $div_attributes['data'] = $this->toHTMLDataArray();
182 |
183 | return self::div_builder( $div_attributes );
184 | }
185 |
186 | /**
187 | * Output Activity Feed as XFBML
188 | *
189 | * @since 1.1
190 | *
191 | * @return string XFBML markup
192 | */
193 | public function asXFBML() {
194 | return self::xfbml_builder( self::ID, $this->toHTMLDataArray() );
195 | }
196 | }
197 |
198 | ?>
199 |
--------------------------------------------------------------------------------
/social-plugins/class-facebook-comments-box.php:
--------------------------------------------------------------------------------
1 | true, 'dark' => true );
60 |
61 | /**
62 | * The number of comments to show by default
63 | *
64 | * @since 1.1
65 | *
66 | * @var int
67 | */
68 | protected $num_posts;
69 |
70 | /**
71 | * The order to use when displaying comments
72 | *
73 | * @since 1.3
74 | *
75 | * @var string
76 | */
77 | protected $order_by;
78 |
79 | /**
80 | * Choices for the order_by property
81 | *
82 | * @since 1.3
83 | *
84 | * @var string
85 | */
86 | public static $order_by_choices = array( 'social' => true, 'time' => true, 'reverse_time' => true );
87 |
88 | /**
89 | * Should we force the mobile-optimized version?
90 | *
91 | * Default is auto-detect
92 | *
93 | * @var bool
94 | */
95 | protected $mobile;
96 |
97 | /**
98 | * I am a comments box.
99 | *
100 | * @since 1.1
101 | *
102 | * @return string name of the social plugin
103 | */
104 | public function __toString() {
105 | return 'Facebook Comments Box Social Plugin';
106 | }
107 |
108 | /**
109 | * Setter for href attribute.
110 | *
111 | * @since 1.1
112 | *
113 | * @param string $url absolute URL
114 | * @return Facebook_Comments_Box support chaining
115 | */
116 | public function setURL( $url ) {
117 | $url = esc_url_raw( $url, array( 'http', 'https' ) );
118 | if ( $url )
119 | $this->href = $url;
120 | return $this;
121 | }
122 |
123 | /**
124 | * Width of the Comments Box.
125 | *
126 | * @since 1.1
127 | *
128 | * @param int $width width in whole pixels
129 | * @return Facebook_Comments_Box support chaining
130 | */
131 | public function setWidth( $width ) {
132 | // narrowest recommended width is 400
133 | if ( is_int( $width ) && $width > 400 )
134 | $this->width = $width;
135 | return $this;
136 | }
137 |
138 | /**
139 | * Choose a light or dark color scheme
140 | *
141 | * @since 1.1
142 | *
143 | * @see self::colorscheme_choices
144 | * @param string $color_scheme light|dark
145 | * @return Facebook_Comments_Box support chaining
146 | */
147 | public function setColorScheme( $color_scheme ) {
148 | if ( is_string( $color_scheme ) && $color_scheme && isset( self::$colorscheme_choices[$color_scheme] ) )
149 | $this->colorscheme = $color_scheme;
150 | return $this;
151 | }
152 |
153 | /**
154 | * The maximum number of comments to display by default
155 | *
156 | * @since 1.1
157 | *
158 | * @param int $num positive number of comments
159 | * @return Facebook_Comments_Box support chaining
160 | */
161 | public function setNumPosts( $num ) {
162 | if ( is_int( $num ) && $num > 0 )
163 | $this->num_posts = $num;
164 | return $this;
165 | }
166 |
167 | /**
168 | * Choose a social, chronological, or reverse chronological comment ordering
169 | *
170 | * @since 1.3
171 | *
172 | * @see self::order_by_choices
173 | * @param string $order_by social|time|
174 | * @return Facebook_Comments_Box support chaining
175 | */
176 | public function setOrderBy( $order_by ) {
177 | if ( is_string( $order_by ) && $order_by && isset( self::$order_by_choices[$order_by] ) )
178 | $this->order_by = $order_by;
179 | return $this;
180 | }
181 |
182 | /**
183 | * Force the mobile view of comments
184 | *
185 | * @since 1.1
186 | *
187 | * @return Facebook_Comments_Box support chaining
188 | */
189 | public function forceMobile() {
190 | $this->mobile = true;
191 | return $this;
192 | }
193 |
194 | /**
195 | * convert an options array into an object
196 | *
197 | * @since 1.1
198 | *
199 | * @param array $values associative array
200 | * @return Facebook_Comments_Box comments box object
201 | */
202 | public static function fromArray( $values ) {
203 | if ( ! is_array( $values ) || empty( $values ) )
204 | return;
205 |
206 | $comments_box = new Facebook_Comments_Box();
207 |
208 | if ( isset( $values['href'] ) && is_string( $values['href'] ) )
209 | $comments_box->setURL( $values['href'] );
210 |
211 | if ( isset( $values['width'] ) )
212 | $comments_box->setWidth( absint( $values['width'] ) );
213 |
214 | if ( isset( $values['num_posts'] ) )
215 | $comments_box->setNumPosts( absint( $values['num_posts'] ) );
216 |
217 | if ( isset( $values['colorscheme'] ) )
218 | $comments_box->setColorScheme( $values['colorscheme'] );
219 |
220 | if ( isset( $values['order_by'] ) )
221 | $comments_box->setOrderBy( $values['order_by'] );
222 |
223 | if ( isset( $values['mobile'] ) && ( $values['mobile'] === true || $values['mobile'] === 'true' || $values['mobile'] == 1 ) )
224 | $comments_box->forceMobile();
225 |
226 | return $comments_box;
227 | }
228 |
229 | /**
230 | * Convert the class to data-* attribute friendly associative array
231 | * will become data-key="value"
232 | * Exclude values if default
233 | *
234 | * @since 1.1
235 | *
236 | * @return array associative array
237 | */
238 | public function toHTMLDataArray() {
239 | $data = array();
240 |
241 | if ( isset( $this->href ) )
242 | $data['href'] = $this->href;
243 |
244 | if ( isset( $this->width ) && is_int( $this->width ) && $this->width > 0 )
245 | $data['width'] = $this->width;
246 |
247 | if ( isset( $this->colorscheme ) && $this->colorscheme !== 'light' )
248 | $data['colorscheme'] = $this->colorscheme;
249 |
250 | if ( isset( $this->num_posts ) && is_int( $this->num_posts ) && $this->num_posts > 0 && $this->num_posts !== 10 )
251 | $data['num-posts'] = $this->num_posts;
252 |
253 | if ( isset( $this->order_by ) )
254 | $data['order-by'] = $this->order_by;
255 |
256 | if ( isset( $this->mobile ) && $this->mobile === true )
257 | $data['mobile'] = 'true';
258 |
259 | return $data;
260 | }
261 |
262 | /**
263 | * Output Comments Box with data-* attributes
264 | *
265 | * @since 1.1
266 | *
267 | * @param array $div_attributes associative array. customize the returned div with id, class, or style attributes. social plugin parameters in data.
268 | * @return string HTML div or empty string
269 | */
270 | public function asHTML( $div_attributes=array() ) {
271 | if ( ! class_exists( 'Facebook_Social_Plugin' ) )
272 | require_once( dirname(__FILE__) . '/class-facebook-social-plugin.php' );
273 |
274 | $div_attributes = Facebook_Social_Plugin::add_required_class( 'fb-' . self::ID, $div_attributes );
275 | $div_attributes['data'] = $this->toHTMLDataArray();
276 |
277 | return Facebook_Social_Plugin::div_builder( $div_attributes );
278 | }
279 |
280 | /**
281 | * Output XFBML element with attributes
282 | *
283 | * @since 1.1
284 | *
285 | * @return string XFBML element or empty string
286 | */
287 | public function asXFBML() {
288 | if ( ! class_exists( 'Facebook_Social_Plugin' ) )
289 | require_once( dirname(__FILE__) . '/class-facebook-social-plugin.php' );
290 |
291 | return Facebook_Social_Plugin::xfbml_builder( self::ID, $this->toHTMLDataArray() );
292 | }
293 | }
294 |
295 | ?>
--------------------------------------------------------------------------------
/social-plugins/class-facebook-embedded-post.php:
--------------------------------------------------------------------------------
1 | href = $url;
72 | return $this;
73 | }
74 |
75 | /**
76 | * Test if a provided width falls in the allowed range of a Facebook embedded post width
77 | *
78 | * @since 1.5.4
79 | *
80 | * @param int $width desired width of an embedded post in whole pixels
81 | * @return bool true if in accepted range
82 | */
83 | public static function isValidWidth( $width ) {
84 | $width = absint( $width );
85 | if ( $width < 350 || $width > 750 )
86 | return false;
87 | return true;
88 | }
89 |
90 | /**
91 | * Width of the embedded post
92 | *
93 | * Must be between 350 and 750 inclusive.
94 | *
95 | * @since 1.5.4
96 | *
97 | * @param int $width width in whole pixels
98 | * @return Facebook_Embedded_Post support chaining
99 | */
100 | public function setWidth( $width ) {
101 | $width = absint( $width );
102 | if ( self::isValidWidth( $width ) )
103 | $this->width = $width;
104 | return $this;
105 | }
106 |
107 | /**
108 | * Add a border to the box.
109 | *
110 | * @since 1.5
111 | *
112 | * @return Facebook_Embedded_Post support chaining
113 | */
114 | public function showBorder() {
115 | $this->show_border = true;
116 | return $this;
117 | }
118 |
119 | /**
120 | * Hide the box border.
121 | *
122 | * @since 1.5
123 | *
124 | * @return Facebook_Embedded_Post support chaining
125 | */
126 | public function hideBorder() {
127 | $this->show_border = false;
128 | return $this;
129 | }
130 |
131 | /**
132 | * convert an options array into an object
133 | *
134 | * @since 1.5
135 | *
136 | * @param array $values associative array
137 | * @return Facebook_Embedded_Post embedded post object
138 | */
139 | public static function fromArray( $values ) {
140 | if ( ! ( is_array( $values ) && isset( $values['href'] ) ) )
141 | return;
142 |
143 | $embed = new Facebook_Embedded_Post();
144 |
145 | if ( isset( $values['href'] ) && $values['href'] )
146 | $embed->setURL( $values['href'] );
147 |
148 | if ( isset( $values['width'] ) )
149 | $embed->setWidth( absint( $values['width'] ) );
150 |
151 | if ( isset( $values['show_border'] ) && ( $values['show_border'] === false || $values['show_border'] === 'false' || $values['show_border'] == 0 ) )
152 | $embed->hideBorder();
153 | else
154 | $embed->showBorder();
155 |
156 | return $embed;
157 | }
158 |
159 | /**
160 | * Convert the class to data-* attribute friendly associative array.
161 | *
162 | * Will become data-key="value". Exclude values if default
163 | *
164 | * @since 1.5
165 | *
166 | * @return array associative array
167 | */
168 | public function toHTMLDataArray() {
169 | $data = array();
170 | if ( ! ( isset( $this->href ) && $this->href ) )
171 | return $data;
172 |
173 | $data['href'] = $this->href;
174 |
175 | if ( $this->width !== 550 )
176 | $data['width'] = $this->width;
177 |
178 | if ( isset( $this->show_border ) && $this->show_border === false )
179 | $data['show-border'] = 'false';
180 |
181 | return $data;
182 | }
183 |
184 | /**
185 | * Output Embedded Post with data-* attributes.
186 | *
187 | * @since 1.5
188 | *
189 | * @param array $div_attributes associative array. customize the returned div with id, class, or style attributes
190 | * @return HTML div or empty string
191 | */
192 | public function asHTML( $div_attributes = array() ) {
193 | $data = $this->toHTMLDataArray();
194 | // if no target href then do nothing
195 | if ( empty( $data ) )
196 | return '';
197 |
198 | if ( ! class_exists( 'Facebook_Social_Plugin' ) )
199 | require_once( dirname(__FILE__) . '/class-facebook-social-plugin.php' );
200 |
201 | $div_attributes = Facebook_Social_Plugin::add_required_class( 'fb-' . self::ID, $div_attributes );
202 | $div_attributes['data'] = $data;
203 |
204 | return Facebook_Social_Plugin::div_builder( $div_attributes );
205 | }
206 |
207 | /**
208 | * Output Embedded Post as XFBML
209 | *
210 | * @since 1.5
211 | *
212 | * @return string XFBML markup
213 | */
214 | public function asXFBML() {
215 | $data = $this->toHTMLDataArray();
216 | // if no target href then do nothing
217 | if ( empty( $data ) )
218 | return '';
219 |
220 | if ( ! class_exists( 'Facebook_Social_Plugin' ) )
221 | require_once( dirname(__FILE__) . '/class-facebook-social-plugin.php' );
222 |
223 | return Facebook_Social_Plugin::xfbml_builder( self::ID, $data );
224 | }
225 | }
226 |
227 | ?>
228 |
--------------------------------------------------------------------------------
/social-plugins/class-facebook-follow-button.php:
--------------------------------------------------------------------------------
1 | true, 'button_count' => true, 'box_count' => true );
53 |
54 | /**
55 | * Show faces of the viewer's friends already following?
56 | *
57 | * Only applies to standard layout. Needs the extra width.
58 | *
59 | * @since 1.1
60 | *
61 | * @var bool
62 | */
63 | protected $show_faces;
64 |
65 | /**
66 | * Define a custom width in whole pixels.
67 | *
68 | * @since 1.1
69 | *
70 | * @var int
71 | */
72 | protected $width;
73 |
74 | /**
75 | * Option to bypass validation.
76 | *
77 | * You might validate when changing settings but choose not to validate on future generators.
78 | *
79 | * @since 1.1
80 | *
81 | * @param bool $validate false if object should not be validated
82 | */
83 | public function __construct( $validate = true ) {
84 | if ( $validate === false )
85 | $this->validate = false;
86 | else
87 | $this->validate = true;
88 | }
89 |
90 | /**
91 | * I am a follow button.
92 | *
93 | * @since 1.1
94 | *
95 | * @return string Facebook social plugin
96 | */
97 | public function __toString() {
98 | return 'Facebook Follow Button';
99 | }
100 |
101 | /**
102 | * Setter for href attribute.
103 | *
104 | * @since 1.1
105 | *
106 | * @param string $url absolute URL
107 | * @return Facebook_Follow_Button support chaining
108 | */
109 | public function setURL( $url ) {
110 | $url = esc_url_raw( $url, array( 'http', 'https' ) );
111 | if ( $url ) {
112 | // you can only follow a Facebook URL
113 | if ( ! $this->validate || parse_url( $url, PHP_URL_HOST ) === 'www.facebook.com' )
114 | $this->href = $url;
115 | }
116 | return $this;
117 | }
118 |
119 | /**
120 | * Choose a layout option.
121 | *
122 | * @since 1.1
123 | *
124 | * @see self::$layout_choices
125 | * @param string $layout a supported layout option
126 | * @return Facebook_Follow_Button support chaining
127 | */
128 | public function setLayout( $layout ) {
129 | if ( is_string( $layout ) && isset( self::$layout_choices[$layout] ) )
130 | $this->layout = $layout;
131 | return $this;
132 | }
133 |
134 | /**
135 | * Show the faces of a logged-on Facebook user's friends.
136 | *
137 | * @since 1.1
138 | *
139 | * @return Facebook_Follow_Button support chaining
140 | */
141 | public function showFaces() {
142 | $this->show_faces = true;
143 | return $this;
144 | }
145 |
146 | /**
147 | * Width of the follow button.
148 | *
149 | * Should be greater than the minimum width of layout option.
150 | *
151 | * @since 1.1
152 | *
153 | * @param int $width width in whole pixels
154 | * @return Facebook_Follow_Button support chaining
155 | */
156 | public function setWidth( $width ) {
157 | // narrowest follow button is box_count at 55
158 | if ( is_int( $width ) && $width > 55 )
159 | $this->width = $width;
160 | return $this;
161 | }
162 |
163 | /**
164 | * Compute a minimum width of a follow button based on configured options.
165 | *
166 | * @since 1.1
167 | *
168 | * @return int minimum width of the current configuration in whole pixels
169 | */
170 | private function compute_minimum_width() {
171 | $min_width = 225; // standard
172 | if ( isset( $this->layout ) ) {
173 | if ( $this->layout === 'button_count' )
174 | $min_width = 90;
175 | else if ( $this->layout === 'box_count' )
176 | $min_width = 55;
177 | }
178 |
179 | return $min_width;
180 | }
181 |
182 | /**
183 | * Some options may be in conflict with other options or not available for main choices.
184 | *
185 | * Reset customizations if we can detect non-compliance to avoid later confusion and/or layout issues.
186 | *
187 | * @since 1.1
188 | *
189 | * @return void
190 | */
191 | public function validate() {
192 | // allow overrides
193 | if ( isset( $this->validate ) && $this->validate === false )
194 | return;
195 |
196 | // show faces supported in standard layout only
197 | if ( isset( $this->show_faces ) && $this->show_faces === true && $this->layout !== 'standard' )
198 | unset( $this->show_faces );
199 |
200 | // is the specified width less than minimum for config?
201 | if ( isset( $this->width ) ) {
202 | $min_width = $this->compute_minimum_width();
203 | if ( $this->width < $min_width )
204 | $this->width = $min_width;
205 | unset( $min_width );
206 | }
207 |
208 | $this->validate = false;
209 | }
210 |
211 | /**
212 | * convert an options array into an object.
213 | *
214 | * @since 1.1
215 | *
216 | * @param array $values associative array
217 | * @return Facebook_Follow_Button follow object
218 | */
219 | public static function fromArray( $values ) {
220 | if ( ! is_array( $values ) || empty( $values ) )
221 | return;
222 |
223 | $follow_button = new Facebook_Follow_Button();
224 |
225 | if ( isset( $values['href'] ) )
226 | $follow_button->setURL( $values['href'] );
227 |
228 | if ( isset( $values['layout'] ) )
229 | $follow_button->setLayout( $values['layout'] );
230 |
231 | if ( isset( $values['show_faces'] ) && ( $values['show_faces'] === true || $values['show_faces'] === 'true' || $values['show_faces'] == 1 ) )
232 | $follow_button->showFaces();
233 |
234 | if ( isset( $values['width'] ) )
235 | $follow_button->setWidth( absint( $values['width'] ) );
236 |
237 | if ( isset( $values['font'] ) )
238 | $follow_button->setFont( $values['font'] );
239 |
240 | if ( isset( $values['colorscheme'] ) )
241 | $follow_button->setColorScheme( $values['colorscheme'] );
242 |
243 | if ( isset( $values['kid_directed_site'] ) && ( $values['kid_directed_site'] === true || $values['kid_directed_site'] === 'true' || $values['kid_directed_site'] == 1 ) )
244 | $follow_button->isKidDirectedSite();
245 |
246 | return $follow_button;
247 | }
248 |
249 | /**
250 | * Convert the class to data-* attribute friendly associative array.
251 | *
252 | * will become data-key="value". Exclude values if default.
253 | *
254 | * @since 1.1
255 | *
256 | * @return array associative array
257 | */
258 | public function toHTMLDataArray() {
259 | if ( ! isset( $this->href ) )
260 | return array();
261 |
262 | $data = parent::toHTMLDataArray();
263 |
264 | $data['href'] = $this->href;
265 |
266 | // show_faces only if standard layout
267 | if ( isset( $this->layout ) && $this->layout !== 'standard' )
268 | $data['layout'] = $this->layout;
269 | else if ( isset( $this->show_faces ) && $this->show_faces === true )
270 | $data['show-faces'] = 'true';
271 |
272 | if ( isset( $this->width ) && is_int( $this->width ) )
273 | $data['width'] = strval( $this->width );
274 |
275 | return $data;
276 | }
277 |
278 | /**
279 | * Output Follow button with data-* attributes.
280 | *
281 | * @since 1.1
282 | *
283 | * @param array $div_attributes associative array. customize the returned div with id, class, or style attributes
284 | * @return HTML div or empty string
285 | */
286 | public function asHTML( $div_attributes=array() ) {
287 | $data = $this->toHTMLDataArray();
288 | // if no target href then do nothing
289 | if ( empty( $data ) )
290 | return '';
291 |
292 | $div_attributes = self::add_required_class( 'fb-' . self::ID, $div_attributes );
293 | $div_attributes['data'] = $data;
294 |
295 | return self::div_builder( $div_attributes );
296 | }
297 |
298 | /**
299 | * Output Follow button as XFBML.
300 | *
301 | * @since 1.1
302 | *
303 | * @return string XFBML markup
304 | */
305 | public function asXFBML() {
306 | $data = $this->toHTMLDataArray();
307 | if ( empty( $data ) )
308 | return '';
309 |
310 | return self::xfbml_builder( self::ID, $data );
311 | }
312 | }
313 | ?>
314 |
--------------------------------------------------------------------------------
/social-plugins/class-facebook-recommendations-bar.php:
--------------------------------------------------------------------------------
1 | true, 'recommend' => true );
70 |
71 | /**
72 | * Display the recommendations bar on the left or right side.
73 | *
74 | * @since 1.1
75 | *
76 | * @var string
77 | */
78 | protected $side;
79 |
80 | /**
81 | * Choose to display the recommendations bar on the left or right side.
82 | *
83 | * @since 1.1
84 | *
85 | * @var array
86 | */
87 | public static $side_choices = array( 'left' => true, 'right' => true );
88 |
89 | /**
90 | * One or more domains to show recommendations for.
91 | *
92 | * @since 1.1
93 | *
94 | * @var array
95 | */
96 | protected $site = array();
97 |
98 | /**
99 | * Number of recommendations to display.
100 | *
101 | * @since 1.1
102 | *
103 | * @var int
104 | */
105 | protected $num_recommendations;
106 |
107 | /**
108 | * Only include articles newer than a given number of days.
109 | *
110 | * @since 1.1
111 | *
112 | * @var int
113 | */
114 | protected $max_age;
115 |
116 | /**
117 | * I am a recommendations bar.
118 | *
119 | * @since 1.1
120 | *
121 | * @return string Facebook social plugin name
122 | */
123 | public function __toString() {
124 | return 'Facebook Recommendations Bar';
125 | }
126 |
127 | /**
128 | * Setter for href attribute.
129 | *
130 | * @since 1.1
131 | *
132 | * @param string $url absolute URL
133 | * @return Facebook_Recommendations_Bar support chaining
134 | */
135 | public function setURL( $url ) {
136 | $url = esc_url_raw( $url, array( 'http', 'https' ) );
137 | if ( $url )
138 | $this->href = $url;
139 | return $this;
140 | }
141 |
142 | /**
143 | * Choose when the plugin expands.
144 | *
145 | * Evaluated in addition to the read_time parameter.
146 | *
147 | * @since 1.1
148 | *
149 | * @param string $trigger onvisible|manual|X%
150 | * @return Facebook_Recommendations_Bar support chaining
151 | */
152 | public function setTrigger( $trigger ) {
153 | if ( is_string( $trigger ) && $trigger ) {
154 | if ( $trigger === 'onvisible' || $trigger === 'manual' ) {
155 | $this->trigger = $trigger;
156 | } else {
157 | $len = strlen( $trigger );
158 | if ( $len > 1 && $len < 5 && substr( $trigger, -1 ) === '%' ) { // 2% - 100%
159 | $pct = absint( substr( $trigger, 0, $len - 1 ) );
160 | if ( $pct > 0 && $pct < 101 ) // positive integer less than or equal to 100
161 | $this->trigger = strval( $pct ) . '%';
162 | }
163 | }
164 | }
165 | return $this;
166 | }
167 |
168 | /**
169 | * Set the number of seconds before the plugin will expand.
170 | *
171 | * Minimum: 10 seconds
172 | *
173 | * @since 1.1
174 | * @param int $seconds whole seconds
175 | * @return Facebook_Recommendations_Bar support chaining
176 | */
177 | public function setReadTime( $seconds ) {
178 | if ( is_int( $seconds ) && $seconds >= 10 )
179 | $this->read_time = $seconds;
180 | return $this;
181 | }
182 |
183 | /**
184 | * Override the default "like" text with "recommend"
185 | *
186 | * @since 1.1
187 | *
188 | * @param string $action like|recommend
189 | * @return Facebook_Recommendations_Bar support chaining
190 | */
191 | public function setAction( $action ) {
192 | if ( is_string( $action ) && isset( self::$action_choices[$action] ) )
193 | $this->action = $action;
194 | return $this;
195 | }
196 |
197 | /**
198 | * Display plugin on the left or right side.
199 | *
200 | * By default the recommendations bar will display at the end of a normal page scan based on the locale (e.g. right side in the left-to-right reading style of English)
201 | *
202 | * @since 1.1
203 | * @param string $side left|right
204 | * @return Facebook_Recommendations_Bar support chaining
205 | */
206 | public function setSide( $side ) {
207 | if ( is_string( $side ) && isset( self::$side_choices[$side] ) )
208 | $this->side = $side;
209 | return $this;
210 | }
211 |
212 | /**
213 | * Show recommendations for an additional domain
214 | *
215 | * @since 1.1
216 | *
217 | * @param string $domain domain name
218 | * @return Facebook_Recommendations_Bar support chaining
219 | */
220 | public function addSite( $domain ) {
221 | if ( is_string( $domain ) && $domain && ! in_array( $domain, $this->site, true ) )
222 | $this->site[] = $domain;
223 | return $this;
224 | }
225 |
226 | /**
227 | * Set the number of recommendations to display
228 | *
229 | * Accepts a number between 1 and 5
230 | *
231 | * @since 1.1
232 | *
233 | * @param int $num number of recommendations. between 1 and 5
234 | * @return Facebook_Recommendations_Bar support chaining
235 | */
236 | public function setNumRecommendations( $num ) {
237 | if ( is_int( $num ) && $num > 0 && $num < 6 )
238 | $this->num_recommendations = $num;
239 | return $this;
240 | }
241 |
242 | /**
243 | * Limit recommendations to a number of days between 1 and 180
244 | *
245 | * Plugin defaults to no maximum age (age=0)
246 | *
247 | * @since 1.1
248 | *
249 | * @param int $days number of whole days
250 | * @return Facebook_Recommendations_Bar support chaining
251 | */
252 | public function setMaxAge( $days ) {
253 | if ( is_int( $days ) && $days >= 0 && $days < 181 )
254 | $this->max_age = $days;
255 | return $this;
256 | }
257 |
258 | /**
259 | * Convert the class to data-* attribute friendly associative array
260 | *
261 | * will become data-key="value". Exclude values if default
262 | *
263 | * @since 1.1
264 | *
265 | * @return array associative array
266 | */
267 | public function toHTMLDataArray() {
268 | $data = parent::toHTMLDataArray();
269 |
270 | if ( isset( $this->href ) )
271 | $data['href'] = $this->href;
272 |
273 | if ( isset( $this->trigger ) )
274 | $data['trigger'] = $this->trigger;
275 |
276 | if ( isset( $this->read_time ) && $this->read_time !== 30 ) // default: 30
277 | $data['read-time'] = strval( $this->read_time );
278 |
279 | if ( isset( $this->action ) && $this->action !== 'like' ) // default: like
280 | $data['action'] = $this->action;
281 |
282 | if ( isset( $this->side ) ) // default: auto
283 | $data['side'] = $this->side;
284 |
285 | if ( isset( $this->site ) && is_array( $this->site ) && ! empty( $this->site ) )
286 | $data['site'] = implode( ',', $this->site );
287 |
288 | if ( isset( $this->num_recommendations ) && $this->num_recommendations != 2 ) // default: 2
289 | $data['num-recommendations'] = strval( $this->num_recommendations );
290 |
291 | if ( isset( $this->max_age ) && $this->max_age != 0 ) // default: 0 (no limit)
292 | $data['max-age'] = $this->max_age;
293 |
294 | // remove generic social plugin properties not applicable to recommendations bar
295 | foreach( array( 'font', 'colorscheme' ) as $prop ) {
296 | unset( $data[$prop] );
297 | }
298 |
299 | return $data;
300 | }
301 |
302 | /**
303 | * convert an options array into an object.
304 | *
305 | * @since 1.1
306 | *
307 | * @param array $values associative array
308 | * @return Facebook_Recommendations_Bar recommendations bar object
309 | */
310 | public static function fromArray( $values ) {
311 | if ( ! is_array( $values ) || empty( $values ) )
312 | return;
313 |
314 | $bar = new Facebook_Recommendations_Bar();
315 |
316 | if ( isset( $values['href'] ) )
317 | $bar->setURL( $values['href'] );
318 |
319 | if ( isset( $values['trigger'] ) )
320 | $bar->setTrigger( $values['trigger'] );
321 |
322 | if ( isset( $values['read_time'] ) )
323 | $bar->setReadTime( absint( $values['read_time'] ) );
324 |
325 | if ( isset( $values['action'] ) )
326 | $bar->setAction( $values['action'] );
327 |
328 | if ( isset( $values['side'] ) )
329 | $bar->setSide( $values['side'] );
330 |
331 | if ( isset( $values['site'] ) ) {
332 | if ( is_string( $values['site'] ) ) {
333 | $bar->addAction( $values['site'] );
334 | } else if ( is_array( $values['site'] ) ) {
335 | foreach( $values['site'] as $action ) {
336 | $bar->addAction( $action );
337 | }
338 | }
339 | }
340 |
341 | if ( isset( $values['num_recommendations'] ) )
342 | $bar->setNumRecommendations( absint( $values['num_recommendations'] ) );
343 |
344 | if ( isset( $values['max_age'] ) )
345 | $bar->setMaxAge( absint( $values['max_age'] ) );
346 |
347 | if ( isset( $values['ref'] ) )
348 | $bar->setReference( $values['ref'] );
349 |
350 | return $bar;
351 | }
352 |
353 | /**
354 | * Output Recommendations Box div with data-* attributes.
355 | *
356 | * @since 1.1
357 | *
358 | * @param array $div_attributes associative array. customize the returned div with id, class, or style attributes
359 | * @return HTML div or empty string
360 | */
361 | public function asHTML( $div_attributes=array() ) {
362 | $div_attributes = self::add_required_class( 'fb-' . self::ID, $div_attributes );
363 | $div_attributes['data'] = $this->toHTMLDataArray();
364 |
365 | return self::div_builder( $div_attributes );
366 | }
367 |
368 | /**
369 | * Output Activity Feed as XFBML.
370 | *
371 | * @since 1.1
372 | *
373 | * @return string XFBML markup
374 | */
375 | public function asXFBML() {
376 | return self::xfbml_builder( self::ID, $this->toHTMLDataArray() );
377 | }
378 | }
379 |
380 | ?>
--------------------------------------------------------------------------------
/social-plugins/class-facebook-recommendations-box.php:
--------------------------------------------------------------------------------
1 | true, '_parent' => true, '_top' => true );
96 |
97 | /**
98 | * Limit the number of days since article creation.
99 | *
100 | * @since 1.1
101 | *
102 | * @var int
103 | */
104 | protected $max_age;
105 |
106 | /**
107 | * I am a recommendation box.
108 | *
109 | * @since 1.1
110 | *
111 | * @return string Facebook social plugin name
112 | */
113 | public function __toString() {
114 | return 'Facebook Recommendations Box';
115 | }
116 |
117 | /**
118 | * Set the domain for which to show activity.
119 | *
120 | * @since 1.1
121 | *
122 | * @param string $domain domain / hostname
123 | * @return Facebook_Recommendations_Box support chaining
124 | */
125 | public function setSite( $domain ) {
126 | if ( is_string( $domain ) && $domain )
127 | $this->site = $domain;
128 | return $this;
129 | }
130 |
131 | /**
132 | * Scope the activity feed display to an additional action
133 | *
134 | * @since 1.1
135 | *
136 | * @param string $action action name. global- or app-scoped
137 | * @return Facebook_Recommendations_Box support chaining
138 | */
139 | public function addAction( $action ) {
140 | if ( is_string( $action ) && ! in_array( $action, $this->action, true ) )
141 | $this->action[] = $action;
142 | return $this;
143 | }
144 |
145 | /**
146 | * Display actions associated with the specified application.
147 | *
148 | * @since 1.1
149 | *
150 | * @param string $app_id Facebook application identifer
151 | * @return Facebook_Recommendations_Box support chaining
152 | */
153 | public function setAppID( $app_id ) {
154 | if ( is_string( $app_id ) ) {
155 | if ( function_exists( 'ctype_digit' ) ) {
156 | if ( ctype_digit( $app_id ) )
157 | $this->app_id = $app_id;
158 | } else if ( preg_match( '/^[\d]+$/', $app_id ) ) {
159 | $this->app_id = $app_id;
160 | }
161 | }
162 | return $this;
163 | }
164 |
165 | /**
166 | * Define the width of the activity feed box in whole pixels.
167 | *
168 | * @since 1.1
169 | *
170 | * @param int $width width in whole pixels
171 | * @return Facebook_Recommendations_Box support chaining
172 | */
173 | public function setWidth( $width ) {
174 | if ( is_int( $width ) && $width > 0 )
175 | $this->width = $width;
176 | return $this;
177 | }
178 |
179 | /**
180 | * Define the height of the recommendations box in whole pixels.
181 | *
182 | * @since 1.1
183 | *
184 | * @param int $height height in whole pixels
185 | * @return Facebook_Recommendations_Box support chaining
186 | */
187 | public function setHeight( $height ) {
188 | if ( is_int( $height ) && $height > 0 )
189 | $this->height = $height;
190 | return $this;
191 | }
192 |
193 | /**
194 | * Show the Facebook header
195 | *
196 | * @since 1.1
197 | *
198 | * @return Facebook_Activity_Feed support chaining
199 | */
200 | public function showHeader() {
201 | $this->header = true;
202 | return $this;
203 | }
204 |
205 | /**
206 | * Hide the Facebook header
207 | *
208 | * @since 1.1
209 | *
210 | * @return Facebook_Recommendations_Box support chaining
211 | */
212 | public function hideHeader() {
213 | $this->header = false;
214 | return $this;
215 | }
216 |
217 | /**
218 | * Define a link target to control browser context on link actions
219 | *
220 | * @since 1.1
221 | *
222 | * @param string $target _blank|_parent|_top
223 | * @return Facebook_Activity_Feed support chaining
224 | */
225 | public function setLinkTarget( $target ) {
226 | if ( is_string( $target ) && isset( self::$linktarget_choices[$target] ) )
227 | $this->linktarget = $target;
228 | return $this;
229 | }
230 |
231 | /**
232 | * Limit recommendations to a number of days between 1 and 180
233 | * Plugin defaults to no maximum age (age=0)
234 | *
235 | * @since 1.1
236 | *
237 | * @param int $days number of whole days
238 | * @return Facebook_Activity_Feed support chaining
239 | */
240 | public function setMaxAge( $days ) {
241 | if ( is_int( $days ) && $days > -1 && $days < 181 )
242 | $this->max_age = $days;
243 | return $this;
244 | }
245 |
246 | /**
247 | * Convert the class to data-* attribute friendly associative array.
248 | *
249 | * will become data-key="value". Exclude values if default
250 | *
251 | * @since 1.1
252 | *
253 | * @return array associative array
254 | */
255 | public function toHTMLDataArray() {
256 | $data = parent::toHTMLDataArray();
257 |
258 | if ( isset( $this->site ) )
259 | $data['site'] = $this->site;
260 |
261 | if ( isset( $this->action ) && is_array( $this->action ) && ! empty( $this->action ) )
262 | $data['action'] = implode( ',', $this->action );
263 |
264 | if ( isset( $this->app_id ) )
265 | $data['app-id'] = $this->app_id;
266 |
267 | if ( isset( $this->width ) && is_int( $this->width ) && $this->width > 0 && $this->width !== 300 ) // default 300
268 | $data['width'] = strval( $this->width );
269 |
270 | if ( isset( $this->height ) && is_int( $this->height ) && $this->height > 0 && $this->height !== 300 ) // default 300
271 | $data['height'] = strval( $this->height );
272 |
273 | if ( isset( $this->header ) && $this->header === false ) // default true
274 | $data['header'] = 'false';
275 | else
276 | $data['header'] = 'true';
277 |
278 | if ( isset( $this->linktarget ) )
279 | $data['linktarget'] = $this->linktarget;
280 |
281 | if ( isset( $this->max_age ) && is_int( $this->max_age ) && $this->max_age > 0 && $this->max_age < 181 ) // default 0
282 | $data['max-age'] = strval( $this->max_age );
283 |
284 | return $data;
285 | }
286 |
287 | /**
288 | * convert an options array into an object.
289 | *
290 | * @since 1.1
291 | *
292 | * @param array $values associative array
293 | * @return Facebook_Recommendations_Box recommendations box object
294 | */
295 | public static function fromArray( $values ) {
296 | if ( ! is_array( $values ) || empty( $values ) )
297 | return;
298 |
299 | $box = new Facebook_Recommendations_Box();
300 |
301 | if ( isset( $values['site'] ) )
302 | $box->setSite( $values['site'] );
303 |
304 | if ( isset( $values['action'] ) ) {
305 | if ( is_string( $values['action'] ) ) {
306 | $box->addAction( $values['action'] );
307 | } else if ( is_array( $values['action'] ) ) {
308 | foreach( $values['action'] as $action ) {
309 | $box->addAction( $action );
310 | }
311 | }
312 | }
313 |
314 | if ( isset( $values['app_id'] ) )
315 | $box->setAppID( $values['app_id'] );
316 |
317 | if ( isset( $values['width'] ) )
318 | $box->setWidth( absint( $values['width'] ) );
319 |
320 | if( isset( $values['height'] ) )
321 | $box->setHeight( absint( $values['height'] ) );
322 |
323 | if ( isset( $values['header'] ) && ( $values['header'] === true || $values['header'] == 1 || $values['header'] === 'true' ) )
324 | $box->showHeader();
325 | else
326 | $box->hideHeader();
327 |
328 | if ( isset( $values['linktarget'] ) )
329 | $box->setLinkTarget( $values['linktarget'] );
330 |
331 | if ( isset( $values['max_age'] ) )
332 | $box->setMaxAge( absint( $values['max_age'] ) );
333 |
334 | if ( isset( $values['font'] ) )
335 | $box->setFont( $values['font'] );
336 |
337 | if ( isset( $values['colorscheme'] ) )
338 | $box->setColorScheme( $values['colorscheme'] );
339 |
340 | if ( isset( $values['ref'] ) )
341 | $box->setReference( $values['ref'] );
342 |
343 | return $box;
344 | }
345 |
346 | /**
347 | * Output Recommendations Box div with data-* attributes.
348 | *
349 | * @since 1.1
350 | *
351 | * @param array $div_attributes associative array. customize the returned div with id, class, or style attributes
352 | * @return HTML div or empty string
353 | */
354 | public function asHTML( $div_attributes=array() ) {
355 | $div_attributes = self::add_required_class( 'fb-' . self::ID, $div_attributes );
356 | $div_attributes['data'] = $this->toHTMLDataArray();
357 |
358 | return self::div_builder( $div_attributes );
359 | }
360 |
361 | /**
362 | * Output Activity Feed as XFBML
363 | *
364 | * @since 1.1
365 | *
366 | * @return string XFBML markup
367 | */
368 | public function asXFBML() {
369 | return self::xfbml_builder( self::ID, $this->toHTMLDataArray() );
370 | }
371 | }
372 |
373 | ?>
374 |
--------------------------------------------------------------------------------
/social-plugins/class-facebook-send-button.php:
--------------------------------------------------------------------------------
1 | href = $url;
58 | return $this;
59 | }
60 |
61 | /**
62 | * convert an options array into an object
63 | *
64 | * @since 1.1
65 | *
66 | * @param array $values associative array
67 | * @return Facebook_Send_Button send button object
68 | */
69 | public static function fromArray( $values ) {
70 | if ( ! is_array( $values ) || empty( $values ) )
71 | return;
72 |
73 | $send_button = new Facebook_Send_Button();
74 |
75 | if ( isset( $values['href'] ) && is_string( $values['href'] ) )
76 | $send_button->setURL( $values['href'] );
77 |
78 | if ( isset( $values['font'] ) )
79 | $send_button->setFont( $values['font'] );
80 |
81 | if ( isset( $values['colorscheme'] ) )
82 | $send_button->setColorScheme( $values['colorscheme'] );
83 |
84 | if ( isset( $values['ref'] ) )
85 | $send_button->setReference( $values['ref'] );
86 |
87 | if ( isset( $values['kid_directed_site'] ) && ( $values['kid_directed_site'] === true || $values['kid_directed_site'] === 'true' || $values['kid_directed_site'] == 1 ) )
88 | $send_button->isKidDirectedSite();
89 |
90 | return $send_button;
91 | }
92 |
93 | /**
94 | * Convert the class to data-* attribute friendly associative array
95 | *
96 | * will become data-key="value". Exclude values if default
97 | *
98 | * @since 1.1
99 | *
100 | * @return array associative array
101 | */
102 | public function toHTMLDataArray() {
103 | $data = parent::toHTMLDataArray();
104 |
105 | if ( isset( $this->href ) )
106 | $data['href'] = $this->href;
107 |
108 | return $data;
109 | }
110 |
111 | /**
112 | * Output Send button with data-* attributes.
113 | *
114 | * @since 1.1
115 | *
116 | * @param array $div_attributes associative array. customize the returned div with id, class, or style attributes
117 | * @return HTML div or empty string
118 | */
119 | public function asHTML( $div_attributes=array() ) {
120 | $div_attributes = self::add_required_class( 'fb-' . self::ID, $div_attributes );
121 | $div_attributes['data'] = $this->toHTMLDataArray();
122 |
123 | return self::div_builder( $div_attributes );
124 | }
125 |
126 | /**
127 | * Output Send button as XFBML
128 | *
129 | * @since 1.1
130 | *
131 | * @return string XFBML markup
132 | */
133 | public function asXFBML() {
134 | return self::xfbml_builder( self::ID, $this->toHTMLDataArray() );
135 | }
136 | }
137 |
138 | ?>
139 |
--------------------------------------------------------------------------------
/social-plugins/class-facebook-social-plugin.php:
--------------------------------------------------------------------------------
1 | true, 'lucida grande' => true, 'segoe ui' => true, 'tahoma' => true, 'trebuchet ms' => true, 'verdana' => true );
27 |
28 | /**
29 | * Choose a light or dark color scheme to match your site style.
30 | *
31 | * @since 1.1
32 | *
33 | * @param string
34 | */
35 | protected $colorscheme;
36 |
37 | /**
38 | * Use a light or dark color scheme.
39 | *
40 | * @since 1.1
41 | *
42 | * @var array
43 | */
44 | public static $colorscheme_choices = array( 'light' => true, 'dark' => true );
45 |
46 | /**
47 | * Add a unique reference to track referrals. Facebook passes this parameter to the destination URL when a Facebook user clicks the link.
48 | *
49 | * Example: 'footer' for a like button in your footer vs. 'banner' for a button in your site banner.
50 | *
51 | * @since 1.1
52 | *
53 | * @var string
54 | */
55 | protected $ref;
56 |
57 | /**
58 | * Is your website primarily directed to children in the United States under the age of 13?
59 | *
60 | * @link https://developers.facebook.com/docs/plugins/restrictions/ Child-directed sites and services
61 | * @since 1.5
62 | *
63 | * @var bool
64 | */
65 | protected $kid_directed_site;
66 |
67 | /**
68 | * Choose a font to match your site styling.
69 | *
70 | * @since 1.1
71 | *
72 | * @see self::$font_choices
73 | * @param string $font a font name from $font_choices
74 | * @return Facebook_Social_Plugin support chaining
75 | */
76 | public function setFont( $font ) {
77 | if ( is_string( $font ) && isset( self::$font_choices[$font] ) )
78 | $this->font = $font;
79 | return $this;
80 | }
81 |
82 | /**
83 | * Choose a light or dark color scheme.
84 | *
85 | * @since 1.1
86 | *
87 | * @see self::colorscheme_choices
88 | * @param string $color_scheme light|dark
89 | * @return Facebook_Social_Plugin support chaining
90 | */
91 | public function setColorScheme( $color_scheme ) {
92 | if ( is_string( $color_scheme ) && isset( self::$colorscheme_choices[$color_scheme] ) )
93 | $this->colorscheme = $color_scheme;
94 | return $this;
95 | }
96 |
97 | /**
98 | * Clean up the ref paramter based on Facebook requirements.
99 | *
100 | * @since 1.1
101 | *
102 | * @param string $ref reference string you would like to track on your site after a Facebook visitor follows a link
103 | * @return string cleaned string
104 | */
105 | public static function cleanRef( $ref ) {
106 | if ( is_string( $ref ) && $ref && strlen( $ref ) < 50 )
107 | return preg_replace( '/[^a-zA-Z0-9\+\/\=\-.\:\_]/', '', $ref );
108 | return '';
109 | }
110 |
111 | /**
112 | * Track referrals from Facebook with a string up to 50 chracters.
113 | *
114 | * Characters in string must be alphanumeric or punctuation (currently +/=-.:_)
115 | *
116 | * @since 1.1
117 | *
118 | * @param string $ref reference string
119 | * @return Facebook_Social_Plugin support chaining
120 | */
121 | public function setReference( $ref ) {
122 | $ref = self::cleanRef( $ref );
123 | if ( $ref )
124 | $this->ref = $ref;
125 | return $this;
126 | }
127 |
128 | /**
129 | * Inform Facebook a social plugin will likely be displayed to a child in the United States under the age of 13.
130 | *
131 | * @since 1.5
132 | * @return Facebook_Social_Plugin support chaining
133 | */
134 | public function isKidDirectedSite() {
135 | $this->kid_directed_site = true;
136 | return $this;
137 | }
138 |
139 | /**
140 | * Convert the class object into an array, removing default values.
141 | *
142 | * @since 1.1
143 | *
144 | * @return array associative array
145 | */
146 | public function toArray() {
147 | $data = array();
148 |
149 | if ( isset( $this->font ) )
150 | $data['font'] = $this->font;
151 |
152 | if ( isset( $this->colorscheme ) && $this->colorscheme !== 'light' )
153 | $data['colorscheme'] = $this->colorscheme;
154 |
155 | if ( isset( $this->ref ) )
156 | $data['ref'] = $this->ref;
157 |
158 | if ( isset( $this->kid_directed_site ) && $this->kid_directed_site === true )
159 | $data['kid_directed_site'] = true;
160 |
161 | return $data;
162 | }
163 |
164 | /**
165 | * Convert the class to data-* attribute friendly associative array.
166 | *
167 | * will become data-key="value". Exclude values if default
168 | *
169 | * @since 1.1
170 | *
171 | * @return array associative array
172 | */
173 | public function toHTMLDataArray() {
174 | $data = $this->toArray();
175 |
176 | // underscores to data-* dashes
177 | if ( isset( $data['kid_directed_site'] ) ) {
178 | $data['kid-directed-site'] = $data['kid_directed_site'];
179 | unset( $data['kid_directed_site'] );
180 | }
181 |
182 | return $this->toArray();
183 | }
184 |
185 | /**
186 | * Add a class required by the social plugin to an existing set of attributes.
187 | *
188 | * @since 1.1
189 |
190 | * @param string $class class name to add to the attributes array
191 | * @param array $attributes existing attributes array
192 | * @return array attributes array with social plugin class
193 | */
194 | public static function add_required_class( $class, $attributes = array() ) {
195 | if ( ! is_array( $attributes ) )
196 | $attributes = array();
197 |
198 | if ( ! is_string( $class ) )
199 | return $attributes;
200 |
201 | if ( isset( $attributes['class'] ) && is_array( $attributes['class'] ) ) {
202 | if ( ! in_array( $class, $attributes['class'] ) )
203 | $attributes['class'][] = $class;
204 | } else {
205 | $attributes['class'] = array( $class );
206 | }
207 |
208 | return $attributes;
209 | }
210 |
211 | /**
212 | * Output div element with data-* attributes.
213 | *
214 | * @since 1.1
215 | *
216 | * @param array $div_attributes associative array. customize the returned div with id, class, or style attributes. social plugin parameters in data.
217 | * @return string HTML div or empty string
218 | */
219 | public static function div_builder( $div_attributes=array() ) {
220 | if ( ! ( is_array( $div_attributes ) && ! empty( $div_attributes ) ) )
221 | return '';
222 |
223 | $div = ' $value ) {
245 | $div .= ' data-' . $attribute . '="' . esc_attr( $value ) . '"';
246 | }
247 | }
248 |
249 | $div .= '>
';
250 | return $div;
251 | }
252 |
253 | /**
254 | * Output XFBML element with attributes.
255 | *
256 | * @since 1.1
257 | *
258 | * @param string $element name of the element, e.g. "like" for fb:like
259 | * @return string XFBML element or empty string
260 | */
261 | public static function xfbml_builder( $element, $data=array() ) {
262 | if ( ! ( is_string( $element ) && $element && is_array( $data ) && ! empty( $data ) ) )
263 | return '';
264 | $element = sanitize_html_class( $element );
265 |
266 | // add XMLNS applicable to the current element and its children for compatibility
267 | $fb = ' $value ) {
270 | $fb .= ' ' . str_replace( '-', '_', $attribute ) . '="' . esc_attr( $value ) . '"';
271 | }
272 |
273 | $fb .= '> ';
274 |
275 | return $fb;
276 | }
277 | }
278 |
279 | ?>
280 |
--------------------------------------------------------------------------------
/social-plugins/comments.php:
--------------------------------------------------------------------------------
1 | based on comments stored on Facebook servers, and Comments Box XFBML markup to be interpreted by the Facebook SDK for JavaScript. Attempt to match CSS-addressable elements of WordPress core themes and customization functions where possible but with Facebook plugin-specific filters to avoid unexpected behaviors.
6 | *
7 | * @since 1.3
8 | */
9 |
10 |
11 | /*
12 | * If the current post is protected by a password and the visitor has not yet
13 | * entered the password we will return early without loading the comments.
14 | */
15 | if ( post_password_required() )
16 | return;
17 | ?>
18 |
19 | ';
78 | /**
79 | * Output content after the Facebook Comments Box display area
80 | *
81 | * @since 1.3
82 | */
83 | do_action( 'facebook_comment_form_after' );
84 | }
85 | unset( $_facebook_comments );
86 | ?>
87 |
88 |
--------------------------------------------------------------------------------
/social-plugins/index.php:
--------------------------------------------------------------------------------
1 | asHTML( array( 'class' => array( 'fb-social-plugin' ) ) );
20 | if ( $html )
21 | return "\n" . $html . "\n";
22 |
23 | return '';
24 | }
25 |
26 | /**
27 | * Add Like Button(s) to post content.
28 | *
29 | * Adds a like button above the post, below the post, or both above and below the post depending on stored preferences.
30 | *
31 | * @since 1.1
32 | *
33 | * @global stdClass|WP_Post $post WordPress post. Used to request a post permalink.
34 | * @param string $content existing content
35 | * @return string passed content with Like Button markup prepended, appended, or both.
36 | */
37 | function facebook_the_content_like_button( $content ) {
38 | global $post;
39 |
40 | // Like Buttons should not be the only content in the post
41 | if ( ! $content )
42 | return $content;
43 |
44 | $options = get_option( 'facebook_like_button' );
45 | if ( ! is_array( $options ) )
46 | $options = array();
47 |
48 | if ( ! isset( $options['position'] ) )
49 | return $content;
50 |
51 | // duplicate_hook
52 | $options['href'] = apply_filters( 'facebook_rel_canonical', get_permalink( $post->ID ) );
53 |
54 | if ( $options['position'] === 'top' ) {
55 | $options['ref'] = 'above-post';
56 | return facebook_get_like_button( $options ) . $content;
57 | } else if ( $options['position'] === 'bottom' ) {
58 | $options['ref'] = 'below-post';
59 | return $content . facebook_get_like_button( $options );
60 | } else if ( $options['position'] === 'both' ) {
61 | $options['ref'] = 'above-post';
62 | $above = facebook_get_like_button( $options );
63 | $options['ref'] = 'below-post';
64 | return $above . $content . facebook_get_like_button( $options );
65 | }
66 |
67 | // don't break the filter
68 | return $content;
69 | }
70 |
71 | /**
72 | * Recommendations Bar markup for use with Facebook SDK for JavaScript
73 | *
74 | * @since 1.1
75 | *
76 | * @param array $options stored options
77 | * @return string HTML div markup or empty string
78 | */
79 | function facebook_get_recommendations_bar( $options = array() ) {
80 | if ( ! class_exists( 'Facebook_Recommendations_Bar' ) )
81 | require_once( dirname(__FILE__) . '/class-facebook-recommendations-bar.php' );
82 |
83 | $bar = Facebook_Recommendations_Bar::fromArray( $options );
84 | if ( ! $bar )
85 | return '';
86 |
87 | $html = $bar->asHTML( array( 'class' => array( 'fb-social-plugin' ) ) );
88 | if ( $html )
89 | return "\n" . $html . "\n";
90 |
91 | return '';
92 | }
93 |
94 | /**
95 | * Add Recommendations Bar to the end of post content.
96 | *
97 | * Triggers the Recommendations Bar display once a visitor scrolls past the end of the post in 'onvisible' trigger mode.
98 | *
99 | * @since 1.1
100 | *
101 | * @global stdClass|WP_Post WordPress post object. Used to scope to singular post views.
102 | * @param string $content post content
103 | * @return string the content with the Recommendations Bar HTML5-style data-* div
104 | */
105 | function facebook_the_content_recommendations_bar( $content ) {
106 | global $post;
107 |
108 | // single post view only
109 | if ( ! isset( $post ) || ! is_singular( get_post_type( $post ) ) )
110 | return $content;
111 |
112 | $options = get_option( 'facebook_recommendations_bar' );
113 | if ( ! is_array( $options ) )
114 | $options = array();
115 |
116 | $options['ref'] = 'recommendations-bar';
117 |
118 | return $content . facebook_get_recommendations_bar( $options );
119 | }
120 |
121 | /**
122 | * Generate HTML for a send button based on passed options.
123 | *
124 | * @since 1.1
125 | *
126 | * @param array $options customizations
127 | * @return string send button HTML for use with the Facebook SDK for JavaScript
128 | */
129 | function facebook_get_send_button( $options = array() ) {
130 | if ( ! class_exists( 'Facebook_Send_Button' ) )
131 | require_once( dirname(__FILE__) . '/class-facebook-send-button.php' );
132 |
133 | $send_button = Facebook_Send_Button::fromArray( $options );
134 | if ( ! $send_button )
135 | return '';
136 |
137 | $html = $send_button->asHTML( array( 'class' => array( 'fb-social-plugin' ) ) );
138 | if ( $html )
139 | return "\n" . $html . "\n";
140 |
141 | return '';
142 | }
143 |
144 | /**
145 | * Add Send Button(s) to post content.
146 | *
147 | * Adds a send button above the post, below the post, or both above and below the post depending on stored preferences.
148 | *
149 | * @since 1.1
150 | *
151 | * @global stdClass|WP_Post WordPress post object. Used to generate a post permalink.
152 | * @param string $content existing content
153 | * @return string passed content with Send Button markup prepended, appended, or both.
154 | */
155 | function facebook_the_content_send_button( $content ) {
156 | global $post;
157 |
158 | // Send Button should not be the only content
159 | if ( ! $content )
160 | return $content;
161 |
162 | $options = get_option( 'facebook_send_button' );
163 | if ( ! is_array( $options ) )
164 | $options = array();
165 |
166 |
167 | $options['href'] = apply_filters( 'facebook_rel_canonical', get_permalink( $post->ID ) );
168 |
169 | if ( $options['position'] === 'top' ) {
170 | $options['ref'] = 'above-post';
171 | return facebook_get_send_button( $options ) . $content;
172 | } else if ( $options['position'] === 'bottom' ) {
173 | $options['ref'] = 'below-post';
174 | return $content . facebook_get_send_button( $options );
175 | } else if ( $options['position'] === 'both' ) {
176 | $options['ref'] = 'above-post';
177 | $above = facebook_get_send_button( $options );
178 | $options['ref'] = 'below-post';
179 | return $above . $content . facebook_get_send_button( $options );
180 | }
181 |
182 | // don't break the filter
183 | return $content;
184 | }
185 |
186 | /**
187 | * Generate HTML for a follow button based on passed options.
188 | *
189 | * @since 1.1
190 | *
191 | * @param array $options customizations
192 | * @return string follow button HTML for use with the Facebook SDK for JavaScript
193 | */
194 | function facebook_get_follow_button( $options = array() ) {
195 | // need a subscription target
196 | if ( ! is_array( $options ) || empty( $options['href'] ) )
197 | return '';
198 |
199 | if ( ! class_exists( 'Facebook_Follow_Button' ) )
200 | require_once( dirname(__FILE__) . '/class-facebook-follow-button.php' );
201 |
202 | $follow_button = Facebook_Follow_Button::fromArray( $options );
203 | if ( ! $follow_button )
204 | return '';
205 |
206 | $html = $follow_button->asHTML( array( 'class' => array( 'fb-social-plugin' ) ) );
207 | if ( is_string($html) && $html )
208 | return "\n" . $html . "\n";
209 |
210 | return '';
211 | }
212 |
213 | /**
214 | * Add Follow Button(s) to post content
215 | *
216 | * Adds a follow button above the post, below the post, or both above and below the post depending on stored preferences.
217 | *
218 | * @since 1.1
219 | *
220 | * @param string $content existing content
221 | * @return string passed content with Follow Button markup prepended, appended, or both.
222 | */
223 | function facebook_the_content_follow_button( $content ) {
224 | // Follow Button should not be the only content
225 | if ( ! $content )
226 | return $content;
227 |
228 | $options = get_option( 'facebook_follow_button' );
229 | if ( ! is_array( $options ) )
230 | $options = array();
231 |
232 | if ( ! class_exists( 'Facebook_User' ) )
233 | require_once( dirname( dirname( __FILE__ ) ) . '/facebook-user.php' );
234 |
235 | $facebook_user = Facebook_User::get_user_meta( get_the_author_meta( 'ID' ), 'fb_data', true );
236 | if ( ! ( $facebook_user && isset( $facebook_user['fb_uid'] ) ) )
237 | return $content;
238 |
239 | $options['href'] = Facebook_User::facebook_profile_link( $facebook_user );
240 | if ( ! $options['href'] )
241 | return $content;
242 |
243 | if ( $options['position'] === 'top' ) {
244 | $options['ref'] = 'above-post';
245 | return facebook_get_follow_button( $options ) . $content;
246 | } else if ( $options['position'] === 'bottom' ) {
247 | $options['ref'] = 'below-post';
248 | return $content . facebook_get_follow_button( $options );
249 | } else if ( $options['position'] === 'both' ) {
250 | $options['ref'] = 'above-post';
251 | $above = facebook_get_follow_button( $options );
252 | $options['ref'] = 'below-post';
253 | return $above . $content . facebook_get_follow_button( $options );
254 | }
255 |
256 | // don't break the filter
257 | return $content;
258 | }
259 |
260 | ?>
261 |
--------------------------------------------------------------------------------
/social-plugins/widgets/follow-button.php:
--------------------------------------------------------------------------------
1 | __( 'Lets a user follow your public updates on Facebook.', 'facebook' ) ) // Args
21 | );
22 | }
23 |
24 | /**
25 | * Front-end display of widget.
26 | *
27 | * @since 1.0
28 | *
29 | * @see WP_Widget::widget()
30 | *
31 | * @param array $args Widget arguments.
32 | * @param array $instance Saved values from database.
33 | * @return void
34 | */
35 | public function widget( $args, $instance ) {
36 | // no follow target. fail early
37 | if ( empty( $instance['href'] ) )
38 | return;
39 |
40 | extract( $args );
41 |
42 | if ( ! isset( $instance['ref'] ) )
43 | $instance['ref'] = 'widget';
44 |
45 | if ( ! function_exists( 'facebook_get_follow_button' ) )
46 | require_once( dirname( dirname(__FILE__) ) . '/social-plugins.php' );
47 |
48 | $follow_button_html = facebook_get_follow_button( $instance );
49 | if ( ! ( is_string( $follow_button_html ) && $follow_button_html ) )
50 | return;
51 |
52 | echo $before_widget;
53 |
54 | $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
55 |
56 | if ( $title )
57 | echo $before_title . $title . $after_title;
58 |
59 | echo $follow_button_html;
60 |
61 | echo $after_widget;
62 | }
63 |
64 | /**
65 | * Sanitize widget form values as they are saved.
66 | *
67 | * @since 1.0
68 | *
69 | * @see WP_Widget::update()
70 | *
71 | * @param array $new_instance Values just sent to be saved.
72 | * @param array $old_instance Previously saved values from database.
73 | *
74 | * @return array Updated safe values to be saved.
75 | */
76 | public function update( $new_instance, $old_instance ) {
77 | $instance = array();
78 | $new_instance = (array) $new_instance;
79 |
80 | if ( ! empty( $new_instance['title'] ) )
81 | $instance['title'] = strip_tags( $new_instance['title'] );
82 |
83 | if ( isset( $new_instance['show_faces'] ) )
84 | $new_instance['show_faces'] = true;
85 | else
86 | $new_instance['show_faces'] = false;
87 |
88 | if ( isset( $new_instance['width'] ) )
89 | $new_instance['width'] = absint( $new_instance['width'] );
90 |
91 | if ( ! class_exists( 'Facebook_Follow_Button' ) )
92 | require_once( dirname( dirname(__FILE__) ) . '/class-facebook-follow-button.php' );
93 |
94 | $follow_button = Facebook_Follow_Button::fromArray( $new_instance );
95 | if ( $follow_button ) {
96 | if ( ! class_exists( 'Facebook_Follow_Button_Settings' ) )
97 | require_once( dirname( dirname( dirname(__FILE__) ) ) . '/admin/settings-follow-button.php' );
98 |
99 | return array_merge( $instance, Facebook_Follow_Button_Settings::html_data_to_options( $follow_button->toHTMLDataArray() ) );
100 | }
101 |
102 | return $instance;
103 | }
104 |
105 | /**
106 | * Back-end widget form.
107 | *
108 | * @since 1.0
109 | *
110 | * @see WP_Widget::form()
111 | *
112 | * @param array $instance Previously saved values from database.
113 | * @return void
114 | */
115 | public function form( $instance ) {
116 | $instance = wp_parse_args( (array) $instance, array(
117 | 'title' => '',
118 | 'href' => '',
119 | 'layout' => 'standard',
120 | 'show_faces' => false,
121 | 'colorscheme' => 'light',
122 | 'font' => '',
123 | 'width' => 0
124 | ) );
125 |
126 | $this->display_title( isset( $instance['title'] ) ? $instance['title'] : '' );
127 | $this->display_href( isset( $instance['href'] ) ? $instance['href'] : '' );
128 |
129 | if ( ! class_exists( 'Facebook_Follow_Button_Settings' ) )
130 | require_once( dirname( dirname( dirname(__FILE__) ) ) . '/admin/settings-follow-button.php' );
131 |
132 | $follow_button_settings = new Facebook_Follow_Button_Settings( $instance );
133 |
134 | echo '' . esc_html( __( 'Layout', 'facebook' ) ) . ': ';
135 | $follow_button_settings->display_layout( array(
136 | 'id' => $this->get_field_id( 'layout' ),
137 | 'name' => $this->get_field_name( 'layout' )
138 | ) );
139 | echo '
';
140 |
141 | echo '';
142 | $follow_button_settings->display_show_faces( array(
143 | 'id' => $this->get_field_id( 'show_faces' ),
144 | 'name' => $this->get_field_name( 'show_faces' )
145 | ) );
146 | echo '
';
147 |
148 | echo '' . esc_html( __( 'Width', 'facebook' ) ) . ' : ';
149 | $follow_button_settings->display_width( array(
150 | 'id' => $this->get_field_id( 'width' ),
151 | 'name' => $this->get_field_name( 'width' )
152 | ) );
153 | echo '
';
154 |
155 | echo '' . esc_html( __( 'Font', 'facebook' ) ) . ' : ';
156 | $follow_button_settings->display_font( array(
157 | 'id' => $this->get_field_id( 'font' ),
158 | 'name' => $this->get_field_name( 'font' )
159 | ) );
160 | echo '
';
161 |
162 | echo '' . esc_html( __( 'Color scheme', 'facebook' ) ) . ': ';
163 | $follow_button_settings->display_colorscheme( array(
164 | 'id' => $this->get_field_id( 'colorscheme' ),
165 | 'name' => $this->get_field_name( 'colorscheme' )
166 | ) );
167 | echo '
';
168 | }
169 |
170 | /**
171 | * Allow a publisher to customize the title displayed above the widget area
172 | *
173 | * e.g. Like us on Facebook!
174 | *
175 | * @since 1.1
176 | *
177 | * @param string $existing_value saved title
178 | * @return void
179 | */
180 | public function display_title( $existing_value = '' ) {
181 | echo '' . esc_html( __( 'Title', 'facebook' ) ) . ': ';
182 | echo '
';
186 | }
187 |
188 | /**
189 | * Customize the Like target
190 | *
191 | * @since 1.1
192 | *
193 | * @param string $existing_value stored URL value
194 | * @return void
195 | */
196 | public function display_href( $existing_value = '' ) {
197 | echo 'URL:
';
201 |
202 | echo '' . esc_html( __( 'Must be a Facebook URL', 'facebook' ) ) . '
';
203 | }
204 | }
205 | ?>
206 |
--------------------------------------------------------------------------------
/social-plugins/widgets/index.php:
--------------------------------------------------------------------------------
1 | 'widget_facebook_like',
23 | 'description' => __( 'Lets a viewer share your content to his or her Facebook timeline.', 'facebook' ) ) // Args
24 | );
25 | }
26 |
27 | /**
28 | * Front-end display of widget.
29 | *
30 | * @see WP_Widget::widget()
31 | *
32 | * @since 1.0
33 | *
34 | * @param array $args Widget arguments.
35 | * @param array $instance Saved values from database.
36 | *
37 | * @return void
38 | */
39 | public function widget( $args, $instance ) {
40 | extract( $args );
41 |
42 | // identify which like button placement led to action
43 | if ( ! isset( $instance['ref'] ) )
44 | $instance['ref'] = 'widget';
45 |
46 | if ( ! class_exists( 'Facebook_Like_Button' ) )
47 | require_once( dirname( dirname(__FILE__) ) . '/class-facebook-like-button.php' );
48 |
49 | $like_button = Facebook_Like_Button::fromArray( $instance );
50 | if ( ! $like_button )
51 | return;
52 |
53 | $like_button_html = $like_button->asHTML();
54 | if ( ! ( is_string( $like_button_html ) && $like_button_html ) )
55 | return;
56 |
57 | echo $before_widget;
58 |
59 | $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
60 |
61 | if ( $title )
62 | echo $before_title . $title . $after_title;
63 |
64 | echo $like_button_html;
65 |
66 | echo $after_widget;
67 | }
68 |
69 | /**
70 | * Sanitize widget form values as they are saved.
71 | *
72 | * @see WP_Widget::update()
73 | *
74 | * @since 1.0
75 | *
76 | * @param array $new_instance Values just sent to be saved.
77 | * @param array $old_instance Previously saved values from database.
78 | *
79 | * @return array Updated safe values to be saved.
80 | */
81 | public function update( $new_instance, $old_instance ) {
82 | $instance = array();
83 | $new_instance = (array) $new_instance;
84 |
85 | if ( ! empty( $new_instance['title'] ) )
86 | $instance['title'] = strip_tags( $new_instance['title'] );
87 |
88 | foreach( array( 'share', 'show_faces' ) as $bool_option ) {
89 | if ( isset( $new_instance[ $bool_option ] ) )
90 | $new_instance[ $bool_option ] = true;
91 | else
92 | $new_instance[ $bool_option ] = false;
93 | }
94 |
95 | if ( ! class_exists( 'Facebook_Like_Button' ) )
96 | require_once( dirname( dirname(__FILE__) ) . '/class-facebook-like-button.php' );
97 |
98 | $like_button = Facebook_Like_Button::fromArray( $new_instance );
99 | if ( $like_button ) {
100 | if ( ! class_exists( 'Facebook_Like_Button_Settings' ) )
101 | require_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/admin/settings-like-button.php' );
102 |
103 | return array_merge( $instance, Facebook_Like_Button_Settings::html_data_to_options( $like_button->toHTMLDataArray() ) );
104 | }
105 |
106 | return $instance;
107 | }
108 |
109 | /**
110 | * Back-end widget form.
111 | *
112 | * @see WP_Widget::form()
113 | *
114 | * @since 1.0
115 | *
116 | * @param array $instance Previously saved values from database.
117 | * @return void
118 | */
119 | public function form( $instance ) {
120 | $instance = wp_parse_args( (array) $instance, array(
121 | 'title' => '',
122 | 'href' => '',
123 | 'share' => false,
124 | 'layout' => 'standard',
125 | 'show_faces' => false,
126 | 'width' => 0,
127 | 'action' => 'like',
128 | 'font' => '',
129 | 'colorscheme' => 'light'
130 | ) );
131 |
132 | $this->display_title( $instance['title'] );
133 | $this->display_href( $instance['href'] );
134 |
135 | if ( ! class_exists( 'Facebook_Like_Button_Settings' ) )
136 | require_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/admin/settings-like-button.php' );
137 |
138 | $like_button_settings = new Facebook_Like_Button_Settings( $instance );
139 |
140 | echo '';
141 | $like_button_settings->display_share( array(
142 | 'id' => $this->get_field_id( 'share' ),
143 | 'name' => $this->get_field_name( 'share' )
144 | ) );
145 | echo '
';
146 |
147 | echo '' . esc_html( __( 'Layout', 'facebook' ) ) . ': ';
148 | $like_button_settings->display_layout( array(
149 | 'id' => $this->get_field_id( 'layout' ),
150 | 'name' => $this->get_field_name( 'layout' )
151 | ) );
152 | echo '
';
153 |
154 | echo '';
155 | $like_button_settings->display_show_faces( array(
156 | 'id' => $this->get_field_id( 'show_faces' ),
157 | 'name' => $this->get_field_name( 'show_faces' )
158 | ) );
159 | echo '
';
160 |
161 | echo '' . esc_html( __( 'Width', 'facebook' ) ) . ' : ';
162 | $like_button_settings->display_width( array(
163 | 'id' => $this->get_field_id( 'width' ),
164 | 'name' => $this->get_field_name( 'width' )
165 | ) );
166 | echo '
';
167 |
168 | echo '' . esc_html( __( 'Action', 'facebook' ) ) . ': ';
169 | $like_button_settings->display_action( array(
170 | 'id' => $this->get_field_id( 'action' ),
171 | 'name' => $this->get_field_name( 'action' )
172 | ) );
173 | echo '
';
174 |
175 | echo '' . esc_html( __( 'Font', 'facebook' ) ) . ' : ';
176 | $like_button_settings->display_font( array(
177 | 'id' => $this->get_field_id( 'font' ),
178 | 'name' => $this->get_field_name( 'font' )
179 | ) );
180 | echo '
';
181 |
182 | echo '' . esc_html( __( 'Color scheme', 'facebook' ) ) . ': ';
183 | $like_button_settings->display_colorscheme( array(
184 | 'id' => $this->get_field_id( 'colorscheme' ),
185 | 'name' => $this->get_field_name( 'colorscheme' )
186 | ) );
187 | echo '
';
188 | }
189 |
190 | /**
191 | * Allow a publisher to customize the title displayed above the widget area.
192 | *
193 | * e.g. Like us on Facebook!
194 | *
195 | * @since 1.1
196 | *
197 | * @param string $existing_value saved title
198 | * @return void
199 | */
200 | public function display_title( $existing_value = '' ) {
201 | echo '' . esc_html( __( 'Title', 'facebook' ) ) . ': ';
202 | echo '
';
206 | }
207 |
208 | /**
209 | * Customize the Like target.
210 | *
211 | * @since 1.1
212 | *
213 | * @param string $existing_value stored URL value
214 | * @return void
215 | */
216 | public function display_href( $existing_value = '' ) {
217 | echo 'URL:
';
221 |
222 | echo '' . esc_html( __( 'Default: URL of the displayed page', 'facebook' ) ) . '
';
223 | }
224 | }
225 |
226 | ?>
227 |
--------------------------------------------------------------------------------
/social-plugins/widgets/recommendations-box.php:
--------------------------------------------------------------------------------
1 | __( 'Shows personalized recommendations to your users.', 'facebook' ) ) // Args
22 | );
23 | }
24 |
25 | /**
26 | * Front-end display of widget.
27 | *
28 | * @see WP_Widget::widget()
29 | *
30 | * @since 1.1
31 | *
32 | * @param array $args Widget arguments.
33 | * @param array $instance Saved values from database.
34 | * @return void
35 | */
36 | public function widget( $args, $instance ) {
37 | extract( $args );
38 |
39 | if ( ! class_exists( 'Facebook_Recommendations_Box' ) )
40 | require_once( dirname( dirname(__FILE__) ) . '/class-facebook-recommendations-box.php' );
41 |
42 | if ( empty( $instance['ref'] ) )
43 | $instance['ref'] = 'recommendations-box-widget';
44 |
45 | $box = Facebook_Recommendations_Box::fromArray( $instance );
46 | if ( ! $box )
47 | return;
48 |
49 | $box_html = $box->asHTML( array( 'class' => array( 'fb-social-plugin' ) ) );
50 | if ( ! ( is_string( $box_html ) && $box_html ) )
51 | return;
52 |
53 | echo $before_widget;
54 |
55 | $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
56 |
57 | if ( $title )
58 | echo $before_title . $title . $after_title;
59 |
60 | echo $box_html;
61 |
62 | echo $after_widget;
63 | }
64 |
65 | /**
66 | * Sanitize widget form values as they are saved.
67 | *
68 | * @see WP_Widget::update()
69 | *
70 | * @since 1.1
71 | *
72 | * @param array $new_instance Values just sent to be saved.
73 | * @param array $old_instance Previously saved values from database.
74 | *
75 | * @return array Updated safe values to be saved.
76 | */
77 | public function update( $new_instance, $old_instance ) {
78 | $instance = array();
79 | $new_instance = (array) $new_instance;
80 |
81 | if ( ! empty( $new_instance['title'] ) )
82 | $instance['title'] = strip_tags( $new_instance['title'] );
83 |
84 | if ( isset( $new_instance['header'] ) )
85 | $new_instance['header'] = true;
86 | else
87 | $new_instance['header'] = false;
88 |
89 | foreach( array( 'width', 'height', 'max_age' ) as $option ) {
90 | if ( isset( $new_instance[ $option ] ) )
91 | $new_instance[ $option ] = absint( $new_instance[ $option ] );
92 | }
93 |
94 | if ( ! class_exists( 'Facebook_Recommendations_Box' ) )
95 | require_once( dirname( dirname( __FILE__ ) ) . '/class-facebook-recommendations-box.php' );
96 |
97 | $box = Facebook_Recommendations_Box::fromArray( $new_instance );
98 | if ( $box ) {
99 | $box_options = $box->toHTMLDataArray();
100 |
101 | if ( isset( $box_options['header'] ) ) {
102 | if ( $box_options['header'] === 'true' )
103 | $box_options['header'] = true;
104 | else if ( $box_options['header'] === 'false' )
105 | $box_options['header'] = false;
106 | }
107 |
108 | if ( isset( $box_options['max-age'] ) ) {
109 | $box_options['max_age'] = absint( $box_options['max-age'] );
110 | unset( $box_options['max-age'] );
111 | }
112 |
113 | foreach( array( 'width', 'height' ) as $option ) {
114 | if ( isset( $box_options[ $option ] ) )
115 | $box_options[ $option ] = absint( $box_options[ $option ] );
116 | }
117 |
118 | return array_merge( $instance, $box_options );
119 | }
120 |
121 | return $instance;
122 | }
123 |
124 | /**
125 | * Back-end widget form.
126 | *
127 | * @see WP_Widget::form()
128 | *
129 | * @since 1.1
130 | *
131 | * @param array $instance Previously saved values from database.
132 | * @return void
133 | */
134 | public function form( $instance ) {
135 | $instance = wp_parse_args( (array) $instance, array(
136 | 'title' => '',
137 | 'max_age' => 0,
138 | 'width' => 0,
139 | 'height' => 0,
140 | 'font' => '',
141 | 'colorscheme' => 'light'
142 | ) );
143 | $this->display_title( $instance['title'] );
144 | $this->display_header( isset( $instance['header'] ) && ( $instance['header'] === true || $instance['header'] == '1' || $instance['header'] === 'true' ) );
145 | $this->display_max_age( absint( $instance['max_age'] ) );
146 | $this->display_width( absint( $instance['width'] ) );
147 | $this->display_height( absint( $instance['height'] ) );
148 | $this->display_font( $instance['font'] );
149 | echo '
';
150 | $this->display_colorscheme( $instance['colorscheme'] );
151 | }
152 |
153 | /**
154 | * Allow a publisher to customize the title displayed above the widget area.
155 | *
156 | * e.g. Things we hope you will like.
157 | *
158 | * @since 1.1
159 | *
160 | * @param string $existing_value saved title
161 | * @return void
162 | */
163 | public function display_title( $existing_value = '' ) {
164 | echo '' . esc_html( __( 'Title', 'facebook' ) ) . ': ';
165 | echo '
';
169 | }
170 |
171 | /**
172 | * Show the Facebook header.
173 | *
174 | * Works best when you don't set your own widget title.
175 | *
176 | * @since 1.1
177 | *
178 | * @param bool $true_false
179 | * @return void
180 | */
181 | public function display_header( $true_false ) {
182 | echo ' ' . esc_html( __( 'Include Facebook header', 'facebook' ) ) . '
';
185 | }
186 |
187 | /**
188 | * Specify the width of the recommendations box in whole pixels.
189 | *
190 | * @since 1.1
191 | *
192 | * @param int $existing_value previously stored value
193 | * @return void
194 | */
195 | public function display_width( $existing_value = 300 ) {
196 | if ( $existing_value < 200 )
197 | $existing_value = 300;
198 | echo '' . esc_html( __( 'Width' ) ) . ': ' . '
';
199 | }
200 |
201 | /**
202 | * Specify the height of the recommendations box in whole pixels.
203 | *
204 | * @since 1.1
205 | *
206 | * @param int $existing_value previously stored value
207 | * @return void
208 | */
209 | public function display_height( $existing_value = 300 ) {
210 | if ( $existing_value < 200 )
211 | $existing_value = 300;
212 | echo '' . esc_html( __( 'Height' ) ) . ': ' . '
';
213 | }
214 |
215 | /**
216 | * Choose a font.
217 | *
218 | * @since 1.1
219 | * @param string $existing_value stored font value
220 | * @return void
221 | */
222 | public function display_font( $existing_value = '' ) {
223 | if ( ! class_exists( 'Facebook_Social_Plugin_Settings' ) )
224 | require_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/admin/settings-social-plugin.php' );
225 |
226 | echo '' . esc_html( __( 'Font', 'facebook') ) . ': ' . Facebook_Social_Plugin_Settings::font_choices( $existing_value ) . ' ';
227 | }
228 |
229 | /**
230 | * Choose a light or dark color scheme.
231 | *
232 | * @since 1.1
233 | *
234 | * @param string $existing_value saved colorscheme value
235 | * @return void
236 | */
237 | public function display_colorscheme( $existing_value = 'light' ) {
238 | if ( ! class_exists( 'Facebook_Social_Plugin_Settings' ) )
239 | require_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/admin/settings-social-plugin.php' );
240 |
241 | $color_schemes = Facebook_Social_Plugin_Settings::color_scheme_choices( $this->get_field_name( 'colorscheme' ), $existing_value );
242 | if ( $color_schemes )
243 | echo '' . esc_html( __( 'Color scheme', 'facebook' ) ) . ': ' . $color_schemes . ' ';
244 | }
245 |
246 | /**
247 | * Limit articles displayed in recommendations box to last N days where N is a number between 0 (no limit) and 180.
248 | *
249 | * @since 1.1
250 | *
251 | * @param int $existing_value stored value
252 | * @return void
253 | */
254 | public function display_max_age( $existing_value = 0 ) {
255 | echo '' . esc_html( __( 'Maximum age', 'facebook' ) ) . ': ';
256 | echo ' ' . esc_html( _n( 'day old', 'days old', $existing_value, 'facebook' ) );
257 |
258 | // days === 0 can be confusing. clarify
259 | if ( $existing_value === 0 )
260 | echo ' ' . esc_html( __( '(no limit)', 'facebook' ) );
261 |
262 | echo '
';
263 |
264 | echo '' . esc_html( __( 'Limit recommendations to articles authored within the last N days.', 'facebook' ) ) . ' ' . esc_html( sprintf( __( 'Reset this value to %s for no date-based limits.', 'facebook' ), '"0"' ) ) . '
';
265 | }
266 | }
267 |
268 | ?>
269 |
--------------------------------------------------------------------------------
/social-plugins/widgets/send-button.php:
--------------------------------------------------------------------------------
1 | __( 'The Send Button allows users to easily send content to their friends.', 'facebook' ), ) // Args
21 | );
22 | }
23 |
24 | /**
25 | * Front-end display of widget.
26 | *
27 | * @see WP_Widget::widget()
28 | *
29 | * @since 1.0
30 | *
31 | * @param array $args Widget arguments.
32 | * @param array $instance Saved values from database.
33 | * @return void
34 | */
35 | public function widget( $args, $instance ) {
36 | extract( $args );
37 |
38 | if ( ! isset( $instance['ref'] ) )
39 | $instance['ref'] = 'widget';
40 |
41 | if ( ! function_exists( 'facebook_get_send_button' ) )
42 | require_once( dirname( dirname(__FILE__) ) . '/social-plugins.php' );
43 | $send_button_html = facebook_get_send_button( $instance );
44 |
45 | if ( ! ( is_string( $send_button_html ) && $send_button_html ) )
46 | return;
47 |
48 | echo $before_widget;
49 |
50 | $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base );
51 |
52 | if ( $title )
53 | echo $before_title . $title . $after_title;
54 |
55 | echo $send_button_html;
56 |
57 | echo $after_widget;
58 | }
59 |
60 | /**
61 | * Sanitize widget form values as they are saved.
62 | *
63 | * @see WP_Widget::update()
64 | *
65 | * @since 1.0
66 | *
67 | * @param array $new_instance Values just sent to be saved.
68 | * @param array $old_instance Previously saved values from database.
69 | *
70 | * @return array Updated safe values to be saved.
71 | */
72 | public function update( $new_instance, $old_instance ) {
73 | $instance = array();
74 | $new_instance = (array) $new_instance;
75 |
76 | if ( ! empty( $new_instance['title'] ) )
77 | $instance['title'] = strip_tags( $new_instance['title'] );
78 |
79 | if ( ! class_exists( 'Facebook_Send_Button' ) )
80 | require_once( dirname( dirname(__FILE__) ) . '/class-facebook-send-button.php' );
81 |
82 | $send_button = Facebook_Send_Button::fromArray( $new_instance );
83 | if ( $send_button ) {
84 | return array_merge( $instance, $send_button->toHTMLDataArray() );
85 | }
86 |
87 | return $instance;
88 | }
89 |
90 | /**
91 | * Back-end widget form.
92 | *
93 | * @see WP_Widget::form()
94 | *
95 | * @since 1.0
96 | *
97 | * @param array $instance Previously saved values from database.
98 | * @return void
99 | */
100 | public function form( $instance ) {
101 | $instance = wp_parse_args( (array) $instance, array(
102 | 'title' => '',
103 | 'href' => '',
104 | 'font' => '',
105 | 'colorscheme' => 'light'
106 | ) );
107 |
108 | $this->display_title( $instance['title'] );
109 | $this->display_href( $instance['href'] );
110 |
111 | if ( ! class_exists( 'Facebook_Send_Button_Settings' ) )
112 | require_once( dirname( dirname( dirname(__FILE__) ) ) . '/admin/settings-send-button.php' );
113 |
114 | $send_button_settings = new Facebook_Send_Button_Settings( $instance );
115 |
116 | echo '' . esc_html( __( 'Font', 'facebook' ) ) . ' : ';
117 | $send_button_settings->display_font( array(
118 | 'id' => $this->get_field_id( 'font' ),
119 | 'name' => $this->get_field_name( 'font' )
120 | ) );
121 | echo '
';
122 |
123 | echo '' . esc_html( __( 'Color scheme', 'facebook' ) ) . ': ';
124 | $send_button_settings->display_colorscheme( array(
125 | 'id' => $this->get_field_id( 'colorscheme' ),
126 | 'name' => $this->get_field_name( 'colorscheme' )
127 | ) );
128 | echo '
';
129 | }
130 |
131 | /**
132 | * Allow a publisher to customize the title displayed above the widget area.
133 | *
134 | * e.g. Send this page to your friends!
135 | *
136 | * @since 1.1
137 | *
138 | * @param string $existing_value saved title
139 | * @return void
140 | */
141 | public function display_title( $existing_value = '' ) {
142 | echo '' . esc_html( __( 'Title', 'facebook' ) ) . ': ';
143 | echo '
';
147 | }
148 |
149 | /**
150 | * Customize the Send target.
151 | *
152 | * @since 1.1
153 | *
154 | * @param string $existing_value stored URL value
155 | * @return void
156 | */
157 | public function display_href( $existing_value = '' ) {
158 | echo 'URL:
';
162 |
163 | echo '' . esc_html( __( 'Default: URL of the displayed page', 'facebook' ) ) . '
';
164 | }
165 | }
166 | ?>
167 |
--------------------------------------------------------------------------------
/static/css/admin/debug.css:
--------------------------------------------------------------------------------
1 | #wpbody-content section {
2 | margin-top: 3em;
3 | }
4 |
5 | #wpbody-content table {
6 | background-color: transparent;
7 | border-collapse: collapse;
8 | border-spacing: 0;
9 | min-width: 33%;
10 | max-width: 100%;
11 | margin-top: 2em;
12 | }
13 |
14 | #wpbody-content th, #wpbody-content td {
15 | padding: 8px;
16 | vertical-align: top;
17 | border-top-style: solid;
18 | border-top-width: 1px;
19 | border-top-color: #ddd;
20 | }
21 |
22 | #wpbody-content th {
23 | font-weight: bold;
24 | }
25 |
26 | #wpbody-content td {
27 | text-align: center;
28 | }
29 |
30 | #debug-server td {
31 | text-align: left;
32 | }
33 |
34 | // Bottom align for column headings
35 | #wpbody-content thead th {
36 | text-align: center;
37 | vertical-align: bottom;
38 | }
39 |
40 | #wpbody-content thead th:first-child {
41 | text-align: left;
42 | }
43 |
44 | #wpbody-content tbody th {
45 | text-align: left;
46 | }
47 |
48 | #wpbody-content caption + thead tr:first-child th, #wpbody-content caption + thead tr:first-child td, #wpbody-content colgroup + thead tr:first-child th, #wpbody-content colgroup + thead tr:first-child td, #wpbody-content thead:first-child tr:first-child th, #wpbody-content thead:first-child tr:first-child td {
49 | border-top: 0;
50 | }
51 |
52 | tbody tr:nth-child(odd) td, tbody tr:nth-child(odd) th {
53 | background-color: #f9f9f9;
54 | }
55 |
56 | .feature-present {
57 | font-style: bold;
58 | color: green;
59 | }
60 |
61 | .feature-not-present {
62 | font-style: bold;
63 | color: red
64 | }
65 |
66 | a.facebook-icon {
67 | text-decoration: none;
68 | }
--------------------------------------------------------------------------------
/static/css/admin/debug.min.css:
--------------------------------------------------------------------------------
1 | #wpbody-content section{margin-top:3em}#wpbody-content table{background-color:transparent;border-collapse:collapse;border-spacing:0;min-width:33%;max-width:100%;margin-top:2em}#wpbody-content th,#wpbody-content td{padding:8px;vertical-align:top;border-top-style:solid;border-top-width:1px;border-top-color:#ddd}#wpbody-content th{font-weight:bold}#wpbody-content td{text-align:center}#debug-server td{text-align:left}// Bottom align for column headings #wpbody-content thead th{text-align:center;vertical-align:bottom}#wpbody-content thead th:first-child{text-align:left}#wpbody-content tbody th{text-align:left}#wpbody-content caption+thead tr:first-child th,#wpbody-content caption+thead tr:first-child td,#wpbody-content colgroup+thead tr:first-child th,#wpbody-content colgroup+thead tr:first-child td,#wpbody-content thead:first-child tr:first-child th,#wpbody-content thead:first-child tr:first-child td{border-top:0}tbody tr:nth-child(odd) td,tbody tr:nth-child(odd) th{background-color:#f9f9f9}.feature-present{font-style:bold;color:green}.feature-not-present{font-style:bold;color:red}a.facebook-icon{text-decoration:none}
--------------------------------------------------------------------------------
/static/css/admin/icons.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'facebookdashicons';
3 | src: url('../../fonts/facebookdashicons.eot');
4 | }
5 | @font-face {
6 | font-family: 'facebookdashicons';
7 | src: url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAATIAAsAAAAABwwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAABCAAAAZIAAAHUKZiRTEZGVE0AAAKcAAAAGgAAABxl3eL0R0RFRgAAArgAAAAdAAAAIAAwAARPUy8yAAAC2AAAAEsAAABgL9zcQGNtYXAAAAMkAAAAOgAAAVLgEvLNaGVhZAAAA2AAAAAuAAAANv10tH9oaGVhAAADkAAAACAAAAAkBBH/5GhtdHgAAAOwAAAADAAAAAwEAAAAbWF4cAAAA7wAAAAGAAAABgADUABuYW1lAAADxAAAAPUAAAH7jFzWJnBvc3QAAAS8AAAADAAAACAAAwAAeJxlTz1IW2EUPV/yYp7h8WKDCRWeL5mKIoVEEMSiiKiLXUSoRRz8SUURTMF0ERxF4RtcpIMigpguli46qgiN6NCx0MWh+IMdOljE8IHi8b6hLt7h3nPPhXPOVbAsKKUSE6PjH8YKhen86Ozk1HhhZhYqBIUOUx8yfti8tLQT1o7lx1A3kKDWT8CJ6mnz2RQjHtbjHlDjYfOFB9tTPxKwAg0bcWSQ+zQz1ZvNZmX0yHjm9zwAoBbVEsKBRhiOylRcU7TuV8xK1K1QXb6vMcUkES9dEM5uK3mTHyKv587SfGhbHo4G+LewfSf/T0OeT86nloijkS6i62S3iqi++0O8vf1O7rzJa03kUosRItWzSVS1dIpBU4jI5F75RKP7joDdLA1CdpdXI6S5HJH9tkxelc6IUO0ceV660DZZ/vlA/irukacNFfLgtZumlJDHfcfkvjsohtyJtUuYf9sBbts4JKvvrrQIX/f/leQDRt5bK0mOhXSa6ujjVjTAksb5agenL7J+S/qurjWNSe3EHgFtTc4JAAB4nGNgYGBkAIKTnfmGIPqcluVDGA0AP8UGGAAAeJxjYGRgYOADYgkGEGBiYARCEMkC5jEAAARgADUAAAB4nGNgZmJgnMDAysDB6MOYxsDA4A6lvzJIMrQwMDAxsDIzwIEAgskQkOaawuDwgOEDA+OD/w8Y9BgfMCg0MDAwwhUoACEjABBCDB8AeJxjYGBgZoBgGQZGBhDwAfIYwXwWBgMgzQGETCCJBwwfGP7/R2YpMAkwQnWBASMbAzJ3RAIAyV4IrgAAeJxjYGRgYADib35vpsfz23xl4GZiAIFzWpYPEfT/B0yMjA+AXA4GsDQAS2ILZwAAeJxjYGRgYHzw/wGDHhMDA8M/BiZGBqAICmAGAG36A/cCAAAAAAAAAAIAAAAAAFAAAAMAAHicnY9BTsJAGIW/gYIxGBM2rht0aWtbEwMcoEsWmhC3pZTSQDpJC1fxDF7Iw7jztc7OhQkzmfzfvHnvnxnghg8M3TBMeXA84IrU8ZBHPh178nw7HjEx947HTM2bnMa7ljLrUx0PuOXF8ZB3Vo49eb4cj7gzE8djZuaJHRk5BRus5oGt9i17KqmWWswuy4uNtYdt1u6r3NaSXpUoOXOUu9G2KM/HTJD2mVNfGzkKfBJCItWl1v+3/foWBMy1EiVjntXY1qfUNmXhJ2HkL/0/b5K2COZBEsVyX/aptRKNzqre4+vi7uGsi6atbO3HYXRh5x+KOVigAAAAeJxjYGbACwAAfQAE) format('woff'),
8 | url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAANAIAAAwBQRkZUTWXd4vQAAAYIAAAAHEdERUYAMgAGAAAF6AAAACBPUy8yL7rcHwAAAVgAAABWY21hcOAU89QAAAHEAAABUmdhc3D//wADAAAF4AAAAAhnbHlmrgALswAAAyQAAACEaGVhZP11tH8AAADcAAAANmhoZWEEEv/mAAABFAAAACRobXR4BKoAAAAAAbAAAAAUbG9jYQAOAEIAAAMYAAAADG1heHAASAAoAAABOAAAACBuYW1ljFzWJgAAA6gAAAH7cG9zdJtVPjcAAAWkAAAAPAABAAAAAQAADHZhzV8PPPUACwIAAAAAAM4qOeEAAAAAzio54QAA/+ACAgHgAAAACAACAAAAAAAAAAEAAAHg/+AALgIAAAD+AAICAAEAAAAAAAAAAAAAAAAAAAAFAAEAAAAFACUAAQAAAAAAAgAAAAEAAQAAAEAAAAAAAAAAAQIAAZAABQAIAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAIABQMAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUGZFZABA4ADwAAHg/+AALgHgACCAAAABAAAAAAAAAgAAAAAAAAAAqgAAAAAAAAIAAAAAAAADAAAAAwAAABwAAQAAAAAATAADAAEAAAAcAAQAMAAAAAgACAACAAAAAOAA8AD//wAAAADgAPAA//8AACAEEAMAAQAAAAAAAAAAAAABBgAAAQAAAAAAAAABAgAAAAIAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgBCAAEAAP/gAgAB4AACAAARASECAP4AAeD+AAAAAAABAAD/4gICAeAAJAAAASEiBhURFBY7ATUjNTM1NDYzMhcVIyIGHQEzByMVMzI2NRE0JgHl/jcLEREL9kNDNy0lFykXEE0KQ4MMEREB4BAM/joLEcZNODE1A0UTEjFNxhELAcYMEAAAAAAADACWAAEAAAAAAAEAEQAkAAEAAAAAAAIABwBGAAEAAAAAAAMALACoAAEAAAAAAAQAEQD5AAEAAAAAAAUACwEjAAEAAAAAAAYAEQFTAAMAAQQJAAEAIgAAAAMAAQQJAAIADgA2AAMAAQQJAAMAWABOAAMAAQQJAAQAIgDVAAMAAQQJAAUAFgELAAMAAQQJAAYAIgEvAGYAYQBjAGUAYgBvAG8AawBkAGEAcwBoAGkAYwBvAG4AcwAAZmFjZWJvb2tkYXNoaWNvbnMAAFIAZQBnAHUAbABhAHIAAFJlZ3VsYXIAAEYAbwBuAHQARgBvAHIAZwBlACAAMgAuADAAIAA6ACAAZgBhAGMAZQBiAG8AbwBrAGQAYQBzAGgAaQBjAG8AbgBzACAAOgAgADkALQA4AC0AMgAwADEAMwAARm9udEZvcmdlIDIuMCA6IGZhY2Vib29rZGFzaGljb25zIDogOS04LTIwMTMAAGYAYQBjAGUAYgBvAG8AawBkAGEAcwBoAGkAYwBvAG4AcwAAZmFjZWJvb2tkYXNoaWNvbnMAAFYAZQByAHMAaQBvAG4AIAAxAC4AMAAAVmVyc2lvbiAxLjAAAGYAYQBjAGUAYgBvAG8AawBkAGEAcwBoAGkAYwBvAG4AcwAAZmFjZWJvb2tkYXNoaWNvbnMAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAABAAIBAgEDB3VuaUYwMDAHdW5pRTAwMAAAAAH//wACAAEAAAAOAAAAGAAAAAAAAgABAAMABAABAAQAAAACAAAAAAABAAAAAMmJbzEAAAAAzio54QAAAADOKjnh) format('truetype'),
9 | url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI%2FPgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiID4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8bWV0YWRhdGE%2BClRoaXMgaXMgYSBjdXN0b20gU1ZHIGZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uCjxpY29uc2V0IGdyaWQ9IjE2Ij48L2ljb25zZXQ%2BCjwvbWV0YWRhdGE%2BCjxkZWZzPgo8Zm9udCBpZD0iZmFjZWJvb2tkYXNoaWNvbnMiIGhvcml6LWFkdi14PSI1MTIiID4KPGZvbnQtZmFjZSB1bml0cy1wZXItZW09IjUxMiIgYXNjZW50PSI0ODAiIGRlc2NlbnQ9Ii0zMiIgLz4KPG1pc3NpbmctZ2x5cGggaG9yaXotYWR2LXg9IjUxMiIgLz4KPGdseXBoIGNsYXNzPSJoaWRkZW4iIHVuaWNvZGU9IiYjeGYwMDA7IiBkPSJNMCw0ODBMIDUxMiAtMzJMMCAtMzIgeiIgaG9yaXotYWR2LXg9IjAiIC8%2BCjxnbHlwaCB1bmljb2RlPSImI3hlMDAwOyIgZD0iTSA0ODUuMzQ0LDQ4MEwgMjguMzUyLDQ4MCBDIDEyLjY3Miw0ODAsMCw0NjcuMzkyLDAsNDUxLjg3MmwwLTQ1My40NCBjMC0xNS41MiwgMTIuNjcyLTI4LjEyOCwgMjguMzUyLTI4LjEyOGwgMjQ2LjAxNiwwIEwgMjc0LjM2OCwxNjcuNjggTCAyMDcuNDI0LDE2Ny42OCBMIDIwNy40MjQsMjQ0LjY0IGwgNjYuOTQ0LDAgTCAyNzQuMzY4LDMwMS4zNDQgIGMwLDY1LjgyNCwgNDAuNTQ0LDEwMS42NjQsIDk5LjcxMiwxMDEuNjY0YyAyOC4zNTIsMCwgNTIuNzA0LTIuMDgwLCA1OS44MDgtMy4wNDBMIDQzMy44ODgsMzMxLjIgbC00MS4wNTYtMC4wMzJjLTMyLjE5MiwwLTM4LjQtMTUuMTY4LTM4LjQtMzcuNDRsMC00OS4wODggbCA3Ni43NjgsMCAgTCA0MjEuMjE2LDE2Ny42OGwtNjYuNzg0LDAgbDAtMTk3LjM3NiBsIDEzMC45MTIsMCBjIDE1LjY0OCwwLCAyOC4zNTIsMTIuNjA4LCAyOC4zNTIsMjguMTI4TCA1MTMuNjk2LDQ1MS44NzIgQyA1MTMuNjk2LDQ2Ny4zOTIsIDUwMC45OTIsNDgwLCA0ODUuMzQ0LDQ4MHoiICAvPgo8Z2x5cGggdW5pY29kZT0iJiN4MjA7IiBob3Jpei1hZHYteD0iMjU2IiAvPgo8L2ZvbnQ%2BPC9kZWZzPjwvc3ZnPg%3D%3D) format('svg');
10 | font-weight: normal;
11 | font-style: normal;
12 | }
13 |
14 | #toplevel_page_facebook-application-settings div.wp-menu-image:before, .facebook-icon:before {
15 | content: '\e000';
16 | font-family: 'facebookdashicons' !important;
17 | font-weight: normal !important;
18 | font-variant: normal !important;
19 | -webkit-font-smoothing: antialiased;
20 | }
21 |
22 | .mp6 #toplevel_page_facebook-application-settings div.wp-menu-image:before {
23 | font-size: 16px !important;
24 | line-height: 1 !important;
25 | }
26 |
--------------------------------------------------------------------------------
/static/css/admin/icons.min.css:
--------------------------------------------------------------------------------
1 | @font-face{font-family:'facebookdashicons';src:url('../../fonts/facebookdashicons.eot')}@font-face{font-family:'facebookdashicons';src:url(data:application/font-woff;charset=utf-8;base64,d09GRk9UVE8AAATIAAsAAAAABwwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABDRkYgAAABCAAAAZIAAAHUKZiRTEZGVE0AAAKcAAAAGgAAABxl3eL0R0RFRgAAArgAAAAdAAAAIAAwAARPUy8yAAAC2AAAAEsAAABgL9zcQGNtYXAAAAMkAAAAOgAAAVLgEvLNaGVhZAAAA2AAAAAuAAAANv10tH9oaGVhAAADkAAAACAAAAAkBBH/5GhtdHgAAAOwAAAADAAAAAwEAAAAbWF4cAAAA7wAAAAGAAAABgADUABuYW1lAAADxAAAAPUAAAH7jFzWJnBvc3QAAAS8AAAADAAAACAAAwAAeJxlTz1IW2EUPV/yYp7h8WKDCRWeL5mKIoVEEMSiiKiLXUSoRRz8SUURTMF0ERxF4RtcpIMigpguli46qgiN6NCx0MWh+IMdOljE8IHi8b6hLt7h3nPPhXPOVbAsKKUSE6PjH8YKhen86Ozk1HhhZhYqBIUOUx8yfti8tLQT1o7lx1A3kKDWT8CJ6mnz2RQjHtbjHlDjYfOFB9tTPxKwAg0bcWSQ+zQz1ZvNZmX0yHjm9zwAoBbVEsKBRhiOylRcU7TuV8xK1K1QXb6vMcUkES9dEM5uK3mTHyKv587SfGhbHo4G+LewfSf/T0OeT86nloijkS6i62S3iqi++0O8vf1O7rzJa03kUosRItWzSVS1dIpBU4jI5F75RKP7joDdLA1CdpdXI6S5HJH9tkxelc6IUO0ceV660DZZ/vlA/irukacNFfLgtZumlJDHfcfkvjsohtyJtUuYf9sBbts4JKvvrrQIX/f/leQDRt5bK0mOhXSa6ujjVjTAksb5agenL7J+S/qurjWNSe3EHgFtTc4JAAB4nGNgYGBkAIKTnfmGIPqcluVDGA0AP8UGGAAAeJxjYGRgYOADYgkGEGBiYARCEMkC5jEAAARgADUAAAB4nGNgZmJgnMDAysDB6MOYxsDA4A6lvzJIMrQwMDAxsDIzwIEAgskQkOaawuDwgOEDA+OD/w8Y9BgfMCg0MDAwwhUoACEjABBCDB8AeJxjYGBgZoBgGQZGBhDwAfIYwXwWBgMgzQGETCCJBwwfGP7/R2YpMAkwQnWBASMbAzJ3RAIAyV4IrgAAeJxjYGRgYADib35vpsfz23xl4GZiAIFzWpYPEfT/B0yMjA+AXA4GsDQAS2ILZwAAeJxjYGRgYHzw/wGDHhMDA8M/BiZGBqAICmAGAG36A/cCAAAAAAAAAAIAAAAAAFAAAAMAAHicnY9BTsJAGIW/gYIxGBM2rht0aWtbEwMcoEsWmhC3pZTSQDpJC1fxDF7Iw7jztc7OhQkzmfzfvHnvnxnghg8M3TBMeXA84IrU8ZBHPh178nw7HjEx947HTM2bnMa7ljLrUx0PuOXF8ZB3Vo49eb4cj7gzE8djZuaJHRk5BRus5oGt9i17KqmWWswuy4uNtYdt1u6r3NaSXpUoOXOUu9G2KM/HTJD2mVNfGzkKfBJCItWl1v+3/foWBMy1EiVjntXY1qfUNmXhJ2HkL/0/b5K2COZBEsVyX/aptRKNzqre4+vi7uGsi6atbO3HYXRh5x+KOVigAAAAeJxjYGbACwAAfQAE) format('woff'),url(data:application/x-font-ttf;charset=utf-8;base64,AAEAAAANAIAAAwBQRkZUTWXd4vQAAAYIAAAAHEdERUYAMgAGAAAF6AAAACBPUy8yL7rcHwAAAVgAAABWY21hcOAU89QAAAHEAAABUmdhc3D//wADAAAF4AAAAAhnbHlmrgALswAAAyQAAACEaGVhZP11tH8AAADcAAAANmhoZWEEEv/mAAABFAAAACRobXR4BKoAAAAAAbAAAAAUbG9jYQAOAEIAAAMYAAAADG1heHAASAAoAAABOAAAACBuYW1ljFzWJgAAA6gAAAH7cG9zdJtVPjcAAAWkAAAAPAABAAAAAQAADHZhzV8PPPUACwIAAAAAAM4qOeEAAAAAzio54QAA/+ACAgHgAAAACAACAAAAAAAAAAEAAAHg/+AALgIAAAD+AAICAAEAAAAAAAAAAAAAAAAAAAAFAAEAAAAFACUAAQAAAAAAAgAAAAEAAQAAAEAAAAAAAAAAAQIAAZAABQAIAUwBZgAAAEcBTAFmAAAA9QAZAIQAAAIABQMAAAAAAAAAAAAAEAAAAAAAAAAAAAAAUGZFZABA4ADwAAHg/+AALgHgACCAAAABAAAAAAAAAgAAAAAAAAAAqgAAAAAAAAIAAAAAAAADAAAAAwAAABwAAQAAAAAATAADAAEAAAAcAAQAMAAAAAgACAACAAAAAOAA8AD//wAAAADgAPAA//8AACAEEAMAAQAAAAAAAAAAAAABBgAAAQAAAAAAAAABAgAAAAIAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgBCAAEAAP/gAgAB4AACAAARASECAP4AAeD+AAAAAAABAAD/4gICAeAAJAAAASEiBhURFBY7ATUjNTM1NDYzMhcVIyIGHQEzByMVMzI2NRE0JgHl/jcLEREL9kNDNy0lFykXEE0KQ4MMEREB4BAM/joLEcZNODE1A0UTEjFNxhELAcYMEAAAAAAADACWAAEAAAAAAAEAEQAkAAEAAAAAAAIABwBGAAEAAAAAAAMALACoAAEAAAAAAAQAEQD5AAEAAAAAAAUACwEjAAEAAAAAAAYAEQFTAAMAAQQJAAEAIgAAAAMAAQQJAAIADgA2AAMAAQQJAAMAWABOAAMAAQQJAAQAIgDVAAMAAQQJAAUAFgELAAMAAQQJAAYAIgEvAGYAYQBjAGUAYgBvAG8AawBkAGEAcwBoAGkAYwBvAG4AcwAAZmFjZWJvb2tkYXNoaWNvbnMAAFIAZQBnAHUAbABhAHIAAFJlZ3VsYXIAAEYAbwBuAHQARgBvAHIAZwBlACAAMgAuADAAIAA6ACAAZgBhAGMAZQBiAG8AbwBrAGQAYQBzAGgAaQBjAG8AbgBzACAAOgAgADkALQA4AC0AMgAwADEAMwAARm9udEZvcmdlIDIuMCA6IGZhY2Vib29rZGFzaGljb25zIDogOS04LTIwMTMAAGYAYQBjAGUAYgBvAG8AawBkAGEAcwBoAGkAYwBvAG4AcwAAZmFjZWJvb2tkYXNoaWNvbnMAAFYAZQByAHMAaQBvAG4AIAAxAC4AMAAAVmVyc2lvbiAxLjAAAGYAYQBjAGUAYgBvAG8AawBkAGEAcwBoAGkAYwBvAG4AcwAAZmFjZWJvb2tkYXNoaWNvbnMAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAABAAIBAgEDB3VuaUYwMDAHdW5pRTAwMAAAAAH//wACAAEAAAAOAAAAGAAAAAAAAgABAAMABAABAAQAAAACAAAAAAABAAAAAMmJbzEAAAAAzio54QAAAADOKjnh) format('truetype'),url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI%2FPgo8IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzNDLy9EVEQgU1ZHIDEuMS8vRU4iICJodHRwOi8vd3d3LnczLm9yZy9HcmFwaGljcy9TVkcvMS4xL0RURC9zdmcxMS5kdGQiID4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8bWV0YWRhdGE%2BClRoaXMgaXMgYSBjdXN0b20gU1ZHIGZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uCjxpY29uc2V0IGdyaWQ9IjE2Ij48L2ljb25zZXQ%2BCjwvbWV0YWRhdGE%2BCjxkZWZzPgo8Zm9udCBpZD0iZmFjZWJvb2tkYXNoaWNvbnMiIGhvcml6LWFkdi14PSI1MTIiID4KPGZvbnQtZmFjZSB1bml0cy1wZXItZW09IjUxMiIgYXNjZW50PSI0ODAiIGRlc2NlbnQ9Ii0zMiIgLz4KPG1pc3NpbmctZ2x5cGggaG9yaXotYWR2LXg9IjUxMiIgLz4KPGdseXBoIGNsYXNzPSJoaWRkZW4iIHVuaWNvZGU9IiYjeGYwMDA7IiBkPSJNMCw0ODBMIDUxMiAtMzJMMCAtMzIgeiIgaG9yaXotYWR2LXg9IjAiIC8%2BCjxnbHlwaCB1bmljb2RlPSImI3hlMDAwOyIgZD0iTSA0ODUuMzQ0LDQ4MEwgMjguMzUyLDQ4MCBDIDEyLjY3Miw0ODAsMCw0NjcuMzkyLDAsNDUxLjg3MmwwLTQ1My40NCBjMC0xNS41MiwgMTIuNjcyLTI4LjEyOCwgMjguMzUyLTI4LjEyOGwgMjQ2LjAxNiwwIEwgMjc0LjM2OCwxNjcuNjggTCAyMDcuNDI0LDE2Ny42OCBMIDIwNy40MjQsMjQ0LjY0IGwgNjYuOTQ0LDAgTCAyNzQuMzY4LDMwMS4zNDQgIGMwLDY1LjgyNCwgNDAuNTQ0LDEwMS42NjQsIDk5LjcxMiwxMDEuNjY0YyAyOC4zNTIsMCwgNTIuNzA0LTIuMDgwLCA1OS44MDgtMy4wNDBMIDQzMy44ODgsMzMxLjIgbC00MS4wNTYtMC4wMzJjLTMyLjE5MiwwLTM4LjQtMTUuMTY4LTM4LjQtMzcuNDRsMC00OS4wODggbCA3Ni43NjgsMCAgTCA0MjEuMjE2LDE2Ny42OGwtNjYuNzg0LDAgbDAtMTk3LjM3NiBsIDEzMC45MTIsMCBjIDE1LjY0OCwwLCAyOC4zNTIsMTIuNjA4LCAyOC4zNTIsMjguMTI4TCA1MTMuNjk2LDQ1MS44NzIgQyA1MTMuNjk2LDQ2Ny4zOTIsIDUwMC45OTIsNDgwLCA0ODUuMzQ0LDQ4MHoiICAvPgo8Z2x5cGggdW5pY29kZT0iJiN4MjA7IiBob3Jpei1hZHYteD0iMjU2IiAvPgo8L2ZvbnQ%2BPC9kZWZzPjwvc3ZnPg%3D%3D) format('svg');font-weight:normal;font-style:normal}#toplevel_page_facebook-application-settings div.wp-menu-image:before,.facebook-icon:before{content:'\e000';font-family:'facebookdashicons' !important;font-weight:normal !important;font-variant:normal !important;-webkit-font-smoothing:antialiased}.mp6 #toplevel_page_facebook-application-settings div.wp-menu-image:before{font-size:16px !important;line-height:1 !important}
--------------------------------------------------------------------------------
/static/css/admin/index.html:
--------------------------------------------------------------------------------
1 |
2 | Empty Index Silence is golden.
--------------------------------------------------------------------------------
/static/css/admin/mentions.css:
--------------------------------------------------------------------------------
1 | #facebook-author-message-box-id .ui-autocomplete {
2 | background-color: #fff;
3 | max-width: 100%;
4 | }
5 |
6 | #facebook-author-message-box-id .ui-autocomplete .subtext {
7 | color: #999;
8 | }
9 |
10 | // hide accessibility helper
11 | #facebook-author-message-box-id .ui-autocomplete .ui-helper-hidden-accessible {
12 | position: absolute !important;
13 | overflow: hidden;
14 | height: 1px;
15 | width: 1px;
16 | clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
17 | clip: rect(1px, 1px, 1px, 1px);
18 | }
19 |
20 | #facebook-author-message-box-id .ui-autocomplete .results {
21 | display: block;
22 | position: absolute;
23 | left: 0;
24 | top: 100%;
25 | width: 100%;
26 | }
27 |
28 | #facebook-author-message-box-id ul.ui-autocomplete {
29 | list-style-type: none;
30 | margin: 0;
31 | background-color: #FFF;
32 | border-color: #333333 #333333 #293E6A;
33 | border-style: solid;
34 | border-width: 1px 1px 2px;
35 | overflow: hidden;
36 | padding: 2px 0;
37 | }
38 |
39 | #facebook-author-message-box-id .ui-autocomplete li {
40 | color: #333;
41 | border-color: #FFF;
42 | border-style: solid;
43 | border-width: 1px 0;
44 | cursor: pointer;
45 | min-height: 32px;
46 | padding: 2px 10px 2px 45px;
47 | display: block;
48 | position: relative;
49 | }
50 |
51 | #facebook-author-message-box-id .ui-autocomplete li.ui-state-focus {
52 | background-color: #6d84b4;
53 | border-color: #3b5998;
54 | }
55 | #facebook-author-message-box-id .ui-autocomplete li.ui-state-focus .text, #facebook-author-message-box-id .ui-autocomplete li.ui-state-focus .subtext {
56 | color: #fff !important;
57 | }
58 |
59 | #facebook-author-message-box-id .ui-autocomplete li a.ui-state-focus {
60 | background-color: transparent !important;
61 | }
62 |
63 | #facebook-author-message-box-id .ui-autocomplete li img {
64 | border: 0;
65 | display: block;
66 | position: absolute;
67 | height: 32px;
68 | width: 32px;
69 | left: 6px;
70 | }
71 |
72 | #facebook-author-message-box-id .ui-autocomplete .text {
73 | font-weight: bold;
74 | padding-top: 0;
75 | padding-bottom: 2px;
76 | padding-left: 5px;
77 | }
78 |
79 | #facebook-author-message-box-id .ui-autocomplete .subtext {
80 | color: #999;
81 | padding-left: 5px;
82 | }
83 |
84 | #facebook-author-message-box-id .ui-autocomplete .text, #facebook-author-message-box-id .ui-autocomplete .subtext {
85 | display: block;
86 | overflow: hidden;
87 | padding-bottom: 2px;
88 | text-overflow: ellipsis;
89 | white-space: nowrap;
90 | }
--------------------------------------------------------------------------------
/static/css/admin/mentions.min.css:
--------------------------------------------------------------------------------
1 | #facebook-author-message-box-id .ui-autocomplete{background-color:#fff;max-width:100%}#facebook-author-message-box-id .ui-autocomplete .subtext{color:#999}// hide accessibility helper #facebook-author-message-box-id .ui-autocomplete .ui-helper-hidden-accessible{position:absolute !important;overflow:hidden;height:1px;width:1px;clip:rect(1px 1px 1px 1px);clip:rect(1px,1px,1px,1px)}#facebook-author-message-box-id .ui-autocomplete .results{display:block;position:absolute;left:0;top:100%;width:100%}#facebook-author-message-box-id ul.ui-autocomplete{list-style-type:none;margin:0;background-color:#FFF;border-color:#333 #333 #293e6a;border-style:solid;border-width:1px 1px 2px;overflow:hidden;padding:2px 0}#facebook-author-message-box-id .ui-autocomplete li{color:#333;border-color:#FFF;border-style:solid;border-width:1px 0;cursor:pointer;min-height:32px;padding:2px 10px 2px 45px;display:block;position:relative}#facebook-author-message-box-id .ui-autocomplete li.ui-state-focus{background-color:#6d84b4;border-color:#3b5998}#facebook-author-message-box-id .ui-autocomplete li.ui-state-focus .text,#facebook-author-message-box-id .ui-autocomplete li.ui-state-focus .subtext{color:#fff !important}#facebook-author-message-box-id .ui-autocomplete li a.ui-state-focus{background-color:transparent !important}#facebook-author-message-box-id .ui-autocomplete li img{border:0;display:block;position:absolute;height:32px;width:32px;left:6px}#facebook-author-message-box-id .ui-autocomplete .text{font-weight:bold;padding-top:0;padding-bottom:2px;padding-left:5px}#facebook-author-message-box-id .ui-autocomplete .subtext{color:#999;padding-left:5px}#facebook-author-message-box-id .ui-autocomplete .text,#facebook-author-message-box-id .ui-autocomplete .subtext{display:block;overflow:hidden;padding-bottom:2px;text-overflow:ellipsis;white-space:nowrap}
--------------------------------------------------------------------------------
/static/css/index.html:
--------------------------------------------------------------------------------
1 |
2 | Empty Index Silence is golden.
--------------------------------------------------------------------------------
/static/fonts/facebookdashicons.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/facebookarchive/wordpress/8807b10a683e23102b484bcd19f47dac80638dc7/static/fonts/facebookdashicons.eot
--------------------------------------------------------------------------------
/static/fonts/facebookdashicons.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/static/fonts/facebookdashicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/facebookarchive/wordpress/8807b10a683e23102b484bcd19f47dac80638dc7/static/fonts/facebookdashicons.ttf
--------------------------------------------------------------------------------
/static/fonts/facebookdashicons.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/facebookarchive/wordpress/8807b10a683e23102b484bcd19f47dac80638dc7/static/fonts/facebookdashicons.woff
--------------------------------------------------------------------------------
/static/fonts/index.html:
--------------------------------------------------------------------------------
1 |
2 | Empty Index Silence is golden.
--------------------------------------------------------------------------------
/static/img/create-app.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/facebookarchive/wordpress/8807b10a683e23102b484bcd19f47dac80638dc7/static/img/create-app.png
--------------------------------------------------------------------------------
/static/img/index.html:
--------------------------------------------------------------------------------
1 |
2 | Empty Index Silence is golden.
--------------------------------------------------------------------------------
/static/index.html:
--------------------------------------------------------------------------------
1 |
2 | Empty Index Silence is golden.
--------------------------------------------------------------------------------
/static/js/admin/index.html:
--------------------------------------------------------------------------------
1 |
2 | Empty Index Silence is golden.
--------------------------------------------------------------------------------
/static/js/admin/login.min.js:
--------------------------------------------------------------------------------
1 | var FB_WP=FB_WP||{};FB_WP.admin=FB_WP.admin||{};FB_WP.admin.login=FB_WP.admin.login||{accounts:{viewer:{id:"",permissions:{connected:false,manage_pages:false,publish_actions:false,publish_stream:false},pages:{}}},messages:{form_submit_prompt:"Please save your edits by submitting the form"},link_style:{cursor:"pointer",color:"#21759B","text-decoration":"underline"},status_change:function(response){if(response.authResponse!==undefined){if(response.authResponse.userID!==undefined){FB_WP.admin.login.accounts.viewer.id=response.authResponse.userID}jQuery(document).trigger("facebook-logged-in")}else{jQuery(document).trigger("facebook-not-logged-in")}},permissions_check:function(){FB.api("/me/permissions",function(response){if(response.data!==undefined&&jQuery.isArray(response.data)){if(response.data[0].installed===1){FB_WP.admin.login.accounts.viewer.permissions.connected=true}if(response.data[0].manage_pages===1){FB_WP.admin.login.accounts.viewer.permissions.manage_pages=true}if(response.data[0].publish_actions===1){FB_WP.admin.login.accounts.viewer.permissions.publish_actions=true}if(response.data[0].publish_stream===1){FB_WP.admin.login.accounts.viewer.permissions.publish_stream=true}}jQuery(document).trigger("facebook-permissions-check")})},get_status:function(){FB.getLoginStatus(FB_WP.admin.login.status_change)},trigger_login:function(callback,scope){if(jQuery.isPlainObject(scope)){var permissions=[];jQuery.each(scope,function(permission){permissions.push(permission)});if(permissions.length>0){FB.login(callback,{scope:permissions.join(",")});return}}FB.login(callback)},init:function(){jQuery(document).one("facebook-logged-in",FB_WP.admin.login.permissions_check);FB_WP.admin.login.get_status()}};FB_WP.admin.login.page=FB_WP.admin.login.page||{accounts:{page:{id:"",name:""}},messages:{add_manage_pages:"Allow new posts to a Facebook Page",delete_stored_page:"None: remove %s",select_new:"Select a new page:",no_create_content_pages:"No new published pages with create content permission found"},get_publishable_pages:function(){FB_WP.admin.login.accounts.viewer.pages.create_content=[];FB.api("/me/accounts","GET",{fields:"id,name,is_published,perms",limit:20,ref:"fbwpp"},function(response){if(response.data===undefined){return}var pages=[];jQuery.each(response.data,function(i,page){if(page.is_published===true&&page.name!==""&&page.perms!==undefined&&jQuery.inArray("CREATE_CONTENT",page.perms)){pages.push({id:page.id,name:page.name})}});FB_WP.admin.login.accounts.viewer.pages.create_content=pages;jQuery(document).trigger("facebook-pages-check")})},display_publishable_pages:function(){if(FB_WP.admin.login.accounts.viewer.pages.create_content===undefined){return}var container=jQuery("#facebook-login");if(container.length===0){return}var field_name=container.data("option");if(field_name===undefined){return}container.empty();if(FB_WP.admin.login.accounts.viewer.pages.create_content.length===0){container.append(jQuery("").text(FB_WP.admin.login.page.messages.no_create_content_pages));return}var field_container=jQuery("