WP Embed Facebook - Version 2.0.4

Version Description

  • changed shortcode tag from [facebook=url] to [facebook url]
  • force app access token
Download this release

Release Info

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

Code changes from version 2.0.3 to 2.0.4

lib/class-wp-embed-fb-admin.php CHANGED
@@ -321,6 +321,7 @@ class WP_Embed_FB_Admin {
321
  self::field( 'checkbox', 'wpemfb_enq_lightbox', __( 'Enqueue Lightbox script', 'wp-embed-facebook' ) );
322
  self::field( 'checkbox', 'wpemfb_enq_wpemfb', __( 'Enqueue WPEmbedFB script', 'wp-embed-facebook' ) );
323
  self::field( 'checkbox', 'wpemfb_enq_fbjs', __( 'Enqueue Facebook SDK', 'wp-embed-facebook' ) );
 
324
  self::section();
325
  ?>
326
  </section>
321
  self::field( 'checkbox', 'wpemfb_enq_lightbox', __( 'Enqueue Lightbox script', 'wp-embed-facebook' ) );
322
  self::field( 'checkbox', 'wpemfb_enq_wpemfb', __( 'Enqueue WPEmbedFB script', 'wp-embed-facebook' ) );
323
  self::field( 'checkbox', 'wpemfb_enq_fbjs', __( 'Enqueue Facebook SDK', 'wp-embed-facebook' ) );
324
+ self::field( 'checkbox', 'wpemfb_force_app_token', __( 'Force app token', 'wp-embed-facebook' ) );
325
  self::section();
326
  ?>
327
  </section>
lib/class-wp-embed-fb-plugin.php CHANGED
@@ -54,6 +54,9 @@ class WP_Embed_FB_Plugin {
54
  * @return array plugin defaults
55
  */
56
  static function getdefaults(){
 
 
 
57
  return array(
58
  'wpemfb_max_width' => '450',
59
  'wpemfb_max_photos' => '24',
@@ -83,8 +86,9 @@ class WP_Embed_FB_Plugin {
83
  'wpemfb_page_small_header' => 'false',
84
  'wpemfb_page_hide_cover' => 'false',
85
  'wpemfb_page_show_posts' => 'false',
86
- 'wpemfb_sdk_lang' => array_key_exists(get_locale(), self::get_fb_locales()) ? get_locale() : 'en_US',
87
  'wpemfb_close_warning' => 'false',
 
88
  );
89
  }
90
  //("uninstalled","deactivated","activated","reactivated")
54
  * @return array plugin defaults
55
  */
56
  static function getdefaults(){
57
+ $locale = get_locale();
58
+ if(strpos($locale,'es_') !== false)
59
+ $locale = 'es_LA';
60
  return array(
61
  'wpemfb_max_width' => '450',
62
  'wpemfb_max_photos' => '24',
86
  'wpemfb_page_small_header' => 'false',
87
  'wpemfb_page_hide_cover' => 'false',
88
  'wpemfb_page_show_posts' => 'false',
89
+ 'wpemfb_sdk_lang' => array_key_exists( $locale, self::get_fb_locales()) ? $locale : 'en_US',
90
  'wpemfb_close_warning' => 'false',
91
+ 'wpemfb_force_app_token' => 'true',
92
  );
93
  }
94
  //("uninstalled","deactivated","activated","reactivated")
lib/class-wp-embed-fb.php CHANGED
@@ -49,6 +49,8 @@ class WP_Embed_FB {
49
  }
50
  static function get_fbsdk(){
51
  if( self::$fbsdk && self::$fbsdk instanceof Sigami_Facebook){
 
 
52
  return self::$fbsdk;
53
  } else {
54
  if(!class_exists('FacebookApiException'))
@@ -61,6 +63,8 @@ class WP_Embed_FB {
61
  }
62
  //$config['fileUpload'] = false; // optional
63
  self::$fbsdk = new Sigami_Facebook($config);
 
 
64
  return self::$fbsdk;
65
  }
66
  }
@@ -375,7 +379,7 @@ class WP_Embed_FB {
375
  static function shortcode($atts){
376
  if(!empty($atts) && isset($atts[0])){
377
  $clean = trim($atts[0],'=');
378
- $juice = str_replace('https://www.facebook.com/','',$clean);
379
  if(isset($atts['width'])){
380
  self::$width = $atts['width'];
381
  }
@@ -422,6 +426,10 @@ class WP_Embed_FB {
422
  }
423
  }
424
 
 
 
 
 
425
  class FaceInit {
426
  static $fbsdk = null;
427
  static function init(){
49
  }
50
  static function get_fbsdk(){
51
  if( self::$fbsdk && self::$fbsdk instanceof Sigami_Facebook){
52
+ if( get_option('wpemfb_force_app_token','true') == 'true' )
53
+ self::$fbsdk->setAccessToken(get_option('wpemfb_app_id').'|'.get_option('wpemfb_app_secret'));
54
  return self::$fbsdk;
55
  } else {
56
  if(!class_exists('FacebookApiException'))
63
  }
64
  //$config['fileUpload'] = false; // optional
65
  self::$fbsdk = new Sigami_Facebook($config);
66
+ if( get_option('wpemfb_force_app_token','true') == 'true' )
67
+ self::$fbsdk->setAccessToken(get_option('wpemfb_app_id').'|'.get_option('wpemfb_app_secret'));
68
  return self::$fbsdk;
69
  }
70
  }
379
  static function shortcode($atts){
380
  if(!empty($atts) && isset($atts[0])){
381
  $clean = trim($atts[0],'=');
382
+ $juice = str_replace(array('https','http','://facebook.com/','://m.facebook.com/','://facebook.com/','://www.facebook.com/'),'',$clean);
383
  if(isset($atts['width'])){
384
  self::$width = $atts['width'];
385
  }
426
  }
427
  }
428
 
429
+ /**
430
+ * Class FaceInit
431
+ * @deprecated
432
+ */
433
  class FaceInit {
434
  static $fbsdk = null;
435
  static function init(){
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: poxtron
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=R8Q85GT3Q8Q26
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.3.2
7
- Stable tag: 2.0.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -42,74 +42,74 @@ Assuming all settings are in their default state.
42
 
43
  * From source using html5 video tag
44
 
45
- `[facebook=https://www.facebook.com/ArchanNair/videos/10152579879850694 ]`
46
 
47
  * Use facebook [embedded video](https://developers.facebook.com/docs/plugins/embedded-video-player) plugin
48
 
49
- `[facebook=https://www.facebook.com/ArchanNair/videos/10152579879850694 social_plugin=true ]`
50
 
51
  **Pages**
52
 
53
  * Using default settings
54
 
55
- `[facebook=https://www.facebook.com/sydneyoperahouse ]`
56
 
57
  * Changing the number of posts shown only for custom embeds
58
 
59
- `[facebook=https://www.facebook.com/sydneyoperahouse posts=2 ]`
60
 
61
  * Use facebook [page plugin](https://developers.facebook.com/docs/plugins/page-plugin)
62
 
63
- `[facebook=https://www.facebook.com/sydneyoperahouse social_plugin=true ]`
64
 
65
  All attributes are optional and if 'attributes' is not present it will use the default values
66
 
67
  **Albums**
68
 
69
- `[facebook=https://www.facebook.com/media/set/?set=a.10151932001713698.1073741831.10883823697 ]`
70
 
71
  **Events**
72
 
73
- `[facebook=https://www.facebook.com/events/507909879383103/ ]`
74
 
75
  **Photos**
76
 
77
  * Embed the photo as a plain image on your site
78
 
79
- `[facebook=https://www.facebook.com/ArchanNair/photos/a.10151932001713698.1073741831.10883823697/10153545048758698/]`
80
 
81
  * Use facebook [embedded post](https://developers.facebook.com/docs/plugins/embedded-posts) plugin
82
 
83
- `[facebook=https://www.facebook.com/ArchanNair/photos/a.10151932001713698.1073741831.10883823697/10153545048758698/ social_plugin=true ]`
84
 
85
  **Posts**
86
 
87
- `[facebook=https://www.facebook.com/radiohead/posts/10152688346467245 ]`
88
 
89
  * Use facebook [embedded post](https://developers.facebook.com/docs/plugins/embedded-posts) plugin
90
 
91
- `[facebook=https://www.facebook.com/radiohead/posts/10152688346467245 social_plugin=true ]`
92
 
93
 
94
  **Profiles**
95
 
96
- `[facebook=https://www.facebook.com/4 ]`
97
 
98
  You will need the facebook id of the user to embed the profile.
99
 
100
  **Changing the width**
101
 
102
- `[facebook=https://www.facebook.com/sydneyoperahouse width=970 ]`
103
 
104
  All shortcodes can be affected by the width attribute and it represents the *maximum width* in pixels the embed can be rendered, never the less all embeds are responsive.
105
 
106
  **Changing the theme**
107
 
108
- `[facebook=https://www.facebook.com/sydneyoperahouse theme=classic ]`
109
 
110
  **Embedding a Facebook object_id**
111
 
112
- `[facebook=507909879383103 ]`
113
 
114
  == Installation ==
115
 
@@ -138,6 +138,10 @@ This is a facebook limitation, will try to work around it.
138
 
139
  == Changelog ==
140
 
 
 
 
 
141
  = 2.0.3 =
142
  * Fixed notice on pages and events with no cover
143
  * Moved admin scripts to footer
@@ -156,7 +160,7 @@ This is a facebook limitation, will try to work around it.
156
  * Fixed time on events
157
  * Update Facebook API to 2.4
158
  * Added a new parameters for shortcode 'social_plugin' and 'theme'
159
- * Fixed shortcode use [facebook=FB_Object_ID ]
160
  * Improved CSS and themes
161
  * New Embed Post Raw
162
 
@@ -177,7 +181,7 @@ This is a facebook limitation, will try to work around it.
177
 
178
  = 1.9.6.3 =
179
  * Fixed MultiSite error
180
- * New Shortcode use [facebook=FB_Object_ID ] solution for fb permalinks
181
  * Fixed raw attribute on shortcode when url is video
182
 
183
  = 1.9.6.2 =
@@ -277,7 +281,7 @@ This is a facebook limitation, will try to work around it.
277
  * Documentation and screenshots.
278
 
279
  = 1.3 =
280
- * Shortcode [facebook=url width=600] width is optional
281
  * Themes
282
  * Multilingual Like Buttons
283
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=R8Q85GT3Q8Q26
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.4
7
+ Stable tag: 2.0.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
42
 
43
  * From source using html5 video tag
44
 
45
+ `[facebook https://www.facebook.com/ArchanNair/videos/10152579879850694 ]`
46
 
47
  * Use facebook [embedded video](https://developers.facebook.com/docs/plugins/embedded-video-player) plugin
48
 
49
+ `[facebook https://www.facebook.com/ArchanNair/videos/10152579879850694 social_plugin=true ]`
50
 
51
  **Pages**
52
 
53
  * Using default settings
54
 
55
+ `[facebook https://www.facebook.com/sydneyoperahouse ]`
56
 
57
  * Changing the number of posts shown only for custom embeds
58
 
59
+ `[facebook https://www.facebook.com/sydneyoperahouse posts=2 ]`
60
 
61
  * Use facebook [page plugin](https://developers.facebook.com/docs/plugins/page-plugin)
62
 
63
+ `[facebook https://www.facebook.com/sydneyoperahouse social_plugin=true ]`
64
 
65
  All attributes are optional and if 'attributes' is not present it will use the default values
66
 
67
  **Albums**
68
 
69
+ `[facebook https://www.facebook.com/media/set/?set=a.10151932001713698.1073741831.10883823697 ]`
70
 
71
  **Events**
72
 
73
+ `[facebook https://www.facebook.com/events/507909879383103/ ]`
74
 
75
  **Photos**
76
 
77
  * Embed the photo as a plain image on your site
78
 
79
+ `[facebook https://www.facebook.com/ArchanNair/photos/a.10151932001713698.1073741831.10883823697/10153545048758698/]`
80
 
81
  * Use facebook [embedded post](https://developers.facebook.com/docs/plugins/embedded-posts) plugin
82
 
83
+ `[facebook https://www.facebook.com/ArchanNair/photos/a.10151932001713698.1073741831.10883823697/10153545048758698/ social_plugin=true ]`
84
 
85
  **Posts**
86
 
87
+ `[facebook https://www.facebook.com/radiohead/posts/10152688346467245 ]`
88
 
89
  * Use facebook [embedded post](https://developers.facebook.com/docs/plugins/embedded-posts) plugin
90
 
91
+ `[facebook https://www.facebook.com/radiohead/posts/10152688346467245 social_plugin=true ]`
92
 
93
 
94
  **Profiles**
95
 
96
+ `[facebook https://www.facebook.com/4 ]`
97
 
98
  You will need the facebook id of the user to embed the profile.
99
 
100
  **Changing the width**
101
 
102
+ `[facebook https://www.facebook.com/sydneyoperahouse width=970 ]`
103
 
104
  All shortcodes can be affected by the width attribute and it represents the *maximum width* in pixels the embed can be rendered, never the less all embeds are responsive.
105
 
106
  **Changing the theme**
107
 
108
+ `[facebook https://www.facebook.com/sydneyoperahouse theme=classic ]`
109
 
110
  **Embedding a Facebook object_id**
111
 
112
+ `[facebook 507909879383103 ]`
113
 
114
  == Installation ==
115
 
138
 
139
  == Changelog ==
140
 
141
+ = 2.0.4 =
142
+ * changed shortcode tag from [facebook=url] to [facebook url]
143
+ * force app access token
144
+
145
  = 2.0.3 =
146
  * Fixed notice on pages and events with no cover
147
  * Moved admin scripts to footer
160
  * Fixed time on events
161
  * Update Facebook API to 2.4
162
  * Added a new parameters for shortcode 'social_plugin' and 'theme'
163
+ * Fixed shortcode use [facebook FB_Object_ID ]
164
  * Improved CSS and themes
165
  * New Embed Post Raw
166
 
181
 
182
  = 1.9.6.3 =
183
  * Fixed MultiSite error
184
+ * New Shortcode use [facebook FB_Object_ID ] solution for fb permalinks
185
  * Fixed raw attribute on shortcode when url is video
186
 
187
  = 1.9.6.2 =
281
  * Documentation and screenshots.
282
 
283
  = 1.3 =
284
+ * Shortcode [facebook url width=600] width is optional
285
  * Themes
286
  * Multilingual Like Buttons
287
 
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, profile, or post. Copy the facebook url to a single line on your post, or use shortcode [facebook=url ] more information at <a href="http://www.wpembedfb.com" title="plugin website">www.wpembedfb.com</a>
6
  Author: Miguel Sirvent
7
- Version: 2.0.3
8
  Author URI: http://profiles.wordpress.org/poxtron/
9
  */
10
 
4
  Plugin URI: http://www.wpembedfb.com
5
  Description: Embed any public Facebook video, photo, album, event, page, profile, or post. Copy the facebook url to a single line on your post, or use shortcode [facebook=url ] more information at <a href="http://www.wpembedfb.com" title="plugin website">www.wpembedfb.com</a>
6
  Author: Miguel Sirvent
7
+ Version: 2.0.4
8
  Author URI: http://profiles.wordpress.org/poxtron/
9
  */
10