Version Description
- Fixed: website page url @sabrina_b
- Added: Shortcode widget
- Updated: Facebook locales
Download this release
Release Info
Developer | poxtron |
Plugin | WP Embed Facebook |
Version | 2.1.13 |
Comparing to | |
See all releases |
Code changes from version 2.1.12 to 2.1.13
- lang/wp-embed-facebook.pot +1 -1
- lib/class-wp-embed-fb-plugin.php +57 -83
- lib/class-wp-embed-fb.php +7 -1
- readme.txt +11 -1
- wp-embed-facebook.php +1 -1
lang/wp-embed-facebook.pot
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
# This file is distributed under the same license as the WP Embed Facebook package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: WP Embed Facebook 2.1.
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://wordpress.org/support/plugin/wp-embed-facebook\n"
|
8 |
"POT-Creation-Date: 2016-10-06 11:26-0500\n"
|
2 |
# This file is distributed under the same license as the WP Embed Facebook package.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: WP Embed Facebook 2.1.12\n"
|
6 |
"Report-Msgid-Bugs-To: "
|
7 |
"https://wordpress.org/support/plugin/wp-embed-facebook\n"
|
8 |
"POT-Creation-Date: 2016-10-06 11:26-0500\n"
|
lib/class-wp-embed-fb-plugin.php
CHANGED
@@ -6,18 +6,18 @@
|
|
6 |
*/
|
7 |
class WP_Embed_FB_Plugin {
|
8 |
const option_name = 'wpemfb_options';
|
9 |
-
private static $path
|
10 |
-
private static $url
|
11 |
-
private static $options
|
12 |
-
private static $defaults
|
13 |
private static $lb_defaults = null;
|
14 |
-
private static $has_photon
|
15 |
private static $wp_timezone = null;
|
16 |
|
17 |
/**
|
18 |
* @var array $link_types Link fields needed for rendering a social plugin
|
19 |
*/
|
20 |
-
static $link_types =
|
21 |
|
22 |
static function hooks() {
|
23 |
//Session start when there is a facebook app
|
@@ -29,7 +29,7 @@ class WP_Embed_FB_Plugin {
|
|
29 |
//register all scripts and styles
|
30 |
add_action( 'wp_enqueue_scripts', __CLASS__ . '::wp_enqueue_scripts' );
|
31 |
|
32 |
-
add_action('widgets_init',__CLASS__.'::widgets_init');
|
33 |
|
34 |
}
|
35 |
|
@@ -68,7 +68,7 @@ class WP_Embed_FB_Plugin {
|
|
68 |
* @return array old options to be deleated since 2.1
|
69 |
*/
|
70 |
static function old_options() {
|
71 |
-
return
|
72 |
'show_posts',
|
73 |
'close_warning',
|
74 |
'height',
|
@@ -104,17 +104,23 @@ class WP_Embed_FB_Plugin {
|
|
104 |
'force_app_token',
|
105 |
'video_download',
|
106 |
'sdk_version'
|
107 |
-
|
108 |
}
|
109 |
|
110 |
static function get_defaults() {
|
111 |
if ( self::$defaults === null ) {
|
112 |
-
$locale
|
113 |
-
|
114 |
-
|
115 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
116 |
$vars = WEF_Social_Plugins::get_defaults();
|
117 |
-
$social_options =
|
118 |
foreach ( $vars as $key => $value ) {
|
119 |
foreach ( $value as $d_key => $d_value ) {
|
120 |
if ( ! in_array( $d_key, self::$link_types ) ) {
|
@@ -122,7 +128,7 @@ class WP_Embed_FB_Plugin {
|
|
122 |
}
|
123 |
}
|
124 |
}
|
125 |
-
self::$defaults =
|
126 |
'sdk_lang' => array_key_exists( $locale, self::get_fb_locales() ) ? $locale : 'en_US',
|
127 |
'max_width' => '450',
|
128 |
'max_photos' => '24',
|
@@ -167,19 +173,20 @@ class WP_Embed_FB_Plugin {
|
|
167 |
'adaptive_fb_plugin' => 'false',
|
168 |
'quote_plugin_active' => 'false',
|
169 |
'quote_post_types' => 'post,page',
|
170 |
-
'auto_embed_active' => 'true'
|
171 |
-
//
|
|
|
172 |
'auto_comments_active' => 'false',
|
173 |
'auto_comments_post_types' => 'post',
|
174 |
'comments_count_active' => 'true',
|
175 |
'comments_open_graph' => 'true',
|
176 |
-
// 'scrape_open_graph' => 'true',
|
177 |
'lightbox_att' => 'data-lightbox="roadtrip"',
|
178 |
'event_start_time_format' => 'l, j F Y g:i a',
|
179 |
'single_post_time_format' => 'l, j F Y g:s a',
|
180 |
'single_post_from_like' => 'false',
|
181 |
'permalink_on_social_plugins' => 'false',
|
182 |
-
|
183 |
}
|
184 |
|
185 |
return apply_filters( 'wpemfb_defaults', self::$defaults );
|
@@ -187,7 +194,7 @@ class WP_Embed_FB_Plugin {
|
|
187 |
|
188 |
static function get_lb_defaults() {
|
189 |
if ( self::$lb_defaults === null ) {
|
190 |
-
$keys =
|
191 |
'albumLabel',
|
192 |
'alwaysShowNavOnTouchDevices',
|
193 |
'showImageNumberLabel',
|
@@ -200,8 +207,8 @@ class WP_Embed_FB_Plugin {
|
|
200 |
'resizeDuration',
|
201 |
'fadeDuration',
|
202 |
'wpGallery'
|
203 |
-
|
204 |
-
self::$lb_defaults =
|
205 |
$defaults = self::get_defaults();
|
206 |
foreach ( $keys as $key ) {
|
207 |
self::$lb_defaults[ $key ] = $defaults[ 'LB_' . $key ];
|
@@ -223,11 +230,11 @@ class WP_Embed_FB_Plugin {
|
|
223 |
} elseif ( session_status() == PHP_SESSION_NONE ) {
|
224 |
session_start();
|
225 |
}
|
226 |
-
if( (float) substr(WP_Embed_FB_Plugin::get_option('sdk_version'),1) <= 2.2 ){
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
}
|
232 |
}
|
233 |
|
@@ -244,20 +251,20 @@ class WP_Embed_FB_Plugin {
|
|
244 |
* Enqueue wp embed facebook styles
|
245 |
*/
|
246 |
static function wp_enqueue_scripts() {
|
247 |
-
foreach (
|
248 |
$on_theme = get_stylesheet_directory() . "/plugins/wp-embed-facebook/$theme/$theme.css";
|
249 |
$true_path = self::url() . "templates/$theme/$theme.css";
|
250 |
-
if(file_exists( $on_theme )){
|
251 |
$true_path = get_stylesheet_directory_uri() . "/plugins/wp-embed-facebook/$theme/$theme.css";
|
252 |
}
|
253 |
|
254 |
-
wp_register_style( 'wpemfb-' . $theme, $true_path,
|
255 |
}
|
256 |
-
wp_register_style( 'wpemfb-lightbox', self::url() . 'lib/lightbox2/css/lightbox.css',
|
257 |
-
wp_register_script( 'wpemfb-lightbox', self::url() . 'lib/lightbox2/js/lightbox.min.js',
|
258 |
$lb_defaults = self::get_lb_defaults();
|
259 |
$options = self::get_option();
|
260 |
-
$translation_array =
|
261 |
foreach ( $lb_defaults as $default_name => $value ) {
|
262 |
if ( $options[ 'LB_' . $default_name ] !== $value ) {
|
263 |
$translation_array[ $default_name ] = $options[ 'LB_' . $default_name ];
|
@@ -267,18 +274,18 @@ class WP_Embed_FB_Plugin {
|
|
267 |
//TODO use something like wp_add_inline_script('wpemfb-lightbox','new Lightbox(WEF_LB)') for LightBox options
|
268 |
wp_localize_script( 'wpemfb-lightbox', 'WEF_LB', $translation_array );
|
269 |
}
|
270 |
-
wp_register_script( 'wpemfb', self::url() . 'lib/js/wpembedfb.min.js',
|
271 |
|
272 |
-
wp_register_script( 'wpemfb-fbjs', self::url() . 'lib/js/fb.min.js',
|
273 |
-
$translation_array =
|
274 |
'local' => $options['sdk_lang'],
|
275 |
'version' => $options['sdk_version'],
|
276 |
'fb_id' => $options['app_id'] == '0' ? '' : $options['app_id']
|
277 |
-
|
278 |
if ( $options['auto_comments_active'] == 'true' && $options['comments_count_active'] == 'true' ) {
|
279 |
-
$translation_array = $translation_array +
|
280 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
281 |
-
|
282 |
}
|
283 |
wp_localize_script( 'wpemfb-fbjs', 'WEF', $translation_array );
|
284 |
|
@@ -332,7 +339,7 @@ class WP_Embed_FB_Plugin {
|
|
332 |
self::$options = $options;
|
333 |
} else {
|
334 |
//check option array for corruption
|
335 |
-
$compare =
|
336 |
foreach ( $defaults as $default_key => $default_value ) {
|
337 |
$compare[ $default_key ] = isset( $options[ $default_key ] ) ? $options[ $default_key ] : $default_value;
|
338 |
}
|
@@ -403,13 +410,11 @@ class WP_Embed_FB_Plugin {
|
|
403 |
}
|
404 |
|
405 |
static function get_fb_locales() {
|
406 |
-
return
|
|
|
407 |
'af_ZA' => 'Afrikaans',
|
408 |
-
'ak_GH' => 'Akan',
|
409 |
-
'am_ET' => 'Amharic',
|
410 |
'ar_AR' => 'Arabic',
|
411 |
-
'
|
412 |
-
'ay_BO' => 'Aymara',
|
413 |
'az_AZ' => 'Azerbaijani',
|
414 |
'be_BY' => 'Belarusian',
|
415 |
'bg_BG' => 'Bulgarian',
|
@@ -418,7 +423,6 @@ class WP_Embed_FB_Plugin {
|
|
418 |
'bs_BA' => 'Bosnian',
|
419 |
'ca_ES' => 'Catalan',
|
420 |
'cb_IQ' => 'Sorani Kurdish',
|
421 |
-
'ck_US' => 'Cherokee',
|
422 |
'co_FR' => 'Corsican',
|
423 |
'cs_CZ' => 'Czech',
|
424 |
'cx_PH' => 'Cebuano',
|
@@ -427,21 +431,13 @@ class WP_Embed_FB_Plugin {
|
|
427 |
'de_DE' => 'German',
|
428 |
'el_GR' => 'Greek',
|
429 |
'en_GB' => 'English (UK)',
|
430 |
-
'en_IN' => 'English (India)',
|
431 |
-
'en_PI' => 'English (Pirate)',
|
432 |
'en_UD' => 'English (Upside Down)',
|
433 |
'en_US' => 'English (US)',
|
434 |
-
'eo_EO' => 'Esperanto',
|
435 |
-
'es_CL' => 'Spanish (Chile)',
|
436 |
-
'es_CO' => 'Spanish (Colombia)',
|
437 |
'es_ES' => 'Spanish (Spain)',
|
438 |
'es_LA' => 'Spanish',
|
439 |
-
'es_MX' => 'Spanish (Mexico)',
|
440 |
-
'es_VE' => 'Spanish (Venezuela)',
|
441 |
'et_EE' => 'Estonian',
|
442 |
'eu_ES' => 'Basque',
|
443 |
'fa_IR' => 'Persian',
|
444 |
-
'fb_LT' => 'Leet Speak',
|
445 |
'ff_NG' => 'Fulah',
|
446 |
'fi_FI' => 'Finnish',
|
447 |
'fo_FO' => 'Faroese',
|
@@ -452,7 +448,6 @@ class WP_Embed_FB_Plugin {
|
|
452 |
'gl_ES' => 'Galician',
|
453 |
'gn_PY' => 'Guarani',
|
454 |
'gu_IN' => 'Gujarati',
|
455 |
-
'gx_GR' => 'Classical Greek',
|
456 |
'ha_NG' => 'Hausa',
|
457 |
'he_IL' => 'Hebrew',
|
458 |
'hi_IN' => 'Hindi',
|
@@ -460,7 +455,6 @@ class WP_Embed_FB_Plugin {
|
|
460 |
'hu_HU' => 'Hungarian',
|
461 |
'hy_AM' => 'Armenian',
|
462 |
'id_ID' => 'Indonesian',
|
463 |
-
'ig_NG' => 'Igbo',
|
464 |
'is_IS' => 'Icelandic',
|
465 |
'it_IT' => 'Italian',
|
466 |
'ja_JP' => 'Japanese',
|
@@ -472,11 +466,6 @@ class WP_Embed_FB_Plugin {
|
|
472 |
'kn_IN' => 'Kannada',
|
473 |
'ko_KR' => 'Korean',
|
474 |
'ku_TR' => 'Kurdish (Kurmanji)',
|
475 |
-
'la_VA' => 'Latin',
|
476 |
-
'lg_UG' => 'Ganda',
|
477 |
-
'li_NL' => 'Limburgish',
|
478 |
-
'ln_CD' => 'Lingala',
|
479 |
-
'lo_LA' => 'Lao',
|
480 |
'lt_LT' => 'Lithuanian',
|
481 |
'lv_LV' => 'Latvian',
|
482 |
'mg_MG' => 'Malagasy',
|
@@ -488,61 +477,46 @@ class WP_Embed_FB_Plugin {
|
|
488 |
'mt_MT' => 'Maltese',
|
489 |
'my_MM' => 'Burmese',
|
490 |
'nb_NO' => 'Norwegian (bokmal)',
|
491 |
-
'nd_ZW' => 'Ndebele',
|
492 |
'ne_NP' => 'Nepali',
|
493 |
'nl_BE' => 'Dutch (België)',
|
494 |
'nl_NL' => 'Dutch',
|
495 |
'nn_NO' => 'Norwegian (nynorsk)',
|
496 |
-
'ny_MW' => 'Chewa',
|
497 |
'or_IN' => 'Oriya',
|
498 |
'pa_IN' => 'Punjabi',
|
499 |
'pl_PL' => 'Polish',
|
500 |
'ps_AF' => 'Pashto',
|
501 |
'pt_BR' => 'Portuguese (Brazil)',
|
502 |
'pt_PT' => 'Portuguese (Portugal)',
|
503 |
-
'
|
504 |
-
'rm_CH' => 'Romansh',
|
505 |
'ro_RO' => 'Romanian',
|
506 |
'ru_RU' => 'Russian',
|
507 |
'rw_RW' => 'Kinyarwanda',
|
508 |
-
'sa_IN' => 'Sanskrit',
|
509 |
'sc_IT' => 'Sardinian',
|
510 |
-
'se_NO' => 'Northern Sámi',
|
511 |
'si_LK' => 'Sinhala',
|
512 |
'sk_SK' => 'Slovak',
|
513 |
'sl_SI' => 'Slovenian',
|
514 |
-
'sn_ZW' => 'Shona',
|
515 |
'so_SO' => 'Somali',
|
516 |
'sq_AL' => 'Albanian',
|
517 |
'sr_RS' => 'Serbian',
|
518 |
'sv_SE' => 'Swedish',
|
519 |
'sw_KE' => 'Swahili',
|
520 |
-
'sy_SY' => 'Syriac',
|
521 |
'sz_PL' => 'Silesian',
|
522 |
'ta_IN' => 'Tamil',
|
523 |
'te_IN' => 'Telugu',
|
524 |
'tg_TJ' => 'Tajik',
|
525 |
'th_TH' => 'Thai',
|
526 |
-
'tk_TM' => 'Turkmen',
|
527 |
'tl_PH' => 'Filipino',
|
528 |
-
'tl_ST' => 'Klingon',
|
529 |
'tr_TR' => 'Turkish',
|
530 |
-
'tt_RU' => 'Tatar',
|
531 |
'tz_MA' => 'Tamazight',
|
532 |
'uk_UA' => 'Ukrainian',
|
533 |
'ur_PK' => 'Urdu',
|
534 |
'uz_UZ' => 'Uzbek',
|
535 |
'vi_VN' => 'Vietnamese',
|
536 |
-
'wo_SN' => 'Wolof',
|
537 |
-
'xh_ZA' => 'Xhosa',
|
538 |
-
'yi_DE' => 'Yiddish',
|
539 |
-
'yo_NG' => 'Yoruba',
|
540 |
'zh_CN' => 'Simplified Chinese (China)',
|
541 |
'zh_HK' => 'Traditional Chinese (Hong Kong)',
|
542 |
'zh_TW' => 'Traditional Chinese (Taiwan)',
|
543 |
-
|
544 |
-
|
545 |
-
);
|
546 |
}
|
547 |
|
548 |
static function get_timezone() {
|
@@ -568,15 +542,15 @@ class WP_Embed_FB_Plugin {
|
|
568 |
return array_map( 'trim', $array );
|
569 |
}
|
570 |
|
571 |
-
static function widgets_init(){
|
572 |
-
register_widget('WEF_Widget');
|
573 |
}
|
574 |
|
575 |
static function lightbox_title( $title ) {
|
576 |
-
$clean_title = esc_attr( wp_rel_nofollow( make_clickable( str_replace(
|
577 |
'"',
|
578 |
'''
|
579 |
-
|
580 |
|
581 |
return apply_filters( 'wef_lightbox_title', 'data-title="' . $clean_title . '"', $title );
|
582 |
}
|
6 |
*/
|
7 |
class WP_Embed_FB_Plugin {
|
8 |
const option_name = 'wpemfb_options';
|
9 |
+
private static $path = null;
|
10 |
+
private static $url = null;
|
11 |
+
private static $options = null;
|
12 |
+
private static $defaults = null;
|
13 |
private static $lb_defaults = null;
|
14 |
+
private static $has_photon = null;
|
15 |
private static $wp_timezone = null;
|
16 |
|
17 |
/**
|
18 |
* @var array $link_types Link fields needed for rendering a social plugin
|
19 |
*/
|
20 |
+
static $link_types = [ 'href', 'uri' ];
|
21 |
|
22 |
static function hooks() {
|
23 |
//Session start when there is a facebook app
|
29 |
//register all scripts and styles
|
30 |
add_action( 'wp_enqueue_scripts', __CLASS__ . '::wp_enqueue_scripts' );
|
31 |
|
32 |
+
add_action( 'widgets_init', __CLASS__ . '::widgets_init' );
|
33 |
|
34 |
}
|
35 |
|
68 |
* @return array old options to be deleated since 2.1
|
69 |
*/
|
70 |
static function old_options() {
|
71 |
+
return [
|
72 |
'show_posts',
|
73 |
'close_warning',
|
74 |
'height',
|
104 |
'force_app_token',
|
105 |
'video_download',
|
106 |
'sdk_version'
|
107 |
+
];
|
108 |
}
|
109 |
|
110 |
static function get_defaults() {
|
111 |
if ( self::$defaults === null ) {
|
112 |
+
$locale = get_locale();
|
113 |
+
$locale = str_replace( [
|
114 |
+
'es_ES',
|
115 |
+
'es_MX',
|
116 |
+
'es_AR',
|
117 |
+
'es_CL',
|
118 |
+
'es_GT',
|
119 |
+
'es_PE',
|
120 |
+
'es_VE'
|
121 |
+
], 'es_LA', $locale );
|
122 |
$vars = WEF_Social_Plugins::get_defaults();
|
123 |
+
$social_options = [];
|
124 |
foreach ( $vars as $key => $value ) {
|
125 |
foreach ( $value as $d_key => $d_value ) {
|
126 |
if ( ! in_array( $d_key, self::$link_types ) ) {
|
128 |
}
|
129 |
}
|
130 |
}
|
131 |
+
self::$defaults = [
|
132 |
'sdk_lang' => array_key_exists( $locale, self::get_fb_locales() ) ? $locale : 'en_US',
|
133 |
'max_width' => '450',
|
134 |
'max_photos' => '24',
|
173 |
'adaptive_fb_plugin' => 'false',
|
174 |
'quote_plugin_active' => 'false',
|
175 |
'quote_post_types' => 'post,page',
|
176 |
+
'auto_embed_active' => 'true',
|
177 |
+
//
|
178 |
+
// 'auto_embed_post_types' => '',//TODO filter embed register handler per post_type
|
179 |
'auto_comments_active' => 'false',
|
180 |
'auto_comments_post_types' => 'post',
|
181 |
'comments_count_active' => 'true',
|
182 |
'comments_open_graph' => 'true',
|
183 |
+
// 'scrape_open_graph' => 'true',
|
184 |
'lightbox_att' => 'data-lightbox="roadtrip"',
|
185 |
'event_start_time_format' => 'l, j F Y g:i a',
|
186 |
'single_post_time_format' => 'l, j F Y g:s a',
|
187 |
'single_post_from_like' => 'false',
|
188 |
'permalink_on_social_plugins' => 'false',
|
189 |
+
] + $social_options;
|
190 |
}
|
191 |
|
192 |
return apply_filters( 'wpemfb_defaults', self::$defaults );
|
194 |
|
195 |
static function get_lb_defaults() {
|
196 |
if ( self::$lb_defaults === null ) {
|
197 |
+
$keys = [
|
198 |
'albumLabel',
|
199 |
'alwaysShowNavOnTouchDevices',
|
200 |
'showImageNumberLabel',
|
207 |
'resizeDuration',
|
208 |
'fadeDuration',
|
209 |
'wpGallery'
|
210 |
+
];
|
211 |
+
self::$lb_defaults = [];
|
212 |
$defaults = self::get_defaults();
|
213 |
foreach ( $keys as $key ) {
|
214 |
self::$lb_defaults[ $key ] = $defaults[ 'LB_' . $key ];
|
230 |
} elseif ( session_status() == PHP_SESSION_NONE ) {
|
231 |
session_start();
|
232 |
}
|
233 |
+
if ( (float) substr( WP_Embed_FB_Plugin::get_option( 'sdk_version' ), 1 ) <= 2.2 ) {
|
234 |
+
$options = WP_Embed_FB_Plugin::get_option();
|
235 |
+
$options['sdk_version'] = 'v2.3';
|
236 |
+
WP_Embed_FB_Plugin::set_options( $options );
|
237 |
+
}
|
238 |
}
|
239 |
}
|
240 |
|
251 |
* Enqueue wp embed facebook styles
|
252 |
*/
|
253 |
static function wp_enqueue_scripts() {
|
254 |
+
foreach ( [ 'default', 'classic' ] as $theme ) {
|
255 |
$on_theme = get_stylesheet_directory() . "/plugins/wp-embed-facebook/$theme/$theme.css";
|
256 |
$true_path = self::url() . "templates/$theme/$theme.css";
|
257 |
+
if ( file_exists( $on_theme ) ) {
|
258 |
$true_path = get_stylesheet_directory_uri() . "/plugins/wp-embed-facebook/$theme/$theme.css";
|
259 |
}
|
260 |
|
261 |
+
wp_register_style( 'wpemfb-' . $theme, $true_path, [], '1.0' );
|
262 |
}
|
263 |
+
wp_register_style( 'wpemfb-lightbox', self::url() . 'lib/lightbox2/css/lightbox.css', [], '1.0' );
|
264 |
+
wp_register_script( 'wpemfb-lightbox', self::url() . 'lib/lightbox2/js/lightbox.min.js', [ 'jquery' ], '1.0' );
|
265 |
$lb_defaults = self::get_lb_defaults();
|
266 |
$options = self::get_option();
|
267 |
+
$translation_array = [];
|
268 |
foreach ( $lb_defaults as $default_name => $value ) {
|
269 |
if ( $options[ 'LB_' . $default_name ] !== $value ) {
|
270 |
$translation_array[ $default_name ] = $options[ 'LB_' . $default_name ];
|
274 |
//TODO use something like wp_add_inline_script('wpemfb-lightbox','new Lightbox(WEF_LB)') for LightBox options
|
275 |
wp_localize_script( 'wpemfb-lightbox', 'WEF_LB', $translation_array );
|
276 |
}
|
277 |
+
wp_register_script( 'wpemfb', self::url() . 'lib/js/wpembedfb.min.js', [ 'jquery' ], '1.0' );
|
278 |
|
279 |
+
wp_register_script( 'wpemfb-fbjs', self::url() . 'lib/js/fb.min.js', [ 'jquery' ], '1.0' );
|
280 |
+
$translation_array = [
|
281 |
'local' => $options['sdk_lang'],
|
282 |
'version' => $options['sdk_version'],
|
283 |
'fb_id' => $options['app_id'] == '0' ? '' : $options['app_id']
|
284 |
+
];
|
285 |
if ( $options['auto_comments_active'] == 'true' && $options['comments_count_active'] == 'true' ) {
|
286 |
+
$translation_array = $translation_array + [
|
287 |
'ajaxurl' => admin_url( 'admin-ajax.php' ),
|
288 |
+
];
|
289 |
}
|
290 |
wp_localize_script( 'wpemfb-fbjs', 'WEF', $translation_array );
|
291 |
|
339 |
self::$options = $options;
|
340 |
} else {
|
341 |
//check option array for corruption
|
342 |
+
$compare = [];
|
343 |
foreach ( $defaults as $default_key => $default_value ) {
|
344 |
$compare[ $default_key ] = isset( $options[ $default_key ] ) ? $options[ $default_key ] : $default_value;
|
345 |
}
|
410 |
}
|
411 |
|
412 |
static function get_fb_locales() {
|
413 |
+
return [
|
414 |
+
|
415 |
'af_ZA' => 'Afrikaans',
|
|
|
|
|
416 |
'ar_AR' => 'Arabic',
|
417 |
+
'ar_IN' => 'Assamese',
|
|
|
418 |
'az_AZ' => 'Azerbaijani',
|
419 |
'be_BY' => 'Belarusian',
|
420 |
'bg_BG' => 'Bulgarian',
|
423 |
'bs_BA' => 'Bosnian',
|
424 |
'ca_ES' => 'Catalan',
|
425 |
'cb_IQ' => 'Sorani Kurdish',
|
|
|
426 |
'co_FR' => 'Corsican',
|
427 |
'cs_CZ' => 'Czech',
|
428 |
'cx_PH' => 'Cebuano',
|
431 |
'de_DE' => 'German',
|
432 |
'el_GR' => 'Greek',
|
433 |
'en_GB' => 'English (UK)',
|
|
|
|
|
434 |
'en_UD' => 'English (Upside Down)',
|
435 |
'en_US' => 'English (US)',
|
|
|
|
|
|
|
436 |
'es_ES' => 'Spanish (Spain)',
|
437 |
'es_LA' => 'Spanish',
|
|
|
|
|
438 |
'et_EE' => 'Estonian',
|
439 |
'eu_ES' => 'Basque',
|
440 |
'fa_IR' => 'Persian',
|
|
|
441 |
'ff_NG' => 'Fulah',
|
442 |
'fi_FI' => 'Finnish',
|
443 |
'fo_FO' => 'Faroese',
|
448 |
'gl_ES' => 'Galician',
|
449 |
'gn_PY' => 'Guarani',
|
450 |
'gu_IN' => 'Gujarati',
|
|
|
451 |
'ha_NG' => 'Hausa',
|
452 |
'he_IL' => 'Hebrew',
|
453 |
'hi_IN' => 'Hindi',
|
455 |
'hu_HU' => 'Hungarian',
|
456 |
'hy_AM' => 'Armenian',
|
457 |
'id_ID' => 'Indonesian',
|
|
|
458 |
'is_IS' => 'Icelandic',
|
459 |
'it_IT' => 'Italian',
|
460 |
'ja_JP' => 'Japanese',
|
466 |
'kn_IN' => 'Kannada',
|
467 |
'ko_KR' => 'Korean',
|
468 |
'ku_TR' => 'Kurdish (Kurmanji)',
|
|
|
|
|
|
|
|
|
|
|
469 |
'lt_LT' => 'Lithuanian',
|
470 |
'lv_LV' => 'Latvian',
|
471 |
'mg_MG' => 'Malagasy',
|
477 |
'mt_MT' => 'Maltese',
|
478 |
'my_MM' => 'Burmese',
|
479 |
'nb_NO' => 'Norwegian (bokmal)',
|
|
|
480 |
'ne_NP' => 'Nepali',
|
481 |
'nl_BE' => 'Dutch (België)',
|
482 |
'nl_NL' => 'Dutch',
|
483 |
'nn_NO' => 'Norwegian (nynorsk)',
|
|
|
484 |
'or_IN' => 'Oriya',
|
485 |
'pa_IN' => 'Punjabi',
|
486 |
'pl_PL' => 'Polish',
|
487 |
'ps_AF' => 'Pashto',
|
488 |
'pt_BR' => 'Portuguese (Brazil)',
|
489 |
'pt_PT' => 'Portuguese (Portugal)',
|
490 |
+
'qz_MM' => 'Burmese',
|
|
|
491 |
'ro_RO' => 'Romanian',
|
492 |
'ru_RU' => 'Russian',
|
493 |
'rw_RW' => 'Kinyarwanda',
|
|
|
494 |
'sc_IT' => 'Sardinian',
|
|
|
495 |
'si_LK' => 'Sinhala',
|
496 |
'sk_SK' => 'Slovak',
|
497 |
'sl_SI' => 'Slovenian',
|
|
|
498 |
'so_SO' => 'Somali',
|
499 |
'sq_AL' => 'Albanian',
|
500 |
'sr_RS' => 'Serbian',
|
501 |
'sv_SE' => 'Swedish',
|
502 |
'sw_KE' => 'Swahili',
|
|
|
503 |
'sz_PL' => 'Silesian',
|
504 |
'ta_IN' => 'Tamil',
|
505 |
'te_IN' => 'Telugu',
|
506 |
'tg_TJ' => 'Tajik',
|
507 |
'th_TH' => 'Thai',
|
|
|
508 |
'tl_PH' => 'Filipino',
|
|
|
509 |
'tr_TR' => 'Turkish',
|
|
|
510 |
'tz_MA' => 'Tamazight',
|
511 |
'uk_UA' => 'Ukrainian',
|
512 |
'ur_PK' => 'Urdu',
|
513 |
'uz_UZ' => 'Uzbek',
|
514 |
'vi_VN' => 'Vietnamese',
|
|
|
|
|
|
|
|
|
515 |
'zh_CN' => 'Simplified Chinese (China)',
|
516 |
'zh_HK' => 'Traditional Chinese (Hong Kong)',
|
517 |
'zh_TW' => 'Traditional Chinese (Taiwan)',
|
518 |
+
|
519 |
+
];
|
|
|
520 |
}
|
521 |
|
522 |
static function get_timezone() {
|
542 |
return array_map( 'trim', $array );
|
543 |
}
|
544 |
|
545 |
+
static function widgets_init() {
|
546 |
+
register_widget( 'WEF_Widget' );
|
547 |
}
|
548 |
|
549 |
static function lightbox_title( $title ) {
|
550 |
+
$clean_title = esc_attr( wp_rel_nofollow( make_clickable( str_replace( [ '"', "'" ], [
|
551 |
'"',
|
552 |
'''
|
553 |
+
], $title ) ) ) );
|
554 |
|
555 |
return apply_filters( 'wef_lightbox_title', 'data-title="' . $clean_title . '"', $title );
|
556 |
}
|
lib/class-wp-embed-fb.php
CHANGED
@@ -595,7 +595,13 @@ class WP_Embed_FB {
|
|
595 |
static function getwebsite( $urls ) {
|
596 |
$url = explode( ' ', trim( $urls ) );
|
597 |
|
598 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
599 |
}
|
600 |
|
601 |
}
|
595 |
static function getwebsite( $urls ) {
|
596 |
$url = explode( ' ', trim( $urls ) );
|
597 |
|
598 |
+
if (preg_match('/https:/',$url[0]))
|
599 |
+
return $url[0];
|
600 |
+
|
601 |
+
if (preg_match('/http:/',$url[0]))
|
602 |
+
return $url[0];
|
603 |
+
|
604 |
+
return 'http://' . $url[0];
|
605 |
}
|
606 |
|
607 |
}
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: Facebook, facebook, Social Plugins, embed facebook, facebook video, facebook posts, facebook publication, facebook publications, facebook event, facebook events, facebook pages, facebook page, facebook profiles, facebook album, facebook albums, facebook photos, facebook photo, social,
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 4.8
|
7 |
-
Stable tag: 2.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -96,6 +96,10 @@ You can overwrite the embed template with a custom one.
|
|
96 |
1. Copy the contents of “wp-embed-facebook/templates/default/” to “your-theme/plugins/wp-embed-facebook/default”
|
97 |
1. Change the template files to what you want. Inside each file you can access the `$fb_data` array that contains the information retrieved from facebook.
|
98 |
|
|
|
|
|
|
|
|
|
99 |
= How can I make my page load faster ? =
|
100 |
|
101 |
Social plugins will load at its own time via JavaScript so you just have to wait on them, for custom embeds a cache plugin will greatly increase performance.
|
@@ -137,6 +141,12 @@ Buying the premium extensions helps to keep this project alive.
|
|
137 |
|
138 |
== Changelog ==
|
139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
140 |
= 2.1.12 =
|
141 |
* Added: shortcode widget
|
142 |
* Added: api version 2.9
|
4 |
Tags: Facebook, facebook, Social Plugins, embed facebook, facebook video, facebook posts, facebook publication, facebook publications, facebook event, facebook events, facebook pages, facebook page, facebook profiles, facebook album, facebook albums, facebook photos, facebook photo, social,
|
5 |
Requires at least: 4.6
|
6 |
Tested up to: 4.8
|
7 |
+
Stable tag: 2.1.13
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
96 |
1. Copy the contents of “wp-embed-facebook/templates/default/” to “your-theme/plugins/wp-embed-facebook/default”
|
97 |
1. Change the template files to what you want. Inside each file you can access the `$fb_data` array that contains the information retrieved from facebook.
|
98 |
|
99 |
+
= I moved from another Facebook comments/like plugin and my comments don't show =
|
100 |
+
|
101 |
+
Go to advanced section on settings and tick the option "Use permalinks on social plugins urls" if it does not work please create a support ticket mentioning the old comments plugin.
|
102 |
+
|
103 |
= How can I make my page load faster ? =
|
104 |
|
105 |
Social plugins will load at its own time via JavaScript so you just have to wait on them, for custom embeds a cache plugin will greatly increase performance.
|
141 |
|
142 |
== Changelog ==
|
143 |
|
144 |
+
= 2.1.13 =
|
145 |
+
* Fixed: website page url @sabrina_b
|
146 |
+
* Added: Shortcode widget
|
147 |
+
* Updated: Facebook locales
|
148 |
+
|
149 |
+
|
150 |
= 2.1.12 =
|
151 |
* Added: shortcode widget
|
152 |
* Added: api version 2.9
|
wp-embed-facebook.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: WP Embed Facebook
|
|
4 |
Plugin URI: http://www.wpembedfb.com
|
5 |
Description: Embed any public Facebook video, photo, album, event, page, comment, profile, or post. Add Facebook comments to all your site, insert Facebook social plugins (like, save, send, share, follow, quote, comments) anywhere on your site. View the <a href="http://www.wpembedfb.com/demo-site/" title="plugin website" target="_blank">demo site</a>.
|
6 |
Author: Miguel Sirvent
|
7 |
-
Version: 2.1.
|
8 |
Author URI: http://www.wpembedfb.com
|
9 |
Text Domain: wp-embed-facebook
|
10 |
Domain Path: /lang
|
4 |
Plugin URI: http://www.wpembedfb.com
|
5 |
Description: Embed any public Facebook video, photo, album, event, page, comment, profile, or post. Add Facebook comments to all your site, insert Facebook social plugins (like, save, send, share, follow, quote, comments) anywhere on your site. View the <a href="http://www.wpembedfb.com/demo-site/" title="plugin website" target="_blank">demo site</a>.
|
6 |
Author: Miguel Sirvent
|
7 |
+
Version: 2.1.13
|
8 |
Author URI: http://www.wpembedfb.com
|
9 |
Text Domain: wp-embed-facebook
|
10 |
Domain Path: /lang
|