WP Embed Facebook - Version 2.1.4

Version Description

  • Added: new action 'wp_embed_fb' on WP_Embed_FB class
  • Added: compatibility for using href=, url=, uri=, link=, on [facebook] shortcode
  • Fixed: shortcode not running when text changed for htmlentities
  • Added: warning when shortcode in badly used.
Download this release

Release Info

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

Code changes from version 2.1.3 to 2.1.4

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.2\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/wp-embed-facebook\n"
8
  "POT-Creation-Date: 2016-06-22 18:07:38+00:00\n"
@@ -512,24 +512,30 @@ msgstr ""
512
  msgid "More information"
513
  msgstr ""
514
 
515
- #: lib/class-wp-embed-fb.php:48
516
  msgid "This is not a valid facebook url"
517
  msgstr ""
518
 
519
- #: lib/class-wp-embed-fb.php:174
 
 
 
 
 
 
520
  msgid "Error: Try embedding this post as a social plugin (only visible to admins)"
521
  msgstr ""
522
 
523
- #: lib/class-wp-embed-fb.php:177 lib/class-wp-embed-fb.php:216
524
  msgid "Code"
525
  msgstr ""
526
 
527
- #: lib/class-wp-embed-fb.php:179 lib/class-wp-embed-fb.php:218
528
- #: lib/class-wp-embed-fb.php:419
529
  msgid "Error"
530
  msgstr ""
531
 
532
- #: lib/class-wp-embed-fb.php:426
533
  msgid ""
534
  "<small>To embed this type of content you need to setup a facebook app on <a "
535
  "href=\"%s\" title=\"WP Embed Facebook Settings\">settings</a></small>"
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.3\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/wp-embed-facebook\n"
8
  "POT-Creation-Date: 2016-06-22 18:07:38+00:00\n"
512
  msgid "More information"
513
  msgstr ""
514
 
515
+ #: lib/class-wp-embed-fb.php:56
516
  msgid "This is not a valid facebook url"
517
  msgstr ""
518
 
519
+ #: lib/class-wp-embed-fb.php:71
520
+ msgid ""
521
+ "You are using the [facebook] shortcode wrong. See examples <a "
522
+ "title=\"Examples\" target=\"_blank\" href=\"%s\" >here</a>."
523
+ msgstr ""
524
+
525
+ #: lib/class-wp-embed-fb.php:183
526
  msgid "Error: Try embedding this post as a social plugin (only visible to admins)"
527
  msgstr ""
528
 
529
+ #: lib/class-wp-embed-fb.php:186 lib/class-wp-embed-fb.php:225
530
  msgid "Code"
531
  msgstr ""
532
 
533
+ #: lib/class-wp-embed-fb.php:188 lib/class-wp-embed-fb.php:227
534
+ #: lib/class-wp-embed-fb.php:428
535
  msgid "Error"
536
  msgstr ""
537
 
538
+ #: lib/class-wp-embed-fb.php:435
539
  msgid ""
540
  "<small>To embed this type of content you need to setup a facebook app on <a "
541
  "href=\"%s\" title=\"WP Embed Facebook Settings\">settings</a></small>"
lib/class-wef-magic-embeds.php CHANGED
@@ -133,5 +133,4 @@ class WEF_Magic_Embeds extends WP_Embed_FB_Plugin {
133
  return $ret;
134
  }
135
 
136
- }
137
- //delete_option('wpemfb_options');
133
  return $ret;
134
  }
135
 
136
+ }
 
