WP Embed Facebook - Version 2.1.14

Version Description

  • Compatibility for PHP 5.3 0..o
Download this release

Release Info

Developer poxtron
Plugin Icon 128x128 WP Embed Facebook
Version 2.1.14
Comparing to
See all releases

Code changes from version 2.1.13 to 2.1.14

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.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"
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.13\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
@@ -17,7 +17,7 @@ class WP_Embed_FB_Plugin {
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
@@ -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,13 +104,13 @@ 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 = get_locale();
113
- $locale = str_replace( [
114
  'es_ES',
115
  'es_MX',
116
  'es_AR',
@@ -118,9 +118,9 @@ class WP_Embed_FB_Plugin {
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,7 +128,7 @@ class WP_Embed_FB_Plugin {
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',
@@ -186,7 +186,7 @@ class WP_Embed_FB_Plugin {
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,7 +194,7 @@ class WP_Embed_FB_Plugin {
194
 
195
  static function get_lb_defaults() {
196
  if ( self::$lb_defaults === null ) {
197
- $keys = [
198
  'albumLabel',
199
  'alwaysShowNavOnTouchDevices',
200
  'showImageNumberLabel',
@@ -207,8 +207,8 @@ class WP_Embed_FB_Plugin {
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 ];
@@ -251,20 +251,20 @@ class WP_Embed_FB_Plugin {
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,18 +274,18 @@ class WP_Embed_FB_Plugin {
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,7 +339,7 @@ class WP_Embed_FB_Plugin {
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,7 +410,7 @@ class WP_Embed_FB_Plugin {
410
  }
411
 
412
  static function get_fb_locales() {
413
- return [
414
 
415
  'af_ZA' => 'Afrikaans',
416
  'ar_AR' => 'Arabic',
@@ -516,7 +516,7 @@ class WP_Embed_FB_Plugin {
516
  'zh_HK' => 'Traditional Chinese (Hong Kong)',
517
  'zh_TW' => 'Traditional Chinese (Taiwan)',
518
 
519
- ];
520
  }
521
 
522
  static function get_timezone() {
@@ -547,10 +547,10 @@ class WP_Embed_FB_Plugin {
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
  }
17
  /**
18
  * @var array $link_types Link fields needed for rendering a social plugin
19
  */
20
+ static $link_types = array( 'href', 'uri' );
21
 
22
  static function hooks() {
23
  //Session start when there is a facebook app
68
  * @return array old options to be deleated since 2.1
69
  */
70
  static function old_options() {
71
+ return array(
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( array(
114
  'es_ES',
115
  'es_MX',
116
  'es_AR',
118
  'es_GT',
119
  'es_PE',
120
  'es_VE'
121
+ ), 'es_LA', $locale );
122
  $vars = WEF_Social_Plugins::get_defaults();
123
+ $social_options = array();
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 = array(
132
  'sdk_lang' => array_key_exists( $locale, self::get_fb_locales() ) ? $locale : 'en_US',
133
  'max_width' => '450',
134
  'max_photos' => '24',
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 = array(
198
  'albumLabel',
199
  'alwaysShowNavOnTouchDevices',
200
  'showImageNumberLabel',
207
  'resizeDuration',
208
  'fadeDuration',
209
  'wpGallery'
210
+ );
211
+ self::$lb_defaults = array();
212
  $defaults = self::get_defaults();
213
  foreach ( $keys as $key ) {
214
  self::$lb_defaults[ $key ] = $defaults[ 'LB_' . $key ];
251
  * Enqueue wp embed facebook styles
252
  */
253
  static function wp_enqueue_scripts() {
254
+ foreach ( array( '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, array(), '1.0' );
262
  }
263
+ wp_register_style( 'wpemfb-lightbox', self::url() . 'lib/lightbox2/css/lightbox.css', array( ), '1.0' );
264
+ wp_register_script( 'wpemfb-lightbox', self::url() . 'lib/lightbox2/js/lightbox.min.js', array( 'jquery' ), '1.0' );
265
  $lb_defaults = self::get_lb_defaults();
266
  $options = self::get_option();
267
+ $translation_array = 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', array( 'jquery' ), '1.0' );
278
 
279
+ wp_register_script( 'wpemfb-fbjs', self::url() . 'lib/js/fb.min.js', array( 'jquery' ), '1.0' );
280
+ $translation_array = 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 + 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 = array();
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 array(
414
 
415
  'af_ZA' => 'Afrikaans',
416
  'ar_AR' => 'Arabic',
516
  'zh_HK' => 'Traditional Chinese (Hong Kong)',
517
  'zh_TW' => 'Traditional Chinese (Taiwan)',
518
 
519
+ );
520
  }
521
 
522
  static function get_timezone() {
547
  }
548
 
549
  static function lightbox_title( $title ) {
550
+ $clean_title = esc_attr( wp_rel_nofollow( make_clickable( str_replace( array( '"', "'" ), array(
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
@@ -513,6 +513,9 @@ class WP_Embed_FB {
513
  }
514
  }
515
 
 
 
 
516
  static function get_fbsdk() {
517
  if ( self::$fbsdk && self::$fbsdk instanceof Sigami_Facebook ) {
518
  if ( WP_Embed_FB_Plugin::get_option( 'force_app_token' ) == 'true' ) {
@@ -522,9 +525,11 @@ class WP_Embed_FB {
522
  return self::$fbsdk;
523
  } else {
524
  if ( ! class_exists( 'FacebookApiException' ) ) {
525
- require_once(WP_Embed_FB_Plugin::path().'lib/base_facebook.php');
 
526
  }
527
- require_once(WP_Embed_FB_Plugin::path().'lib/class-sigami-facebook.php');
 
528
  $config = array();
529
  $config['appId'] = WP_Embed_FB_Plugin::get_option( 'app_id' );
530
  $config['secret'] = WP_Embed_FB_Plugin::get_option( 'app_secret' );
513
  }
514
  }
515
 
516
+ /**
517
+ * @return null|Sigami_Facebook
518
+ */
519
  static function get_fbsdk() {
520
  if ( self::$fbsdk && self::$fbsdk instanceof Sigami_Facebook ) {
521
  if ( WP_Embed_FB_Plugin::get_option( 'force_app_token' ) == 'true' ) {
525
  return self::$fbsdk;
526
  } else {
527
  if ( ! class_exists( 'FacebookApiException' ) ) {
528
+ /** @noinspection PhpIncludeInspection */
529
+ require_once( WP_Embed_FB_Plugin::path() . 'lib/base_facebook.php');
530
  }
531
+ /** @noinspection PhpIncludeInspection */
532
+ require_once( WP_Embed_FB_Plugin::path() . 'lib/class-sigami-facebook.php');
533
  $config = array();
534
  $config['appId'] = WP_Embed_FB_Plugin::get_option( 'app_id' );
535
  $config['secret'] = WP_Embed_FB_Plugin::get_option( 'app_secret' );
lib/lightbox2/js/lightbox.js CHANGED
@@ -472,13 +472,13 @@ jQuery(function ($) {
472
  else {
473
  for (var key in WEF_LB) {
474
  if (WEF_LB.hasOwnProperty(key)) {
475
- if (WEF_LB[key] == 'false') {
476
  WEF_LB[key] = false;
477
  }
478
- else if (WEF_LB[key] == 'true') {
479
  WEF_LB[key] = true;
480
  }
481
- else if (key != 'albumLabel') {
482
  WEF_LB[key] = parseInt(WEF_LB[key]);
483
  }
484
  }
472
  else {
473
  for (var key in WEF_LB) {
474
  if (WEF_LB.hasOwnProperty(key)) {
475
+ if (WEF_LB[key] === 'false') {
476
  WEF_LB[key] = false;
477
  }
478
+ else if (WEF_LB[key] === 'true') {
479
  WEF_LB[key] = true;
480
  }
481
+ else if (key !== 'albumLabel') {
482
  WEF_LB[key] = parseInt(WEF_LB[key]);
483
  }
484
  }
lib/lightbox2/js/lightbox.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(function(a){function b(b){this.album=[],this.currentImageIndex=void 0,this.init(),this.options=a.extend({},this.constructor.defaults),this.option(b)}if(b.defaults={albumLabel:"Image %1 of %2",alwaysShowNavOnTouchDevices:!1,fadeDuration:500,fitImagesInViewport:!0,positionFromTop:50,resizeDuration:700,showImageNumberLabel:!0,wrapAround:!1,disableScrolling:!1},b.prototype.option=function(b){a.extend(this.options,b)},b.prototype.imageCountLabel=function(a,b){return this.options.albumLabel.replace(/%1/g,a).replace(/%2/g,b)},b.prototype.init=function(){this.enable(),this.build()},b.prototype.enable=function(){var b=this;a("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(c){return b.start(a(c.currentTarget)),!1})},b.prototype.build=function(){var b=this;a('<div id="lightboxOverlay" class="lightboxOverlay"></div><div id="lightbox" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" ></a><a class="lb-next" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo(a("body")),this.$lightbox=a("#lightbox"),this.$overlay=a("#lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".lb-outerContainer"),this.$container=this.$lightbox.find(".lb-container"),this.containerTopPadding=parseInt(this.$container.css("padding-top"),10),this.containerRightPadding=parseInt(this.$container.css("padding-right"),10),this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10),this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10),this.$overlay.hide().on("click",function(){return b.end(),!1}),this.$lightbox.hide().on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$outerContainer.on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$lightbox.find(".lb-prev").on("click",function(){return 0===b.currentImageIndex?b.changeImage(b.album.length-1):b.changeImage(b.currentImageIndex-1),!1}),this.$lightbox.find(".lb-next").on("click",function(){return b.currentImageIndex===b.album.length-1?b.changeImage(0):b.changeImage(b.currentImageIndex+1),!1}),this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return b.end(),!1})},b.prototype.start=function(b){function c(a){d.album.push({link:a.attr("href"),title:a.attr("data-title")||a.attr("title")})}var d=this,e=a(window);e.on("resize",a.proxy(this.sizeOverlay,this)),a("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var f,g=0,h=b.attr("data-lightbox");if(h){f=a(b.prop("tagName")+'[data-lightbox="'+h+'"]');for(var i=0;i<f.length;i=++i)c(a(f[i])),f[i]===b[0]&&(g=i)}else if("lightbox"===b.attr("rel"))c(b);else{f=a(b.prop("tagName")+'[rel="'+b.attr("rel")+'"]');for(var j=0;j<f.length;j=++j)c(a(f[j])),f[j]===b[0]&&(g=j)}var k=e.scrollTop()+this.options.positionFromTop,l=e.scrollLeft();this.$lightbox.css({top:k+"px",left:l+"px"}).fadeIn(this.options.fadeDuration),this.options.disableScrolling&&(a("body").addClass("lb-disable-scrolling"),a("html").addClass("lb-disable-scrolling")),this.changeImage(g)},b.prototype.changeImage=function(b){var c=this;this.disableKeyboardNav();var d=this.$lightbox.find(".lb-image");this.$overlay.fadeIn(this.options.fadeDuration),a(".lb-loader").fadeIn("slow"),this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide(),this.$outerContainer.addClass("animating");var e=new Image;e.onload=function(){var f,g,h,i,j,k,l;d.attr("src",c.album[b].link),f=a(e),d.width(e.width),d.height(e.height),c.options.fitImagesInViewport&&(l=a(window).width(),k=a(window).height(),j=l-c.containerLeftPadding-c.containerRightPadding-20,i=k-c.containerTopPadding-c.containerBottomPadding-120,c.options.maxWidth&&c.options.maxWidth<j&&(j=c.options.maxWidth),c.options.maxHeight&&c.options.maxHeight<j&&(i=c.options.maxHeight),(e.width>j||e.height>i)&&(e.width/j>e.height/i?(h=j,g=parseInt(e.height/(e.width/h),10),d.width(h),d.height(g)):(g=i,h=parseInt(e.width/(e.height/g),10),d.width(h),d.height(g)))),c.sizeContainer(d.width(),d.height())},e.src=this.album[b].link,this.currentImageIndex=b},b.prototype.sizeOverlay=function(){this.$overlay.width(a(document).width()).height(a(document).height())},b.prototype.sizeContainer=function(a,b){function c(){d.$lightbox.find(".lb-dataContainer").width(g),d.$lightbox.find(".lb-prevLink").height(h),d.$lightbox.find(".lb-nextLink").height(h),d.showImage()}var d=this,e=this.$outerContainer.outerWidth(),f=this.$outerContainer.outerHeight(),g=a+this.containerLeftPadding+this.containerRightPadding,h=b+this.containerTopPadding+this.containerBottomPadding;e!==g||f!==h?this.$outerContainer.animate({width:g,height:h},this.options.resizeDuration,"swing",function(){c()}):c()},b.prototype.showImage=function(){this.$lightbox.find(".lb-loader").stop(!0).hide(),this.$lightbox.find(".lb-image").fadeIn("slow"),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},b.prototype.updateNav=function(){var a=!1;try{document.createEvent("TouchEvent"),a=!!this.options.alwaysShowNavOnTouchDevices}catch(b){}this.$lightbox.find(".lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(a&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".lb-prev").show(),a&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),a&&this.$lightbox.find(".lb-next").css("opacity","1"))))},b.prototype.updateDetails=function(){var b=this;if("undefined"!=typeof this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title&&this.$lightbox.find(".lb-caption").html(this.album[this.currentImageIndex].title).fadeIn("fast").find("a").on("click",function(b){void 0!==a(this).attr("target")?window.open(a(this).attr("href"),a(this).attr("target")):location.href=a(this).attr("href")}),this.album.length>1&&this.options.showImageNumberLabel){var c=this.imageCountLabel(this.currentImageIndex+1,this.album.length);this.$lightbox.find(".lb-number").text(c).fadeIn("fast")}else this.$lightbox.find(".lb-number").hide();this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return b.sizeOverlay()})},b.prototype.preloadNeighboringImages=function(){if(this.album.length>this.currentImageIndex+1){var a=new Image;a.src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){var b=new Image;b.src=this.album[this.currentImageIndex-1].link}},b.prototype.enableKeyboardNav=function(){a(document).on("keyup.keyboard",a.proxy(this.keyboardAction,this))},b.prototype.disableKeyboardNav=function(){a(document).off(".keyboard")},b.prototype.keyboardAction=function(a){var b=27,c=37,d=39,e=a.keyCode,f=String.fromCharCode(e).toLowerCase();e===b||f.match(/x|o|c/)?this.end():"p"===f||e===c?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):"n"!==f&&e!==d||(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},b.prototype.end=function(){this.disableKeyboardNav(),a(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),a("select, object, embed").css({visibility:"visible"}),this.options.disableScrolling&&(a("body").removeClass("lb-disable-scrolling"),a("html").removeClass("lb-disable-scrolling"))},"undefined"==typeof WEF_LB)new b;else{for(var c in WEF_LB)WEF_LB.hasOwnProperty(c)&&("false"==WEF_LB[c]?WEF_LB[c]=!1:"true"==WEF_LB[c]?WEF_LB[c]=!0:"albumLabel"!=c&&(WEF_LB[c]=parseInt(WEF_LB[c])));WEF_LB.hasOwnProperty("wpGallery")&&WEF_LB.wpGallery&&a(".gallery-icon a").each(function(){var b=a(this).attr("href"),c=new RegExp(".*?(\\.jpg|\\.png|\\.gif|\\.svg)","i"),d=c.exec(b);null!==d&&a(this).attr("data-lightbox","roadtrip")}),new b(WEF_LB)}});
1
+ jQuery(function(a){function b(b){this.album=[],this.currentImageIndex=void 0,this.init(),this.options=a.extend({},this.constructor.defaults),this.option(b)}if(b.defaults={albumLabel:"Image %1 of %2",alwaysShowNavOnTouchDevices:!1,fadeDuration:500,fitImagesInViewport:!0,positionFromTop:50,resizeDuration:700,showImageNumberLabel:!0,wrapAround:!1,disableScrolling:!1},b.prototype.option=function(b){a.extend(this.options,b)},b.prototype.imageCountLabel=function(a,b){return this.options.albumLabel.replace(/%1/g,a).replace(/%2/g,b)},b.prototype.init=function(){this.enable(),this.build()},b.prototype.enable=function(){var b=this;a("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(c){return b.start(a(c.currentTarget)),!1})},b.prototype.build=function(){var b=this;a('<div id="lightboxOverlay" class="lightboxOverlay"></div><div id="lightbox" class="lightbox"><div class="lb-outerContainer"><div class="lb-container"><img class="lb-image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==" /><div class="lb-nav"><a class="lb-prev" href="" ></a><a class="lb-next" href="" ></a></div><div class="lb-loader"><a class="lb-cancel"></a></div></div></div><div class="lb-dataContainer"><div class="lb-data"><div class="lb-details"><span class="lb-caption"></span><span class="lb-number"></span></div><div class="lb-closeContainer"><a class="lb-close"></a></div></div></div></div>').appendTo(a("body")),this.$lightbox=a("#lightbox"),this.$overlay=a("#lightboxOverlay"),this.$outerContainer=this.$lightbox.find(".lb-outerContainer"),this.$container=this.$lightbox.find(".lb-container"),this.containerTopPadding=parseInt(this.$container.css("padding-top"),10),this.containerRightPadding=parseInt(this.$container.css("padding-right"),10),this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10),this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10),this.$overlay.hide().on("click",function(){return b.end(),!1}),this.$lightbox.hide().on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$outerContainer.on("click",function(c){return"lightbox"===a(c.target).attr("id")&&b.end(),!1}),this.$lightbox.find(".lb-prev").on("click",function(){return 0===b.currentImageIndex?b.changeImage(b.album.length-1):b.changeImage(b.currentImageIndex-1),!1}),this.$lightbox.find(".lb-next").on("click",function(){return b.currentImageIndex===b.album.length-1?b.changeImage(0):b.changeImage(b.currentImageIndex+1),!1}),this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return b.end(),!1})},b.prototype.start=function(b){function c(a){d.album.push({link:a.attr("href"),title:a.attr("data-title")||a.attr("title")})}var d=this,e=a(window);e.on("resize",a.proxy(this.sizeOverlay,this)),a("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[];var f,g=0,h=b.attr("data-lightbox");if(h){f=a(b.prop("tagName")+'[data-lightbox="'+h+'"]');for(var i=0;i<f.length;i=++i)c(a(f[i])),f[i]===b[0]&&(g=i)}else if("lightbox"===b.attr("rel"))c(b);else{f=a(b.prop("tagName")+'[rel="'+b.attr("rel")+'"]');for(var j=0;j<f.length;j=++j)c(a(f[j])),f[j]===b[0]&&(g=j)}var k=e.scrollTop()+this.options.positionFromTop,l=e.scrollLeft();this.$lightbox.css({top:k+"px",left:l+"px"}).fadeIn(this.options.fadeDuration),this.options.disableScrolling&&(a("body").addClass("lb-disable-scrolling"),a("html").addClass("lb-disable-scrolling")),this.changeImage(g)},b.prototype.changeImage=function(b){var c=this;this.disableKeyboardNav();var d=this.$lightbox.find(".lb-image");this.$overlay.fadeIn(this.options.fadeDuration),a(".lb-loader").fadeIn("slow"),this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide(),this.$outerContainer.addClass("animating");var e=new Image;e.onload=function(){var f,g,h,i,j,k,l;d.attr("src",c.album[b].link),f=a(e),d.width(e.width),d.height(e.height),c.options.fitImagesInViewport&&(l=a(window).width(),k=a(window).height(),j=l-c.containerLeftPadding-c.containerRightPadding-20,i=k-c.containerTopPadding-c.containerBottomPadding-120,c.options.maxWidth&&c.options.maxWidth<j&&(j=c.options.maxWidth),c.options.maxHeight&&c.options.maxHeight<j&&(i=c.options.maxHeight),(e.width>j||e.height>i)&&(e.width/j>e.height/i?(h=j,g=parseInt(e.height/(e.width/h),10),d.width(h),d.height(g)):(g=i,h=parseInt(e.width/(e.height/g),10),d.width(h),d.height(g)))),c.sizeContainer(d.width(),d.height())},e.src=this.album[b].link,this.currentImageIndex=b},b.prototype.sizeOverlay=function(){this.$overlay.width(a(document).width()).height(a(document).height())},b.prototype.sizeContainer=function(a,b){function c(){d.$lightbox.find(".lb-dataContainer").width(g),d.$lightbox.find(".lb-prevLink").height(h),d.$lightbox.find(".lb-nextLink").height(h),d.showImage()}var d=this,e=this.$outerContainer.outerWidth(),f=this.$outerContainer.outerHeight(),g=a+this.containerLeftPadding+this.containerRightPadding,h=b+this.containerTopPadding+this.containerBottomPadding;e!==g||f!==h?this.$outerContainer.animate({width:g,height:h},this.options.resizeDuration,"swing",function(){c()}):c()},b.prototype.showImage=function(){this.$lightbox.find(".lb-loader").stop(!0).hide(),this.$lightbox.find(".lb-image").fadeIn("slow"),this.updateNav(),this.updateDetails(),this.preloadNeighboringImages(),this.enableKeyboardNav()},b.prototype.updateNav=function(){var a=!1;try{document.createEvent("TouchEvent"),a=!!this.options.alwaysShowNavOnTouchDevices}catch(b){}this.$lightbox.find(".lb-nav").show(),this.album.length>1&&(this.options.wrapAround?(a&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".lb-prev").show(),a&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),a&&this.$lightbox.find(".lb-next").css("opacity","1"))))},b.prototype.updateDetails=function(){var b=this;if("undefined"!=typeof this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title&&this.$lightbox.find(".lb-caption").html(this.album[this.currentImageIndex].title).fadeIn("fast").find("a").on("click",function(b){void 0!==a(this).attr("target")?window.open(a(this).attr("href"),a(this).attr("target")):location.href=a(this).attr("href")}),this.album.length>1&&this.options.showImageNumberLabel){var c=this.imageCountLabel(this.currentImageIndex+1,this.album.length);this.$lightbox.find(".lb-number").text(c).fadeIn("fast")}else this.$lightbox.find(".lb-number").hide();this.$outerContainer.removeClass("animating"),this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return b.sizeOverlay()})},b.prototype.preloadNeighboringImages=function(){if(this.album.length>this.currentImageIndex+1){var a=new Image;a.src=this.album[this.currentImageIndex+1].link}if(this.currentImageIndex>0){var b=new Image;b.src=this.album[this.currentImageIndex-1].link}},b.prototype.enableKeyboardNav=function(){a(document).on("keyup.keyboard",a.proxy(this.keyboardAction,this))},b.prototype.disableKeyboardNav=function(){a(document).off(".keyboard")},b.prototype.keyboardAction=function(a){var b=27,c=37,d=39,e=a.keyCode,f=String.fromCharCode(e).toLowerCase();e===b||f.match(/x|o|c/)?this.end():"p"===f||e===c?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):"n"!==f&&e!==d||(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},b.prototype.end=function(){this.disableKeyboardNav(),a(window).off("resize",this.sizeOverlay),this.$lightbox.fadeOut(this.options.fadeDuration),this.$overlay.fadeOut(this.options.fadeDuration),a("select, object, embed").css({visibility:"visible"}),this.options.disableScrolling&&(a("body").removeClass("lb-disable-scrolling"),a("html").removeClass("lb-disable-scrolling"))},"undefined"==typeof WEF_LB)new b;else{for(var c in WEF_LB)WEF_LB.hasOwnProperty(c)&&("false"===WEF_LB[c]?WEF_LB[c]=!1:"true"===WEF_LB[c]?WEF_LB[c]=!0:"albumLabel"!==c&&(WEF_LB[c]=parseInt(WEF_LB[c])));WEF_LB.hasOwnProperty("wpGallery")&&WEF_LB.wpGallery&&a(".gallery-icon a").each(function(){var b=a(this).attr("href"),c=new RegExp(".*?(\\.jpg|\\.png|\\.gif|\\.svg)","i"),d=c.exec(b);null!==d&&a(this).attr("data-lightbox","roadtrip")}),new b(WEF_LB)}});
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.13
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -141,6 +141,9 @@ Buying the premium extensions helps to keep this project alive.
141
 
142
  == Changelog ==
143
 
 
 
 
144
  = 2.1.13 =
145
  * Fixed: website page url @sabrina_b
146
  * Added: Shortcode widget
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.14
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
141
 
142
  == Changelog ==
143
 
144
+ = 2.1.14 =
145
+ * Compatibility for PHP 5.3 0..o
146
+
147
  = 2.1.13 =
148
  * Fixed: website page url @sabrina_b
149
  * Added: Shortcode widget
wp-embed-facebook.php CHANGED
@@ -4,16 +4,19 @@ 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.13
8
  Author URI: http://www.wpembedfb.com
9
  Text Domain: wp-embed-facebook
10
  Domain Path: /lang
11
  */
12
 
 
13
  require_once( plugin_dir_path( __FILE__ ) . 'lib/class-wp-embed-fb-plugin.php' );
14
  WP_Embed_FB_Plugin::hooks();
15
 
 
16
  require_once( WP_Embed_FB_Plugin::path() . 'lib/class-wef-widget.php' );
 
17
  require_once( WP_Embed_FB_Plugin::path() . 'lib/class-wef-social-plugins.php' );
18
 
19
 
@@ -26,21 +29,24 @@ register_uninstall_hook( __FILE__, 'WP_Embed_FB_Plugin::uninstall' );
26
  /** @see WP_Embed_FB_Plugin::deactivate */
27
  register_deactivation_hook( __FILE__, 'WP_Embed_FB_Plugin::deactivate' );
28
 
29
-
30
- require_once( WP_Embed_FB_Plugin::path() . 'lib/class-wp-embed-fb.php' );
31
 
32
  /* Magic here */
33
- require_once( WP_Embed_FB_Plugin::path() . 'lib/class-wef-magic-embeds.php' );
 
34
  WEF_Magic_Embeds::hooks();
35
 
36
 
37
  if ( WP_Embed_FB_Plugin::get_option( 'auto_comments_active' ) === 'true' ) {
38
- require_once( WP_Embed_FB_Plugin::path() . 'lib/class-wef-comments.php' );
 
39
  WEF_Comments::hooks();
40
  }
41
 
42
  if ( is_admin() ) {
43
- require_once( WP_Embed_FB_Plugin::path() . 'lib/class-wp-embed-fb-admin.php' );
 
44
  WP_Embed_FB_Admin::hooks();
45
 
46
  /** @see WP_Embed_FB_Admin::add_action_link */
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.14
8
  Author URI: http://www.wpembedfb.com
9
  Text Domain: wp-embed-facebook
10
  Domain Path: /lang
11
  */
12
 
13
+ /** @noinspection PhpIncludeInspection */
14
  require_once( plugin_dir_path( __FILE__ ) . 'lib/class-wp-embed-fb-plugin.php' );
15
  WP_Embed_FB_Plugin::hooks();
16
 
17
+ /** @noinspection PhpIncludeInspection */
18
  require_once( WP_Embed_FB_Plugin::path() . 'lib/class-wef-widget.php' );
19
+ /** @noinspection PhpIncludeInspection */
20
  require_once( WP_Embed_FB_Plugin::path() . 'lib/class-wef-social-plugins.php' );
21
 
22
 
29
  /** @see WP_Embed_FB_Plugin::deactivate */
30
  register_deactivation_hook( __FILE__, 'WP_Embed_FB_Plugin::deactivate' );
31
 
32
+ /** @noinspection PhpIncludeInspection */
33
+ require_once( WP_Embed_FB_Plugin::path() . 'lib/class-wp-embed-fb.php' );
34
 
35
  /* Magic here */
36
+ /** @noinspection PhpIncludeInspection */
37
+ require_once( WP_Embed_FB_Plugin::path() . 'lib/class-wef-magic-embeds.php' );
38
  WEF_Magic_Embeds::hooks();
39
 
40
 
41
  if ( WP_Embed_FB_Plugin::get_option( 'auto_comments_active' ) === 'true' ) {
42
+ /** @noinspection PhpIncludeInspection */
43
+ require_once( WP_Embed_FB_Plugin::path() . 'lib/class-wef-comments.php' );
44
  WEF_Comments::hooks();
45
  }
46
 
47
  if ( is_admin() ) {
48
+ /** @noinspection PhpIncludeInspection */
49
+ require_once( WP_Embed_FB_Plugin::path() . 'lib/class-wp-embed-fb-admin.php' );
50
  WP_Embed_FB_Admin::hooks();
51
 
52
  /** @see WP_Embed_FB_Admin::add_action_link */