lib/class-wp-embed-fb.php CHANGED
@@ -37,9 +37,17 @@ class WP_Embed_FB {
37
  * @return string
38
  */
39
  static function shortcode( $atts ) {
 
 
 
 
 
 
 
40
  if ( ! empty( $atts ) && isset( $atts[0] ) ) {
41
  $clean = trim( $atts[0], '=' );
42
- //, 'href=', 'uri=', 'url=', 'src=', 'link=' )
 
43
  if ( is_numeric( $clean ) ) {
44
  $juice = $clean;
45
  $clean = "https://www.facebook.com/$juice";
@@ -60,7 +68,7 @@ class WP_Embed_FB {
60
  return $embed;
61
  }
62
 
63
- return '';
64
  }
65
 
66
  static function embed_register_handler(
@@ -104,6 +112,7 @@ class WP_Embed_FB {
104
  if ( self::is_raw( $type_and_id['type'] ) ) {
105
  wp_enqueue_style( 'wpemfb-' . self::get_theme() );
106
  }
 
107
  $return = self::print_embed( $type_and_id['fb_id'], $type_and_id['type'], $juice );
108
  self::clear_atts();
109
 
37
  * @return string
38
  */
39
  static function shortcode( $atts ) {
40
+ $compat = array('href','uri','src','url','link');
41
+ foreach($compat as $com){
42
+ if(isset($atts[$com])){
43
+ $atts[0] = $atts[$com];
44
+ unset($atts[$com]);
45
+ }
46
+ }
47
  if ( ! empty( $atts ) && isset( $atts[0] ) ) {
48
  $clean = trim( $atts[0], '=' );
49
+ $clean = html_entity_decode($clean);
50
+
51
  if ( is_numeric( $clean ) ) {
52
  $juice = $clean;
53
  $clean = "https://www.facebook.com/$juice";
68
  return $embed;
69
  }
70
 
71
+ return sprintf(__('You are using the [facebook] shortcode wrong. See examples <a title="Examples" target="_blank" href="%s" >here</a>.','wp-embed-facebook'),'http://www.wpembedfb.com/demo-site/category/custom-embeds/');
72
  }
73
 
74
  static function embed_register_handler(
112
  if ( self::is_raw( $type_and_id['type'] ) ) {
113
  wp_enqueue_style( 'wpemfb-' . self::get_theme() );
114
  }
115
+ do_action('wp_embed_fb');
116
  $return = self::print_embed( $type_and_id['fb_id'], $type_and_id['type'], $juice );
117
  self::clear_atts();
118
 
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: 3.8.1
6
  Tested up to: 4.5.3
7
- Stable tag: 2.1.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -102,6 +102,12 @@ This can only be achieved using the premium version
102
 
103
  == Changelog ==
104
 
 
 
 
 
 
 
105
  = 2.1.3 =
106
  * Fixed: includes giving problems in some sites.
107
 
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: 3.8.1
6
  Tested up to: 4.5.3
7
+ Stable tag: 2.1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
102
 
103
  == Changelog ==
104
 
105
+ = 2.1.4 =
106
+ * Added: new action 'wp_embed_fb' on WP_Embed_FB class
107
+ * Added: compatibility for using href=, url=, uri=, link=, on [facebook] shortcode
108
+ * Fixed: shortcode not running when text changed for htmlentities
109
+ * Added: warning when shortcode in badly used.
110
+
111
  = 2.1.3 =
112
  * Fixed: includes giving problems in some sites.
113
 
templates/classic/album.php CHANGED
@@ -26,7 +26,7 @@
26
  foreach ($fb_data['photos']['data'] as $pic) {
27
  $data_title = isset($pic['name']) ? $pic['name'] : '';
28
  ?>
29
- <a href="<?php echo $pic['source'] ?>" data-lightbox="roadtrip" <?php echo !empty($data_title) ? 'data-title="'.esc_attr(wp_rel_nofollow(make_clickable(str_replace(array('"',"'"),array('&#34;','&#39;'),$data_title)))).'"' : '' ?> >
30
  <img class="thumbnail" src="<?php echo $pic['picture'] ?>" />
31
  </a>
32
  <?php
26
  foreach ($fb_data['photos']['data'] as $pic) {
27
  $data_title = isset($pic['name']) ? $pic['name'] : '';
28
  ?>
29
+ <a href="<?php echo $pic['source'] ?>" <?php echo WP_Embed_FB_Plugin::get_option('lightbox_att') ?> <?php echo !empty($data_title) ? 'data-title="'.esc_attr(wp_rel_nofollow(make_clickable(str_replace(array('"',"'"),array('&#34;','&#39;'),$data_title)))).'"' : '' ?> >
30
  <img class="thumbnail" src="<?php echo $pic['picture'] ?>" />
31
  </a>
32
  <?php
templates/classic/classic.css CHANGED
@@ -1 +1 @@
1
- .wef-classic{font:300 14px/20px Helvetica;padding:10px;display:inline-block;border-width:1px;border-style:solid;border-color:#23487f;box-shadow:1px 1px 2px #23487f;width:100%;background-color:#fff}.wef-classic .row{margin-left:-10px;margin-right:-10px;display:table;width:100%}.wef-classic .col-1,.wef-classic .col-2,.wef-classic .col-3,.wef-classic .col-4,.wef-classic .col-5,.wef-classic .col-6,.wef-classic .col-7,.wef-classic .col-8,.wef-classic .col-9,.wef-classic .col-10,.wef-classic .col-11,.wef-classic .col-12{position:relative;min-height:1px;padding-left:10px;padding-right:10px;display:table-cell;vertical-align:middle;text-align:left}.wef-classic .col-12{width:100%}.wef-classic .col-11{width:91.66667%}.wef-classic .col-10{width:83.33333%}.wef-classic .col-9{width:75%}.wef-classic .col-8{width:66.66667%}.wef-classic .col-7{width:58.33333%}.wef-classic .col-6{width:50%}.wef-classic .col-5{width:41.66667%}.wef-classic .col-4{width:33.33333%}.wef-classic .col-3{width:25%}.wef-classic .col-2{width:16.66667%}.wef-classic .col-1{width:8.33333%}.wef-classic hr{margin-top:10px !important;margin-bottom:10px !important;margin-left:0 !important;margin-right:0 !important;float:none !important;border-top:1px;border-style:solid;border-color:#23487f;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;height:0 !important;width:100% !important}.wef-classic img.icon{float:right;box-shadow:none;margin:0;padding:0;display:block}.wef-classic img.thumbnail{border:1px solid gray;border-radius:2px;height:60px !important;margin:1px;padding:2px;width:60px !important}.wef-classic .album-thumbs{line-height:1px !important}.wef-classic a{font:300 14px/20px Helvetica;color:#23487f !important;text-decoration:none !important;border:0 !important;margin:0 !important;padding:0 !important;box-shadow:none !important}.wef-classic a:focus,.wef-classic a:hover{color:#23487f;text-decoration:underline !important}.wef-classic a.post-likes{color:#6d84b4 !important;font-size:12px !important}.wef-classic a.road-trip{width:0 !important;height:0 !important}.wef-classic a img{display:inline-block !important;margin:0;padding:0}.wef-classic p{font:300 14px/20px Helvetica;padding:0 !important;margin:0 !important}.wef-classic p.post-time{font-style:italic;color:#8e8c8d;font-size:12px}.wef-classic p.caption-link{text-align:right;word-break:break-all}.wef-classic p.caption-link a{font-size:12px;color:#8e8c8d !important;text-transform:uppercase}.wef-classic p.caption-title{text-align:left}.wef-classic p.caption-title a{font-size:12px;font-weight:bold}.wef-classic iframe,.wef-classic embed,.wef-classic object,.wef-classic video,.wef-classic audio{width:100% !important;border:0 !important;margin:0 !important;padding:0 !important}.wef-classic .post-link{border-width:1px;border-style:solid;border-color:#d0d0d0;box-shadow:1px 1px 2px #b3b3b3}.wef-classic .post-link p{padding-left:10px !important;padding-right:10px !important}.wef-classic .text-center{text-align:center}.wef-classic .pl-none{padding-left:0 !important;word-break:break-all}.wef-classic .color{color:#23487f}.wef-classic .bold{font-weight:bold !important}.wef-classic .title{font-size:20px !important;font-weight:bold !important;word-break:break-all;display:inherit !important;height:100% !important;background-color:transparent !important;padding-top:5px !important}.wef-classic .pad-top{padding-top:5px}.wef-classic .page-post{left:2.6% !important}.wef-classic .caption-description p{color:#8e8c8d !important;font-style:italic !important;font-size:12px !important}.wef-classic .wef-measure{width:100%}.wef-classic .break-all{word-break:break-all}.wef-classic .event_address{color:#565656;font-size:12px}.wef-classic .relative-container{position:relative;display:block;height:0;overflow:hidden}.wef-classic .relative-container .relative,.wef-classic .relative-container .video iframe,.wef-classic .video .relative-container iframe,.wef-classic .relative-container .video embed,.wef-classic .video .relative-container embed,.wef-classic .relative-container .video object,.wef-classic .video .relative-container object,.wef-classic .relative-container .video video,.wef-classic .video .relative-container video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0;margin:0;padding:0}.wef-classic .video{padding:0 0 56.25%}.wef-classic .fbpost-image{padding:0 0 52.34%}.wef-classic .fbpost-image div{cursor:pointer;background-size:cover;background-position:50% 50%}.wef-classic .cover{padding:0 0 36.86%}.wef-classic .cover div{background-size:100% !important;background-position-x:0;cursor:pointer}.wef-video-link{margin:0 !important;padding:0 !important}.wef-video-link a{font:300 14px/20px Helvetica;color:#23487f !important;text-decoration:none !important;border:0 !important;margin:0 !important;padding:0 !important;box-shadow:none !important}
1
+ .wef-classic{font:300 14px/20px Helvetica;padding:10px;display:block;border-width:1px;border-style:solid;border-color:#23487f;box-shadow:1px 1px 2px #23487f;width:100%;background-color:#fff}.wef-classic .row{margin-left:-10px;margin-right:-10px;display:table;width:100%}.wef-classic .col-1,.wef-classic .col-2,.wef-classic .col-3,.wef-classic .col-4,.wef-classic .col-5,.wef-classic .col-6,.wef-classic .col-7,.wef-classic .col-8,.wef-classic .col-9,.wef-classic .col-10,.wef-classic .col-11,.wef-classic .col-12{position:relative;min-height:1px;padding-left:10px;padding-right:10px;display:table-cell;vertical-align:middle;text-align:left}.wef-classic .col-12{width:100%}.wef-classic .col-11{width:91.66667%}.wef-classic .col-10{width:83.33333%}.wef-classic .col-9{width:75%}.wef-classic .col-8{width:66.66667%}.wef-classic .col-7{width:58.33333%}.wef-classic .col-6{width:50%}.wef-classic .col-5{width:41.66667%}.wef-classic .col-4{width:33.33333%}.wef-classic .col-3{width:25%}.wef-classic .col-2{width:16.66667%}.wef-classic .col-1{width:8.33333%}.wef-classic hr{margin-top:10px !important;margin-bottom:10px !important;margin-left:0 !important;margin-right:0 !important;float:none !important;border-top:1px;border-style:solid;border-color:#23487f;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;height:0 !important;width:100% !important}.wef-classic img.icon{float:right;box-shadow:none;margin:0;padding:0;display:block}.wef-classic img.thumbnail{border:1px solid gray;border-radius:2px;height:60px !important;margin:1px;padding:2px;width:60px !important}.wef-classic .album-thumbs{line-height:1px !important}.wef-classic a{font:300 14px/20px Helvetica;color:#23487f !important;text-decoration:none !important;border:0 !important;margin:0 !important;padding:0 !important;box-shadow:none !important}.wef-classic a:focus,.wef-classic a:hover{color:#23487f;text-decoration:underline !important}.wef-classic a.post-likes{color:#6d84b4 !important;font-size:12px !important}.wef-classic a.road-trip{width:0 !important;height:0 !important}.wef-classic a img{display:inline-block !important;margin:0;padding:0}.wef-classic p{font:300 14px/20px Helvetica;padding:0 !important;margin:0 !important}.wef-classic p.post-time{font-style:italic;color:#8e8c8d;font-size:12px}.wef-classic p.caption-link{text-align:right;word-break:break-all}.wef-classic p.caption-link a{font-size:12px;color:#8e8c8d !important;text-transform:uppercase}.wef-classic p.caption-title{text-align:left}.wef-classic p.caption-title a{font-size:12px;font-weight:bold}.wef-classic iframe,.wef-classic embed,.wef-classic object,.wef-classic video,.wef-classic audio{width:100% !important;border:0 !important;margin:0 !important;padding:0 !important}.wef-classic .post-link{border-width:1px;border-style:solid;border-color:#d0d0d0;box-shadow:1px 1px 2px #b3b3b3}.wef-classic .post-link p{padding-left:10px !important;padding-right:10px !important}.wef-classic .text-center{text-align:center}.wef-classic .pl-none{padding-left:0 !important;word-break:break-all}.wef-classic .color{color:#23487f}.wef-classic .bold{font-weight:bold !important}.wef-classic .title{font-size:20px !important;font-weight:bold !important;word-break:break-all;display:inherit !important;height:100% !important;background-color:transparent !important;padding-top:5px !important}.wef-classic .pad-top{padding-top:5px}.wef-classic .page-post{left:2.6% !important}.wef-classic .caption-description p{color:#8e8c8d !important;font-style:italic !important;font-size:12px !important}.wef-classic .wef-measure{width:100%}.wef-classic .break-all{word-break:break-all}.wef-classic .event_address{color:#565656;font-size:12px}.wef-classic .relative-container{position:relative;display:block;height:0;overflow:hidden}.wef-classic .relative-container .relative,.wef-classic .relative-container .video iframe,.wef-classic .video .relative-container iframe,.wef-classic .relative-container .video embed,.wef-classic .video .relative-container embed,.wef-classic .relative-container .video object,.wef-classic .video .relative-container object,.wef-classic .relative-container .video video,.wef-classic .video .relative-container video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0;margin:0;padding:0}.wef-classic .video{padding:0 0 56.25%}.wef-classic .fbpost-image{padding:0 0 52.34%}.wef-classic .fbpost-image div{cursor:pointer;background-size:cover;background-position:50% 50%}.wef-classic .cover{padding:0 0 36.86%}.wef-classic .cover div{background-size:100% !important;background-position-x:0;cursor:pointer}.wef-video-link{margin:0 !important;padding:0 !important}.wef-video-link a{font:300 14px/20px Helvetica;color:#23487f !important;text-decoration:none !important;border:0 !important;margin:0 !important;padding:0 !important;box-shadow:none !important}
templates/classic/classic.sass CHANGED
@@ -1,7 +1,7 @@
1
  .wef-classic
2
  font: 300 14px/20px Helvetica
3
  padding: 10px
4
- display: inline-block
5
  border:
6
  width: 1px
7
  style: solid
1
  .wef-classic
2
  font: 300 14px/20px Helvetica
3
  padding: 10px
4
+ display: block
5
  border:
6
  width: 1px
7
  style: solid
templates/classic/social-plugin.php CHANGED
@@ -1,6 +1,6 @@
1
  <div class="wef-measure" style="max-width: <?php echo $width ?>px;"></div>
2
  <?php
3
- switch($type){
4
  case 'page' :
5
  /** @noinspection PhpUndefinedVariableInspection */
6
  echo WEF_Social_Plugins::get('page',array('href'=>'https://www.facebook.com/' . $fb_data['link'],'width'=>$width));
1
  <div class="wef-measure" style="max-width: <?php echo $width ?>px;"></div>
2
  <?php
3
+ switch ( $type ) {
4
  case 'page' :
5
  /** @noinspection PhpUndefinedVariableInspection */
6
  echo WEF_Social_Plugins::get('page',array('href'=>'https://www.facebook.com/' . $fb_data['link'],'width'=>$width));
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.3
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.4
8
  Author URI: http://www.wpembedfb.com
9
  Text Domain: wp-embed-facebook
10
  Domain Path: /lang